2021-05-27 21:56:16 +00:00
|
|
|
extends Control
|
|
|
|
|
|
|
|
|
|
|
|
signal quit_pressed
|
|
|
|
signal mute_pressed
|
2021-06-07 21:07:44 +00:00
|
|
|
#signal musicplayer_pressed
|
2021-05-27 21:56:16 +00:00
|
|
|
|
|
|
|
func _ready():
|
2021-06-07 21:07:44 +00:00
|
|
|
#get_node("option_settings").connect("mute_pressed", self, "_on_control_mute_pressed")
|
|
|
|
MusicManager.connect("mute_pressed", self, "_on_control_mute_pressed")
|
|
|
|
MusicManager.connect("musicplayer_pressed", self, "_on_control_musicplayer_pressed")
|
|
|
|
MusicManager.connect_ext( "mute_pressed", self )
|
|
|
|
$option_settings.connect( "mute_pressed", self, "_on_control_mute_pressed" )
|
|
|
|
$option_settings.connect_ext( "mute_pressed", self )
|
2021-05-27 21:56:16 +00:00
|
|
|
update_sound_button()
|
|
|
|
|
|
|
|
|
|
|
|
func _on_quit_button_pressed():
|
2021-06-07 21:07:44 +00:00
|
|
|
Config.msg_debug("_on_quit_button_pressed")
|
2021-05-27 21:56:16 +00:00
|
|
|
emit_signal( "quit_pressed" )
|
|
|
|
|
|
|
|
|
2021-06-07 21:07:44 +00:00
|
|
|
func _on_control_musicplayer_pressed():
|
|
|
|
Config.msg_debug("Option -> Receibed signal")
|
|
|
|
#emit_signal ( "musicplayer_pressed" )
|
|
|
|
|
|
|
|
|
2021-05-27 21:56:16 +00:00
|
|
|
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()
|
|
|
|
|
2021-06-07 21:07:44 +00:00
|
|
|
|
2021-05-27 21:56:16 +00:00
|
|
|
func _on_help_button_pressed():
|
|
|
|
$option_info/window_dialog.show()
|
|
|
|
|
|
|
|
|
|
|
|
func _on_settings_button_pressed():
|
|
|
|
$option_settings/window_dialog.show()
|
|
|
|
|
2021-06-07 21:07:44 +00:00
|
|
|
|
2021-05-27 21:56:16 +00:00
|
|
|
func update_sound_button():
|
2021-06-07 21:07:44 +00:00
|
|
|
Config.msg_debug("<Option> update_sound_button")
|
2021-05-27 21:56:16 +00:00
|
|
|
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")
|
2021-06-07 21:07:44 +00:00
|
|
|
#MusicManager.set_mute_on()
|
2021-05-27 21:56:16 +00:00
|
|
|
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")
|
2021-06-07 21:07:44 +00:00
|
|
|
#MusicManager.set_mute_off()
|
|
|
|
#$option_settings/window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND/h_box_container_2/mute.pressed = Config.mute
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func update_musicplayer():
|
|
|
|
Config.msg_debug("update_musicplayer")
|
|
|
|
$option_settings/window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND/h_box_container_5/musicplayer.pressed = Config.get_playermusic()
|
|
|
|
if Config.get_playermusic():
|
|
|
|
MusicManager.set_playermusic_on()
|
|
|
|
else:
|
|
|
|
MusicManager.set_playermusic_off()
|
2021-05-27 21:56:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
func _on_sound_button_pressed():
|
2021-06-07 21:07:44 +00:00
|
|
|
Config.msg_debug("Option mute")
|
2021-05-27 21:56:16 +00:00
|
|
|
MusicManager.set_sound_mute(not Config.mute)
|
|
|
|
emit_signal( "mute_pressed" )
|
|
|
|
|
|
|
|
|
|
|
|
func _on_control_mute_pressed():
|
2021-06-07 21:07:44 +00:00
|
|
|
Config.msg_debug("<Option> Received Signal mute")
|
2021-05-27 21:56:16 +00:00
|
|
|
update_sound_button()
|