forked from team-sg/hero-mark-2
implement rest of options, including CRT/LCD filter!
This commit is contained in:
parent
e0e56d3ffa
commit
2da5935c3b
4 changed files with 31 additions and 12 deletions
|
@ -94,15 +94,20 @@ func load_defaults(section: int = Section.ALL) -> void:
|
||||||
func save_options() -> void:
|
func save_options() -> void:
|
||||||
var file = ConfigFile.new()
|
var file = ConfigFile.new()
|
||||||
#Game
|
#Game
|
||||||
file.set_value("game","rumble",rumble)
|
file.set_value("game", "rumble", rumble)
|
||||||
|
file.set_value("game", "gore", gore)
|
||||||
#Video
|
#Video
|
||||||
file.set_value("video","fullscreen",fullscreen)
|
file.set_value("video", "fullscreen", fullscreen)
|
||||||
file.set_value("video","scaling_mode",scaling_mode)
|
file.set_value("video", "window_size", window_size)
|
||||||
file.set_value("video","transition_speed",transition_speed)
|
file.set_value("video", "scaling_mode", scaling_mode)
|
||||||
|
file.set_value("video", "transition_speed", transition_speed)
|
||||||
|
file.set_value("video", "border", border)
|
||||||
|
file.set_value("video", "scanlines", scanlines)
|
||||||
#Audio
|
#Audio
|
||||||
file.set_value("audio","master_volume",master_volume)
|
file.set_value("audio", "master_volume", master_volume)
|
||||||
file.set_value("audio","music_volume",music_volume)
|
file.set_value("audio", "music_volume", music_volume)
|
||||||
file.set_value("audio","sound_volume",sound_volume)
|
file.set_value("audio", "sound_volume", sound_volume)
|
||||||
|
file.set_value("audio", "landing_sound", landing_sound)
|
||||||
# last played file
|
# last played file
|
||||||
file.set_value("save", "last_file", last_file)
|
file.set_value("save", "last_file", last_file)
|
||||||
# save the options to file
|
# save the options to file
|
||||||
|
@ -116,7 +121,8 @@ func _set_fullscreen(value: bool) -> void:
|
||||||
OS.window_fullscreen = fullscreen
|
OS.window_fullscreen = fullscreen
|
||||||
|
|
||||||
func _set_window_size(value: float) -> void:
|
func _set_window_size(value: float) -> void:
|
||||||
pass
|
window_size = value
|
||||||
|
OS.window_size = Game.RESOLUTION * window_size
|
||||||
|
|
||||||
func _set_scaling_mode(value: int) -> void:
|
func _set_scaling_mode(value: int) -> void:
|
||||||
scaling_mode = value
|
scaling_mode = value
|
||||||
|
@ -134,7 +140,8 @@ func _set_border(value: int) -> void:
|
||||||
Border.current_border = border
|
Border.current_border = border
|
||||||
|
|
||||||
func _set_scanlines(value: int) -> void:
|
func _set_scanlines(value: int) -> void:
|
||||||
pass
|
scanlines = value
|
||||||
|
SceneManager.set_scanlines(scanlines)
|
||||||
|
|
||||||
|
|
||||||
# audio setters
|
# audio setters
|
||||||
|
|
|
@ -32,6 +32,20 @@ func change_scene(new_scene: Node) -> void:
|
||||||
viewport.call_deferred("add_child", new_scene)
|
viewport.call_deferred("add_child", new_scene)
|
||||||
current_scene = new_scene
|
current_scene = new_scene
|
||||||
|
|
||||||
|
func set_scanlines(type: int) -> void:
|
||||||
|
yield(get_tree(), "idle_frame")
|
||||||
|
match type:
|
||||||
|
Options.ScanlineType.NONE:
|
||||||
|
viewport_container.material.set_shader_param("enabled", false)
|
||||||
|
Options.ScanlineType.CRT:
|
||||||
|
viewport_container.material.set_shader_param("enabled", true)
|
||||||
|
viewport_container.material.set_shader_param("scanline_opacity", Vector2(0.2, 0.0))
|
||||||
|
viewport_container.material.set_shader_param("brightness", 1.1)
|
||||||
|
Options.ScanlineType.LCD:
|
||||||
|
viewport_container.material.set_shader_param("enabled", true)
|
||||||
|
viewport_container.material.set_shader_param("scanline_opacity", Vector2(0.2, 0.2))
|
||||||
|
viewport_container.material.set_shader_param("brightness", 1.2)
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
var tree := get_tree()
|
var tree := get_tree()
|
||||||
# capture initial scene
|
# capture initial scene
|
||||||
|
|
|
@ -8,7 +8,7 @@ shader = ExtResource( 2 )
|
||||||
shader_param/enabled = false
|
shader_param/enabled = false
|
||||||
shader_param/resolution = Vector2( 256, 192 )
|
shader_param/resolution = Vector2( 256, 192 )
|
||||||
shader_param/curvature = Vector2( 0, 0 )
|
shader_param/curvature = Vector2( 0, 0 )
|
||||||
shader_param/scanline_opacity = Vector2( 0.2, 0.2 )
|
shader_param/scanline_opacity = Vector2( 0.2, 0 )
|
||||||
shader_param/brightness = 1.0
|
shader_param/brightness = 1.0
|
||||||
|
|
||||||
[node name="SceneManager" type="Node"]
|
[node name="SceneManager" type="Node"]
|
||||||
|
|
|
@ -16,5 +16,3 @@ func _gui_input(event):
|
||||||
Audio.ac_music.stop()
|
Audio.ac_music.stop()
|
||||||
current_selection = posmod(current_selection,sounds.size())
|
current_selection = posmod(current_selection,sounds.size())
|
||||||
body.text = titles[current_selection]
|
body.text = titles[current_selection]
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue