summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortpart <tpart120@proton.me>2024-06-26 16:33:03 +0200
committertpart <tpart120@proton.me>2024-06-26 16:33:03 +0200
commit677b9c898b0fc3faac2aa505cce438a2b2189265 (patch)
tree78d7739cbd51346b2551bbc5eec6e4dff6e128e0
parent2ce3b759c4cd27dc422924fde991a9de85524be5 (diff)
downloadhurrycurry-677b9c898b0fc3faac2aa505cce438a2b2189265.tar
hurrycurry-677b9c898b0fc3faac2aa505cce438a2b2189265.tar.bz2
hurrycurry-677b9c898b0fc3faac2aa505cce438a2b2189265.tar.zst
Support optionally running activation code with menu manager; Fix shuffling in credits not updating
-rw-r--r--client/menu/credits_menu.gd4
-rw-r--r--client/menu/ingame_menu.tscn2
-rw-r--r--client/menu/menu_manager.gd6
3 files changed, 7 insertions, 5 deletions
diff --git a/client/menu/credits_menu.gd b/client/menu/credits_menu.gd
index e4eac72d..07fffab9 100644
--- a/client/menu/credits_menu.gd
+++ b/client/menu/credits_menu.gd
@@ -24,7 +24,7 @@ var cc_by_3 := {
@onready var menu_manager: MenuManager = get_parent()
@onready var label = $Panel/MarginContainer/VBoxContainer/RichTextLabel
-func _ready():
+func prepare():
contributors.shuffle()
label.text = "[center][b]undercooked - a game about cooking[/b]\n\ndeveloped by\n\n[b]"
label.text += ", ".join(contributors)
@@ -35,6 +35,6 @@ func _ready():
label.text += "[b]\"%s\" %s[/b]\nLicensed under Creative Commons: By Attribution 3.0 License\nhttps://creativecommons.org/licenses/by/3.0/\n\n" % [k, v]
label.text += "[b]Additional CC0 assets by:[/b]\n" + "\n".join(cc_0)
-
+
func _on_back_pressed():
menu_manager.goBack()
diff --git a/client/menu/ingame_menu.tscn b/client/menu/ingame_menu.tscn
index f29c7115..47b7cb54 100644
--- a/client/menu/ingame_menu.tscn
+++ b/client/menu/ingame_menu.tscn
@@ -72,7 +72,7 @@ anchors_preset = 9
anchor_bottom = 1.0
offset_left = -400.0
offset_right = -90.0
-offset_bottom = 648.0
+offset_bottom = 1296.0
grow_vertical = 2
[node name="Margin" type="MarginContainer" parent="Side"]
diff --git a/client/menu/menu_manager.gd b/client/menu/menu_manager.gd
index dc6afce8..1285a7e6 100644
--- a/client/menu/menu_manager.gd
+++ b/client/menu/menu_manager.gd
@@ -28,7 +28,9 @@ func goBack():
func show_menu(menu_name: String):
for k in menus.keys():
if k == menu_name:
- menus[k].visible = true
+ menus[k].show()
+ if menus[k].has_method("prepare"):
+ menus[k].prepare() # Optionally run some code
Global.focus_first_button(menus[k])
else:
- menus[k].visible = false
+ menus[k].hide()