From cfddacb278aa0a743beffe772c747128af803805 Mon Sep 17 00:00:00 2001 From: Sebastian Lohff Date: Thu, 24 Apr 2025 15:02:11 +0200 Subject: [PATCH] Renaming / moving buttons Move "Leave" buttons always to upper right of screen. The "Get a Wav" button now has a text that expresses better what it does depending on the platform (save, download, share). --- scenes/MultiplayerConnect.tscn | 11 ++++++----- scenes/main.gd | 12 ++++++++---- scenes/main.tscn | 3 ++- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/scenes/MultiplayerConnect.tscn b/scenes/MultiplayerConnect.tscn index 90f7840..516a5d4 100644 --- a/scenes/MultiplayerConnect.tscn +++ b/scenes/MultiplayerConnect.tscn @@ -93,6 +93,11 @@ text = "Freq:" unique_name_in_owner = true layout_mode = 2 +[node name="LeaveButton" type="Button" parent="VBoxContainer/MorseView/VBoxContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 10 +text = "Leave Frequency" + [node name="PlayerContainer" type="VBoxContainer" parent="VBoxContainer/MorseView/VBoxContainer"] unique_name_in_owner = true layout_mode = 2 @@ -104,10 +109,6 @@ size_flags_vertical = 3 size_flags_stretch_ratio = 2.0 text = "MORSE" -[node name="LeaveButton" type="Button" parent="VBoxContainer/MorseView/VBoxContainer"] -layout_mode = 2 -text = "Leave Frequency" - [node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"] layout_mode = 2 @@ -145,8 +146,8 @@ autowrap_mode = 2 [connection signal="pressed" from="VBoxContainer/ConnectView/VBoxContainer/HBoxContainer/BackButton" to="." method="_on_back_button_pressed"] [connection signal="pressed" from="VBoxContainer/ConnectView/VBoxContainer/RefreshButton" to="." method="_on_refresh_button_pressed"] [connection signal="item_clicked" from="VBoxContainer/ConnectView/VBoxContainer/FreqList" to="." method="_on_freq_list_join"] +[connection signal="pressed" from="VBoxContainer/MorseView/VBoxContainer/HBoxContainer/LeaveButton" to="." method="_on_leave_button_pressed"] [connection signal="button_down" from="VBoxContainer/MorseView/VBoxContainer/MorseButton" to="." method="_on_morse_button_button_down"] [connection signal="button_up" from="VBoxContainer/MorseView/VBoxContainer/MorseButton" to="." method="_on_morse_button_button_up"] -[connection signal="pressed" from="VBoxContainer/MorseView/VBoxContainer/LeaveButton" to="." method="_on_leave_button_pressed"] [connection signal="gui_input" from="VBoxContainer/HBoxContainer/HBoxContainer2/Label" to="." method="_on_error_label_gui_input"] [connection signal="gui_input" from="VBoxContainer/HBoxContainer/HBoxContainer2/ErrorLabel" to="." method="_on_error_label_gui_input"] diff --git a/scenes/main.gd b/scenes/main.gd index 41fad80..d71bb6b 100644 --- a/scenes/main.gd +++ b/scenes/main.gd @@ -20,6 +20,12 @@ func fill_buffer(): phase = fmod(phase + increment, 1.0) func _ready(): + match OS.get_name(): + "Android": + %WavButton.text = "Share Wav" + "Web": + %WavButton.text = "Download Wav" + $Player.stream.mix_rate = sample_hz $Player.volume_db = -100 $Player.play() @@ -28,14 +34,12 @@ func _ready(): if multiplayer_enabled: %MultiplayerButton.visible = true - - - print("External freq: ", Utils.get_external_freq_param()) if Utils.get_external_freq_param(): + print("Direct connect to external freq: ", Utils.get_external_freq_param()) _on_multiplayer_button_pressed() - # FIXME: make this dependant on button + # FIXME: make this dependent on button OS.open_midi_inputs() print(OS.get_connected_midi_inputs()) diff --git a/scenes/main.tscn b/scenes/main.tscn index 6bec0ff..94699ae 100644 --- a/scenes/main.tscn +++ b/scenes/main.tscn @@ -55,9 +55,10 @@ size_flags_stretch_ratio = 2.0 text = "MORSE" [node name="WavButton" type="Button" parent="VBoxContainer"] +unique_name_in_owner = true layout_mode = 2 size_flags_vertical = 3 -text = "Write Wav" +text = "Save Wav" [node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"] layout_mode = 2