From 11b0eb46c1f5fd9924e2adb85c05950c78f9d7d5 Mon Sep 17 00:00:00 2001 From: AleaJactaEst Date: Thu, 23 Sep 2021 20:55:57 +0200 Subject: [PATCH] update script to active menu --- scenes/interfaces/music_manager/music_manager.gd | 7 +------ scenes/interfaces/options/option_settings.gd | 11 +++-------- scenes/interfaces/options/options.gd | 4 ++-- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/scenes/interfaces/music_manager/music_manager.gd b/scenes/interfaces/music_manager/music_manager.gd index 9ea9f1f..64dd34b 100644 --- a/scenes/interfaces/music_manager/music_manager.gd +++ b/scenes/interfaces/music_manager/music_manager.gd @@ -58,13 +58,8 @@ func _ready(): music_player.connect("finished", self, "_on_stream_finished", []) -func connect_ext( signal_name, target ): - Config.msg_debug("Connect external [signal:" + signal_name + ", func:" + "_on_signal_" + signal_name + "]") - target.connect( signal_name, self, "_on_signal_" + signal_name ) - - func connect_ext_func( signal_name, target , function_target): - Config.msg_debug("Connect external [signal:" + signal_name + ", func:" + "_on_signal_" + signal_name + "]") + Config.msg_debug("Connect external [signal:" + signal_name + ", func:" + function_target + "]") target.connect( signal_name, self, function_target ) diff --git a/scenes/interfaces/options/option_settings.gd b/scenes/interfaces/options/option_settings.gd index dc07873..cbbb1e9 100644 --- a/scenes/interfaces/options/option_settings.gd +++ b/scenes/interfaces/options/option_settings.gd @@ -79,17 +79,12 @@ func _ready(): MusicManager.connect("musicplayer_pressed", self, "_on_signal_musicplayer_pressed") #$option.connect("mute_pressed", self, "update_mute") MusicManager.connect("mute_pressed", self, "_on_signal_mute_pressed") - MusicManager.connect_ext("musicplayer_pressed", self ) - MusicManager.connect_ext("mute_pressed", self ) - - -func connect_ext( signal_name, target): - Config.msg_debug("Connect external [signal:" + signal_name + ", func:" + "_on_signal_" + signal_name + "]") - target.connect( signal_name, self, "_on_signal_" + signal_name ) + MusicManager.connect_ext_func("musicplayer_pressed", self, "_on_signal_musicplayer_pressed") + MusicManager.connect_ext_func("mute_pressed", self, "_on_signal_mute_pressed" ) func connect_ext_func( signal_name, target , function_target): - Config.msg_debug("Connect external [signal:" + signal_name + ", func:" + "_on_signal_" + signal_name + "]") + Config.msg_debug("Connect external [signal:" + signal_name + ", func:" + function_target + "]") target.connect( signal_name, self, function_target ) diff --git a/scenes/interfaces/options/options.gd b/scenes/interfaces/options/options.gd index a8342e2..2469ff1 100644 --- a/scenes/interfaces/options/options.gd +++ b/scenes/interfaces/options/options.gd @@ -9,9 +9,9 @@ func _ready(): #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 ) + MusicManager.connect_ext_func( "mute_pressed", self, "_on_signal_mute_pressed" ) $option_settings.connect( "mute_pressed", self, "_on_control_mute_pressed" ) - $option_settings.connect_ext( "mute_pressed", self ) + $option_settings.connect_ext_func( "mute_pressed", self, "_on_signal_mute_pressed" ) update_sound_button()