52 lines
1.5 KiB
GDScript3
52 lines
1.5 KiB
GDScript3
|
extends Control
|
||
|
|
||
|
|
||
|
signal quit_pressed
|
||
|
signal mute_pressed
|
||
|
|
||
|
|
||
|
func _ready():
|
||
|
get_node("option_settings").connect("mute_pressed", self, "_on_control_mute_pressed")
|
||
|
update_sound_button()
|
||
|
|
||
|
|
||
|
func _on_quit_button_pressed():
|
||
|
emit_signal( "quit_pressed" )
|
||
|
|
||
|
|
||
|
func _on_language_button_pressed():
|
||
|
$option_language/window_dialog.show()
|
||
|
|
||
|
|
||
|
func _on_news_button_pressed():
|
||
|
#$option_news/accept_dialog.show()
|
||
|
$option_news/window_dialog.show()
|
||
|
|
||
|
func _on_help_button_pressed():
|
||
|
$option_info/window_dialog.show()
|
||
|
|
||
|
|
||
|
func _on_settings_button_pressed():
|
||
|
$option_settings/window_dialog.show()
|
||
|
|
||
|
func update_sound_button():
|
||
|
Config.msg_debug("")
|
||
|
if Config.mute:
|
||
|
$options_reduce/h_box_container/sound_button.texture_normal = load ( "res://assets/interfaces/Login-Khanat-sound-muted-button.png")
|
||
|
$options_reduce/h_box_container/sound_button.texture_hover = load ( "res://assets/interfaces/Login-Khanat-sound-muted-button-hover.png")
|
||
|
else:
|
||
|
$options_reduce/h_box_container/sound_button.texture_normal = load ( "res://assets/interfaces/Login-Khanat-sound-button.png")
|
||
|
$options_reduce/h_box_container/sound_button.texture_hover = load ( "res://assets/interfaces/Login-Khanat-sound-button-hover.png")
|
||
|
|
||
|
|
||
|
func _on_sound_button_pressed():
|
||
|
Config.msg_debug("")
|
||
|
MusicManager.set_sound_mute(not Config.mute)
|
||
|
emit_signal( "mute_pressed" )
|
||
|
|
||
|
|
||
|
func _on_control_mute_pressed():
|
||
|
Config.msg_debug("received signal mute")
|
||
|
update_sound_button()
|
||
|
$option_settings/window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND/h_box_container_2/mute.pressed = Config.mute
|