Post Game jam commit
This commit is contained in:
commit
6db2131520
164 changed files with 172524 additions and 0 deletions
51
scripts/settings_menu.gd
Normal file
51
scripts/settings_menu.gd
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
extends NinePatchRect
|
||||
|
||||
@export var volume_slider : HSlider
|
||||
@export var fullscreen_check : CheckBox
|
||||
@export var vsync_check : CheckBox
|
||||
|
||||
|
||||
func _ready():
|
||||
_update_settings()
|
||||
|
||||
Settings.apply_all()
|
||||
|
||||
func _update_settings():
|
||||
volume_slider.value = Settings.master_volume
|
||||
fullscreen_check.button_pressed = Settings.fullscreen
|
||||
vsync_check.button_pressed = Settings.vsync
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
_update_settings()
|
||||
if (event.is_action_pressed("ui_cancel")):
|
||||
get_viewport().set_input_as_handled()
|
||||
visible = !visible
|
||||
get_tree().paused = visible
|
||||
elif (event.is_action_pressed("fullscreen")):
|
||||
get_viewport().set_input_as_handled()
|
||||
Settings.fullscreen = !Settings.fullscreen
|
||||
Settings.apply_fullscreen()
|
||||
|
||||
func _on_volume_changed(value: float):
|
||||
Settings.master_volume = value
|
||||
Settings.apply_volume()
|
||||
|
||||
func _on_fullscreen_toggled(enabled: bool):
|
||||
Settings.fullscreen = enabled
|
||||
Settings.apply_fullscreen()
|
||||
|
||||
func _on_max_fps_changed(value: float):
|
||||
Settings.max_fps = int(value)
|
||||
Settings.apply_max_fps()
|
||||
|
||||
func _on_vsync_toggled(enabled : bool):
|
||||
Settings.vsync = enabled
|
||||
Settings.apply_vsync()
|
||||
|
||||
func _on_exit_button_pressed() -> void:
|
||||
get_tree().quit()
|
||||
|
||||
|
||||
func _on_continue_button_pressed() -> void:
|
||||
visible = false
|
||||
get_tree().paused = visible
|
||||
Loading…
Add table
Add a link
Reference in a new issue