From 80bf4c19d3a6a3baf61dde7f4e5acc78de03d70d Mon Sep 17 00:00:00 2001 From: tpart Date: Wed, 26 Jun 2024 14:40:18 +0200 Subject: Disable distance fade to improve performance --- client/map/tiles/bark.tres | 1 - client/map/tiles/leaves.tres | 1 - 2 files changed, 2 deletions(-) (limited to 'client') diff --git a/client/map/tiles/bark.tres b/client/map/tiles/bark.tres index 53b9adc6..24bc469b 100644 --- a/client/map/tiles/bark.tres +++ b/client/map/tiles/bark.tres @@ -10,6 +10,5 @@ metallic = 0.4 roughness = 0.301511 normal_enabled = true normal_texture = ExtResource("2_v3ray") -distance_fade_mode = 2 distance_fade_min_distance = 2.0 distance_fade_max_distance = 4.0 diff --git a/client/map/tiles/leaves.tres b/client/map/tiles/leaves.tres index 99486408..5c2b2082 100644 --- a/client/map/tiles/leaves.tres +++ b/client/map/tiles/leaves.tres @@ -7,6 +7,5 @@ resource_name = "NormalTree_Leaves" transparency = 4 albedo_texture = ExtResource("1_jg4r8") metallic_specular = 0.0 -distance_fade_mode = 2 distance_fade_min_distance = 2.0 distance_fade_max_distance = 4.0 -- cgit v1.2.3-70-g09d2 From 1bc6e59a4dbef9d2770fc5264acd9fda2195872d Mon Sep 17 00:00:00 2001 From: tpart Date: Wed, 26 Jun 2024 14:59:51 +0200 Subject: Add controller button interaction to menus --- client/project.godot | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'client') diff --git a/client/project.godot b/client/project.godot index e7a93c3a..bb2b6896 100644 --- a/client/project.godot +++ b/client/project.godot @@ -23,6 +23,14 @@ Global="*res://global.gd" [input] +ui_accept={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194309,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194310,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":32,"physical_keycode":0,"key_label":0,"unicode":32,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":true,"script":null) +] +} forward={ "deadzone": 0.1, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"echo":false,"script":null) -- cgit v1.2.3-70-g09d2 From 69bc0630667f285708ddbb74af8ef83f7a41fc23 Mon Sep 17 00:00:00 2001 From: tpart Date: Wed, 26 Jun 2024 16:08:38 +0200 Subject: Rewrite settings system; Add full controller support to settings; Add menu manager system --- client/global.gd | 10 ++++++++++ client/menu/character_menu.gd | 3 ++- client/menu/credits_menu.gd | 3 ++- client/menu/credits_menu.tscn | 10 +--------- client/menu/ingame_menu.gd | 11 +++++++++++ client/menu/ingame_menu.tscn | 27 ++++++++++++++------------- client/menu/main_menu.gd | 17 ++++++++--------- client/menu/main_menu.tscn | 10 +--------- client/menu/menu_manager.gd | 34 ++++++++++++++++++++++++++++++++++ client/menu/menu_manager.tscn | 38 ++++++++++++++++++++++++++++++++++++++ client/menu/scene_transition.gd | 7 ++----- client/menu/settings_menu.gd | 4 +++- client/menu/settings_menu.tscn | 10 +--------- client/project.godot | 2 +- 14 files changed, 128 insertions(+), 58 deletions(-) create mode 100644 client/menu/menu_manager.gd create mode 100644 client/menu/menu_manager.tscn (limited to 'client') diff --git a/client/global.gd b/client/global.gd index 095deec8..83517b2d 100644 --- a/client/global.gd +++ b/client/global.gd @@ -50,3 +50,13 @@ func load_profile(): settings[i] = saved_settings[i] print("Loaded settings: ", settings) + +func focus_first_button(node: Node) -> bool: + if node is Button: + node.grab_focus() + print("Node %s (%s) was selected for focus" % [node.name, node]) + return true + for c in node.get_children(): + if focus_first_button(c): + return true + return false diff --git a/client/menu/character_menu.gd b/client/menu/character_menu.gd index f4b878be..f0c17f18 100644 --- a/client/menu/character_menu.gd +++ b/client/menu/character_menu.gd @@ -21,9 +21,10 @@ extends Control func _ready(): $VBoxContainer/top_panel/a/username.text = Global.settings["username"] character.select_hairstyle(Global.settings["character"]) + Global.focus_first_button(self) func _on_back_pressed(): - $SceneTransition.transition_to("res://menu/main_menu.tscn") + $SceneTransition.transition_to("res://menu/menu_manager.tscn") func _on_username_text_changed(new_text): Global.settings["username"] = new_text diff --git a/client/menu/credits_menu.gd b/client/menu/credits_menu.gd index e3ea4c51..e4eac72d 100644 --- a/client/menu/credits_menu.gd +++ b/client/menu/credits_menu.gd @@ -21,6 +21,7 @@ var cc_by_3 := { "Glasses": "Jeremy Edelblut" } +@onready var menu_manager: MenuManager = get_parent() @onready var label = $Panel/MarginContainer/VBoxContainer/RichTextLabel func _ready(): @@ -36,4 +37,4 @@ func _ready(): label.text += "[b]Additional CC0 assets by:[/b]\n" + "\n".join(cc_0) func _on_back_pressed(): - $SceneTransition.transition_to("res://menu/main_menu.tscn") + menu_manager.goBack() diff --git a/client/menu/credits_menu.tscn b/client/menu/credits_menu.tscn index a6536e16..372664d4 100644 --- a/client/menu/credits_menu.tscn +++ b/client/menu/credits_menu.tscn @@ -1,9 +1,7 @@ -[gd_scene load_steps=6 format=3 uid="uid://7mqbxa054bjv"] +[gd_scene load_steps=4 format=3 uid="uid://7mqbxa054bjv"] [ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme.tres" id="1_emk5o"] [ext_resource type="Script" path="res://menu/credits_menu.gd" id="1_igs63"] -[ext_resource type="PackedScene" uid="uid://l4vm07dtda4j" path="res://menu/menu_background.tscn" id="2_k0853"] -[ext_resource type="PackedScene" uid="uid://bg2d78ycorcqk" path="res://menu/scene_transition.tscn" id="4_fbbdb"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_p2qmw"] bg_color = Color(0, 0, 0, 0.878431) @@ -18,8 +16,6 @@ grow_vertical = 2 theme = ExtResource("1_emk5o") script = ExtResource("1_igs63") -[node name="MenuBackground" parent="." instance=ExtResource("2_k0853")] - [node name="Panel" type="Panel" parent="."] layout_mode = 1 anchors_preset = 15 @@ -58,8 +54,4 @@ bbcode_enabled = true layout_mode = 2 text = "Back" -[node name="SceneTransition" parent="." instance=ExtResource("4_fbbdb")] -visible = false -layout_mode = 1 - [connection signal="pressed" from="Panel/MarginContainer/VBoxContainer/back" to="." method="_on_back_pressed"] diff --git a/client/menu/ingame_menu.gd b/client/menu/ingame_menu.gd index 21bfa8ac..9987f8ca 100644 --- a/client/menu/ingame_menu.gd +++ b/client/menu/ingame_menu.gd @@ -1,6 +1,17 @@ extends Control @onready var anim = $AnimationPlayer +@onready var options = $Side/Margin/Options + +func act(): + show() + anim.play("activate") + Global.focus_first_button(options) + +func deact(): + anim.play_backwards("activate") + await anim.animation_finished + hide() func _on_main_menu_pressed(): get_parent().transition_to("res://menu/main_menu.tscn") diff --git a/client/menu/ingame_menu.tscn b/client/menu/ingame_menu.tscn index cf35a7e7..920c8724 100644 --- a/client/menu/ingame_menu.tscn +++ b/client/menu/ingame_menu.tscn @@ -10,7 +10,7 @@ length = 0.001 tracks/0/type = "bezier" tracks/0/imported = false tracks/0/enabled = true -tracks/0/path = NodePath("side:position:x") +tracks/0/path = NodePath("Side:position:x") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/keys = { @@ -24,7 +24,7 @@ resource_name = "activate" tracks/0/type = "bezier" tracks/0/imported = false tracks/0/enabled = true -tracks/0/path = NodePath("side:position:x") +tracks/0/path = NodePath("Side:position:x") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/keys = { @@ -65,26 +65,27 @@ libraries = { } speed_scale = 8.0 -[node name="side" type="PanelContainer" parent="."] +[node name="Side" type="PanelContainer" parent="."] material = SubResource("ShaderMaterial_o2vtr") layout_mode = 1 anchors_preset = 9 anchor_bottom = 1.0 offset_left = -400.0 offset_right = -90.0 +offset_bottom = 648.0 grow_vertical = 2 -[node name="margin" type="MarginContainer" parent="side"] +[node name="Margin" type="MarginContainer" parent="Side"] layout_mode = 2 theme_override_constants/margin_left = 20 theme_override_constants/margin_top = 20 theme_override_constants/margin_right = 20 theme_override_constants/margin_bottom = 20 -[node name="options" type="VBoxContainer" parent="side/margin"] +[node name="Options" type="VBoxContainer" parent="Side/Margin"] layout_mode = 2 -[node name="title" type="Label" parent="side/margin/options"] +[node name="Title" type="Label" parent="Side/Margin/Options"] layout_mode = 2 auto_translate = false theme_override_colors/font_outline_color = Color(0.566408, 0.208917, 0.266045, 1) @@ -93,25 +94,25 @@ theme_override_fonts/font = SubResource("FontVariation_ud3l8") theme_override_font_sizes/font_size = 48 text = "Undercooked" -[node name="spacer" type="Control" parent="side/margin/options"] +[node name="Spacer" type="Control" parent="Side/Margin/Options"] custom_minimum_size = Vector2(0, 10) layout_mode = 2 -[node name="reconnect" type="Button" parent="side/margin/options"] +[node name="Reconnect" type="Button" parent="Side/Margin/Options"] layout_mode = 2 text = "Reconnect" alignment = 0 -[node name="main_menu" type="Button" parent="side/margin/options"] +[node name="MainMenu" type="Button" parent="Side/Margin/Options"] layout_mode = 2 text = "Main Menu" alignment = 0 -[node name="quit" type="Button" parent="side/margin/options"] +[node name="Quit" type="Button" parent="Side/Margin/Options"] layout_mode = 2 text = "Quit" alignment = 0 -[connection signal="pressed" from="side/margin/options/reconnect" to="." method="_on_reconnect_pressed"] -[connection signal="pressed" from="side/margin/options/main_menu" to="." method="_on_main_menu_pressed"] -[connection signal="pressed" from="side/margin/options/quit" to="." method="_on_quit_pressed"] +[connection signal="pressed" from="Side/Margin/Options/Reconnect" to="." method="_on_reconnect_pressed"] +[connection signal="pressed" from="Side/Margin/Options/MainMenu" to="." method="_on_main_menu_pressed"] +[connection signal="pressed" from="Side/Margin/Options/Quit" to="." method="_on_quit_pressed"] diff --git a/client/menu/main_menu.gd b/client/menu/main_menu.gd index 31ca5462..5e66646b 100644 --- a/client/menu/main_menu.gd +++ b/client/menu/main_menu.gd @@ -16,25 +16,24 @@ # extends Control -@onready var transition = $SceneTransition -@onready var quick_connect = $side/margin/options/quick_connect +@onready var menu_manager: MenuManager = get_parent() + @onready var quit_button = $side/margin/options/quit @onready var connect_uri = $side/margin/options/connect/uri func _ready(): - quick_connect.grab_focus() if OS.has_feature("web"): quit_button.hide() connect_uri.text = Global.settings["last_server_url"] func _on_quit_pressed(): - transition.quit() + menu_manager.transition.quit() func _on_credits_pressed(): - transition.transition_to("res://menu/credits_menu.tscn") + menu_manager.goto("credits") func _on_connect_pressed(): - var url = $side/margin/options/connect/uri.text + var url = connect_uri.text Global.settings["last_server_url"] = url Global.save_profile() connect_to(url) @@ -52,10 +51,10 @@ func _on_quick_connect_pressed(): func connect_to(url): print("Connecting to %s" % url) Global.server_url = url - transition.transition_to("res://game.tscn") + menu_manager.transition.transition_to("res://game.tscn") func _on_change_character_pressed(): - transition.transition_to("res://menu/character_menu.tscn") + menu_manager.transition.transition_to("res://menu/character_menu.tscn") func _on_settings_pressed(): - transition.transition_to("res://menu/settings_menu.tscn") + menu_manager.goto("settings") diff --git a/client/menu/main_menu.tscn b/client/menu/main_menu.tscn index 0deeb748..c42a90c1 100644 --- a/client/menu/main_menu.tscn +++ b/client/menu/main_menu.tscn @@ -1,11 +1,9 @@ -[gd_scene load_steps=9 format=3 uid="uid://dbj8508whxgwv"] +[gd_scene load_steps=7 format=3 uid="uid://dbj8508whxgwv"] [ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme.tres" id="1_nlcpo"] [ext_resource type="Script" path="res://menu/main_menu.gd" id="2_qot2j"] [ext_resource type="Shader" path="res://menu/blur_mix.gdshader" id="4_050xu"] [ext_resource type="FontFile" uid="uid://bo4vh5xkpvrh1" path="res://menu/font-sansita-swashed.woff2" id="4_mfs30"] -[ext_resource type="PackedScene" uid="uid://l4vm07dtda4j" path="res://menu/menu_background.tscn" id="4_ydj5p"] -[ext_resource type="PackedScene" uid="uid://bg2d78ycorcqk" path="res://menu/scene_transition.tscn" id="5_651nk"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_irdo3"] shader = ExtResource("4_050xu") @@ -27,8 +25,6 @@ grow_vertical = 2 theme = ExtResource("1_nlcpo") script = ExtResource("2_qot2j") -[node name="MenuBackground" parent="." instance=ExtResource("4_ydj5p")] - [node name="side" type="PanelContainer" parent="."] material = SubResource("ShaderMaterial_irdo3") layout_mode = 1 @@ -98,10 +94,6 @@ layout_mode = 2 text = "Quit" alignment = 0 -[node name="SceneTransition" parent="." instance=ExtResource("5_651nk")] -visible = false -layout_mode = 1 - [connection signal="pressed" from="side/margin/options/quick_connect" to="." method="_on_quick_connect_pressed"] [connection signal="pressed" from="side/margin/options/connect/connect" to="." method="_on_connect_pressed"] [connection signal="pressed" from="side/margin/options/change_character" to="." method="_on_change_character_pressed"] diff --git a/client/menu/menu_manager.gd b/client/menu/menu_manager.gd new file mode 100644 index 00000000..dc6afce8 --- /dev/null +++ b/client/menu/menu_manager.gd @@ -0,0 +1,34 @@ +extends Control +class_name MenuManager + +@onready var menus = { + "main": $MainMenu, + "credits": $CreditsMenu, + "settings": $SettingsMenu +} +@onready var transition = $SceneTransition + +var menu_stack = ["main"] + +func _ready(): + Global.focus_first_button(menus[menu_stack.back()]) + +func goto(menu_name: String): + show_menu(menu_name) + menu_stack.push_back(menu_name) + print("Go to called. Stack: " + str(menu_stack)) + +func goBack(): + menu_stack.pop_back() + if menu_stack.is_empty(): + Global.showError("Menu stack empty") + show_menu(menu_stack.back()) + print("Go back called. Stack: " + str(menu_stack)) + +func show_menu(menu_name: String): + for k in menus.keys(): + if k == menu_name: + menus[k].visible = true + Global.focus_first_button(menus[k]) + else: + menus[k].visible = false diff --git a/client/menu/menu_manager.tscn b/client/menu/menu_manager.tscn new file mode 100644 index 00000000..6b2d7b33 --- /dev/null +++ b/client/menu/menu_manager.tscn @@ -0,0 +1,38 @@ +[gd_scene load_steps=7 format=3 uid="uid://cd52sr1cmo8oj"] + +[ext_resource type="Script" path="res://menu/menu_manager.gd" id="1_c0rjm"] +[ext_resource type="PackedScene" uid="uid://l4vm07dtda4j" path="res://menu/menu_background.tscn" id="2_nf7b6"] +[ext_resource type="PackedScene" uid="uid://dbj8508whxgwv" path="res://menu/main_menu.tscn" id="3_ccpur"] +[ext_resource type="PackedScene" uid="uid://7mqbxa054bjv" path="res://menu/credits_menu.tscn" id="4_xhcd8"] +[ext_resource type="PackedScene" uid="uid://8ic77jmadadj" path="res://menu/settings_menu.tscn" id="5_lifj8"] +[ext_resource type="PackedScene" uid="uid://bg2d78ycorcqk" path="res://menu/scene_transition.tscn" id="6_p4u45"] + +[node name="MenuManager" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_c0rjm") + +[node name="MenuBackground" parent="." instance=ExtResource("2_nf7b6")] + +[node name="MainMenu" parent="." instance=ExtResource("3_ccpur")] +layout_mode = 1 + +[node name="CreditsMenu" parent="." instance=ExtResource("4_xhcd8")] +visible = false +layout_mode = 1 + +[node name="SettingsMenu" parent="." instance=ExtResource("5_lifj8")] +visible = false +layout_mode = 1 + +[node name="SceneTransition" parent="." instance=ExtResource("6_p4u45")] +layout_mode = 0 +anchors_preset = 0 +anchor_right = 0.0 +anchor_bottom = 0.0 +grow_horizontal = 1 +grow_vertical = 1 diff --git a/client/menu/scene_transition.gd b/client/menu/scene_transition.gd index 8d9f38cf..87a1ec1b 100644 --- a/client/menu/scene_transition.gd +++ b/client/menu/scene_transition.gd @@ -45,9 +45,6 @@ func out(): func _process(_delta): if ingame: if not menu.visible and Input.is_action_just_pressed("pause"): - menu.visible = true - menu.anim.play("activate") + menu.act() elif menu.visible and Input.is_action_just_pressed("pause"): - menu.anim.play_backwards("activate") - await menu.anim.animation_finished - menu.visible = false + menu.deact() diff --git a/client/menu/settings_menu.gd b/client/menu/settings_menu.gd index a023cf36..c92a64f3 100644 --- a/client/menu/settings_menu.gd +++ b/client/menu/settings_menu.gd @@ -15,5 +15,7 @@ # extends Control +@onready var menu_manager: MenuManager = get_parent() + func _on_back_pressed(): - $SceneTransition.transition_to("res://menu/main_menu.tscn") + menu_manager.goBack() diff --git a/client/menu/settings_menu.tscn b/client/menu/settings_menu.tscn index 18a32759..e1fefa47 100644 --- a/client/menu/settings_menu.tscn +++ b/client/menu/settings_menu.tscn @@ -1,9 +1,7 @@ -[gd_scene load_steps=5 format=3 uid="uid://8ic77jmadadj"] +[gd_scene load_steps=3 format=3 uid="uid://8ic77jmadadj"] [ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme.tres" id="1_foq3a"] -[ext_resource type="PackedScene" uid="uid://l4vm07dtda4j" path="res://menu/menu_background.tscn" id="1_wi8ti"] [ext_resource type="Script" path="res://menu/settings_menu.gd" id="2_3hgm8"] -[ext_resource type="PackedScene" uid="uid://bg2d78ycorcqk" path="res://menu/scene_transition.tscn" id="2_t0one"] [node name="SettingsMenu" type="Control"] layout_mode = 3 @@ -15,8 +13,6 @@ grow_vertical = 2 theme = ExtResource("1_foq3a") script = ExtResource("2_3hgm8") -[node name="MenuBackground" parent="." instance=ExtResource("1_wi8ti")] - [node name="outer_gap" type="MarginContainer" parent="."] layout_mode = 1 anchors_preset = 15 @@ -58,8 +54,4 @@ layout_mode = 2 size_flags_vertical = 8 text = "Back to Main Menu" -[node name="SceneTransition" parent="." instance=ExtResource("2_t0one")] -visible = false -layout_mode = 1 - [connection signal="pressed" from="outer_gap/panel/inner_gap/back" to="." method="_on_back_pressed"] diff --git a/client/project.godot b/client/project.godot index bb2b6896..e6c1caaf 100644 --- a/client/project.godot +++ b/client/project.godot @@ -11,7 +11,7 @@ config_version=5 [application] config/name="undercooked" -run/main_scene="res://menu/main_menu.tscn" +run/main_scene="res://menu/menu_manager.tscn" config/features=PackedStringArray("4.2", "Forward Plus") boot_splash/bg_color=Color(0.282353, 0.141176, 0.141176, 1) boot_splash/image="res://icon.png" -- cgit v1.2.3-70-g09d2 From 33c578b2c8fcf680e0426653bc54c67822ed8c39 Mon Sep 17 00:00:00 2001 From: tpart Date: Wed, 26 Jun 2024 16:12:52 +0200 Subject: Fix round corners of main menu panel --- client/menu/main_menu.tscn | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'client') diff --git a/client/menu/main_menu.tscn b/client/menu/main_menu.tscn index c42a90c1..7bd1ccc3 100644 --- a/client/menu/main_menu.tscn +++ b/client/menu/main_menu.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=7 format=3 uid="uid://dbj8508whxgwv"] +[gd_scene load_steps=8 format=3 uid="uid://dbj8508whxgwv"] [ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme.tres" id="1_nlcpo"] [ext_resource type="Script" path="res://menu/main_menu.gd" id="2_qot2j"] @@ -11,6 +11,8 @@ shader_parameter/blur_amount = 3.5 shader_parameter/mix_amount = 0.3 shader_parameter/color_over = null +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_cm1nk"] + [sub_resource type="FontVariation" id="FontVariation_htgmg"] base_font = ExtResource("4_mfs30") variation_embolden = 0.5 @@ -32,6 +34,7 @@ anchors_preset = 9 anchor_bottom = 1.0 offset_right = 340.0 grow_vertical = 2 +theme_override_styles/panel = SubResource("StyleBoxFlat_cm1nk") [node name="margin" type="MarginContainer" parent="side"] layout_mode = 2 -- cgit v1.2.3-70-g09d2 From 8dfe99686938995c9d1d8ff4499fab31ef61681a Mon Sep 17 00:00:00 2001 From: tpart Date: Wed, 26 Jun 2024 16:22:10 +0200 Subject: Improve focus style to make it more visible and accessible --- client/menu/character_menu.tscn | 2 +- client/menu/credits_menu.tscn | 2 +- client/menu/error_menu.tscn | 2 +- client/menu/font-josefin-sans.woff2 | Bin 47448 -> 0 bytes client/menu/font-josefin-sans.woff2.import | 33 ----------- client/menu/font-sansita-swashed.woff2 | Bin 92808 -> 0 bytes client/menu/font-sansita-swashed.woff2.import | 33 ----------- client/menu/ingame_menu.tscn | 4 +- client/menu/main_menu.tscn | 4 +- client/menu/settings_menu.tscn | 2 +- client/menu/theme.tres | 63 -------------------- client/menu/theme/focus_style.tres | 17 ++++++ client/menu/theme/font-josefin-sans.woff2 | Bin 0 -> 47448 bytes client/menu/theme/font-josefin-sans.woff2.import | 33 +++++++++++ client/menu/theme/font-sansita-swashed.woff2 | Bin 0 -> 92808 bytes .../menu/theme/font-sansita-swashed.woff2.import | 33 +++++++++++ client/menu/theme/theme.tres | 64 +++++++++++++++++++++ client/player/chat_message.tscn | 2 +- 18 files changed, 156 insertions(+), 138 deletions(-) delete mode 100644 client/menu/font-josefin-sans.woff2 delete mode 100644 client/menu/font-josefin-sans.woff2.import delete mode 100644 client/menu/font-sansita-swashed.woff2 delete mode 100644 client/menu/font-sansita-swashed.woff2.import delete mode 100644 client/menu/theme.tres create mode 100644 client/menu/theme/focus_style.tres create mode 100644 client/menu/theme/font-josefin-sans.woff2 create mode 100644 client/menu/theme/font-josefin-sans.woff2.import create mode 100644 client/menu/theme/font-sansita-swashed.woff2 create mode 100644 client/menu/theme/font-sansita-swashed.woff2.import create mode 100644 client/menu/theme/theme.tres (limited to 'client') diff --git a/client/menu/character_menu.tscn b/client/menu/character_menu.tscn index cad0cb35..b958cf9d 100644 --- a/client/menu/character_menu.tscn +++ b/client/menu/character_menu.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=7 format=3 uid="uid://1f7xpirm5d28"] -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme.tres" id="1_ak2pw"] +[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme.tres" id="1_ak2pw"] [ext_resource type="Script" path="res://menu/character_menu.gd" id="1_brhd1"] [ext_resource type="PackedScene" uid="uid://b3hhir2fvnunu" path="res://player/character/character.tscn" id="3_odq7n"] [ext_resource type="PackedScene" uid="uid://bg2d78ycorcqk" path="res://menu/scene_transition.tscn" id="4_c0ocf"] diff --git a/client/menu/credits_menu.tscn b/client/menu/credits_menu.tscn index 372664d4..74d5cbc9 100644 --- a/client/menu/credits_menu.tscn +++ b/client/menu/credits_menu.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=4 format=3 uid="uid://7mqbxa054bjv"] -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme.tres" id="1_emk5o"] +[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme.tres" id="1_emk5o"] [ext_resource type="Script" path="res://menu/credits_menu.gd" id="1_igs63"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_p2qmw"] diff --git a/client/menu/error_menu.tscn b/client/menu/error_menu.tscn index 0b86cceb..ea01ddc3 100644 --- a/client/menu/error_menu.tscn +++ b/client/menu/error_menu.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=5 format=3 uid="uid://cimgn07lbcs4v"] -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme.tres" id="1_cabdu"] +[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme.tres" id="1_cabdu"] [ext_resource type="PackedScene" uid="uid://l4vm07dtda4j" path="res://menu/menu_background.tscn" id="2_5fxol"] [ext_resource type="Script" path="res://menu/error_menu.gd" id="2_dbe41"] [ext_resource type="PackedScene" uid="uid://bg2d78ycorcqk" path="res://menu/scene_transition.tscn" id="4_1nbt3"] diff --git a/client/menu/font-josefin-sans.woff2 b/client/menu/font-josefin-sans.woff2 deleted file mode 100644 index dce2708f..00000000 Binary files a/client/menu/font-josefin-sans.woff2 and /dev/null differ diff --git a/client/menu/font-josefin-sans.woff2.import b/client/menu/font-josefin-sans.woff2.import deleted file mode 100644 index 9bf40c47..00000000 --- a/client/menu/font-josefin-sans.woff2.import +++ /dev/null @@ -1,33 +0,0 @@ -[remap] - -importer="font_data_dynamic" -type="FontFile" -uid="uid://5ixo6b3bd3km" -path="res://.godot/imported/font-josefin-sans.woff2-8195d19f9e478a66f9d2ca31db663e15.fontdata" - -[deps] - -source_file="res://menu/font-josefin-sans.woff2" -dest_files=["res://.godot/imported/font-josefin-sans.woff2-8195d19f9e478a66f9d2ca31db663e15.fontdata"] - -[params] - -Rendering=null -antialiasing=1 -generate_mipmaps=false -multichannel_signed_distance_field=false -msdf_pixel_range=8 -msdf_size=48 -allow_system_fallback=true -force_autohinter=false -hinting=1 -subpixel_positioning=1 -oversampling=0.0 -Fallbacks=null -fallbacks=[] -Compress=null -compress=true -preload=[] -language_support={} -script_support={} -opentype_features={} diff --git a/client/menu/font-sansita-swashed.woff2 b/client/menu/font-sansita-swashed.woff2 deleted file mode 100644 index 5c665fb0..00000000 Binary files a/client/menu/font-sansita-swashed.woff2 and /dev/null differ diff --git a/client/menu/font-sansita-swashed.woff2.import b/client/menu/font-sansita-swashed.woff2.import deleted file mode 100644 index 54056a3c..00000000 --- a/client/menu/font-sansita-swashed.woff2.import +++ /dev/null @@ -1,33 +0,0 @@ -[remap] - -importer="font_data_dynamic" -type="FontFile" -uid="uid://bo4vh5xkpvrh1" -path="res://.godot/imported/font-sansita-swashed.woff2-259623c6db3c7be991207ff769c643a5.fontdata" - -[deps] - -source_file="res://menu/font-sansita-swashed.woff2" -dest_files=["res://.godot/imported/font-sansita-swashed.woff2-259623c6db3c7be991207ff769c643a5.fontdata"] - -[params] - -Rendering=null -antialiasing=1 -generate_mipmaps=false -multichannel_signed_distance_field=false -msdf_pixel_range=8 -msdf_size=48 -allow_system_fallback=true -force_autohinter=false -hinting=1 -subpixel_positioning=1 -oversampling=0.0 -Fallbacks=null -fallbacks=[] -Compress=null -compress=true -preload=[] -language_support={} -script_support={} -opentype_features={} diff --git a/client/menu/ingame_menu.tscn b/client/menu/ingame_menu.tscn index 920c8724..cfd6ebba 100644 --- a/client/menu/ingame_menu.tscn +++ b/client/menu/ingame_menu.tscn @@ -2,8 +2,8 @@ [ext_resource type="Script" path="res://menu/ingame_menu.gd" id="1_gd1i3"] [ext_resource type="Shader" path="res://menu/blur_mix.gdshader" id="1_o42mc"] -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme.tres" id="1_tm331"] -[ext_resource type="FontFile" uid="uid://bo4vh5xkpvrh1" path="res://menu/font-sansita-swashed.woff2" id="2_4u0ox"] +[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme.tres" id="1_tm331"] +[ext_resource type="FontFile" uid="uid://bo4vh5xkpvrh1" path="res://menu/theme/font-sansita-swashed.woff2" id="2_4u0ox"] [sub_resource type="Animation" id="Animation_8sedy"] length = 0.001 diff --git a/client/menu/main_menu.tscn b/client/menu/main_menu.tscn index 7bd1ccc3..76b55a1a 100644 --- a/client/menu/main_menu.tscn +++ b/client/menu/main_menu.tscn @@ -1,9 +1,9 @@ [gd_scene load_steps=8 format=3 uid="uid://dbj8508whxgwv"] -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme.tres" id="1_nlcpo"] +[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme.tres" id="1_nlcpo"] [ext_resource type="Script" path="res://menu/main_menu.gd" id="2_qot2j"] [ext_resource type="Shader" path="res://menu/blur_mix.gdshader" id="4_050xu"] -[ext_resource type="FontFile" uid="uid://bo4vh5xkpvrh1" path="res://menu/font-sansita-swashed.woff2" id="4_mfs30"] +[ext_resource type="FontFile" uid="uid://bo4vh5xkpvrh1" path="res://menu/theme/font-sansita-swashed.woff2" id="4_mfs30"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_irdo3"] shader = ExtResource("4_050xu") diff --git a/client/menu/settings_menu.tscn b/client/menu/settings_menu.tscn index e1fefa47..6ead9b8b 100644 --- a/client/menu/settings_menu.tscn +++ b/client/menu/settings_menu.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=3 format=3 uid="uid://8ic77jmadadj"] -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme.tres" id="1_foq3a"] +[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme.tres" id="1_foq3a"] [ext_resource type="Script" path="res://menu/settings_menu.gd" id="2_3hgm8"] [node name="SettingsMenu" type="Control"] diff --git a/client/menu/theme.tres b/client/menu/theme.tres deleted file mode 100644 index c2ec3b12..00000000 --- a/client/menu/theme.tres +++ /dev/null @@ -1,63 +0,0 @@ -[gd_resource type="Theme" load_steps=8 format=3 uid="uid://b0qmvo504e457"] - -[ext_resource type="FontFile" uid="uid://5ixo6b3bd3km" path="res://menu/font-josefin-sans.woff2" id="1_go7fi"] -[ext_resource type="FontFile" uid="uid://bo4vh5xkpvrh1" path="res://menu/font-sansita-swashed.woff2" id="1_tneco"] - -[sub_resource type="FontVariation" id="FontVariation_lyo8w"] -base_font = ExtResource("1_go7fi") -variation_embolden = 1.25 -spacing_top = 5 - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_25x32"] -content_margin_left = 10.0 -content_margin_top = 10.0 -content_margin_right = 10.0 -content_margin_bottom = 10.0 -bg_color = Color(1, 1, 1, 0.0352941) -corner_radius_top_left = 5 -corner_radius_top_right = 5 -corner_radius_bottom_right = 5 -corner_radius_bottom_left = 5 - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_2fl8q"] -content_margin_left = 10.0 -content_margin_top = 10.0 -content_margin_right = 10.0 -content_margin_bottom = 10.0 -bg_color = Color(1, 1, 1, 0.266667) -corner_radius_top_left = 5 -corner_radius_top_right = 5 -corner_radius_bottom_right = 5 -corner_radius_bottom_left = 5 - -[sub_resource type="StyleBoxLine" id="StyleBoxLine_emtvk"] -content_margin_top = 5.0 -content_margin_bottom = 5.0 -color = Color(1, 1, 1, 1) -grow_begin = 0.0 -grow_end = 0.0 -thickness = 3 - -[sub_resource type="FontVariation" id="FontVariation_ff4nr"] -base_font = ExtResource("1_tneco") -variation_embolden = 0.7 - -[resource] -Button/font_sizes/font_size = 18 -Button/fonts/font = SubResource("FontVariation_lyo8w") -Button/styles/disabled = SubResource("StyleBoxFlat_25x32") -Button/styles/focus = SubResource("StyleBoxFlat_25x32") -Button/styles/hover = SubResource("StyleBoxFlat_2fl8q") -Button/styles/normal = SubResource("StyleBoxFlat_25x32") -Button/styles/pressed = SubResource("StyleBoxFlat_25x32") -HSeparator/styles/separator = SubResource("StyleBoxLine_emtvk") -Label/font_sizes/font_size = 16 -Label/fonts/font = ExtResource("1_tneco") -LineEdit/styles/focus = SubResource("StyleBoxFlat_25x32") -LineEdit/styles/normal = SubResource("StyleBoxFlat_25x32") -LineEdit/styles/read_only = SubResource("StyleBoxFlat_25x32") -RichTextLabel/fonts/bold_font = SubResource("FontVariation_ff4nr") -RichTextLabel/fonts/bold_italics_font = null -RichTextLabel/fonts/italics_font = null -RichTextLabel/fonts/mono_font = null -RichTextLabel/fonts/normal_font = ExtResource("1_tneco") diff --git a/client/menu/theme/focus_style.tres b/client/menu/theme/focus_style.tres new file mode 100644 index 00000000..a01843fe --- /dev/null +++ b/client/menu/theme/focus_style.tres @@ -0,0 +1,17 @@ +[gd_resource type="StyleBoxFlat" format=3 uid="uid://b86kbd3pfkd5w"] + +[resource] +content_margin_left = 10.0 +content_margin_top = 10.0 +content_margin_right = 10.0 +content_margin_bottom = 10.0 +bg_color = Color(1, 1, 1, 0.0627451) +border_width_left = 2 +border_width_top = 2 +border_width_right = 2 +border_width_bottom = 2 +border_color = Color(0.818673, 0.926505, 1, 1) +corner_radius_top_left = 5 +corner_radius_top_right = 5 +corner_radius_bottom_right = 5 +corner_radius_bottom_left = 5 diff --git a/client/menu/theme/font-josefin-sans.woff2 b/client/menu/theme/font-josefin-sans.woff2 new file mode 100644 index 00000000..dce2708f Binary files /dev/null and b/client/menu/theme/font-josefin-sans.woff2 differ diff --git a/client/menu/theme/font-josefin-sans.woff2.import b/client/menu/theme/font-josefin-sans.woff2.import new file mode 100644 index 00000000..5ecd872c --- /dev/null +++ b/client/menu/theme/font-josefin-sans.woff2.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://5ixo6b3bd3km" +path="res://.godot/imported/font-josefin-sans.woff2-e2c3f263d98e1132cfe6af3f4f0a3454.fontdata" + +[deps] + +source_file="res://menu/theme/font-josefin-sans.woff2" +dest_files=["res://.godot/imported/font-josefin-sans.woff2-e2c3f263d98e1132cfe6af3f4f0a3454.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/client/menu/theme/font-sansita-swashed.woff2 b/client/menu/theme/font-sansita-swashed.woff2 new file mode 100644 index 00000000..5c665fb0 Binary files /dev/null and b/client/menu/theme/font-sansita-swashed.woff2 differ diff --git a/client/menu/theme/font-sansita-swashed.woff2.import b/client/menu/theme/font-sansita-swashed.woff2.import new file mode 100644 index 00000000..faf840fa --- /dev/null +++ b/client/menu/theme/font-sansita-swashed.woff2.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://bo4vh5xkpvrh1" +path="res://.godot/imported/font-sansita-swashed.woff2-323b4a2ee0671aba6e17a6f073f706f3.fontdata" + +[deps] + +source_file="res://menu/theme/font-sansita-swashed.woff2" +dest_files=["res://.godot/imported/font-sansita-swashed.woff2-323b4a2ee0671aba6e17a6f073f706f3.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/client/menu/theme/theme.tres b/client/menu/theme/theme.tres new file mode 100644 index 00000000..96cdbb19 --- /dev/null +++ b/client/menu/theme/theme.tres @@ -0,0 +1,64 @@ +[gd_resource type="Theme" load_steps=9 format=3 uid="uid://b0qmvo504e457"] + +[ext_resource type="FontFile" uid="uid://5ixo6b3bd3km" path="res://menu/theme/font-josefin-sans.woff2" id="1_f8qb0"] +[ext_resource type="StyleBox" uid="uid://b86kbd3pfkd5w" path="res://menu/theme/focus_style.tres" id="2_brg2c"] +[ext_resource type="FontFile" uid="uid://bo4vh5xkpvrh1" path="res://menu/theme/font-sansita-swashed.woff2" id="3_8u6ww"] + +[sub_resource type="FontVariation" id="FontVariation_lyo8w"] +base_font = ExtResource("1_f8qb0") +variation_embolden = 1.25 +spacing_top = 5 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_25x32"] +content_margin_left = 10.0 +content_margin_top = 10.0 +content_margin_right = 10.0 +content_margin_bottom = 10.0 +bg_color = Color(1, 1, 1, 0.0352941) +corner_radius_top_left = 5 +corner_radius_top_right = 5 +corner_radius_bottom_right = 5 +corner_radius_bottom_left = 5 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_2fl8q"] +content_margin_left = 10.0 +content_margin_top = 10.0 +content_margin_right = 10.0 +content_margin_bottom = 10.0 +bg_color = Color(1, 1, 1, 0.266667) +corner_radius_top_left = 5 +corner_radius_top_right = 5 +corner_radius_bottom_right = 5 +corner_radius_bottom_left = 5 + +[sub_resource type="StyleBoxLine" id="StyleBoxLine_emtvk"] +content_margin_top = 5.0 +content_margin_bottom = 5.0 +color = Color(1, 1, 1, 1) +grow_begin = 0.0 +grow_end = 0.0 +thickness = 3 + +[sub_resource type="FontVariation" id="FontVariation_ff4nr"] +base_font = ExtResource("3_8u6ww") +variation_embolden = 0.7 + +[resource] +Button/font_sizes/font_size = 18 +Button/fonts/font = SubResource("FontVariation_lyo8w") +Button/styles/disabled = SubResource("StyleBoxFlat_25x32") +Button/styles/focus = ExtResource("2_brg2c") +Button/styles/hover = SubResource("StyleBoxFlat_2fl8q") +Button/styles/normal = SubResource("StyleBoxFlat_25x32") +Button/styles/pressed = SubResource("StyleBoxFlat_25x32") +HSeparator/styles/separator = SubResource("StyleBoxLine_emtvk") +Label/font_sizes/font_size = 16 +Label/fonts/font = ExtResource("3_8u6ww") +LineEdit/styles/focus = ExtResource("2_brg2c") +LineEdit/styles/normal = SubResource("StyleBoxFlat_25x32") +LineEdit/styles/read_only = SubResource("StyleBoxFlat_25x32") +RichTextLabel/fonts/bold_font = SubResource("FontVariation_ff4nr") +RichTextLabel/fonts/bold_italics_font = null +RichTextLabel/fonts/italics_font = null +RichTextLabel/fonts/mono_font = null +RichTextLabel/fonts/normal_font = ExtResource("3_8u6ww") diff --git a/client/player/chat_message.tscn b/client/player/chat_message.tscn index 1ac82368..816c9c4f 100644 --- a/client/player/chat_message.tscn +++ b/client/player/chat_message.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=4 format=3 uid="uid://5rcfoyuiwuya"] -[ext_resource type="FontFile" uid="uid://5ixo6b3bd3km" path="res://menu/font-josefin-sans.woff2" id="1_3ximm"] +[ext_resource type="FontFile" uid="uid://5ixo6b3bd3km" path="res://menu/theme/font-josefin-sans.woff2" id="1_3ximm"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_dpele"] bg_color = Color(1, 1, 1, 1) -- cgit v1.2.3-70-g09d2 From 5d280643f19196d4eab75d2cd0980258fb7af649 Mon Sep 17 00:00:00 2001 From: tpart Date: Wed, 26 Jun 2024 16:22:54 +0200 Subject: Fix ingame menu redirecting to wrong scene --- client/menu/ingame_menu.gd | 2 +- client/menu/ingame_menu.tscn | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'client') diff --git a/client/menu/ingame_menu.gd b/client/menu/ingame_menu.gd index 9987f8ca..4752c382 100644 --- a/client/menu/ingame_menu.gd +++ b/client/menu/ingame_menu.gd @@ -14,7 +14,7 @@ func deact(): hide() func _on_main_menu_pressed(): - get_parent().transition_to("res://menu/main_menu.tscn") + get_parent().transition_to("res://menu/menu_manager.tscn") func _on_quit_pressed(): get_parent().quit() diff --git a/client/menu/ingame_menu.tscn b/client/menu/ingame_menu.tscn index cfd6ebba..f29c7115 100644 --- a/client/menu/ingame_menu.tscn +++ b/client/menu/ingame_menu.tscn @@ -1,9 +1,9 @@ [gd_scene load_steps=10 format=3 uid="uid://lxlgtjm8hw7v"] [ext_resource type="Script" path="res://menu/ingame_menu.gd" id="1_gd1i3"] +[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme.tres" id="1_lb056"] [ext_resource type="Shader" path="res://menu/blur_mix.gdshader" id="1_o42mc"] -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme.tres" id="1_tm331"] -[ext_resource type="FontFile" uid="uid://bo4vh5xkpvrh1" path="res://menu/theme/font-sansita-swashed.woff2" id="2_4u0ox"] +[ext_resource type="FontFile" uid="uid://bo4vh5xkpvrh1" path="res://menu/theme/font-sansita-swashed.woff2" id="4_27kbu"] [sub_resource type="Animation" id="Animation_8sedy"] length = 0.001 @@ -46,7 +46,7 @@ shader_parameter/mix_amount = 0.3 shader_parameter/color_over = null [sub_resource type="FontVariation" id="FontVariation_ud3l8"] -base_font = ExtResource("2_4u0ox") +base_font = ExtResource("4_27kbu") variation_embolden = 0.5 [node name="IngameMenu" type="Control"] @@ -56,7 +56,7 @@ anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -theme = ExtResource("1_tm331") +theme = ExtResource("1_lb056") script = ExtResource("1_gd1i3") [node name="AnimationPlayer" type="AnimationPlayer" parent="."] -- cgit v1.2.3-70-g09d2 From 2ce3b759c4cd27dc422924fde991a9de85524be5 Mon Sep 17 00:00:00 2001 From: tpart Date: Wed, 26 Jun 2024 16:24:02 +0200 Subject: Fix error menu focus; Fix transition target of error menu --- client/menu/error_menu.gd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'client') diff --git a/client/menu/error_menu.gd b/client/menu/error_menu.gd index 9938ee9d..087261e5 100644 --- a/client/menu/error_menu.gd +++ b/client/menu/error_menu.gd @@ -1,7 +1,8 @@ extends Control func _ready(): + Global.focus_first_button(self) $Panel/contents/mesage.text = Global.error_message func _on_return_pressed(): - $SceneTransition.transition_to("res://menu/main_menu.tscn") + $SceneTransition.transition_to("res://menu/menu_manager.tscn") -- cgit v1.2.3-70-g09d2 From 677b9c898b0fc3faac2aa505cce438a2b2189265 Mon Sep 17 00:00:00 2001 From: tpart Date: Wed, 26 Jun 2024 16:33:03 +0200 Subject: Support optionally running activation code with menu manager; Fix shuffling in credits not updating --- client/menu/credits_menu.gd | 4 ++-- client/menu/ingame_menu.tscn | 2 +- client/menu/menu_manager.gd | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'client') 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() -- cgit v1.2.3-70-g09d2