57 lines
1.6 KiB
GDScript3
57 lines
1.6 KiB
GDScript3
|
extends Control
|
||
|
|
||
|
|
||
|
signal quit_pressed
|
||
|
signal mute_pressed
|
||
|
|
||
|
|
||
|
func _ready():
|
||
|
#get_node("option_settings").connect("mute_pressed", self, "_on_control_mute_pressed")
|
||
|
MusicManager.connect("mute_pressed", self, "_on_signal_mute_pressed")
|
||
|
MusicManager.connect_ext_func( "mute_pressed", self , "_on_signal_mute_pressed")
|
||
|
$option_settings.connect( "mute_pressed", self, "_on_signal_mute_pressed" )
|
||
|
$option_settings.connect_ext_func( "mute_pressed", self, "_on_signal_mute_pressed" )
|
||
|
update_sound_button()
|
||
|
|
||
|
|
||
|
func _on_signal_mute_pressed():
|
||
|
Config.msg_debug("<Option> Received Signal mute")
|
||
|
update_sound_button()
|
||
|
|
||
|
|
||
|
func update_sound_button():
|
||
|
Config.msg_debug("<Option> update_sound_button")
|
||
|
if Config.mute:
|
||
|
$g/g/font/menu/sound_button.texture_normal = load ( "res://assets/interfaces/Login-Khanat-sound-muted-button.png")
|
||
|
$g/g/font/menu/sound_button.texture_hover = load ( "res://assets/interfaces/Login-Khanat-sound-muted-button-hover.png")
|
||
|
else:
|
||
|
$g/g/font/menu/sound_button.texture_normal = load ( "res://assets/interfaces/Login-Khanat-sound-button.png")
|
||
|
$g/g/font/menu/sound_button.texture_hover = load ( "res://assets/interfaces/Login-Khanat-sound-button-hover.png")
|
||
|
|
||
|
|
||
|
func _on_language_button_pressed():
|
||
|
$option_language/window_dialog.show()
|
||
|
|
||
|
|
||
|
func _on_sound_button_pressed():
|
||
|
Config.msg_debug("Option mute")
|
||
|
MusicManager.set_sound_mute(not Config.mute)
|
||
|
emit_signal( "mute_pressed" )
|
||
|
update_sound_button()
|
||
|
|
||
|
|
||
|
func _on_jukebox_button_pressed():
|
||
|
MusicManager.open()
|
||
|
|
||
|
|
||
|
func _on_settings_button_pressed():
|
||
|
$option_settings/window_dialog.show()
|
||
|
|
||
|
|
||
|
func _on_help_button_pressed():
|
||
|
$option_info/window_dialog.show()
|
||
|
|
||
|
|
||
|
func _on_quit_button_pressed():
|
||
|
get_tree().quit()
|