aboutsummaryrefslogtreecommitdiff
path: root/game/src/MainMenu
diff options
context:
space:
mode:
author htmlJoel <ajmach6@gmail.com>2023-03-01 20:34:07 +0100
committer Joel Machens <ajmach6@gmail.com>2023-03-12 05:46:24 +0100
commit3573d59ef42c935dc27bb6a4ae9bb3c4ba041c08 (patch)
treefba91cccf66ddd07e518cb4fb9cb0ab89fed9fb4 /game/src/MainMenu
parentdfd6d33a9bd1fda56589efa66a9ca0f63f5e46f8 (diff)
Added General Tab
Fix OptionsMenu scaling Options UI extended Connected escape for back
Diffstat (limited to 'game/src/MainMenu')
-rw-r--r--game/src/MainMenu/MainMenu.gd14
-rw-r--r--game/src/MainMenu/MainMenu.tscn10
2 files changed, 17 insertions, 7 deletions
diff --git a/game/src/MainMenu/MainMenu.gd b/game/src/MainMenu/MainMenu.gd
index 7e790c0..662cd90 100644
--- a/game/src/MainMenu/MainMenu.gd
+++ b/game/src/MainMenu/MainMenu.gd
@@ -16,12 +16,10 @@ var _checksum_label : Label
func _ready():
print("From GDScript")
TestSingleton.hello_singleton()
- # UIFUN-97
- var checksum := Checksum.get_checksum_text()
- _checksum_label.tooltip_text = "Checksum " + checksum
- _checksum_label.text = "(" + checksum.substr(0, 4) + ")"
- _new_game_button.grab_focus()
-
+ # UI-111
+ _checksum_label.tooltip_text = "Checksum " + Checksum.get_checksum_text()
+ _checksum_label.text = "(" + Checksum.get_checksum_text().substr(0, 4) + ")"
+ _on_new_game_button_visibility_changed()
# REQUIREMENTS:
# * SS-14
@@ -55,3 +53,7 @@ func _on_credits_button_pressed():
func _on_exit_button_pressed():
print("See you later!")
get_tree().quit()
+
+func _on_new_game_button_visibility_changed():
+ if visible:
+ _new_game_button.grab_focus.call_deferred()
diff --git a/game/src/MainMenu/MainMenu.tscn b/game/src/MainMenu/MainMenu.tscn
index af2d975..4fc95d8 100644
--- a/game/src/MainMenu/MainMenu.tscn
+++ b/game/src/MainMenu/MainMenu.tscn
@@ -1,7 +1,8 @@
-[gd_scene load_steps=3 format=3 uid="uid://dvoin538iby54"]
+[gd_scene load_steps=4 format=3 uid="uid://dvoin538iby54"]
[ext_resource type="Theme" uid="uid://cr4lh0vraucx7" path="res://default_theme.tres" id="1_dfm41"]
[ext_resource type="Script" path="res://src/MainMenu/MainMenu.gd" id="2_nm1fq"]
+[ext_resource type="PackedScene" uid="uid://b7oncobnacxmt" path="res://src/LocaleButton.tscn" id="3_amonp"]
[node name="MainMenu" type="Control" node_paths=PackedStringArray("_new_game_button", "_checksum_label")]
editor_description = "UI-13"
@@ -152,7 +153,14 @@ mouse_filter = 1
theme_type_variation = &"Label_Checksum"
text = "(0000)"
+[node name="LocaleButton" parent="Panel/VBox/Margin2" instance=ExtResource("3_amonp")]
+layout_mode = 2
+size_flags_horizontal = 8
+alignment = 0
+text_overrun_behavior = 4
+
[connection signal="pressed" from="Panel/VBox/Margin/ButtonList/NewGameButton" to="." method="_on_new_game_button_pressed"]
+[connection signal="visibility_changed" from="Panel/VBox/Margin/ButtonList/NewGameButton" to="." method="_on_new_game_button_visibility_changed"]
[connection signal="pressed" from="Panel/VBox/Margin/ButtonList/ContinueButton" to="." method="_on_continue_button_pressed"]
[connection signal="pressed" from="Panel/VBox/Margin/ButtonList/MultiplayerButton" to="." method="_on_multi_player_button_pressed"]
[connection signal="pressed" from="Panel/VBox/Margin/ButtonList/OptionsButton" to="." method="_on_options_button_pressed"]