diff options
Diffstat (limited to 'client/gui')
143 files changed, 2071 insertions, 1290 deletions
diff --git a/client/gui/components/blur_setup.gd b/client/gui/components/blur_setup.gd index 6034aa7f..89a6b322 100644 --- a/client/gui/components/blur_setup.gd +++ b/client/gui/components/blur_setup.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -18,7 +18,7 @@ class_name BlurSetup func _ready(): update(Settings.read("graphics.ui_blur")) - Settings.hook_changed("graphics.ui_blur", "main", update) + Settings.hook_changed("graphics.ui_blur", self, update) func update(state): material.set_shader_parameter("enable_blur", state) diff --git a/client/gui/components/controller_button.gd b/client/gui/components/controller_button.gd index 71f1332f..06de9bf3 100644 --- a/client/gui/components/controller_button.gd +++ b/client/gui/components/controller_button.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/client/gui/components/message/chat_message.gd b/client/gui/components/message/chat_message.gd index 27403701..547b2651 100644 --- a/client/gui/components/message/chat_message.gd +++ b/client/gui/components/message/chat_message.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/client/gui/components/message/chat_message.tscn b/client/gui/components/message/chat_message.tscn index 1478c738..e09b16e6 100644 --- a/client/gui/components/message/chat_message.tscn +++ b/client/gui/components/message/chat_message.tscn @@ -1,33 +1,31 @@ -[gd_scene load_steps=4 format=3 uid="uid://bpc2qgsvcafhe"] +[gd_scene format=3 uid="uid://bpc2qgsvcafhe"] [ext_resource type="Script" uid="uid://6rprqelfdp3" path="res://gui/components/message/chat_message.gd" id="1_ey0qp"] -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://gui/resources/theme/theme.tres" id="1_rx6vg"] [sub_resource type="FontVariation" id="FontVariation_jfhbh"] variation_embolden = 1.3 -[node name="ChatMessage" type="VBoxContainer"] +[node name="ChatMessage" type="VBoxContainer" unique_id=1631647881] offset_right = 72.0 offset_bottom = 192.0 -theme = ExtResource("1_rx6vg") script = ExtResource("1_ey0qp") -[node name="Sender" type="Label" parent="."] +[node name="Sender" type="Label" parent="." unique_id=1014991872] layout_mode = 2 theme_override_fonts/font = SubResource("FontVariation_jfhbh") text = "<Name>" -[node name="FadeAway" type="Timer" parent="."] +[node name="FadeAway" type="Timer" parent="." unique_id=2014646] one_shot = true -[node name="MarginContainer" type="MarginContainer" parent="."] +[node name="MarginContainer" type="MarginContainer" parent="." unique_id=813671083] layout_mode = 2 theme_override_constants/margin_left = 10 theme_override_constants/margin_top = 0 theme_override_constants/margin_right = 0 theme_override_constants/margin_bottom = 5 -[node name="Message" type="Label" parent="MarginContainer"] +[node name="Message" type="Label" parent="MarginContainer" unique_id=1374308464] layout_mode = 2 size_flags_horizontal = 3 text = "Message" diff --git a/client/gui/components/message/item/item_message.gd b/client/gui/components/message/item/item_message.gd index f5a97723..6ea0d1a0 100644 --- a/client/gui/components/message/item/item_message.gd +++ b/client/gui/components/message/item/item_message.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/client/gui/components/message/item/item_message.tscn b/client/gui/components/message/item/item_message.tscn index 59e0ebf9..1a858d31 100644 --- a/client/gui/components/message/item/item_message.tscn +++ b/client/gui/components/message/item/item_message.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=6 format=3 uid="uid://fkqh36s4vl3p"] +[gd_scene format=3 uid="uid://fkqh36s4vl3p"] [ext_resource type="Script" uid="uid://boheclidwdafn" path="res://gui/components/message/item/item_message.gd" id="1_76lg0"] [ext_resource type="PackedScene" uid="uid://cem5xcld6vn51" path="res://gui/components/message/item/item_render.tscn" id="1_sju7l"] @@ -12,7 +12,7 @@ corner_radius_top_right = 30 corner_radius_bottom_right = 30 corner_radius_bottom_left = 30 -[node name="ItemMessage" type="PanelContainer"] +[node name="ItemMessage" type="PanelContainer" unique_id=1861821904] auto_translate_mode = 2 clip_children = 2 offset_right = 256.0 @@ -21,24 +21,24 @@ size_flags_vertical = 0 theme_override_styles/panel = SubResource("StyleBoxFlat_dpele") script = ExtResource("1_76lg0") -[node name="VBoxContainer" type="VBoxContainer" parent="."] +[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=28071380] layout_mode = 2 size_flags_vertical = 0 theme_override_constants/separation = 0 -[node name="SubViewportContainer" type="SubViewportContainer" parent="VBoxContainer"] +[node name="SubViewportContainer" type="SubViewportContainer" parent="VBoxContainer" unique_id=2111560579] layout_mode = 2 -[node name="SubViewport" type="SubViewport" parent="VBoxContainer/SubViewportContainer"] +[node name="SubViewport" type="SubViewport" parent="VBoxContainer/SubViewportContainer" unique_id=1284360089] own_world_3d = true transparent_bg = true handle_input_locally = false size = Vector2i(256, 224) render_target_update_mode = 4 -[node name="ItemRender" parent="VBoxContainer/SubViewportContainer/SubViewport" instance=ExtResource("1_sju7l")] +[node name="ItemRender" parent="VBoxContainer/SubViewportContainer/SubViewport" unique_id=1937813006 instance=ExtResource("1_sju7l")] -[node name="ProgressBar" type="ProgressBar" parent="VBoxContainer"] +[node name="ProgressBar" type="ProgressBar" parent="VBoxContainer" unique_id=299145094] custom_minimum_size = Vector2(0, 32) layout_mode = 2 theme_override_styles/background = ExtResource("3_t61n3") diff --git a/client/gui/components/message/item/item_render.gd b/client/gui/components/message/item/item_render.gd index 374644c3..0c488e64 100644 --- a/client/gui/components/message/item/item_render.gd +++ b/client/gui/components/message/item/item_render.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/client/gui/components/message/item/item_render.tscn b/client/gui/components/message/item/item_render.tscn index 3d993b7a..fb636eb4 100644 --- a/client/gui/components/message/item/item_render.tscn +++ b/client/gui/components/message/item/item_render.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=3 format=3 uid="uid://cem5xcld6vn51"] +[gd_scene format=3 uid="uid://cem5xcld6vn51"] [ext_resource type="Script" uid="uid://bt7773og3p557" path="res://gui/components/message/item/item_render.gd" id="1_jfi7o"] @@ -7,17 +7,17 @@ ambient_light_source = 2 ambient_light_color = Color(1, 1, 1, 1) ambient_light_energy = 0.5 -[node name="ItemRender" type="Node3D"] +[node name="ItemRender" type="Node3D" unique_id=888778935] script = ExtResource("1_jfi7o") -[node name="Camera3D" type="Camera3D" parent="."] +[node name="Camera3D" type="Camera3D" parent="." unique_id=345542198] transform = Transform3D(1, 0, 0, 0, 0.939693, 0.34202, 0, -0.34202, 0.939693, 0, 0.5, 1) projection = 1 size = 0.6 -[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."] +[node name="DirectionalLight3D" type="DirectionalLight3D" parent="." unique_id=1536463653] transform = Transform3D(1, 0, 0, 0, 0.173648, 0.984808, 0, -0.984808, 0.173648, 0, 0, 0) light_energy = 0.5 -[node name="WorldEnvironment" type="WorldEnvironment" parent="."] +[node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=554449090] environment = SubResource("Environment_iyxrx") diff --git a/client/gui/components/message/renderer.gd b/client/gui/components/message/renderer.gd new file mode 100644 index 00000000..fda880de --- /dev/null +++ b/client/gui/components/message/renderer.gd @@ -0,0 +1,34 @@ +# Hurry Curry! - a game about cooking +# Copyright (C) 2026 Hurry Curry! Contributors +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, version 3 of the License only. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. +# +class_name Renderer +extends SubViewportContainer + +var current_object: Node3D = null + +func setup_item(name: String): + if current_object: current_object.queue_free() + current_object = ItemFactory.produce(name, $SubViewport/Node3D/Base) + $SubViewport/Node3D/Camera3D.size = 1. + $SubViewport/Node3D/Base.add_child(current_object) + +func setup_tile(parts: Array): + if current_object: current_object.queue_free() + var tf = TileFactory.new() + current_object = Node3D.new() + tf.produce(current_object, parts, Vector2i(0, 0), [["counter"], ["floor"], ["counter"], []]) + current_object.translate(Vector3(-0.5, 0.0, -0.5)) + $SubViewport/Node3D/Camera3D.size = 2. + $SubViewport/Node3D/Base.add_child(current_object) diff --git a/client/gui/components/message/renderer.gd.uid b/client/gui/components/message/renderer.gd.uid new file mode 100644 index 00000000..333f8bb2 --- /dev/null +++ b/client/gui/components/message/renderer.gd.uid @@ -0,0 +1 @@ +uid://bv6faf7woy4yo diff --git a/client/gui/components/message/renderer.tscn b/client/gui/components/message/renderer.tscn new file mode 100644 index 00000000..8436405e --- /dev/null +++ b/client/gui/components/message/renderer.tscn @@ -0,0 +1,43 @@ +[gd_scene format=3 uid="uid://hdgsa0yfhnfw"] + +[ext_resource type="Script" uid="uid://bv6faf7woy4yo" path="res://gui/components/message/renderer.gd" id="1_3x5y3"] + +[sub_resource type="BoxMesh" id="BoxMesh_pcjn7"] + +[sub_resource type="Environment" id="Environment_vdkpo"] +background_mode = 1 +background_color = Color(0, 0, 0, 0) +ambient_light_source = 2 +ambient_light_color = Color(1, 1, 1, 1) + +[node name="Renderer" type="SubViewportContainer" unique_id=1275527447] +offset_right = 512.0 +offset_bottom = 512.0 +script = ExtResource("1_3x5y3") + +[node name="SubViewport" type="SubViewport" parent="." unique_id=541744446] +own_world_3d = true +transparent_bg = true +handle_input_locally = false +render_target_update_mode = 4 + +[node name="Node3D" type="Node3D" parent="SubViewport" unique_id=973467049] + +[node name="DebugPlaceholder" type="MeshInstance3D" parent="SubViewport/Node3D" unique_id=703186492] +visible = false +mesh = SubResource("BoxMesh_pcjn7") +skeleton = NodePath("../../../..") + +[node name="WorldEnvironment" type="WorldEnvironment" parent="SubViewport/Node3D" unique_id=1814649689] +environment = SubResource("Environment_vdkpo") + +[node name="Camera3D" type="Camera3D" parent="SubViewport/Node3D" unique_id=298159124] +transform = Transform3D(1, 0, 0, 0, 0.8660254, 0.5, 0, -0.5, 0.8660254, 0, 2, 3) +projection = 1 +far = 30.0 + +[node name="DirectionalLight3D" type="DirectionalLight3D" parent="SubViewport/Node3D" unique_id=687060995] +transform = Transform3D(0.7071067, 0.49999997, -0.4999999, 0, 0.70710677, 0.7071067, 0.7071067, -0.49999997, 0.4999999, 0, 0, 0) + +[node name="Base" type="Node3D" parent="SubViewport/Node3D" unique_id=1655606239] +transform = Transform3D(0.70710677, 0, 0.70710677, 0, 1, 0, -0.70710677, 0, 0.70710677, 0, 0, 0) diff --git a/client/gui/components/smart_margin_container.gd b/client/gui/components/smart_margin_container.gd index 046dc6f3..30a219f3 100644 --- a/client/gui/components/smart_margin_container.gd +++ b/client/gui/components/smart_margin_container.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/client/gui/components/touch_scroll_container.gd b/client/gui/components/touch_scroll_container.gd index 292d084a..f262b99c 100644 --- a/client/gui/components/touch_scroll_container.gd +++ b/client/gui/components/touch_scroll_container.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/client/gui/menus/book/book.gd b/client/gui/menus/book/book.gd new file mode 100644 index 00000000..8a0e0db1 --- /dev/null +++ b/client/gui/menus/book/book.gd @@ -0,0 +1,117 @@ +# Hurry Curry! - a game about cooking +# Copyright (C) 2026 Hurry Curry! Contributors +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, version 3 of the License only. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. +# +class_name BookMenu +extends Menu + +const MARGIN: int = 32 + +var current_page := 0 + +@onready var first := $Margin/HBoxContainer/First/PanelContainer/MarginContainer +@onready var second := $Margin/HBoxContainer/Second/PanelContainer/MarginContainer + +static var TOOLS_WITH_COUNTER = ["cutting-board", "rolling-board", "deep-fryer", "sink", "book"] + +@export var title_font: Font +@export var default_font: Font + +var pages: Array + +class BookData: + var game: Game + var data: Dictionary + + func _init(game_, data_) -> void: + game = game_ + data = data_ + +var book_data: BookData + +func _ready(): + super() + book_data = data + pages = book_data.data["pages"] + # Flip book for rtl languages + $Margin/HBoxContainer/Previous.flip_h = not is_layout_rtl() + $Margin/HBoxContainer/Next.flip_h = is_layout_rtl() + build_page() + +func build_page() -> void: + $Margin/HBoxContainer/Previous.disabled = current_page == 0 + $Margin/HBoxContainer/Next.disabled = current_page == pages.size() - 1 + for c: Node in first.get_children(): + c.queue_free() + for c: Node in second.get_children(): + c.queue_free() + + var p: Dictionary = pages[current_page] + match p.page_type: + "contents": + var title := build_title(MessageParser.new(p["title"], book_data.game).result) + var vbox := VBoxContainer.new() + vbox.add_child(title) + for i: Array in p.table: + var m := MessageParser.new(i[0], book_data.game) + vbox.add_child(build_contents_entry(m.result, i[1])) + second.add_child(vbox) + "recipe": + var title := build_title(MessageParser.new(p["title"], book_data.game).result) + var par := build_paragraph(MessageParser.new(p["description"], book_data.game).result) + var vbox := VBoxContainer.new() + vbox.add_child(title) + vbox.add_child(par) + var dia := Diagram.new(p["diagram"], book_data.game) + first.add_child(vbox) + second.add_child(dia) + _: push_error("%s not known" % p.page_type) + return Control.new() + +func build_title(m: String) -> Label: + var label := Label.new() + label.add_theme_font_override("font", title_font) + label.add_theme_font_size_override("font_size", 42) + label.add_theme_color_override("font_color", Color.BLACK) + label.text = m + return label + +func build_paragraph(m: String) -> Label: + var label := Label.new() + label.add_theme_font_override("font", default_font) + label.add_theme_font_size_override("font_size", 32) + label.add_theme_color_override("font_color", Color.BLACK) + label.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART + label.text = m + return label + +func build_contents_entry(m: String, ref: int) -> Control: + var b := LinkButton.new() + b.text = m + b.pressed.connect(func(): + current_page = ref + build_page() + ) + b.add_theme_font_override("font", default_font) + b.add_theme_font_size_override("font_size", 32) + b.add_theme_color_override("font_color", Color.BLACK) + return b + +func _on_previous_pressed() -> void: + current_page = clampi(current_page - 1, 0, pages.size() - 1) + build_page() + +func _on_next_pressed() -> void: + current_page = clampi(current_page + 1, 0, pages.size() - 1) + build_page() diff --git a/client/gui/menus/book/book.gd.uid b/client/gui/menus/book/book.gd.uid new file mode 100644 index 00000000..9bda6bc4 --- /dev/null +++ b/client/gui/menus/book/book.gd.uid @@ -0,0 +1 @@ +uid://d1jive3atu4k7 diff --git a/client/gui/menus/book/book.tscn b/client/gui/menus/book/book.tscn new file mode 100644 index 00000000..1d178b50 --- /dev/null +++ b/client/gui/menus/book/book.tscn @@ -0,0 +1,110 @@ +[gd_scene format=3 uid="uid://bdggwo8un3mys"] + +[ext_resource type="Script" uid="uid://d1jive3atu4k7" path="res://gui/menus/book/book.gd" id="1_gyisx"] +[ext_resource type="Material" uid="uid://beea1pc5nt67r" path="res://gui/resources/materials/dark_blur_material.tres" id="2_0j5mt"] +[ext_resource type="FontVariation" uid="uid://cl6m4hqsnrpav" path="res://gui/resources/fonts/sansita-swashed-bold.tres" id="2_blsld"] +[ext_resource type="Texture2D" uid="uid://35rd5gamtyqm" path="res://gui/resources/icons/arrow.svg" id="2_x03iu"] +[ext_resource type="FontFile" uid="uid://5ixo6b3bd3km" path="res://gui/resources/fonts/font-josefin-sans.woff2" id="3_5pkoa"] +[ext_resource type="Texture2D" uid="uid://j75dbytlbju" path="res://gui/resources/icons/arrow_pressed.svg" id="3_raafv"] +[ext_resource type="Texture2D" uid="uid://b33qmctbpf48g" path="res://gui/resources/icons/arrow_hover.svg" id="4_ee6vw"] +[ext_resource type="Texture2D" uid="uid://by3qsrpxnfq4w" path="res://gui/resources/icons/arrow_focus.svg" id="5_0j5mt"] +[ext_resource type="StyleBox" uid="uid://bqhs5wtdp2oax" path="res://gui/resources/style/paper_panel_style.tres" id="6_raafv"] +[ext_resource type="Script" uid="uid://cmncjc06kadpe" path="res://gui/components/blur_setup.gd" id="7_ee6vw"] + +[sub_resource type="FontVariation" id="FontVariation_ns2fj"] +base_font = ExtResource("2_blsld") + +[sub_resource type="FontVariation" id="FontVariation_wsg84"] +base_font = ExtResource("3_5pkoa") +variation_opentype = { +2003265652: 300 +} + +[node name="Book" type="Control" unique_id=2012988471] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_gyisx") +title_font = SubResource("FontVariation_ns2fj") +default_font = SubResource("FontVariation_wsg84") +support_anim = false + +[node name="Panel" type="Panel" parent="." unique_id=172674263] +material = ExtResource("2_0j5mt") +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("7_ee6vw") + +[node name="Margin" type="MarginContainer" parent="." unique_id=782381175] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_top = 16 +theme_override_constants/margin_bottom = 16 + +[node name="HBoxContainer" type="HBoxContainer" parent="Margin" unique_id=410074371] +layout_mode = 2 + +[node name="Previous" type="TextureButton" parent="Margin/HBoxContainer" unique_id=1963804769] +layout_mode = 2 +texture_normal = ExtResource("2_x03iu") +texture_pressed = ExtResource("3_raafv") +texture_hover = ExtResource("4_ee6vw") +texture_disabled = ExtResource("3_raafv") +texture_focused = ExtResource("5_0j5mt") +stretch_mode = 3 +flip_h = true + +[node name="First" type="HBoxContainer" parent="Margin/HBoxContainer" unique_id=418992738] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="PanelContainer" type="PanelContainer" parent="Margin/HBoxContainer/First" unique_id=1651447616] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_styles/panel = ExtResource("6_raafv") + +[node name="MarginContainer" type="MarginContainer" parent="Margin/HBoxContainer/First/PanelContainer" unique_id=1382780384] +layout_mode = 2 +theme_override_constants/margin_left = 32 +theme_override_constants/margin_top = 32 +theme_override_constants/margin_right = 32 +theme_override_constants/margin_bottom = 32 + +[node name="Second" type="HBoxContainer" parent="Margin/HBoxContainer" unique_id=1289010064] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="PanelContainer" type="PanelContainer" parent="Margin/HBoxContainer/Second" unique_id=1634660876] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_styles/panel = ExtResource("6_raafv") + +[node name="MarginContainer" type="MarginContainer" parent="Margin/HBoxContainer/Second/PanelContainer" unique_id=455360074] +layout_mode = 2 +theme_override_constants/margin_left = 32 +theme_override_constants/margin_top = 32 +theme_override_constants/margin_right = 32 +theme_override_constants/margin_bottom = 32 + +[node name="Next" type="TextureButton" parent="Margin/HBoxContainer" unique_id=1006389953] +layout_mode = 2 +texture_normal = ExtResource("2_x03iu") +texture_pressed = ExtResource("3_raafv") +texture_hover = ExtResource("4_ee6vw") +texture_disabled = ExtResource("3_raafv") +texture_focused = ExtResource("5_0j5mt") +stretch_mode = 3 + +[connection signal="pressed" from="Margin/HBoxContainer/Previous" to="." method="_on_previous_pressed"] +[connection signal="pressed" from="Margin/HBoxContainer/Next" to="." method="_on_next_pressed"] diff --git a/client/gui/menus/book/diagram.gd b/client/gui/menus/book/diagram.gd new file mode 100644 index 00000000..b4ae3f30 --- /dev/null +++ b/client/gui/menus/book/diagram.gd @@ -0,0 +1,124 @@ +# Hurry Curry! - a game about cooking +# Copyright (C) 2026 Hurry Curry! Contributors +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, version 3 of the License only. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. +# +class_name Diagram +extends Control + +const RENDERER := preload("res://gui/components/message/renderer.tscn") +var BASE_SIZE: float = 64.; +var hsize: float = 32.; + +var raw: Dictionary +var nodes: Array#[DiagramNode] +var edges: Array#[DiagramEdge] +var draw_nodes: Array +var renderers: Array[Renderer] = [] + +class DiagramNode: + var position: Vector2 + var label: MessageParser + var style: String + + func _init(raw: Dictionary, game: Game): + position = Vector2(raw["position"][0], raw["position"][1]) + label = MessageParser.new(raw["label"], game) + style = raw["style"] + +class DiagramEdge: + var src: int + var dst: int + + func _init(raw: Dictionary): + src = raw["src"] + dst = raw["dst"] + +func _init(raw_: Dictionary, game: Game) -> void: + raw = raw_ + nodes = raw["nodes"].map(func(r): return DiagramNode.new(r, game)) + edges = raw["edges"].map(func(r): return DiagramEdge.new(r)) + # ugh + draw_nodes = raw["nodes"].map(func(r): return DiagramNode.new(r, game)) + +func _ready() -> void: + redraw_images() + item_rect_changed.connect(func(): + if size != Vector2(64, 64): scale() + ) + +func redraw_images() -> void: + for r in renderers: + r.queue_free() + renderers.clear() + for n: DiagramNode in draw_nodes: + var r: Renderer = RENDERER.instantiate() + r.get_node("SubViewport").size = Vector2.ONE * hsize * 2. + add_child(r) + r.position = n.position - Vector2(hsize, hsize) + match n.label.kind: + MessageParser.Kind.ITEM: r.setup_object(n.label.result) + MessageParser.Kind.TILE: r.setup_object([n.label.result]) + renderers.push_back(r) + +func scale() -> void: + var bounds = Rect2(Vector2.ONE * BASE_SIZE * 0.5, Vector2(size.x - BASE_SIZE, size.y - BASE_SIZE)) + var current := Rect2(Vector2(INF, INF), Vector2(-INF, -INF)) + for n: DiagramNode in nodes: + current.position = current.position.min(n.position) + current.end = current.end.max(n.position) + var s = Vector2.ONE.min(bounds.size / current.size) + hsize = BASE_SIZE * 0.5 * min(s.x, s.y) + for i in nodes.size(): + var dn: DiagramNode = draw_nodes[i] + var n: DiagramNode = nodes[i] + dn.position = n.position - current.position + dn.position *= s + dn.position += bounds.position + redraw_images() + +func _draw() -> void: + for n: DiagramNode in draw_nodes: + match n.style: + "intermediate_product": + draw_circle(n.position, hsize, Color("#555"), true, -1., true) + "final_product": + draw_circle(n.position, hsize, Color("#333"), true, -1., true) + "process_active": + draw_rect(Rect2(n.position - Vector2(hsize, hsize), Vector2(hsize, hsize) * 2.), Color("#47c42b")) + "process_passive": + draw_rect(Rect2(n.position - Vector2(hsize, hsize), Vector2(hsize, hsize) * 2.), Color("#c4a32b")) + "process_instant": + draw_rect(Rect2(n.position - Vector2(hsize, hsize), Vector2(hsize, hsize) * 2.), Color("#5452d8")) + + for e: DiagramEdge in edges: + var src_node: DiagramNode = draw_nodes[e.src] + var dst_node: DiagramNode = draw_nodes[e.dst] + var src := node_edge_connect_pos(src_node, dst_node) + var dst := node_edge_connect_pos(dst_node, src_node) + + var dir = (src - dst).normalized() + var tip0 = dst + var tip1 = dst + dir.rotated(0.2 * PI) * 10. + var tip2 = dst + dir.rotated(-0.2 * PI) * 10. + dst += dir * 5. + + draw_colored_polygon([tip0, tip1, tip2], Color.BLACK) + draw_line(src, dst, Color.BLACK, 2., true) + +func node_edge_connect_pos(src: DiagramNode, dst: DiagramNode) -> Vector2: + var dir = (dst.position - src.position).normalized() + if src.style == "intermediate_product" or src.style == "final_product": + return src.position + dir * hsize + else: + return src.position + dir / max(abs(dir.y), abs(dir.x)) * hsize diff --git a/client/gui/menus/book/diagram.gd.uid b/client/gui/menus/book/diagram.gd.uid new file mode 100644 index 00000000..debd91e5 --- /dev/null +++ b/client/gui/menus/book/diagram.gd.uid @@ -0,0 +1 @@ +uid://jqmllc8hafx0 diff --git a/client/gui/menus/character.gd b/client/gui/menus/character.gd index fa3d213e..42b22918 100644 --- a/client/gui/menus/character.gd +++ b/client/gui/menus/character.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -24,7 +24,9 @@ func _ready(): $VBoxContainer/top_panel/a/username.text = Profile.read("username") character.set_style(Profile.read("character_style"), "chef") -func exit(): +func _menu_music(): Sound.set_music("reflets-dans-leau", -3, true) + +func exit(exit_data = null): if username_edit.text == "": var popup_data := MenuPopup.Data.new() popup_data.text = tr("c.error.empty_username") @@ -34,7 +36,7 @@ func exit(): await submenu("res://gui/menus/popup.tscn", popup_data) return Profile.write("username", username_edit.text) - super() + super(exit_data) func _on_character_back_pressed(): modify_style(func m(current_style: Dictionary): diff --git a/client/gui/menus/character.tscn b/client/gui/menus/character.tscn index fa5f513c..24d698c5 100644 --- a/client/gui/menus/character.tscn +++ b/client/gui/menus/character.tscn @@ -1,6 +1,5 @@ -[gd_scene load_steps=14 format=3 uid="uid://1f7xpirm5d28"] +[gd_scene format=3 uid="uid://1f7xpirm5d28"] -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://gui/resources/theme/theme.tres" id="1_ak2pw"] [ext_resource type="Script" uid="uid://bglusga8l5c27" path="res://gui/menus/character.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://gui/menus/transition/scene_transition.tscn" id="4_c0ocf"] @@ -14,67 +13,66 @@ [ext_resource type="Script" uid="uid://cmncjc06kadpe" path="res://gui/components/blur_setup.gd" id="7_nj82n"] [ext_resource type="Material" uid="uid://beea1pc5nt67r" path="res://gui/resources/materials/dark_blur_material.tres" id="12_mjf6q"] -[node name="CharacterMenu" type="Control"] +[node name="CharacterMenu" type="Control" unique_id=1936971311] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -theme = ExtResource("1_ak2pw") script = ExtResource("1_brhd1") -[node name="Node3D" type="Node3D" parent="."] +[node name="Node3D" type="Node3D" parent="." unique_id=1910363995] -[node name="Character" parent="Node3D" instance=ExtResource("3_odq7n")] +[node name="Character" parent="Node3D" unique_id=331462834 instance=ExtResource("3_odq7n")] -[node name="Camera3D" type="Camera3D" parent="Node3D"] +[node name="Camera3D" type="Camera3D" parent="Node3D" unique_id=1576520390] transform = Transform3D(1, 0, 0, 0, 0.9781476, 0.2079117, 0, -0.2079117, 0.9781476, 0, 1.125, 2.75) current = true fov = 40.0 -[node name="KitchenBackground" parent="Node3D" instance=ExtResource("4_oanna")] +[node name="KitchenBackground" parent="Node3D" unique_id=2119883164 instance=ExtResource("4_oanna")] transform = Transform3D(0.8660254, 0, 0.5, 0, 1, 0, -0.5, 0, 0.8660254, 0, 0, 0) -[node name="SpotLight3D" type="SpotLight3D" parent="Node3D"] +[node name="SpotLight3D" type="SpotLight3D" parent="Node3D" unique_id=1688426082] transform = Transform3D(0.8825786, -0.13509111, 0.4503392, 0, 0.9578325, 0.2873271, -0.47016487, -0.25358877, 0.8453625, 1.1277027, 1.109924, 2.02365) light_color = Color(0.87094337, 0.86437446, 0.85403997, 1) light_energy = 1.5 shadow_enabled = true shadow_blur = 3.0 -[node name="SpotLight3D2" type="SpotLight3D" parent="Node3D"] +[node name="SpotLight3D2" type="SpotLight3D" parent="Node3D" unique_id=104233494] transform = Transform3D(0.9149456, 0.11595869, -0.3865594, 0, 0.9578325, 0.28732717, 0.40357724, -0.2628887, 0.87636465, -1.2921853, 1.109924, 2.02365) light_color = Color(0.87094337, 0.86437446, 0.85403997, 1) light_energy = 0.8 shadow_enabled = true shadow_blur = 3.0 -[node name="SpotLight3D5" type="SpotLight3D" parent="Node3D"] +[node name="SpotLight3D5" type="SpotLight3D" parent="Node3D" unique_id=807895905] transform = Transform3D(0.99089444, -0.009957474, -0.13427223, 0.029642614, -0.95665854, 0.2896995, -0.13133734, -0.29104182, -0.94765246, -0.27793396, 1.5702409, -1.0504578) light_color = Color(0.6709639, 0.8500128, 1, 1) light_energy = 5.0 spot_range = 1.9395764 spot_angle = 25.84634 -[node name="SpotLight3D4" type="SpotLight3D" parent="Node3D"] +[node name="SpotLight3D4" type="SpotLight3D" parent="Node3D" unique_id=33030011] transform = Transform3D(0.9139213, -0.3175812, 0.2527643, -0.093218885, -0.77032155, -0.63080496, 0.39504167, 0.5529437, -0.73361796, 1.0089738, 0.124474704, -1.4214872) light_color = Color(0.7758381, 0.7974717, 1, 1) light_energy = 5.0 -[node name="OmniLight3D3" type="OmniLight3D" parent="Node3D"] +[node name="OmniLight3D3" type="OmniLight3D" parent="Node3D" unique_id=513945686] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.6456945, 0.76124895, 0.72990704) -light_color = Color(0.84705883, 0.5019608, 0.43529412, 1) +light_color = Color(0.79, 0.3476, 0.50244, 1) light_energy = 0.75 omni_range = 6.4840736 -[node name="OmniLight3D4" type="OmniLight3D" parent="Node3D"] +[node name="OmniLight3D4" type="OmniLight3D" parent="Node3D" unique_id=1260513554] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.5320137, 0.48659694, 0.6924461) -light_color = Color(0.5875623, 0.58040434, 0.8120325, 1) +light_color = Color(0.42633, 0.4131, 0.81, 1) light_energy = 0.75 omni_range = 6.071165 -[node name="VBoxContainer" type="VBoxContainer" parent="."] +[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=841911331] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -82,14 +80,14 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -[node name="top_panel" type="Panel" parent="VBoxContainer"] +[node name="top_panel" type="Panel" parent="VBoxContainer" unique_id=1181042323] material = ExtResource("5_cgkmt") custom_minimum_size = Vector2(0, 100) layout_mode = 2 theme_override_styles/panel = ExtResource("6_wxiis") script = ExtResource("7_nj82n") -[node name="a" type="VBoxContainer" parent="VBoxContainer/top_panel"] +[node name="a" type="VBoxContainer" parent="VBoxContainer/top_panel" unique_id=1129893219] layout_mode = 1 anchors_preset = 5 anchor_left = 0.5 @@ -100,16 +98,16 @@ offset_right = 216.0 offset_bottom = 110.0 grow_horizontal = 2 -[node name="Label" type="Label" parent="VBoxContainer/top_panel/a"] +[node name="Label" type="Label" parent="VBoxContainer/top_panel/a" unique_id=535228051] layout_mode = 2 text = "c.settings.username" horizontal_alignment = 1 -[node name="username" type="LineEdit" parent="VBoxContainer/top_panel/a"] +[node name="username" type="LineEdit" parent="VBoxContainer/top_panel/a" unique_id=79006791] layout_mode = 2 max_length = 32 -[node name="Spacer" type="MarginContainer" parent="VBoxContainer"] +[node name="Spacer" type="MarginContainer" parent="VBoxContainer" unique_id=1314962703] layout_mode = 2 size_flags_vertical = 3 theme_override_constants/margin_left = 50 @@ -117,16 +115,17 @@ theme_override_constants/margin_top = 50 theme_override_constants/margin_right = 50 theme_override_constants/margin_bottom = 50 -[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/Spacer"] +[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/Spacer" unique_id=355029923] layout_mode = 2 alignment = 1 -[node name="Headware" type="HBoxContainer" parent="VBoxContainer/Spacer/VBoxContainer"] +[node name="Headware" type="HBoxContainer" parent="VBoxContainer/Spacer/VBoxContainer" unique_id=337136830] +layout_direction = 2 layout_mode = 2 size_flags_vertical = 3 alignment = 1 -[node name="Back" type="TextureButton" parent="VBoxContainer/Spacer/VBoxContainer/Headware"] +[node name="Back" type="TextureButton" parent="VBoxContainer/Spacer/VBoxContainer/Headware" unique_id=39776895] layout_mode = 2 size_flags_horizontal = 3 focus_neighbor_right = NodePath("../Forward") @@ -138,11 +137,11 @@ ignore_texture_size = true stretch_mode = 5 flip_h = true -[node name="Spacer" type="Control" parent="VBoxContainer/Spacer/VBoxContainer/Headware"] +[node name="Spacer" type="Control" parent="VBoxContainer/Spacer/VBoxContainer/Headware" unique_id=480930147] layout_mode = 2 size_flags_horizontal = 3 -[node name="Forward" type="TextureButton" parent="VBoxContainer/Spacer/VBoxContainer/Headware"] +[node name="Forward" type="TextureButton" parent="VBoxContainer/Spacer/VBoxContainer/Headware" unique_id=743596728] layout_mode = 2 size_flags_horizontal = 3 focus_neighbor_left = NodePath("../Back") @@ -153,12 +152,13 @@ texture_focused = ExtResource("6_u31hl") ignore_texture_size = true stretch_mode = 5 -[node name="Hairstyle" type="HBoxContainer" parent="VBoxContainer/Spacer/VBoxContainer"] +[node name="Hairstyle" type="HBoxContainer" parent="VBoxContainer/Spacer/VBoxContainer" unique_id=46243549] +layout_direction = 2 layout_mode = 2 size_flags_vertical = 3 alignment = 1 -[node name="Back" type="TextureButton" parent="VBoxContainer/Spacer/VBoxContainer/Hairstyle"] +[node name="Back" type="TextureButton" parent="VBoxContainer/Spacer/VBoxContainer/Hairstyle" unique_id=1986439220] layout_mode = 2 size_flags_horizontal = 3 focus_neighbor_right = NodePath("../Forward") @@ -170,11 +170,11 @@ ignore_texture_size = true stretch_mode = 5 flip_h = true -[node name="Spacer" type="Control" parent="VBoxContainer/Spacer/VBoxContainer/Hairstyle"] +[node name="Spacer" type="Control" parent="VBoxContainer/Spacer/VBoxContainer/Hairstyle" unique_id=1730649887] layout_mode = 2 size_flags_horizontal = 3 -[node name="Forward" type="TextureButton" parent="VBoxContainer/Spacer/VBoxContainer/Hairstyle"] +[node name="Forward" type="TextureButton" parent="VBoxContainer/Spacer/VBoxContainer/Hairstyle" unique_id=1174265017] layout_mode = 2 size_flags_horizontal = 3 focus_neighbor_left = NodePath("../Back") @@ -185,12 +185,13 @@ texture_focused = ExtResource("6_u31hl") ignore_texture_size = true stretch_mode = 5 -[node name="Character" type="HBoxContainer" parent="VBoxContainer/Spacer/VBoxContainer"] +[node name="Character" type="HBoxContainer" parent="VBoxContainer/Spacer/VBoxContainer" unique_id=1020578308] +layout_direction = 2 layout_mode = 2 size_flags_vertical = 3 alignment = 1 -[node name="Back" type="TextureButton" parent="VBoxContainer/Spacer/VBoxContainer/Character"] +[node name="Back" type="TextureButton" parent="VBoxContainer/Spacer/VBoxContainer/Character" unique_id=65037917] layout_mode = 2 size_flags_horizontal = 3 focus_neighbor_right = NodePath("../Forward") @@ -202,11 +203,11 @@ ignore_texture_size = true stretch_mode = 5 flip_h = true -[node name="Spacer" type="Control" parent="VBoxContainer/Spacer/VBoxContainer/Character"] +[node name="Spacer" type="Control" parent="VBoxContainer/Spacer/VBoxContainer/Character" unique_id=1821703862] layout_mode = 2 size_flags_horizontal = 3 -[node name="Forward" type="TextureButton" parent="VBoxContainer/Spacer/VBoxContainer/Character"] +[node name="Forward" type="TextureButton" parent="VBoxContainer/Spacer/VBoxContainer/Character" unique_id=1721685554] layout_mode = 2 size_flags_horizontal = 3 focus_neighbor_left = NodePath("../Back") @@ -217,14 +218,14 @@ texture_focused = ExtResource("6_u31hl") ignore_texture_size = true stretch_mode = 5 -[node name="bottom_panel" type="Panel" parent="VBoxContainer"] +[node name="bottom_panel" type="Panel" parent="VBoxContainer" unique_id=971465503] material = ExtResource("12_mjf6q") custom_minimum_size = Vector2(0, 75) layout_mode = 2 theme_override_styles/panel = ExtResource("6_wxiis") script = ExtResource("7_nj82n") -[node name="back" type="Button" parent="VBoxContainer/bottom_panel"] +[node name="back" type="Button" parent="VBoxContainer/bottom_panel" unique_id=68338925] layout_mode = 1 anchors_preset = 8 anchor_left = 0.5 @@ -240,7 +241,7 @@ grow_vertical = 2 size_flags_vertical = 8 text = "c.menu.back" -[node name="SceneTransition" parent="." instance=ExtResource("4_c0ocf")] +[node name="SceneTransition" parent="." unique_id=863534827 instance=ExtResource("4_c0ocf")] visible = false layout_mode = 1 diff --git a/client/gui/menus/chat.gd b/client/gui/menus/chat.gd index aae76f82..df065ebc 100644 --- a/client/gui/menus/chat.gd +++ b/client/gui/menus/chat.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/client/gui/menus/chat.tscn b/client/gui/menus/chat.tscn index 5b046191..441f3eea 100644 --- a/client/gui/menus/chat.tscn +++ b/client/gui/menus/chat.tscn @@ -1,13 +1,12 @@ -[gd_scene load_steps=7 format=3 uid="uid://dbd6k56l4p0ls"] +[gd_scene format=3 uid="uid://dbd6k56l4p0ls"] [ext_resource type="Script" uid="uid://cfweimyoq5vv0" path="res://gui/menus/chat.gd" id="1_gntkb"] [ext_resource type="Material" uid="uid://beea1pc5nt67r" path="res://gui/resources/materials/dark_blur_material.tres" id="2_1au48"] -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://gui/resources/theme/theme.tres" id="3_lrbjr"] [ext_resource type="StyleBox" uid="uid://bw4jamyna1top" path="res://gui/resources/style/panel_style_sidebar.tres" id="4_d4nta"] [ext_resource type="Script" uid="uid://cmncjc06kadpe" path="res://gui/components/blur_setup.gd" id="5_l1coj"] [ext_resource type="Script" uid="uid://bd7bylb2t2m0" path="res://gui/components/touch_scroll_container.gd" id="6_ff15x"] -[node name="ChatOpen" type="Control"] +[node name="ChatOpen" type="Control" unique_id=2023475735] layout_mode = 3 anchors_preset = 9 anchor_bottom = 1.0 @@ -16,27 +15,26 @@ grow_vertical = 2 script = ExtResource("1_gntkb") support_anim = false -[node name="PanelContainer" type="PanelContainer" parent="."] +[node name="PanelContainer" type="PanelContainer" parent="." unique_id=947723788] material = ExtResource("2_1au48") layout_mode = 1 anchors_preset = 9 anchor_bottom = 1.0 offset_right = 296.0 grow_vertical = 2 -theme = ExtResource("3_lrbjr") theme_override_styles/panel = ExtResource("4_d4nta") script = ExtResource("5_l1coj") -[node name="MarginContainer" type="MarginContainer" parent="PanelContainer"] +[node name="MarginContainer" type="MarginContainer" parent="PanelContainer" unique_id=1727397765] layout_mode = 2 -[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/MarginContainer"] +[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/MarginContainer" unique_id=1494822989] layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 theme_override_constants/separation = 0 -[node name="ScrollContainerCustom" type="ScrollContainer" parent="PanelContainer/MarginContainer/VBoxContainer"] +[node name="ScrollContainerCustom" type="ScrollContainer" parent="PanelContainer/MarginContainer/VBoxContainer" unique_id=505698548] material = ExtResource("2_1au48") layout_mode = 2 size_flags_horizontal = 3 @@ -44,12 +42,12 @@ size_flags_vertical = 3 script = ExtResource("6_ff15x") auto_scroll_to_bottom = true -[node name="Messages" type="VBoxContainer" parent="PanelContainer/MarginContainer/VBoxContainer/ScrollContainerCustom"] +[node name="Messages" type="VBoxContainer" parent="PanelContainer/MarginContainer/VBoxContainer/ScrollContainerCustom" unique_id=284153322] layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 -[node name="LineEdit" type="LineEdit" parent="PanelContainer/MarginContainer/VBoxContainer" groups=["autoselect"]] +[node name="LineEdit" type="LineEdit" parent="PanelContainer/MarginContainer/VBoxContainer" unique_id=1024788333 groups=["autoselect"]] layout_mode = 2 placeholder_text = "c.chat.write_message" keep_editing_on_text_submit = true diff --git a/client/gui/menus/document/document.gd b/client/gui/menus/document/document.gd deleted file mode 100644 index 781dbfca..00000000 --- a/client/gui/menus/document/document.gd +++ /dev/null @@ -1,152 +0,0 @@ -# Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, version 3 of the License only. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. -# -extends Menu - -const MARGIN: int = 75 - -var labels := {} - -func _ready(): - super() - $ScrollContainer/VBoxContainer.add_child(build_document(data)) - -func build_document(element: Dictionary, bullet: bool = false) -> Control: - var node: Control - match element["t"]: - "document": - node = VBoxContainer.new() - node.name = "Document" - for e in element["es"]: - node.add_child(build_document(e)) - "page": - node = PanelContainer.new() - node.name = "Page" - node.add_theme_stylebox_override("panel", preload("res://gui/resources/style/paper_panel_style.tres")) - node.set_custom_minimum_size(Vector2(800, 1131.371)) - var margin := MarginContainer.new() - margin.add_theme_constant_override("margin_bottom", MARGIN) - margin.add_theme_constant_override("margin_top", MARGIN) - margin.add_theme_constant_override("margin_left", MARGIN) - margin.add_theme_constant_override("margin_right", MARGIN) - var vbox := VBoxContainer.new() - if element["background"]: - margin.add_child(background(element["background"])) - margin.add_child(vbox) - for e in element["es"]: - vbox.add_child(build_document(e, bullet)) - node.add_child(margin) - "label": - var label_id = element["id"] - node = build_document(element["e"], bullet) - labels[label_id] = node - "list": - node = VBoxContainer.new() - node.name = "List" - for e in element["es"]: - node.add_child(build_document(e, true)) - "table": - node = VBoxContainer.new() - node.name = "Rows" - node.size_flags_horizontal = Control.SIZE_EXPAND_FILL - for r in range(element["es"].size()): - var row = HBoxContainer.new() - node.add_child(row) - row.size_flags_horizontal = Control.SIZE_EXPAND_FILL - row.name = "Row%d" % r - for c in element["es"][r]: - var e = build_document(c, bullet) - e.size_flags_horizontal = Control.SIZE_EXPAND_FILL - row.add_child(e) - "par": - node = VBoxContainer.new() - node.name = "Paragraph" - for e in element["es"]: - node.add_child(build_document(e, bullet)) - "ref": - # TODO: Support clicking - node = build_document(element["e"], bullet) - "conditional": - # Ignore all conditionals for now, since they are only revelant for typst version - node = Control.new() - "text": - node = text_node(element, bullet) - _: - node = Control.new() - push_error("Error building document: Unknown type \"%s\"" % element["t"]) - return node - -func text_node(element: Dictionary, bullet: bool) -> Control: - var node: Control - var label := Label.new() - # we need a hbox container for rtl - if bullet: - node = HBoxContainer.new() - var bullet_label := Label.new() - bullet_label.text = "•" - if element.get("size"): - bullet_label.add_theme_font_size_override("font_size", element["size"]) - # TODO: Ignore font color for now. Will be removed in the future. - # if element.get("color"): - # bullet_label.add_theme_color_override("font_color", Color(element["color"])) - bullet_label.add_theme_color_override("font_color", Color.BLACK) - label.add_theme_color_override("font_color", Color.BLACK) - node.add_child(bullet_label) - label.size_flags_horizontal = Control.SIZE_EXPAND_FILL - node.add_child(label) - else: - node = label - label.name = "Text" - label.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART - label.text = Global.get_message_str(element["s"]) - if element.get("font"): - match element["font"]: - "Great Vibes": - node.add_theme_font_override("font", preload("res://gui/resources/fonts/font-sansita-swashed.woff2")) - if element.get("size"): - node.add_theme_font_size_override("font_size", element["size"]) - # TODO: Ignore font color for now. Will be removed in the future. - # if element.get("color"): - # label.add_theme_color_override("font_color", Color(element["color"])) - label.add_theme_color_override("font_color", Color.BLACK) - return node - -func background(background_name: String) -> SubViewportContainer: - var item_name: String - match background_name: - "cover": item_name = "plate:plate,plate,plate,dirt" - "toc": item_name = "tomato" - "tomato_soup": item_name = "plate:tomato-soup" - "burger": item_name = "plate:sliced-bun,sliced-tomato,sliced-lettuce" - "mochi": item_name = "plate:strawberry-mochi" - "curry": item_name = "plate:curry,cooked-rice" - "icecream": item_name = "plate:strawberry-icecream" - "drinks": item_name = "glass:strawberry-shake" - var n: item_name = n - var scene: ItemRender = preload("res://gui/components/message/item/item_render.tscn").instantiate() - scene.set_item(item_name, false) - var vc := SubViewportContainer.new() - var viewport := SubViewport.new() - viewport.add_child(scene) - viewport.own_world_3d = true - viewport.transparent_bg = true - vc.size_flags_horizontal = Control.SIZE_SHRINK_CENTER - vc.size_flags_vertical = Control.SIZE_SHRINK_END - #vc.material = preload("res://menu/theme/materials/printed_material.tres") - vc.add_child(viewport) - return vc - -func _menu_open(): pass -func _menu_exit(): pass diff --git a/client/gui/menus/document/document.gd.uid b/client/gui/menus/document/document.gd.uid deleted file mode 100644 index c84b53b1..00000000 --- a/client/gui/menus/document/document.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://c83p4k0nredmd diff --git a/client/gui/menus/document/document.tscn b/client/gui/menus/document/document.tscn deleted file mode 100644 index 537ac8b8..00000000 --- a/client/gui/menus/document/document.tscn +++ /dev/null @@ -1,29 +0,0 @@ -[gd_scene load_steps=3 format=3 uid="uid://bdggwo8un3mys"] - -[ext_resource type="Script" uid="uid://c83p4k0nredmd" path="res://gui/menus/document/document.gd" id="1_gyisx"] -[ext_resource type="Script" uid="uid://bd7bylb2t2m0" path="res://gui/components/touch_scroll_container.gd" id="2_0d0p0"] - -[node name="Document" 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_gyisx") -support_anim = false -auto_anim = null - -[node name="ScrollContainer" type="ScrollContainer" parent="."] -layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -script = ExtResource("2_0d0p0") - -[node name="VBoxContainer" type="VBoxContainer" parent="ScrollContainer"] -layout_mode = 2 -size_flags_horizontal = 6 -size_flags_vertical = 4 diff --git a/client/gui/menus/entry.gd b/client/gui/menus/entry.gd index 4006f00b..2c5905fa 100644 --- a/client/gui/menus/entry.gd +++ b/client/gui/menus/entry.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -27,7 +27,8 @@ func _ready(): if Cli.opts.has("render-items") or Cli.opts.has("render-tiles"): await submenu("res://system/render_tool.tscn") if Cli.opts.has("connect_address"): - await submenu("res://gui/menus/game.tscn", Cli.opts["connect_address"]) + var urls: Array[String] = [Cli.opts["connect_address"]] + await submenu("res://gui/menus/game.tscn", urls) elif not Settings.read("gameplay.setup_completed"): await submenu("res://gui/menus/setup/setup.tscn") else: diff --git a/client/gui/menus/entry.tscn b/client/gui/menus/entry.tscn index f4eced3e..a4e74f5e 100644 --- a/client/gui/menus/entry.tscn +++ b/client/gui/menus/entry.tscn @@ -1,8 +1,8 @@ -[gd_scene load_steps=2 format=3 uid="uid://cd52sr1cmo8oj"] +[gd_scene format=3 uid="uid://cd52sr1cmo8oj"] [ext_resource type="Script" uid="uid://yxaynnimyxgr" path="res://gui/menus/entry.gd" id="1_kibw2"] -[node name="Entry" type="Control"] +[node name="Entry" type="Control" unique_id=1447244984] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 diff --git a/client/gui/menus/error.gd b/client/gui/menus/error.gd index efe173c3..1e122fac 100644 --- a/client/gui/menus/error.gd +++ b/client/gui/menus/error.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -20,6 +20,8 @@ extends Menu func _ready(): super() message.text = data[0] + previous_path = "res://gui/menus/main/main.tscn" + Sound.set_music("error", -1, true) func _on_return_pressed(): replace_menu("res://gui/menus/main/main.tscn") diff --git a/client/gui/menus/error.tscn b/client/gui/menus/error.tscn index 37f8019f..ccfcaeb4 100644 --- a/client/gui/menus/error.tscn +++ b/client/gui/menus/error.tscn @@ -1,25 +1,24 @@ -[gd_scene load_steps=7 format=3 uid="uid://cimgn07lbcs4v"] +[gd_scene format=3 uid="uid://cimgn07lbcs4v"] -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://gui/resources/theme/theme.tres" id="1_cabdu"] [ext_resource type="PackedScene" uid="uid://l4vm07dtda4j" path="res://gui/menus/main/background.tscn" id="2_5fxol"] [ext_resource type="Script" uid="uid://bl0n4atrdcogm" path="res://gui/menus/error.gd" id="2_dbe41"] [ext_resource type="PackedScene" uid="uid://bg2d78ycorcqk" path="res://gui/menus/transition/scene_transition.tscn" id="4_1nbt3"] [ext_resource type="Material" uid="uid://beea1pc5nt67r" path="res://gui/resources/materials/dark_blur_material.tres" id="4_hxkkd"] +[ext_resource type="StyleBox" uid="uid://de80aw86emnql" path="res://gui/resources/style/square_panel_override.tres" id="5_42a6r"] [ext_resource type="Script" uid="uid://byshs20og68tn" path="res://gui/components/smart_margin_container.gd" id="5_rfcg2"] -[node name="ErrorMenu" type="Control"] +[node name="ErrorMenu" type="Control" unique_id=1514511445] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -theme = ExtResource("1_cabdu") script = ExtResource("2_dbe41") -[node name="MenuBackground" parent="." instance=ExtResource("2_5fxol")] +[node name="MenuBackground" parent="." unique_id=2057939786 instance=ExtResource("2_5fxol")] -[node name="Panel" type="Panel" parent="."] +[node name="Panel" type="Panel" parent="." unique_id=192312358] material = ExtResource("4_hxkkd") layout_mode = 1 anchors_preset = 15 @@ -27,8 +26,9 @@ anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 +theme_override_styles/panel = ExtResource("5_42a6r") -[node name="SmartMarginContainer" type="MarginContainer" parent="Panel"] +[node name="SmartMarginContainer" type="MarginContainer" parent="Panel" unique_id=1539898124] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -38,40 +38,42 @@ grow_vertical = 2 script = ExtResource("5_rfcg2") metadata/_custom_type_script = "uid://byshs20og68tn" -[node name="Contents" type="VBoxContainer" parent="Panel/SmartMarginContainer"] +[node name="Contents" type="VBoxContainer" parent="Panel/SmartMarginContainer" unique_id=454783322] layout_mode = 2 alignment = 1 -[node name="Title" type="Label" parent="Panel/SmartMarginContainer/Contents"] +[node name="Title" type="Label" parent="Panel/SmartMarginContainer/Contents" unique_id=777220090] layout_mode = 2 theme_override_font_sizes/font_size = 61 text = "c.menu.error.title" horizontal_alignment = 1 -[node name="Message" type="Label" parent="Panel/SmartMarginContainer/Contents"] +[node name="Message" type="Label" parent="Panel/SmartMarginContainer/Contents" unique_id=989678496] +custom_minimum_size = Vector2(500, 0) layout_mode = 2 theme_override_font_sizes/font_size = 24 text = "This should be the error message." horizontal_alignment = 1 +autowrap_mode = 3 -[node name="Control" type="Control" parent="Panel/SmartMarginContainer/Contents"] +[node name="Control" type="Control" parent="Panel/SmartMarginContainer/Contents" unique_id=2080730031] custom_minimum_size = Vector2(0, 15.805) layout_mode = 2 -[node name="HBoxContainer" type="HBoxContainer" parent="Panel/SmartMarginContainer/Contents"] +[node name="HBoxContainer" type="HBoxContainer" parent="Panel/SmartMarginContainer/Contents" unique_id=847704926] layout_mode = 2 alignment = 1 -[node name="Return" type="Button" parent="Panel/SmartMarginContainer/Contents/HBoxContainer"] +[node name="Return" type="Button" parent="Panel/SmartMarginContainer/Contents/HBoxContainer" unique_id=2058870738] layout_mode = 2 size_flags_horizontal = 4 text = "c.menu.ingame.main_menu" -[node name="Reconnect" type="Button" parent="Panel/SmartMarginContainer/Contents/HBoxContainer"] +[node name="Reconnect" type="Button" parent="Panel/SmartMarginContainer/Contents/HBoxContainer" unique_id=1168099563] layout_mode = 2 text = "c.menu.ingame.reconnect" -[node name="SceneTransition" parent="." instance=ExtResource("4_1nbt3")] +[node name="SceneTransition" parent="." unique_id=1340959213 instance=ExtResource("4_1nbt3")] visible = false layout_mode = 1 diff --git a/client/gui/menus/game.gd b/client/gui/menus/game.gd index e0ab5de7..5379d32d 100644 --- a/client/gui/menus/game.gd +++ b/client/gui/menus/game.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -17,6 +17,7 @@ extends Menu class_name GameMenu @onready var game: Game = $Game +@onready var overlays: Overlays = $Overlays @onready var popup_message: PopupMessage = $Overlays/PopupMessage @onready var chat_preview: ChatPreview = $Overlays/ChatPreview @onready var pinned_items: PinnedItemMessages = $Overlays/PinnedMessages @@ -25,7 +26,6 @@ func _ready(): get_tree().get_root().go_back_requested.connect(open_ingame_menu) super() transition.set_loading_text(tr("c.menu.game.connecting")) - Settings.hook_changed_init("gameplay.first_person", "mouse_lock", func (_a): update_mouse_capture()) func _input(_event): if Input.is_action_just_pressed("ui_menu"): @@ -59,19 +59,22 @@ func get_shot_path(template: String) -> String: var filename = template % Time.get_datetime_string_from_system() return "%s/%s" % [path, filename] +func _menu_open(): + await super() + Input.mouse_mode = Input.MOUSE_MODE_CAPTURED + func _menu_cover(state): super(state) - game.follow_camera.disable_input_menu = state - game.follow_camera.update_disable_input() - update_mouse_capture() + overlays.visible = not state + game.mp.send_idle(state) + game.follow_camera._disable_input = state + Input.mouse_mode = Input.MOUSE_MODE_CAPTURED if not covered else Input.MOUSE_MODE_VISIBLE func _menu_exit(): - super() + await super() Input.mouse_mode = Input.MOUSE_MODE_VISIBLE -func update_mouse_capture(): - var cap = Settings.read("gameplay.first_person") and not covered - Input.mouse_mode = Input.MOUSE_MODE_CAPTURED if cap else Input.MOUSE_MODE_VISIBLE +func _menu_music(): Sound.set_music(null) func open_ingame_menu(): if popup != null: return diff --git a/client/gui/menus/game.tscn b/client/gui/menus/game.tscn index 44efef21..f0322454 100644 --- a/client/gui/menus/game.tscn +++ b/client/gui/menus/game.tscn @@ -1,10 +1,10 @@ -[gd_scene load_steps=4 format=3 uid="uid://bbjwoxs71fnsk"] +[gd_scene format=3 uid="uid://bbjwoxs71fnsk"] [ext_resource type="Script" uid="uid://bmno0s2du3ie6" path="res://gui/menus/game.gd" id="1_cdpsh"] [ext_resource type="PackedScene" uid="uid://c6krh36hoqfg8" path="res://game.tscn" id="2_uojcy"] [ext_resource type="PackedScene" uid="uid://cr26jennm5c0c" path="res://gui/overlays/overlays.tscn" id="3_eaud4"] -[node name="GameMenu" type="Control"] +[node name="GameMenu" type="Control" unique_id=348091771] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 @@ -14,7 +14,7 @@ grow_vertical = 2 script = ExtResource("1_cdpsh") auto_anim = false -[node name="Game" parent="." instance=ExtResource("2_uojcy")] +[node name="Game" parent="." unique_id=229241562 instance=ExtResource("2_uojcy")] -[node name="Overlays" parent="." instance=ExtResource("3_eaud4")] +[node name="Overlays" parent="." unique_id=553707754 instance=ExtResource("3_eaud4")] layout_mode = 1 diff --git a/client/gui/menus/ingame.gd b/client/gui/menus/ingame.gd index 133b6d8f..809bac32 100644 --- a/client/gui/menus/ingame.gd +++ b/client/gui/menus/ingame.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -39,10 +39,8 @@ func anim_setup(): pass func _menu_open(): anim.play("activate") await anim.animation_finished - game.mp.send_idle(true) func _menu_exit(): - game.mp.send_idle(false) anim.play_backwards("activate") await anim.animation_finished diff --git a/client/gui/menus/ingame.tscn b/client/gui/menus/ingame.tscn index 2eb47b7d..eb5d5f1f 100644 --- a/client/gui/menus/ingame.tscn +++ b/client/gui/menus/ingame.tscn @@ -1,6 +1,5 @@ -[gd_scene load_steps=12 format=3 uid="uid://lxlgtjm8hw7v"] +[gd_scene format=3 uid="uid://lxlgtjm8hw7v"] -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://gui/resources/theme/theme.tres" id="1_2vmyh"] [ext_resource type="Script" uid="uid://dyi2xohgxeybb" path="res://gui/menus/ingame.gd" id="2_0h3no"] [ext_resource type="Material" uid="uid://beea1pc5nt67r" path="res://gui/resources/materials/dark_blur_material.tres" id="3_vvvlt"] [ext_resource type="Script" uid="uid://cmncjc06kadpe" path="res://gui/components/blur_setup.gd" id="4_b6bm7"] @@ -46,23 +45,20 @@ _data = { base_font = ExtResource("4_scupw") variation_embolden = 0.5 -[node name="IngameMenu" type="Control"] +[node name="IngameMenu" type="Control" unique_id=419075883] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -theme = ExtResource("1_2vmyh") script = ExtResource("2_0h3no") -[node name="AnimationPlayer" type="AnimationPlayer" parent="."] -libraries = { -&"": SubResource("AnimationLibrary_u0kyp") -} +[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=697888286] +libraries/ = SubResource("AnimationLibrary_u0kyp") speed_scale = 8.0 -[node name="Side" type="PanelContainer" parent="."] +[node name="Side" type="PanelContainer" parent="." unique_id=957227252] material = ExtResource("3_vvvlt") layout_mode = 1 anchors_preset = 9 @@ -72,7 +68,7 @@ grow_vertical = 2 theme_override_styles/panel = ExtResource("4_vr8y1") script = ExtResource("4_b6bm7") -[node name="Margin" type="MarginContainer" parent="Side"] +[node name="Margin" type="MarginContainer" parent="Side" unique_id=1942923773] layout_mode = 2 theme_override_constants/margin_left = 20 theme_override_constants/margin_top = 20 @@ -80,10 +76,10 @@ theme_override_constants/margin_right = 20 theme_override_constants/margin_bottom = 20 script = ExtResource("6_poj4k") -[node name="Options" type="VBoxContainer" parent="Side/Margin"] +[node name="Options" type="VBoxContainer" parent="Side/Margin" unique_id=878742867] layout_mode = 2 -[node name="Title" type="Label" parent="Side/Margin/Options"] +[node name="Title" type="Label" parent="Side/Margin/Options" unique_id=629270934] auto_translate_mode = 2 layout_mode = 2 theme_override_colors/font_outline_color = Color(0.566408, 0.208917, 0.266045, 1) @@ -92,44 +88,44 @@ theme_override_fonts/font = SubResource("FontVariation_ud3l8") theme_override_font_sizes/font_size = 48 text = "Hurry Curry!" -[node name="Spacer" type="Control" parent="Side/Margin/Options"] +[node name="Spacer" type="Control" parent="Side/Margin/Options" unique_id=419321461] custom_minimum_size = Vector2(0, 10) layout_mode = 2 -[node name="Resume" type="Button" parent="Side/Margin/Options"] +[node name="Resume" type="Button" parent="Side/Margin/Options" unique_id=431520230] layout_mode = 2 text = "c.menu.ingame.resume" alignment = 0 -[node name="Leave" type="Button" parent="Side/Margin/Options"] +[node name="Leave" type="Button" parent="Side/Margin/Options" unique_id=2061159794] layout_mode = 2 text = "c.menu.ingame.join" alignment = 0 -[node name="Abort" type="Button" parent="Side/Margin/Options"] +[node name="Abort" type="Button" parent="Side/Margin/Options" unique_id=1050558982] layout_mode = 2 text = "c.menu.ingame.cancel" alignment = 0 -[node name="Reconnect" type="Button" parent="Side/Margin/Options"] +[node name="Reconnect" type="Button" parent="Side/Margin/Options" unique_id=1904838944] layout_mode = 2 text = "c.menu.ingame.reconnect" alignment = 0 -[node name="Spacer2" type="Control" parent="Side/Margin/Options"] +[node name="Spacer2" type="Control" parent="Side/Margin/Options" unique_id=11264676] custom_minimum_size = Vector2(0, 10) layout_mode = 2 -[node name="Settings" type="Button" parent="Side/Margin/Options"] +[node name="Settings" type="Button" parent="Side/Margin/Options" unique_id=1505522399] layout_mode = 2 text = "c.menu.settings" alignment = 0 -[node name="Spacer3" type="Control" parent="Side/Margin/Options"] +[node name="Spacer3" type="Control" parent="Side/Margin/Options" unique_id=834104183] custom_minimum_size = Vector2(0, 10) layout_mode = 2 -[node name="MainMenu" type="Button" parent="Side/Margin/Options"] +[node name="MainMenu" type="Button" parent="Side/Margin/Options" unique_id=1519330892] layout_mode = 2 text = "c.menu.ingame.main_menu" alignment = 0 diff --git a/client/gui/menus/main/about.gd b/client/gui/menus/main/about.gd index 95f98d30..f1f71ef6 100644 --- a/client/gui/menus/main/about.gd +++ b/client/gui/menus/main/about.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -17,11 +17,18 @@ extends Menu var authors := ["metamuffin", "nokoe", "tpart"] -var contributors := ["sofviic", "BigBrotherNii", "Miner34"] +var contributors := ["sofviic", "BigBrotherNii", "Miner34", "jnms"] const cc_by_4 := "CC-BY 4.0" const cc_by_3 := "CC-BY 3.0" +const cc_by_sa_4 := "CC-BY-SA 4.0" const cc0 := "CC0" +const LICENSE_LINKS = { + cc_by_4: "https://creativecommons.org/licenses/by/4.0/", + cc_by_3: "https://creativecommons.org/licenses/by/3.0/", + cc0: "https://creativecommons.org/publicdomain/zero/1.0/", +} + const AGPL_NOTICE := """This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3 of the License only. @@ -35,10 +42,32 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.""" const SOURCE_CODE := "https://codeberg.org/hurrycurry/hurrycurry" +const REPORT_ISSUE := "https://codeberg.org/hurrycurry/hurrycurry/issues" func _ready() -> void: - super() + super () $side/margin/options/first/source.tooltip_text = SOURCE_CODE + $side/margin/options/first/report_issue.tooltip_text = REPORT_ISSUE + +var translators = { + tr("c.settings.ui.language.ar"): ["sofviic"], + tr("c.settings.ui.language.bar"): ["Ember"], + tr("c.settings.ui.language.el"): ["n0toose"], + tr("c.settings.ui.language.eu"): ["josuigoa"], + tr("c.settings.ui.language.fi"): ["Ricky-Tigg"], + tr("c.settings.ui.language.fr"): ["fnetX", "lejun", "macbook-girl"], + tr("c.settings.ui.language.he"): ["RustyStriker"], + tr("c.settings.ui.language.it"): ["Miner34", "solemden"], + tr("c.settings.ui.language.ja"): ["BigBrotherNii"], + tr("c.settings.ui.language.nl"): ["Vistaus"], + tr("c.settings.ui.language.pl"): ["tranzystorekk"], + tr("c.settings.ui.language.ru"): ["0ko"], + tr("c.settings.ui.language.sv"): ["Mahatma_G"], + tr("c.settings.ui.language.tr"): ["furkanunsalan", "tekrei"], + tr("c.settings.ui.language.vi"): ["hthienloc"], + tr("c.settings.ui.language.zh_Hans"): ["Outbreak2096"], + tr("c.settings.ui.language.zh_Hant"): ["hugoalh"], +} var credits := [ [tr("c.credits.models"), [ @@ -47,7 +76,8 @@ var credits := [ ["Poly by Google", "Strawberry", cc_by_3], ["Poly by Google", "Fish", cc_by_3], ["Poly by Google", "Rolling pin", cc_by_3], - ["jeremy", "Propeller hat", cc_by_3] + ["jeremy", "Propeller hat", cc_by_3], + ["jeremy", "Donut", cc_by_3] ]], [tr("c.credits.sounds"), [ ["Dryoma", "Footstep sounds", cc_by_4], @@ -61,25 +91,14 @@ var credits := [ ["Dillon Becker", "Super Dialogue Audio Pack V1", cc_by_4], ["Ekrcoaster", "Water steaming on hot surface #2", cc0] ]], + [tr("c.credits.music"), [ + ["Giorgi Latso, Asuas", "Debussy: Images I. Reflets dans l'eau (adapted: bars 1-35)", cc_by_sa_4], + ]], [tr("c.credits.other"), [ ["Ray Trace", "Nintendo_Switch_Pro_Controller.svg", cc_by_4], ["Amousey", "Curved solid arrow.svg", cc0] ]], - [tr("c.credits.translations"), { - tr("c.settings.ui.language.zh_Hans"): ["Outbreak2096"], - tr("c.settings.ui.language.zh_Hant"): ["hugoalh"], - tr("c.settings.ui.language.nl"): ["Vistaus"], - tr("c.settings.ui.language.it"): ["Miner34", "solemden"], - tr("c.settings.ui.language.eu"): ["josuigoa"], - tr("c.settings.ui.language.fr"): ["fnetX", "lejun"], - tr("c.settings.ui.language.pl"): ["tranzystorekk"], - tr("c.settings.ui.language.he"): ["RustyStriker"], - tr("c.settings.ui.language.el"): ["n0toose"], - tr("c.settings.ui.language.ja"): ["BigBrotherNii"], - tr("c.settings.ui.language.ar"): ["sofviic"], - tr("c.settings.ui.language.tr"): ["furkanunsalan", "tekrei"], - tr("c.settings.ui.language.ru"): ["0ko"], - }] + [tr("c.credits.translations"), translators] ] func _menu_cover(state): @@ -114,24 +133,29 @@ func credits_text() -> String: text += "[cell][left]%s[/left][/cell]" % entry[2] text += "[/table]" text += "\n\n\n" + + text += "[b]%s[/b]\n\n[table=2]" % tr("c.credits.licenses") + for key in LICENSE_LINKS: + text += "[cell][right]%s[/right][/cell]" % key + text += "[cell][left][url=%s]%s[/url][/left][/cell]" % [LICENSE_LINKS[key], tr("c.credits.licenses.link_label")] + text += "[/table]\n\n\n" text += "\n[b]%s[/b]\n\n\n[/center]" % tr("c.credits.thanks") return text func legal_text() -> String: var all: Array[String] = [] - var translators: Array[String] = [] - for c in credits[3][1].values(): - translators.append_array(c) - translators.shuffle() + var translators_list: Array[String] = [] + for c in translators.values(): translators_list.append_array(c) + translators_list.shuffle() authors.shuffle() contributors.shuffle() all.append_array(authors) all.append_array(contributors) - all.append_array(translators) + all.append_array(translators_list) var text := "Hurry Curry! - a game about cooking\n" - text += "[code]Copyright 2024, 2025 %s\n\n" % ", ".join(dedup_array(all)) + text += "[code]Copyright 2024, 2025, 2026 %s\n\n" % ", ".join(dedup_array(all)) text += "%s[/code]\n\n" % AGPL_NOTICE text += tr("c.legal.using_godot") text += "\n\n[code]%s[/code]" % Engine.get_license_text() @@ -162,13 +186,15 @@ func _on_legal_pressed() -> void: func _on_version_pressed() -> void: submenu("res://gui/menus/popup_large.tscn", version_text()) -func _on_back_pressed() -> void: - exit() - +func _on_report_issue_pressed() -> void: + OS.shell_open(REPORT_ISSUE) func _on_source_pressed() -> void: OS.shell_open(SOURCE_CODE) +func _on_back_pressed() -> void: + exit() + func dedup_array(a: Array) -> Array: var b = [] for x in a: if not b.has(x): b.append(x) diff --git a/client/gui/menus/main/about.tscn b/client/gui/menus/main/about.tscn index 006b61fe..4972f925 100644 --- a/client/gui/menus/main/about.tscn +++ b/client/gui/menus/main/about.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=7 format=3 uid="uid://bpaenm8c6nmo8"] +[gd_scene format=3 uid="uid://bpaenm8c6nmo8"] [ext_resource type="Script" uid="uid://pcu87stpkgd8" path="res://gui/menus/main/about.gd" id="1_0acu0"] [ext_resource type="Material" uid="uid://2j8a0c0a2ta5" path="res://gui/resources/materials/blur_material.tres" id="1_ai5pk"] @@ -10,7 +10,7 @@ base_font = ExtResource("4_kx3j7") variation_embolden = 0.5 -[node name="AboutMenu" type="Control"] +[node name="AboutMenu" type="Control" unique_id=328206708] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 @@ -20,7 +20,7 @@ grow_vertical = 2 script = ExtResource("1_0acu0") support_anim = false -[node name="side" type="PanelContainer" parent="."] +[node name="side" type="PanelContainer" parent="." unique_id=1730663891] material = ExtResource("1_ai5pk") layout_mode = 1 anchors_preset = 9 @@ -29,7 +29,7 @@ offset_right = 294.0 grow_vertical = 2 theme_override_styles/panel = ExtResource("2_pya1x") -[node name="margin" type="MarginContainer" parent="side"] +[node name="margin" type="MarginContainer" parent="side" unique_id=1640262757] layout_mode = 2 theme_override_constants/margin_left = 20 theme_override_constants/margin_top = 20 @@ -37,10 +37,10 @@ theme_override_constants/margin_right = 20 theme_override_constants/margin_bottom = 20 script = ExtResource("4_t51wf") -[node name="options" type="VBoxContainer" parent="side/margin"] +[node name="options" type="VBoxContainer" parent="side/margin" unique_id=604487146] layout_mode = 2 -[node name="title" type="Label" parent="side/margin/options"] +[node name="title" type="Label" parent="side/margin/options" unique_id=1445391877] auto_translate_mode = 2 layout_mode = 2 theme_override_colors/font_outline_color = Color(0.566408, 0.208917, 0.266045, 1) @@ -49,39 +49,44 @@ theme_override_fonts/font = SubResource("FontVariation_o2r3e") theme_override_font_sizes/font_size = 48 text = "Hurry Curry!" -[node name="spacer" type="Control" parent="side/margin/options"] +[node name="spacer" type="Control" parent="side/margin/options" unique_id=1554190815] custom_minimum_size = Vector2(0, 10) layout_mode = 2 -[node name="first" type="VBoxContainer" parent="side/margin/options"] +[node name="first" type="VBoxContainer" parent="side/margin/options" unique_id=1664599829] layout_mode = 2 -[node name="credits" type="Button" parent="side/margin/options/first"] +[node name="credits" type="Button" parent="side/margin/options/first" unique_id=1348170129] layout_mode = 2 text = "c.menu.about.credits" alignment = 0 -[node name="version" type="Button" parent="side/margin/options/first"] +[node name="version" type="Button" parent="side/margin/options/first" unique_id=451517354] layout_mode = 2 text = "c.menu.about.version" alignment = 0 -[node name="legal" type="Button" parent="side/margin/options/first"] +[node name="legal" type="Button" parent="side/margin/options/first" unique_id=1574566583] layout_mode = 2 text = "c.menu.about.legal" alignment = 0 -[node name="source" type="Button" parent="side/margin/options/first"] +[node name="source" type="Button" parent="side/margin/options/first" unique_id=111074078] layout_mode = 2 text = "c.menu.about.source" alignment = 0 -[node name="first2" type="VBoxContainer" parent="side/margin/options"] +[node name="report_issue" type="Button" parent="side/margin/options/first" unique_id=2075032381] +layout_mode = 2 +text = "c.menu.about.report_issue" +alignment = 0 + +[node name="first2" type="VBoxContainer" parent="side/margin/options" unique_id=2077205946] layout_mode = 2 size_flags_vertical = 3 alignment = 2 -[node name="back" type="Button" parent="side/margin/options/first2"] +[node name="back" type="Button" parent="side/margin/options/first2" unique_id=2024436203] layout_mode = 2 text = "c.menu.back" alignment = 0 @@ -90,4 +95,5 @@ alignment = 0 [connection signal="pressed" from="side/margin/options/first/version" to="." method="_on_version_pressed"] [connection signal="pressed" from="side/margin/options/first/legal" to="." method="_on_legal_pressed"] [connection signal="pressed" from="side/margin/options/first/source" to="." method="_on_source_pressed"] +[connection signal="pressed" from="side/margin/options/first/report_issue" to="." method="_on_report_issue_pressed"] [connection signal="pressed" from="side/margin/options/first2/back" to="." method="_on_back_pressed"] diff --git a/client/gui/menus/main/background.gd b/client/gui/menus/main/background.gd index a0a71a08..e4ca9e5b 100644 --- a/client/gui/menus/main/background.gd +++ b/client/gui/menus/main/background.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -15,8 +15,17 @@ # extends Node3D -const CRATES = ["tomato-crate", "bun-crate", "steak-crate", "cheese-crate", "lettuce-crate", "flour-crate", "coconut-crate"] -const TOOLS = ["stove", "stove", "stove", "sink", "cutting-board", "sink", "cutting-board", "rolling-board", "oven", "freezer"] +const CRATES = ["tomato-crate", "bun-crate", "steak-crate", "cheese-crate", "lettuce-crate", "mushroom-crate"] +const TOOLS_WEIGHTED: Dictionary[Array, float] = { + ["stove"]: 3, + ["counter", "sink"]: 2, + ["counter", "cutting-board"]: 2, + ["counter", "rolling-board"]: 2, + ["oven"]: 1, + ["freezer"]: 1, + ["counter", "deep-fryer"]: 1 +} +const ITEMS = ["pot", "pan", "foodprocessor", "plate", "basket", "lettuce", "dirty-plate", "cheese"] @onready var environment: WorldEnvironment = $Environment @onready var map: Map = $Map @@ -25,26 +34,42 @@ func _ready(): if !Global.on_vulkan(): environment.environment.tonemap_exposure = 0.25 - var tiles = {} + var tiles_dict: Dictionary[Vector2i, Array] = {} # : Dictionary[Vector2i, Array[String]] + var item_counters := [] for x in range(-10, 11): for y in range(-10, 11): - var w = exp(-sqrt(x * x + y * y) * 0.15) + var w = exp(-Vector2(x, y).length() * 0.15) var k = randf() * w - var tn = null - if k > 0.25: tn = "floor" - if k > 0.4: tn = choose(CRATES) if randf() > 0.3 else "counter" - if k > 0.6: tn = choose(TOOLS) - if tn != null: tiles[str(Vector2i(x,y))] = [tn,[x,y]] - - var gt = func (cs): - var t = tiles.get(str(Vector2i(cs[0],cs[1]))) - return null if t == null else t[0] - for pk in tiles.keys(): - var x = tiles[pk][1][0] - var y = tiles[pk][1][1] - var t = gt.call([x,y]) - if t != null: map.set_tile(Vector2i(x,y), t, [[x,y-1],[x-1,y],[x,y+1],[x+1,y]].map(gt)) - + var tiles: Array = [] + if k > 0.25: tiles = ["floor"] + if k > 0.4: tiles = ["floor"] + [choose(CRATES)] if randf() > 0.7 else ["floor", "counter"] + if k > 0.6: tiles = ["floor"] + choose_weighted(TOOLS_WEIGHTED) + if not tiles.is_empty(): + tiles_dict[Vector2i(x,y)] = tiles + if tiles.has("counter") and tiles.size() <= 2 and randf() > 0.5 and w > 0.45: + item_counters.push_back(Vector2i(x, y)) + map.set_all_tiles(tiles_dict) map.flush() + for v: Vector2i in item_counters: + var t = map.get_topmost_instance(v) + var item := ItemFactory.produce(choose(ITEMS), t) + add_child(item) + item.position = t.item_base.global_position + var rot := randf() * 2 * PI + item.rotation.y = rot + item.rotation_target = rot + t.set_item(item) + func choose(a): return a[floor(a.size() * randf())] + +func choose_weighted(weighted_options: Dictionary[Array, float]): # -> Array? + var weight_sum := 0. + var areas: Dictionary[float, Array] = {} + for k in weighted_options: + weight_sum += weighted_options[k] + areas[weight_sum] = k + var selection = randf() * weight_sum + for k in areas: + if k >= selection: + return areas[k] diff --git a/client/gui/menus/main/background.tscn b/client/gui/menus/main/background.tscn index c1b11c7d..e379da7e 100644 --- a/client/gui/menus/main/background.tscn +++ b/client/gui/menus/main/background.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=12 format=3 uid="uid://l4vm07dtda4j"] +[gd_scene format=3 uid="uid://l4vm07dtda4j"] [ext_resource type="Script" uid="uid://b2tq5rcjjcxdg" path="res://gui/menus/main/background.gd" id="1_pgu7b"] [ext_resource type="Script" uid="uid://cwg7wympevxs4" path="res://map/auto_setup/environment_setup.gd" id="2_7dwbj"] @@ -43,29 +43,29 @@ shader_parameter/noise = SubResource("NoiseTexture2D_s4fnp") shader_parameter/ccloud = Color(0.835938, 0.835938, 0.835938, 1) shader_parameter/csky = Color(0.329412, 0.333333, 0.8, 1) -[node name="MenuBackground" type="Node3D"] +[node name="MenuBackground" type="Node3D" unique_id=1471208495] script = ExtResource("1_pgu7b") -[node name="Camera" type="Camera3D" parent="."] +[node name="Camera" type="Camera3D" parent="." unique_id=258327854] transform = Transform3D(0.614606, 0.499662, -0.610408, -0.00282255, 0.775198, 0.631712, 0.78883, -0.386531, 0.477852, -9.13611, 4.90356, 1.22532) projection = 1 current = true size = 8.0 far = 100.0 -[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."] +[node name="DirectionalLight3D" type="DirectionalLight3D" parent="." unique_id=1203649791] transform = Transform3D(0.290334, 0.904946, -0.311092, 0.336606, 0.207739, 0.918445, 0.895769, -0.371371, -0.244296, 0, 7, 0) light_energy = 1.25 shadow_enabled = true -[node name="Environment" type="WorldEnvironment" parent="."] +[node name="Environment" type="WorldEnvironment" parent="." unique_id=1003206879] environment = SubResource("Environment_slkjl") script = ExtResource("2_7dwbj") allow_sdfgi = false -[node name="the-sky-tm" type="MeshInstance3D" parent="."] +[node name="the-sky-tm" type="MeshInstance3D" parent="." unique_id=1016857390] transform = Transform3D(0.614606, 0.499662, -0.610408, -0.00282255, 0.775198, 0.631712, 0.78883, -0.386531, 0.477851, 6, -13, -11) mesh = SubResource("QuadMesh_fvp2p") surface_material_override/0 = SubResource("ShaderMaterial_gd87g") -[node name="Map" parent="." instance=ExtResource("4_nslxb")] +[node name="Map" parent="." unique_id=1077103745 instance=ExtResource("4_nslxb")] diff --git a/client/gui/menus/main/clouds.gdshader b/client/gui/menus/main/clouds.gdshader index 8103f691..02073e7a 100644 --- a/client/gui/menus/main/clouds.gdshader +++ b/client/gui/menus/main/clouds.gdshader @@ -1,6 +1,6 @@ /* Hurry Curry! - a game about cooking - Copyright (C) 2025 Hurry Curry! Contributors + Copyright (C) 2026 Hurry Curry! Contributors This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by diff --git a/client/gui/menus/main/main.gd b/client/gui/menus/main/main.gd index 7a389304..584dd404 100644 --- a/client/gui/menus/main/main.gd +++ b/client/gui/menus/main/main.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -22,12 +22,18 @@ func _ready(): super() if OS.has_feature("web"): quit_button.hide() - Sound.play_music("MainMenu") ServerList.one_shot() + await get_tree().create_timer(0.7).timeout + +func _menu_music(): Sound.set_music("reflets-dans-leau", 3, false) func _menu_cover(state): $side.visible = not state +func exit(exit_data = null): + Sound.set_music(null) + super(exit_data) + func _on_quit_pressed(): quit() diff --git a/client/gui/menus/main/main.tscn b/client/gui/menus/main/main.tscn index 1cfb2b26..86d9eda2 100644 --- a/client/gui/menus/main/main.tscn +++ b/client/gui/menus/main/main.tscn @@ -1,6 +1,5 @@ -[gd_scene load_steps=10 format=3 uid="uid://dbj8508whxgwv"] +[gd_scene format=3 uid="uid://dbj8508whxgwv"] -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://gui/resources/theme/theme.tres" id="1_3qfu3"] [ext_resource type="Script" uid="uid://bpiynadrmdd37" path="res://gui/menus/main/main.gd" id="2_xjnc3"] [ext_resource type="PackedScene" uid="uid://l4vm07dtda4j" path="res://gui/menus/main/background.tscn" id="3_4evao"] [ext_resource type="Material" uid="uid://2j8a0c0a2ta5" path="res://gui/resources/materials/blur_material.tres" id="4_nx4vf"] @@ -13,19 +12,18 @@ base_font = ExtResource("5_k7bqq") variation_embolden = 0.5 -[node name="MainMenu" type="Control"] +[node name="MainMenu" type="Control" unique_id=934155310] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -theme = ExtResource("1_3qfu3") script = ExtResource("2_xjnc3") -[node name="MenuBackground" parent="." instance=ExtResource("3_4evao")] +[node name="MenuBackground" parent="." unique_id=828608925 instance=ExtResource("3_4evao")] -[node name="side" type="PanelContainer" parent="."] +[node name="side" type="PanelContainer" parent="." unique_id=1401818823] material = ExtResource("4_nx4vf") layout_mode = 1 anchors_preset = 9 @@ -35,7 +33,7 @@ grow_vertical = 2 theme_override_styles/panel = ExtResource("5_qlyeo") script = ExtResource("5_0mn56") -[node name="margin" type="MarginContainer" parent="side"] +[node name="margin" type="MarginContainer" parent="side" unique_id=549446082] layout_mode = 2 theme_override_constants/margin_left = 20 theme_override_constants/margin_top = 20 @@ -43,10 +41,10 @@ theme_override_constants/margin_right = 20 theme_override_constants/margin_bottom = 20 script = ExtResource("7_btdj1") -[node name="options" type="VBoxContainer" parent="side/margin"] +[node name="options" type="VBoxContainer" parent="side/margin" unique_id=1558510257] layout_mode = 2 -[node name="title" type="Label" parent="side/margin/options"] +[node name="title" type="Label" parent="side/margin/options" unique_id=540540059] auto_translate_mode = 2 layout_mode = 2 theme_override_colors/font_outline_color = Color(0.566408, 0.208917, 0.266045, 1) @@ -55,34 +53,34 @@ theme_override_fonts/font = SubResource("FontVariation_htgmg") theme_override_font_sizes/font_size = 48 text = "Hurry Curry!" -[node name="spacer" type="Control" parent="side/margin/options"] +[node name="spacer" type="Control" parent="side/margin/options" unique_id=1242411861] custom_minimum_size = Vector2(0, 10) layout_mode = 2 -[node name="first" type="VBoxContainer" parent="side/margin/options"] +[node name="first" type="VBoxContainer" parent="side/margin/options" unique_id=1694849718] layout_mode = 2 -[node name="play" type="Button" parent="side/margin/options/first"] +[node name="play" type="Button" parent="side/margin/options/first" unique_id=1447115479] layout_mode = 2 text = "c.menu.play" alignment = 0 -[node name="change_character" type="Button" parent="side/margin/options/first"] +[node name="change_character" type="Button" parent="side/margin/options/first" unique_id=1051730060] layout_mode = 2 text = "c.menu.customize_chef" alignment = 0 -[node name="settings" type="Button" parent="side/margin/options/first"] +[node name="settings" type="Button" parent="side/margin/options/first" unique_id=568488542] layout_mode = 2 text = "c.menu.settings" alignment = 0 -[node name="about" type="Button" parent="side/margin/options/first"] +[node name="about" type="Button" parent="side/margin/options/first" unique_id=1838863329] layout_mode = 2 text = "c.menu.about" alignment = 0 -[node name="quit" type="Button" parent="side/margin/options/first"] +[node name="quit" type="Button" parent="side/margin/options/first" unique_id=1209482714] layout_mode = 2 text = "c.menu.quit" alignment = 0 diff --git a/client/gui/menus/main/play.gd b/client/gui/menus/main/play.gd index 206b4d9f..0100a556 100644 --- a/client/gui/menus/main/play.gd +++ b/client/gui/menus/main/play.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -35,7 +35,6 @@ func _ready(): if OS.has_feature("web"): server.hide() connect_uri.text = Profile.read("last_server_url") - Sound.play_music("MainMenu") ServerList.update_server_list.connect(update_server_list) ServerList.update_loading.connect(update_server_list_loading) @@ -72,12 +71,21 @@ func update_server_list(lists: Array[Array]): var idx := 0 for l in lists: + # Move incompatible servers to the end of list + for i in l: + if not Global.is_protocol_version_compatible(i.version): + l.erase(i) + l.push_back(i) + for i in l: var server_item: ServerListItem = server_list_item.instantiate() server_list.add_child(server_item) - # TODO: Implement fallback address correctly - server_item.setup(i.name, roundi(i.players_online), i.version) - server_item.button.pressed.connect(connect_to.bind(i.address[0])) + + var urls: Array[String] = [] + urls.append_array(i.address) + + server_item.setup(i.name, roundi(i.players_online), i.version, urls) + server_item.button.pressed.connect(connect_to.bind(urls)) # Focus the same server with the same index as the previously focused one if idx == prev_selected_idx: server_item.button.grab_focus() @@ -110,8 +118,9 @@ func _on_connect_pressed(): url = url + ":27032" connect_uri.text = url Profile.write("last_server_url", url) - connect_to(url) + connect_to([url]) +# TODO unused code func _on_quick_connect_pressed(): if OS.has_feature("web"): connect_to(JavaScriptBridge.eval(""" @@ -120,11 +129,10 @@ func _on_quick_connect_pressed(): : `ws://${window.location.hostname}:27032/` """)) else: - connect_to("wss://hurrycurry.metamuffin.org/") + connect_to(["wss://hurrycurry.metamuffin.org/"]) -func connect_to(url: String): - print("Connecting to %s" % url) - get_parent().replace_menu("res://gui/menus/game.tscn", url) +func connect_to(urls: Array[String]): + get_parent().replace_menu("res://gui/menus/game.tscn", urls) func _on_server_control_pressed(): match Server.state: @@ -139,10 +147,10 @@ func _on_editor_control_pressed(): Service.State.FAILED: Editor.start() func _on_server_connect_pressed(): - connect_to("ws://%s:%d" % [ServerService.connect_address(), Settings.read("server.bind_port")]) + connect_to(["ws://%s:%d" % [ServerService.connect_address(), Settings.read("server.bind_port")]]) func _on_editor_connect_pressed(): - connect_to("ws://[::1]:27032/") + connect_to(["ws://[::1]:27035/"]) func _process(_delta): server_control.disabled = false diff --git a/client/gui/menus/main/play.tscn b/client/gui/menus/main/play.tscn index 441024a2..bad01b3d 100644 --- a/client/gui/menus/main/play.tscn +++ b/client/gui/menus/main/play.tscn @@ -1,6 +1,5 @@ -[gd_scene load_steps=9 format=3 uid="uid://c8url5fpttbem"] +[gd_scene format=3 uid="uid://c8url5fpttbem"] -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://gui/resources/theme/theme.tres" id="1_cckds"] [ext_resource type="Script" uid="uid://b126k2228nj4s" path="res://gui/menus/main/play.gd" id="2_phxx0"] [ext_resource type="Material" uid="uid://2j8a0c0a2ta5" path="res://gui/resources/materials/blur_material.tres" id="3_fsbt7"] [ext_resource type="Script" uid="uid://byshs20og68tn" path="res://gui/components/smart_margin_container.gd" id="4_gst6r"] @@ -13,18 +12,17 @@ base_font = ExtResource("5_ojpbf") variation_embolden = 0.5 -[node name="PlayMenu" type="Control"] +[node name="PlayMenu" type="Control" unique_id=1252891233] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -theme = ExtResource("1_cckds") script = ExtResource("2_phxx0") support_anim = false -[node name="side" type="PanelContainer" parent="."] +[node name="side" type="PanelContainer" parent="." unique_id=1284540533] material = ExtResource("3_fsbt7") layout_mode = 1 anchors_preset = 9 @@ -33,7 +31,7 @@ offset_right = 294.0 grow_vertical = 2 theme_override_styles/panel = SubResource("StyleBoxFlat_ukani") -[node name="margin" type="MarginContainer" parent="side"] +[node name="margin" type="MarginContainer" parent="side" unique_id=1784114587] layout_mode = 2 theme_override_constants/margin_left = 20 theme_override_constants/margin_top = 20 @@ -41,10 +39,10 @@ theme_override_constants/margin_right = 20 theme_override_constants/margin_bottom = 20 script = ExtResource("4_gst6r") -[node name="options" type="VBoxContainer" parent="side/margin"] +[node name="options" type="VBoxContainer" parent="side/margin" unique_id=393125381] layout_mode = 2 -[node name="title" type="Label" parent="side/margin/options"] +[node name="title" type="Label" parent="side/margin/options" unique_id=793049090] auto_translate_mode = 2 layout_mode = 2 theme_override_colors/font_outline_color = Color(0.566408, 0.208917, 0.266045, 1) @@ -53,91 +51,91 @@ theme_override_fonts/font = SubResource("FontVariation_htgmg") theme_override_font_sizes/font_size = 48 text = "Hurry Curry!" -[node name="spacer" type="Control" parent="side/margin/options"] +[node name="spacer" type="Control" parent="side/margin/options" unique_id=1031721504] custom_minimum_size = Vector2(0, 10) layout_mode = 2 -[node name="second" type="VBoxContainer" parent="side/margin/options"] +[node name="second" type="VBoxContainer" parent="side/margin/options" unique_id=704950761] layout_mode = 2 size_flags_vertical = 3 -[node name="Loading" type="Label" parent="side/margin/options/second"] +[node name="Loading" type="Label" parent="side/margin/options/second" unique_id=135556328] visible = false layout_mode = 2 size_flags_horizontal = 3 text = "c.menu.play.fetching_list" horizontal_alignment = 1 -[node name="NoServers" type="Label" parent="side/margin/options/second"] +[node name="NoServers" type="Label" parent="side/margin/options/second" unique_id=410117321] visible = false layout_mode = 2 size_flags_horizontal = 3 text = "c.menu.play.no_servers" horizontal_alignment = 1 -[node name="ScrollContainerCustom" type="ScrollContainer" parent="side/margin/options/second"] +[node name="ScrollContainerCustom" type="ScrollContainer" parent="side/margin/options/second" unique_id=333759324] layout_mode = 2 size_flags_vertical = 3 horizontal_scroll_mode = 0 script = ExtResource("5_cm120") -[node name="ServerList" type="VBoxContainer" parent="side/margin/options/second/ScrollContainerCustom"] +[node name="ServerList" type="VBoxContainer" parent="side/margin/options/second/ScrollContainerCustom" unique_id=80221134] layout_mode = 2 size_flags_horizontal = 3 -[node name="spacer" type="Control" parent="side/margin/options/second"] +[node name="spacer" type="Control" parent="side/margin/options/second" unique_id=1444292306] custom_minimum_size = Vector2(0, 10) layout_mode = 2 -[node name="connect" type="HBoxContainer" parent="side/margin/options/second"] +[node name="connect" type="HBoxContainer" parent="side/margin/options/second" unique_id=1829587107] layout_mode = 2 -[node name="uri" type="LineEdit" parent="side/margin/options/second/connect"] +[node name="uri" type="LineEdit" parent="side/margin/options/second/connect" unique_id=1944124428] auto_translate_mode = 2 layout_mode = 2 size_flags_horizontal = 3 placeholder_text = "wss://example.org" -[node name="connect" type="Button" parent="side/margin/options/second/connect"] +[node name="connect" type="Button" parent="side/margin/options/second/connect" unique_id=1041792506] layout_mode = 2 text = "c.menu.play.connect" -[node name="server" type="HBoxContainer" parent="side/margin/options/second"] +[node name="server" type="HBoxContainer" parent="side/margin/options/second" unique_id=1567357857] layout_mode = 2 -[node name="control" type="Button" parent="side/margin/options/second/server"] +[node name="control" type="Button" parent="side/margin/options/second/server" unique_id=1099190373] layout_mode = 2 size_flags_horizontal = 3 text = "c.menu.play.server" alignment = 0 -[node name="connect" type="Button" parent="side/margin/options/second/server"] +[node name="connect" type="Button" parent="side/margin/options/second/server" unique_id=1829531390] layout_mode = 2 text = "c.menu.play.connect" -[node name="editor" type="HBoxContainer" parent="side/margin/options/second"] +[node name="editor" type="HBoxContainer" parent="side/margin/options/second" unique_id=1123501321] layout_mode = 2 -[node name="control" type="Button" parent="side/margin/options/second/editor"] +[node name="control" type="Button" parent="side/margin/options/second/editor" unique_id=613744759] layout_mode = 2 size_flags_horizontal = 3 text = "c.menu.play.editor" alignment = 0 -[node name="connect" type="Button" parent="side/margin/options/second/editor"] +[node name="connect" type="Button" parent="side/margin/options/second/editor" unique_id=1523696561] layout_mode = 2 text = "c.menu.play.connect" -[node name="spacer2" type="Control" parent="side/margin/options/second"] +[node name="spacer2" type="Control" parent="side/margin/options/second" unique_id=1087902272] custom_minimum_size = Vector2(0, 10) layout_mode = 2 -[node name="back" type="Button" parent="side/margin/options/second"] +[node name="back" type="Button" parent="side/margin/options/second" unique_id=1719311439] layout_mode = 2 text = "c.menu.back" alignment = 0 -[node name="VBoxContainer" type="VBoxContainer" parent="side/margin/options/second"] +[node name="VBoxContainer" type="VBoxContainer" parent="side/margin/options/second" unique_id=1532324619] layout_mode = 2 [connection signal="text_changed" from="side/margin/options/second/connect/uri" to="." method="_on_uri_text_changed"] diff --git a/client/gui/menus/main/server_list_item.gd b/client/gui/menus/main/server_list_item.gd index 0cffdd72..4ec191a3 100644 --- a/client/gui/menus/main/server_list_item.gd +++ b/client/gui/menus/main/server_list_item.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -17,19 +17,29 @@ class_name ServerListItem extends PanelContainer var error_style_focus: StyleBoxFlat = preload("res://gui/resources/style/error_focus_style.tres") +var error_style_normal: StyleBoxFlat = preload("res://gui/resources/style/error_normal_style.tres") + @onready var title: Label = $MarginContainer/VBoxContainer/Title -@onready var info: Label = $MarginContainer/VBoxContainer/Info +@onready var online: Label = $MarginContainer/VBoxContainer/HBoxContainer/Online +@onready var address: Label = $MarginContainer/VBoxContainer/HBoxContainer/Address @onready var button: Button = $Button -func setup(name_: String, online_players: int, version: Array): +func setup(name_: String, online_players: int, version: Array, addresses: Array[String]): title.text = name_ - if version[0] != Multiplayer.VERSION_MAJOR or version[1] > Multiplayer.VERSION_MINOR: + if not Global.is_protocol_version_compatible(version): button.disabled = true + button.add_theme_stylebox_override("disabled", error_style_normal) button.add_theme_stylebox_override("focus", error_style_focus) - info.text = tr("c.menu.play.server_version_mismatch") - info.add_theme_color_override("font_color", Color("ff2222")) + online.text = tr("c.menu.play.server_version_mismatch") + online.add_theme_color_override("font_color", Color("ff2222")) + address.visible = false return - info.text = tr("c.menu.play.server_players").format([online_players]) + online.text = tr("c.menu.play.server_players").format([online_players]) + + if addresses.size() > 1 or not addresses[0].begins_with("wss://"): + address.visible = false + else: + address.text = addresses[0].trim_suffix(":443").trim_prefix("wss://").trim_prefix("hurrycurry.") # This node is in group not no_click_sound, so sounds won't be automatically connected # by menu system. Reason: These nodes are deleted and re-created every few seconds diff --git a/client/gui/menus/main/server_list_item.tscn b/client/gui/menus/main/server_list_item.tscn index ee1b9bf7..7d892a78 100644 --- a/client/gui/menus/main/server_list_item.tscn +++ b/client/gui/menus/main/server_list_item.tscn @@ -1,20 +1,20 @@ -[gd_scene load_steps=3 format=3 uid="uid://t2h60dhuvfsk"] +[gd_scene format=3 uid="uid://t2h60dhuvfsk"] [ext_resource type="Script" uid="uid://xr5oigbgd0aw" path="res://gui/menus/main/server_list_item.gd" id="1_1n1yg"] [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_1n1yg"] -[node name="ServerListItem" type="PanelContainer"] +[node name="ServerListItem" type="PanelContainer" unique_id=2062705951] offset_right = 400.0 offset_bottom = 40.0 size_flags_horizontal = 3 theme_override_styles/panel = SubResource("StyleBoxEmpty_1n1yg") script = ExtResource("1_1n1yg") -[node name="Button" type="Button" parent="." groups=["no_click_sound"]] +[node name="Button" type="Button" parent="." unique_id=1213365601 groups=["no_click_sound"]] layout_mode = 2 -[node name="MarginContainer" type="MarginContainer" parent="."] +[node name="MarginContainer" type="MarginContainer" parent="." unique_id=1363186299] layout_mode = 2 mouse_filter = 2 theme_override_constants/margin_left = 10 @@ -22,19 +22,33 @@ theme_override_constants/margin_top = 10 theme_override_constants/margin_right = 10 theme_override_constants/margin_bottom = 10 -[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"] +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer" unique_id=1686608173] layout_mode = 2 mouse_filter = 2 -[node name="Title" type="Label" parent="MarginContainer/VBoxContainer"] +[node name="Title" type="Label" parent="MarginContainer/VBoxContainer" unique_id=27759863] layout_mode = 2 theme_override_colors/font_color = Color(0.87451, 0.87451, 0.87451, 1) theme_override_font_sizes/font_size = 18 text = "Example Server" text_overrun_behavior = 3 -[node name="Info" type="Label" parent="MarginContainer/VBoxContainer"] +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer" unique_id=1537690218] +layout_mode = 2 +mouse_filter = 2 +theme_override_constants/separation = 16 + +[node name="Online" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=741851992] layout_mode = 2 theme_override_colors/font_color = Color(0.749781, 0.74978, 0.74978, 1) theme_override_font_sizes/font_size = 14 -text = "5 players online" +text = "5 players" + +[node name="Address" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=1214181115] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_colors/font_color = Color(0.749781, 0.74978, 0.74978, 1) +theme_override_font_sizes/font_size = 14 +text = "wss://example.example.example.org" +horizontal_alignment = 2 +text_overrun_behavior = 3 diff --git a/client/gui/menus/map_selector/map_details_selector.gd b/client/gui/menus/map_selector/map_details_selector.gd new file mode 100644 index 00000000..250c299b --- /dev/null +++ b/client/gui/menus/map_selector/map_details_selector.gd @@ -0,0 +1,120 @@ +# Hurry Curry! - a game about cooking +# Copyright (C) 2026 Hurry Curry! Contributors +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, version 3 of the License only. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. +# +extends Menu +class_name MapDetailsSelector + +const MAX_BOT_COUNT_PER_TYPE: int = 3 + +var two_handed: bool +var default_two_handed: bool +var bots_enabled := false +var bot_counts: Dictionary[String, int] = {} + +var bot_reset_buttons: Dictionary[String, Button] = {} +var bot_inc_buttons: Dictionary[String, Button] = {} +var bot_dec_buttons: Dictionary[String, Button] = {} + +@onready var game: Game = $"../../Game" # TODO + +@onready var title_label: Label = $OuterMargin/Panel/InnerMargin/VBoxContainer/Title +@onready var bots_container: VBoxContainer = $OuterMargin/Panel/InnerMargin/VBoxContainer/VBoxContainer/Bots +@onready var bot_settings: Control = $OuterMargin/Panel/InnerMargin/VBoxContainer/VBoxContainer/Bots/ScrollContainerCustom/BotSettings +@onready var bot_settings_container: Control = $OuterMargin/Panel/InnerMargin/VBoxContainer/VBoxContainer/Bots/ScrollContainerCustom +@onready var start_button: Button = $OuterMargin/Panel/InnerMargin/VBoxContainer/HBoxContainer/Start +@onready var two_handed_button: CheckButton = $OuterMargin/Panel/InnerMargin/VBoxContainer/VBoxContainer/TwoHanded +@onready var custom_game_warning: Label = $OuterMargin/Panel/InnerMargin/VBoxContainer/CustomGameWarning + +func _ready() -> void: + title_label.text = data[0]["display_name"] + default_two_handed = false if data[0]["hand_count"] == 1. else true + two_handed = default_two_handed + two_handed_button.button_pressed = two_handed + + var bot_algos: Array = data[1] + for algo: String in bot_algos: + bot_counts[algo] = 0 + + var h := HBoxContainer.new() + h.name = algo + var add := Button.new() + add.text = "+" + var reset := Button.new() + reset.size_flags_horizontal = SIZE_EXPAND_FILL + var remove := Button.new() + remove.text = "-" + bot_reset_buttons[algo] = reset + bot_inc_buttons[algo] = add + bot_dec_buttons[algo] = remove + update_bot_reset_text(algo) + add.pressed.connect(increase_bot_count.bind(algo)) + reset.pressed.connect(reset_bot_count.bind(algo)) + remove.pressed.connect(decrease_bot_count.bind(algo)) + h.add_child(remove) + h.add_child(reset) + h.add_child(add) + bot_settings.add_child(h) + + super() + start_button.grab_focus() + +func increase_bot_count(algo_id: String): + bot_counts[algo_id] += 1 + update_bot_reset_text(algo_id) + +func decrease_bot_count(algo_id: String): + bot_counts[algo_id] -= 1 + update_bot_reset_text(algo_id) + +func reset_bot_count(algo_id: String): + if bot_counts[algo_id] == 0: bot_counts[algo_id] = 1 + else: bot_counts[algo_id] = 0 + update_bot_reset_text(algo_id) + +func update_bot_reset_text(algo_id: String): + var display_name: String = tr("s.bot.%s" % algo_id) + bot_reset_buttons[algo_id].text = "%s (%d)" % [display_name, bot_counts[algo_id]] + set_disabled(bot_reset_buttons[algo_id], false) + set_disabled(bot_inc_buttons[algo_id], not bot_counts[algo_id] < MAX_BOT_COUNT_PER_TYPE) + set_disabled(bot_dec_buttons[algo_id], not bot_counts[algo_id] > 0) + +func _on_enable_bots_toggled(toggled_on: bool) -> void: + bots_enabled = toggled_on + bot_settings_container.visible = toggled_on + update_warning() + +func _on_two_handed_toggled(toggled_on: bool) -> void: + two_handed = toggled_on + update_warning() + +func _on_back_pressed() -> void: + exit(false) + +func _on_start_pressed() -> void: + var selected_map_name: String = data[0]["name"] + var hand_count: int = 2 if two_handed else 1 + + var selected_bots: Array[String] = [] + if bots_enabled: + for k in bot_counts.keys(): + for i in range(bot_counts[k]): + selected_bots.append(k) + + @warning_ignore("incompatible_ternary") + game.mp.send_start_game_vote(game.my_player_id, selected_map_name, hand_count if two_handed != default_two_handed else null, selected_bots if bots_enabled else null) + exit(true) + +func update_warning(): + custom_game_warning.visible = two_handed != default_two_handed or bots_enabled diff --git a/client/gui/menus/map_selector/map_details_selector.gd.uid b/client/gui/menus/map_selector/map_details_selector.gd.uid new file mode 100644 index 00000000..7a32eb14 --- /dev/null +++ b/client/gui/menus/map_selector/map_details_selector.gd.uid @@ -0,0 +1 @@ +uid://cntuh7y15r4uy diff --git a/client/gui/menus/map_selector/map_details_selector.tscn b/client/gui/menus/map_selector/map_details_selector.tscn new file mode 100644 index 00000000..750f6d57 --- /dev/null +++ b/client/gui/menus/map_selector/map_details_selector.tscn @@ -0,0 +1,112 @@ +[gd_scene format=3 uid="uid://bx0n0h6jh7hrd"] + +[ext_resource type="Script" uid="uid://cntuh7y15r4uy" path="res://gui/menus/map_selector/map_details_selector.gd" id="1_jsc2p"] +[ext_resource type="Script" uid="uid://byshs20og68tn" path="res://gui/components/smart_margin_container.gd" id="2_ksn3m"] +[ext_resource type="Material" uid="uid://beea1pc5nt67r" path="res://gui/resources/materials/dark_blur_material.tres" id="3_f0rsd"] +[ext_resource type="Script" uid="uid://cmncjc06kadpe" path="res://gui/components/blur_setup.gd" id="4_d3ya2"] +[ext_resource type="Script" uid="uid://bd7bylb2t2m0" path="res://gui/components/touch_scroll_container.gd" id="6_dxk78"] + +[node name="MapDetailsSelector" type="Control" unique_id=510306535] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_jsc2p") +support_anim = false + +[node name="OuterMargin" type="MarginContainer" parent="." unique_id=869412596] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 50 +theme_override_constants/margin_top = 50 +theme_override_constants/margin_right = 50 +theme_override_constants/margin_bottom = 50 +script = ExtResource("2_ksn3m") + +[node name="Panel" type="Panel" parent="OuterMargin" unique_id=1557970649] +material = ExtResource("3_f0rsd") +layout_mode = 2 +script = ExtResource("4_d3ya2") + +[node name="InnerMargin" type="MarginContainer" parent="OuterMargin/Panel" unique_id=2023236197] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 50 +theme_override_constants/margin_top = 50 +theme_override_constants/margin_right = 50 +theme_override_constants/margin_bottom = 50 + +[node name="VBoxContainer" type="VBoxContainer" parent="OuterMargin/Panel/InnerMargin" unique_id=2137087020] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="Title" type="Label" parent="OuterMargin/Panel/InnerMargin/VBoxContainer" unique_id=1471975030] +layout_mode = 2 +theme_override_font_sizes/font_size = 36 +text = "Map name" +horizontal_alignment = 1 + +[node name="VBoxContainer" type="VBoxContainer" parent="OuterMargin/Panel/InnerMargin/VBoxContainer" unique_id=1831622843] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="TwoHanded" type="CheckButton" parent="OuterMargin/Panel/InnerMargin/VBoxContainer/VBoxContainer" unique_id=1928176691] +layout_mode = 2 +text = "c.menu.map_selector.two_handed" + +[node name="Bots" type="VBoxContainer" parent="OuterMargin/Panel/InnerMargin/VBoxContainer/VBoxContainer" unique_id=1569430044] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="EnableBots" type="CheckButton" parent="OuterMargin/Panel/InnerMargin/VBoxContainer/VBoxContainer/Bots" unique_id=1715103927] +layout_mode = 2 +text = "c.menu.map_selector.enable_bots" + +[node name="ScrollContainerCustom" type="ScrollContainer" parent="OuterMargin/Panel/InnerMargin/VBoxContainer/VBoxContainer/Bots" unique_id=1499397868] +visible = false +layout_mode = 2 +size_flags_vertical = 3 +script = ExtResource("6_dxk78") +metadata/_custom_type_script = "uid://bd7bylb2t2m0" + +[node name="BotSettings" type="VBoxContainer" parent="OuterMargin/Panel/InnerMargin/VBoxContainer/VBoxContainer/Bots/ScrollContainerCustom" unique_id=101347071] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="CustomGameWarning" type="Label" parent="OuterMargin/Panel/InnerMargin/VBoxContainer" unique_id=557709694] +visible = false +layout_mode = 2 +theme_override_colors/font_color = Color(1, 0.9019608, 0.49803922, 1) +text = "s.custom_game_warn" +horizontal_alignment = 1 + +[node name="HBoxContainer" type="HBoxContainer" parent="OuterMargin/Panel/InnerMargin/VBoxContainer" unique_id=2025174871] +layout_mode = 2 + +[node name="Back" type="Button" parent="OuterMargin/Panel/InnerMargin/VBoxContainer/HBoxContainer" unique_id=2006434901] +layout_mode = 2 +text = "c.menu.back" + +[node name="Spacer" type="Control" parent="OuterMargin/Panel/InnerMargin/VBoxContainer/HBoxContainer" unique_id=399194568] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="Start" type="Button" parent="OuterMargin/Panel/InnerMargin/VBoxContainer/HBoxContainer" unique_id=1675695981] +layout_mode = 2 +text = "c.menu.map_selector.start" + +[connection signal="toggled" from="OuterMargin/Panel/InnerMargin/VBoxContainer/VBoxContainer/TwoHanded" to="." method="_on_two_handed_toggled"] +[connection signal="toggled" from="OuterMargin/Panel/InnerMargin/VBoxContainer/VBoxContainer/Bots/EnableBots" to="." method="_on_enable_bots_toggled"] +[connection signal="pressed" from="OuterMargin/Panel/InnerMargin/VBoxContainer/HBoxContainer/Back" to="." method="_on_back_pressed"] +[connection signal="pressed" from="OuterMargin/Panel/InnerMargin/VBoxContainer/HBoxContainer/Start" to="." method="_on_start_pressed"] diff --git a/client/gui/menus/map_selector/map_list_item.gd b/client/gui/menus/map_selector/map_list_item.gd new file mode 100644 index 00000000..7775c079 --- /dev/null +++ b/client/gui/menus/map_selector/map_list_item.gd @@ -0,0 +1,28 @@ +# Hurry Curry! - a game about cooking +# Copyright (C) 2026 Hurry Curry! Contributors +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, version 3 of the License only. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. +# +class_name MapListItem +extends PanelContainer + +@onready var button: Button = $Button + +@onready var name_label: Label = $MarginContainer/VBoxContainer/Name +@onready var difficulty_label: Label = $MarginContainer/VBoxContainer/HBoxContainer/Difficulty +@onready var recommended_players_label: Label = $MarginContainer/VBoxContainer/HBoxContainer/RecommendedPlayers + +func setup(name_: String, difficulty: int, recommended_players: int): + name_label.text = name_ + difficulty_label.text = tr("c.map.difficulty.%d" % (difficulty - 1)) + recommended_players_label.text = tr("c.map.players_recommended").format([recommended_players]) diff --git a/client/gui/menus/map_selector/map_list_item.gd.uid b/client/gui/menus/map_selector/map_list_item.gd.uid new file mode 100644 index 00000000..41f512a7 --- /dev/null +++ b/client/gui/menus/map_selector/map_list_item.gd.uid @@ -0,0 +1 @@ +uid://di7j0scdcg2ox diff --git a/client/gui/menus/map_selector/map_list_item.tscn b/client/gui/menus/map_selector/map_list_item.tscn new file mode 100644 index 00000000..65736fc7 --- /dev/null +++ b/client/gui/menus/map_selector/map_list_item.tscn @@ -0,0 +1,59 @@ +[gd_scene format=3 uid="uid://buyelb8w7edpe"] + +[ext_resource type="Script" uid="uid://di7j0scdcg2ox" path="res://gui/menus/map_selector/map_list_item.gd" id="1_fywrp"] +[ext_resource type="StyleBox" uid="uid://d1xhwgrptnlli" path="res://gui/resources/style/panel_button_backround_style.tres" id="2_3fooa"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_1n1yg"] + +[node name="ServerListItem" type="PanelContainer" unique_id=2062705951] +offset_right = 400.0 +offset_bottom = 40.0 +size_flags_horizontal = 3 +theme_override_styles/panel = SubResource("StyleBoxEmpty_1n1yg") +script = ExtResource("1_fywrp") + +[node name="Panel" type="Panel" parent="." unique_id=485329348] +layout_mode = 2 +theme_override_styles/panel = ExtResource("2_3fooa") + +[node name="Button" type="Button" parent="." unique_id=1213365601] +layout_mode = 2 + +[node name="MarginContainer" type="MarginContainer" parent="." unique_id=1363186299] +layout_mode = 2 +mouse_filter = 2 +theme_override_constants/margin_left = 10 +theme_override_constants/margin_top = 10 +theme_override_constants/margin_right = 10 +theme_override_constants/margin_bottom = 10 + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer" unique_id=1686608173] +layout_mode = 2 +mouse_filter = 2 + +[node name="Name" type="Label" parent="MarginContainer/VBoxContainer" unique_id=27759863] +layout_mode = 2 +theme_override_colors/font_color = Color(0.87451, 0.87451, 0.87451, 1) +theme_override_font_sizes/font_size = 18 +text = "Example Map" +text_overrun_behavior = 3 + +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer" unique_id=1537690218] +layout_mode = 2 +mouse_filter = 2 +theme_override_constants/separation = 16 + +[node name="Difficulty" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=741851992] +layout_mode = 2 +theme_override_colors/font_color = Color(0.749781, 0.74978, 0.74978, 1) +theme_override_font_sizes/font_size = 14 +text = "Medium" + +[node name="RecommendedPlayers" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=1214181115] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_colors/font_color = Color(0.749781, 0.74978, 0.74978, 1) +theme_override_font_sizes/font_size = 14 +text = "5 players recommended" +horizontal_alignment = 2 +text_overrun_behavior = 3 diff --git a/client/gui/menus/map_selector/map_selector.gd b/client/gui/menus/map_selector/map_selector.gd new file mode 100644 index 00000000..9190b8f3 --- /dev/null +++ b/client/gui/menus/map_selector/map_selector.gd @@ -0,0 +1,43 @@ +# Hurry Curry! - a game about cooking +# Copyright (C) 2026 Hurry Curry! Contributors +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, version 3 of the License only. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. +# +extends Menu +class_name MapSelector + +const MAP_LIST_ITEM = preload("res://gui/menus/map_selector/map_list_item.tscn") + +@onready var map_container: VBoxContainer = $OuterMargin/Panel/InnerMargin/VBoxContainer/ScrollContainer/VBoxContainer + +func _ready() -> void: + var maps: Array = data[0] + for m in maps: + var item: MapListItem = MAP_LIST_ITEM.instantiate() + item.name = m["name"] + map_container.add_child(item) + item.setup(m["display_name"], int(m["difficulty"]), int(m["players"])) + item.button.pressed.connect(select_map.bind(m)) + super() + +func select_map(map): + var algos: Array = data[1] + var success = await submenu("res://gui/menus/map_selector/map_details_selector.tscn", [map, algos]) + if success: exit() + +func _menu_cover(state: bool): + # TODO: Find a better way to hide this menu without hiding submenu, this feels hacky + $OuterMargin.visible = not state + +func _on_back_pressed() -> void: + exit() diff --git a/client/gui/menus/map_selector/map_selector.gd.uid b/client/gui/menus/map_selector/map_selector.gd.uid new file mode 100644 index 00000000..64f6e6d9 --- /dev/null +++ b/client/gui/menus/map_selector/map_selector.gd.uid @@ -0,0 +1 @@ +uid://dgl836r2uwjfw diff --git a/client/gui/menus/map_selector/map_selector.tscn b/client/gui/menus/map_selector/map_selector.tscn new file mode 100644 index 00000000..b88ec0ea --- /dev/null +++ b/client/gui/menus/map_selector/map_selector.tscn @@ -0,0 +1,76 @@ +[gd_scene format=3 uid="uid://b26sufndh0pm5"] + +[ext_resource type="Script" uid="uid://dgl836r2uwjfw" path="res://gui/menus/map_selector/map_selector.gd" id="1_37to6"] +[ext_resource type="Script" uid="uid://byshs20og68tn" path="res://gui/components/smart_margin_container.gd" id="2_5vs08"] +[ext_resource type="Material" uid="uid://beea1pc5nt67r" path="res://gui/resources/materials/dark_blur_material.tres" id="3_txniv"] +[ext_resource type="Script" uid="uid://cmncjc06kadpe" path="res://gui/components/blur_setup.gd" id="4_kobpr"] +[ext_resource type="Script" uid="uid://bd7bylb2t2m0" path="res://gui/components/touch_scroll_container.gd" id="6_7xmra"] + +[node name="MapSelector" type="Control" unique_id=510306535] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_37to6") +support_anim = false + +[node name="OuterMargin" type="MarginContainer" parent="." unique_id=869412596] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 50 +theme_override_constants/margin_top = 50 +theme_override_constants/margin_right = 50 +theme_override_constants/margin_bottom = 50 +script = ExtResource("2_5vs08") + +[node name="Panel" type="Panel" parent="OuterMargin" unique_id=1557970649] +material = ExtResource("3_txniv") +layout_mode = 2 +script = ExtResource("4_kobpr") + +[node name="InnerMargin" type="MarginContainer" parent="OuterMargin/Panel" unique_id=2023236197] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 50 +theme_override_constants/margin_top = 50 +theme_override_constants/margin_right = 50 +theme_override_constants/margin_bottom = 50 + +[node name="VBoxContainer" type="VBoxContainer" parent="OuterMargin/Panel/InnerMargin" unique_id=2137087020] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="Title" type="Label" parent="OuterMargin/Panel/InnerMargin/VBoxContainer" unique_id=1471975030] +layout_mode = 2 +theme_override_font_sizes/font_size = 36 +text = "c.map.select" +horizontal_alignment = 1 + +[node name="ScrollContainer" type="ScrollContainer" parent="OuterMargin/Panel/InnerMargin/VBoxContainer" unique_id=394287120] +layout_mode = 2 +size_flags_vertical = 3 +script = ExtResource("6_7xmra") + +[node name="VBoxContainer" type="VBoxContainer" parent="OuterMargin/Panel/InnerMargin/VBoxContainer/ScrollContainer" unique_id=1798845933] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="HBoxContainer" type="HBoxContainer" parent="OuterMargin/Panel/InnerMargin/VBoxContainer" unique_id=1907231166] +layout_mode = 2 + +[node name="Back" type="Button" parent="OuterMargin/Panel/InnerMargin/VBoxContainer/HBoxContainer" unique_id=1801916460] +layout_mode = 2 +text = "c.menu.back" + +[connection signal="pressed" from="OuterMargin/Panel/InnerMargin/VBoxContainer/HBoxContainer/Back" to="." method="_on_back_pressed"] diff --git a/client/gui/menus/menu.gd b/client/gui/menus/menu.gd index e0d5472a..6d440118 100644 --- a/client/gui/menus/menu.gd +++ b/client/gui/menus/menu.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -24,13 +24,15 @@ extends Control var data -signal submenu_close() +signal submenu_close(exit_data: Variant) const transition_scene = preload("res://gui/menus/transition/scene_transition.tscn") var transition: SceneTransition var parent_menu: Menu = null var previous_path = null # : String var open_since = 0 +var exiting := false +var disabled := false func _ready(): open_since = Time.get_ticks_msec() @@ -41,6 +43,7 @@ func _ready(): update_parent_menu(self.get_parent()) if support_anim: anim_setup() if auto_anim: _menu_open() + _menu_music() get_tree().get_root().go_back_requested.connect(exit_maybe) func anim_setup(): @@ -52,40 +55,60 @@ func _menu_exit(): if transition != null: await transition.fade_out() func _menu_cover(_state: bool): pass +func _menu_music(): + pass var popup: Menu = null var covered := false -func submenu(path: String, data_ = null): +func submenu(path: String, data_ = null) -> Variant: var prev_focus = Global.focused_node if popup != null: return - _disable_recursive(self, true) + disabled = true; _update_disabled(self) covered = true await _menu_cover(true) popup = load(path).instantiate() popup.data = data_ add_child(popup) # print("Submenu opened ", path) - await submenu_close + var exit_data = await submenu_close # print("Submenu closed ", path) covered = false await _menu_cover(false) Global.focused_menu = self - _disable_recursive(self, false) + _menu_music() + disabled = false; _update_disabled(self) if prev_focus != null: prev_focus.grab_focus() + return exit_data + +func _update_disabled(node: Node): + if node is BaseButton: _update_button_disabled(node) + for c in node.get_children(): _update_disabled(c) + +func _update_button_disabled(node: BaseButton): + if disabled: + if node.disabled: node.add_to_group("disabled") + else: node.remove_from_group("disabled") + node.disabled = true + else: + node.disabled = node.is_in_group("disabled") + node.remove_from_group("disabled") -func _disable_recursive(node: Node, state: bool): - if node is BaseButton: - if state and node.disabled: node.add_to_group("was_disabled") - else: node.remove_from_group("was_disabled") - node.disabled = state or node.is_in_group("was_disabled") - for c in node.get_children(): _disable_recursive(c, state) +func set_disabled(node: BaseButton, state: bool): + if state: node.add_to_group("disabled") + else: node.remove_from_group("disabled") + node.disabled = state or disabled -func exit(): +func exit(exit_data: Variant = null): + disabled = true; _update_disabled(self) + if transition and transition.fading: + push_error("menu exit() called twice") + return + if popup != null: await popup.exit() await self._menu_exit() if previous_path != null: replace_menu(previous_path) else: - get_parent().submenu_close.emit() + get_parent().submenu_close.emit(exit_data) queue_free() func quit(): @@ -93,15 +116,17 @@ func quit(): get_parent().quit() func replace_menu(path: String, data_ = null, prev_path = null): # prev_path: String? + if exiting: return # Already fading out print("Replace menu: ", path) + exiting = true if popup != null: await popup.exit() - _disable_recursive(self, true) + disabled = true; _update_disabled(self) await _menu_exit() - var new_popup: Menu = load(path).instantiate() - new_popup.data = data_ - if prev_path != null: new_popup.previous_path = prev_path - get_parent().add_child(new_popup) - if parent_menu != null: parent_menu.popup = new_popup + var new_menu: Menu = load(path).instantiate() + new_menu.data = data_ + if prev_path != null: new_menu.previous_path = prev_path + get_parent().add_child(new_menu) + if parent_menu != null: parent_menu.popup = new_menu queue_free() var focus_auto_changed := false @@ -145,7 +170,12 @@ func _input(_event): func exit_maybe() -> void: # Exit menu if all conditions are met if popup != null: return + if transition and transition.fading: return var time := Time.get_ticks_msec() if time - open_since < 100: return Sound.play_click() exit() + +static func get_parent_menu(node: Node) -> Menu: + if node is Menu: return node + else: return Menu.get_parent_menu(node.get_parent()) diff --git a/client/gui/menus/popup.gd b/client/gui/menus/popup.gd index d4849e92..75ed20fd 100644 --- a/client/gui/menus/popup.gd +++ b/client/gui/menus/popup.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/client/gui/menus/popup.tscn b/client/gui/menus/popup.tscn index 13137ccb..9824befd 100644 --- a/client/gui/menus/popup.tscn +++ b/client/gui/menus/popup.tscn @@ -1,23 +1,21 @@ -[gd_scene load_steps=6 format=3 uid="uid://lwtym0pbc17g"] +[gd_scene format=3 uid="uid://lwtym0pbc17g"] -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://gui/resources/theme/theme.tres" id="1_m0d0r"] [ext_resource type="Script" uid="uid://bevyiytj5tawr" path="res://gui/menus/popup.gd" id="2_1h10j"] [ext_resource type="Material" uid="uid://beea1pc5nt67r" path="res://gui/resources/materials/dark_blur_material.tres" id="3_iouvy"] [ext_resource type="Script" uid="uid://byshs20og68tn" path="res://gui/components/smart_margin_container.gd" id="3_j0ajn"] [ext_resource type="Script" uid="uid://cmncjc06kadpe" path="res://gui/components/blur_setup.gd" id="4_e4iqk"] -[node name="Popup" type="Control"] +[node name="Popup" type="Control" unique_id=1672917346] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -theme = ExtResource("1_m0d0r") script = ExtResource("2_1h10j") support_anim = false -[node name="MarginContainer" type="MarginContainer" parent="."] +[node name="MarginContainer" type="MarginContainer" parent="." unique_id=1225266694] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -26,27 +24,27 @@ grow_horizontal = 2 grow_vertical = 2 script = ExtResource("3_j0ajn") -[node name="CenterContainer" type="CenterContainer" parent="MarginContainer"] +[node name="CenterContainer" type="CenterContainer" parent="MarginContainer" unique_id=1460089015] layout_mode = 2 -[node name="Panel" type="PanelContainer" parent="MarginContainer/CenterContainer"] +[node name="Panel" type="PanelContainer" parent="MarginContainer/CenterContainer" unique_id=1826029895] material = ExtResource("3_iouvy") layout_mode = 2 script = ExtResource("4_e4iqk") -[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/CenterContainer/Panel"] +[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/CenterContainer/Panel" unique_id=52701780] layout_mode = 2 -[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/CenterContainer/Panel/MarginContainer"] +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/CenterContainer/Panel/MarginContainer" unique_id=1126454074] layout_mode = 2 theme_override_constants/separation = 16 -[node name="Message" type="Label" parent="MarginContainer/CenterContainer/Panel/MarginContainer/VBoxContainer"] +[node name="Message" type="Label" parent="MarginContainer/CenterContainer/Panel/MarginContainer/VBoxContainer" unique_id=1617024507] custom_minimum_size = Vector2(400, 0) layout_mode = 2 horizontal_alignment = 1 autowrap_mode = 3 -[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/CenterContainer/Panel/MarginContainer/VBoxContainer"] +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/CenterContainer/Panel/MarginContainer/VBoxContainer" unique_id=1415559610] layout_mode = 2 alignment = 1 diff --git a/client/gui/menus/popup_large.gd b/client/gui/menus/popup_large.gd index 772a8373..41f6bd9f 100644 --- a/client/gui/menus/popup_large.gd +++ b/client/gui/menus/popup_large.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -23,3 +23,6 @@ func _ready(): func _on_back_pressed(): exit() + +func _on_text_meta_clicked(meta: Variant) -> void: + OS.shell_open(str(meta)) diff --git a/client/gui/menus/popup_large.tscn b/client/gui/menus/popup_large.tscn index bcbafe1b..4bf5109e 100644 --- a/client/gui/menus/popup_large.tscn +++ b/client/gui/menus/popup_large.tscn @@ -1,24 +1,22 @@ -[gd_scene load_steps=7 format=3 uid="uid://7mqbxa054bjv"] +[gd_scene format=3 uid="uid://7mqbxa054bjv"] -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://gui/resources/theme/theme.tres" id="1_kabr3"] [ext_resource type="Script" uid="uid://c3eimx76ucpsp" path="res://gui/menus/popup_large.gd" id="2_m0b5d"] [ext_resource type="Script" uid="uid://byshs20og68tn" path="res://gui/components/smart_margin_container.gd" id="3_36vhf"] [ext_resource type="Material" uid="uid://beea1pc5nt67r" path="res://gui/resources/materials/dark_blur_material.tres" id="4_8ybj3"] [ext_resource type="Script" uid="uid://cmncjc06kadpe" path="res://gui/components/blur_setup.gd" id="5_63jf0"] [ext_resource type="Script" uid="uid://bd7bylb2t2m0" path="res://gui/components/touch_scroll_container.gd" id="6_smk7v"] -[node name="PopupLarge" type="Control"] +[node name="PopupLarge" type="Control" unique_id=958921744] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -theme = ExtResource("1_kabr3") script = ExtResource("2_m0b5d") support_anim = false -[node name="OuterMargin" type="MarginContainer" parent="."] +[node name="OuterMargin" type="MarginContainer" parent="." unique_id=296321292] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -27,12 +25,12 @@ grow_horizontal = 2 grow_vertical = 2 script = ExtResource("3_36vhf") -[node name="Panel" type="Panel" parent="OuterMargin"] +[node name="Panel" type="Panel" parent="OuterMargin" unique_id=751771892] material = ExtResource("4_8ybj3") layout_mode = 2 script = ExtResource("5_63jf0") -[node name="InnerMargin" type="MarginContainer" parent="OuterMargin/Panel"] +[node name="InnerMargin" type="MarginContainer" parent="OuterMargin/Panel" unique_id=1609382166] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -44,31 +42,32 @@ theme_override_constants/margin_top = 50 theme_override_constants/margin_right = 50 theme_override_constants/margin_bottom = 50 -[node name="Vert" type="VBoxContainer" parent="OuterMargin/Panel/InnerMargin"] +[node name="Vert" type="VBoxContainer" parent="OuterMargin/Panel/InnerMargin" unique_id=798911037] layout_mode = 2 -[node name="ScrollContainer" type="ScrollContainer" parent="OuterMargin/Panel/InnerMargin/Vert"] +[node name="ScrollContainer" type="ScrollContainer" parent="OuterMargin/Panel/InnerMargin/Vert" unique_id=1639832367] layout_mode = 2 size_flags_vertical = 3 script = ExtResource("6_smk7v") -[node name="Text" type="RichTextLabel" parent="OuterMargin/Panel/InnerMargin/Vert/ScrollContainer"] +[node name="Text" type="RichTextLabel" parent="OuterMargin/Panel/InnerMargin/Vert/ScrollContainer" unique_id=87487052] auto_translate_mode = 2 layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 theme_override_constants/table_h_separation = 25 +theme_override_font_sizes/normal_font_size = 22 +theme_override_font_sizes/bold_font_size = 22 theme_override_font_sizes/bold_italics_font_size = 22 theme_override_font_sizes/italics_font_size = 22 theme_override_font_sizes/mono_font_size = 22 -theme_override_font_sizes/normal_font_size = 22 -theme_override_font_sizes/bold_font_size = 22 bbcode_enabled = true fit_content = true scroll_active = false -[node name="back" type="Button" parent="OuterMargin/Panel/InnerMargin/Vert"] +[node name="back" type="Button" parent="OuterMargin/Panel/InnerMargin/Vert" unique_id=323355152] layout_mode = 2 text = "c.menu.back" +[connection signal="meta_clicked" from="OuterMargin/Panel/InnerMargin/Vert/ScrollContainer/Text" to="." method="_on_text_meta_clicked"] [connection signal="pressed" from="OuterMargin/Panel/InnerMargin/Vert/back" to="." method="_on_back_pressed"] diff --git a/client/gui/menus/rating/rating.gd b/client/gui/menus/rating/rating.gd index 023c1333..4d47637f 100644 --- a/client/gui/menus/rating/rating.gd +++ b/client/gui/menus/rating/rating.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -35,10 +35,10 @@ func _process(_delta): func show_rating(stars_: int, points: int): match stars_: - 0: title.text = tr("c.score.poor") - 1: title.text = tr("c.score.acceptable") - 2: title.text = tr("c.score.good") - 3: title.text = tr("c.score.excellent") + 0: title.text = tr("c.score.stars.poor") + 1: title.text = tr("c.score.stars.acceptable") + 2: title.text = tr("c.score.stars.good") + 3: title.text = tr("c.score.stars.excellent") subtitle.text = tr("c.score.points_par").format([points]) diff --git a/client/gui/menus/rating/rating.tscn b/client/gui/menus/rating/rating.tscn index 062dcca2..4e54572c 100644 --- a/client/gui/menus/rating/rating.tscn +++ b/client/gui/menus/rating/rating.tscn @@ -1,8 +1,7 @@ -[gd_scene load_steps=12 format=3 uid="uid://buu3cdpigs8qq"] +[gd_scene format=3 uid="uid://buu3cdpigs8qq"] -[ext_resource type="Texture2D" uid="uid://b10goh4dsa3b0" path="res://player/particles/satisfied/star.webp" id="1_7qv7r"] +[ext_resource type="Texture2D" uid="uid://b10goh4dsa3b0" path="res://map/effects/satisfied/star.webp" id="1_7qv7r"] [ext_resource type="Shader" uid="uid://cekkkqsvd7rvw" path="res://gui/menus/rating/desaturate.gdshader" id="1_pddsm"] -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://gui/resources/theme/theme.tres" id="1_uwajf"] [ext_resource type="Script" uid="uid://5tmklxkaa6e0" path="res://gui/menus/rating/rating.gd" id="2_cq0se"] [ext_resource type="Material" uid="uid://beea1pc5nt67r" path="res://gui/resources/materials/dark_blur_material.tres" id="4_hdurb"] [ext_resource type="AudioStream" uid="uid://camy77x26mmpv" path="res://gui/resources/sounds/success.ogg" id="5_tutpj"] @@ -27,18 +26,17 @@ point_count = 2 offsets = PackedFloat32Array(0, 0.0584795, 1) colors = PackedColorArray(1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0) -[node name="Rating" type="Control"] +[node name="Rating" type="Control" unique_id=1594483139] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -theme = ExtResource("1_uwajf") script = ExtResource("2_cq0se") support_anim = false -[node name="MarginContainer" type="MarginContainer" parent="."] +[node name="MarginContainer" type="MarginContainer" parent="." unique_id=1435310334] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -50,35 +48,35 @@ theme_override_constants/margin_top = 64 theme_override_constants/margin_right = 128 theme_override_constants/margin_bottom = 64 -[node name="PanelContainer" type="PanelContainer" parent="MarginContainer"] +[node name="PanelContainer" type="PanelContainer" parent="MarginContainer" unique_id=1405558399] material = ExtResource("4_hdurb") layout_mode = 2 -[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/PanelContainer"] +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/PanelContainer" unique_id=1254262874] layout_mode = 2 theme_override_constants/separation = 64 alignment = 1 -[node name="Text" type="VBoxContainer" parent="MarginContainer/PanelContainer/VBoxContainer"] +[node name="Text" type="VBoxContainer" parent="MarginContainer/PanelContainer/VBoxContainer" unique_id=1793831024] layout_mode = 2 -[node name="Title" type="Label" parent="MarginContainer/PanelContainer/VBoxContainer/Text"] +[node name="Title" type="Label" parent="MarginContainer/PanelContainer/VBoxContainer/Text" unique_id=1695693158] layout_mode = 2 theme_override_font_sizes/font_size = 48 text = "Title here" horizontal_alignment = 1 -[node name="Subtitle" type="Label" parent="MarginContainer/PanelContainer/VBoxContainer/Text"] +[node name="Subtitle" type="Label" parent="MarginContainer/PanelContainer/VBoxContainer/Text" unique_id=100592740] layout_mode = 2 theme_override_font_sizes/font_size = 24 text = "Subtitle here" horizontal_alignment = 1 -[node name="Stars" type="HBoxContainer" parent="MarginContainer/PanelContainer/VBoxContainer"] +[node name="Stars" type="HBoxContainer" parent="MarginContainer/PanelContainer/VBoxContainer" unique_id=800110825] layout_mode = 2 alignment = 1 -[node name="Star1" type="TextureRect" parent="MarginContainer/PanelContainer/VBoxContainer/Stars"] +[node name="Star1" type="TextureRect" parent="MarginContainer/PanelContainer/VBoxContainer/Stars" unique_id=968347719] material = SubResource("ShaderMaterial_oi7xd") custom_minimum_size = Vector2(128, 128) layout_mode = 2 @@ -86,11 +84,11 @@ texture = ExtResource("1_7qv7r") expand_mode = 1 stretch_mode = 5 -[node name="Sound" type="AudioStreamPlayer" parent="MarginContainer/PanelContainer/VBoxContainer/Stars/Star1"] +[node name="Sound" type="AudioStreamPlayer" parent="MarginContainer/PanelContainer/VBoxContainer/Stars/Star1" unique_id=720864083] stream = ExtResource("5_tutpj") pitch_scale = 1.5 -[node name="Star2" type="TextureRect" parent="MarginContainer/PanelContainer/VBoxContainer/Stars"] +[node name="Star2" type="TextureRect" parent="MarginContainer/PanelContainer/VBoxContainer/Stars" unique_id=1682444818] material = SubResource("ShaderMaterial_ney6s") custom_minimum_size = Vector2(128, 128) layout_mode = 2 @@ -98,11 +96,11 @@ texture = ExtResource("1_7qv7r") expand_mode = 1 stretch_mode = 5 -[node name="Sound" type="AudioStreamPlayer" parent="MarginContainer/PanelContainer/VBoxContainer/Stars/Star2"] +[node name="Sound" type="AudioStreamPlayer" parent="MarginContainer/PanelContainer/VBoxContainer/Stars/Star2" unique_id=1243382756] stream = ExtResource("5_tutpj") pitch_scale = 1.65 -[node name="Star3" type="TextureRect" parent="MarginContainer/PanelContainer/VBoxContainer/Stars"] +[node name="Star3" type="TextureRect" parent="MarginContainer/PanelContainer/VBoxContainer/Stars" unique_id=1083493921] material = SubResource("ShaderMaterial_27tx1") custom_minimum_size = Vector2(128, 128) layout_mode = 2 @@ -110,32 +108,32 @@ texture = ExtResource("1_7qv7r") expand_mode = 1 stretch_mode = 5 -[node name="Sound" type="AudioStreamPlayer" parent="MarginContainer/PanelContainer/VBoxContainer/Stars/Star3"] +[node name="Sound" type="AudioStreamPlayer" parent="MarginContainer/PanelContainer/VBoxContainer/Stars/Star3" unique_id=914623751] stream = ExtResource("5_tutpj") pitch_scale = 1.9 -[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/PanelContainer/VBoxContainer"] +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/PanelContainer/VBoxContainer" unique_id=1069207568] layout_mode = 2 theme_override_constants/separation = 64 alignment = 1 -[node name="Scoreboard" type="Button" parent="MarginContainer/PanelContainer/VBoxContainer/HBoxContainer"] +[node name="Scoreboard" type="Button" parent="MarginContainer/PanelContainer/VBoxContainer/HBoxContainer" unique_id=1025430333] layout_mode = 2 text = "c.menu.scoreboard.button" -[node name="Close" type="Button" parent="MarginContainer/PanelContainer/VBoxContainer/HBoxContainer"] +[node name="Close" type="Button" parent="MarginContainer/PanelContainer/VBoxContainer/HBoxContainer" unique_id=268757521] layout_mode = 2 text = "c.menu.accept" -[node name="StarTimer" type="Timer" parent="."] +[node name="StarTimer" type="Timer" parent="." unique_id=1015283419] wait_time = 0.5 one_shot = true -[node name="ButtonTimer" type="Timer" parent="."] +[node name="ButtonTimer" type="Timer" parent="." unique_id=1816650084] one_shot = true autostart = true -[node name="Control" type="Control" parent="."] +[node name="Control" type="Control" parent="." unique_id=2091475568] layout_mode = 1 anchors_preset = 8 anchor_left = 0.5 @@ -145,7 +143,7 @@ anchor_bottom = 0.5 grow_horizontal = 2 grow_vertical = 2 -[node name="Particles" type="CPUParticles2D" parent="Control"] +[node name="Particles" type="CPUParticles2D" parent="Control" unique_id=751600196] emitting = false amount = 32 texture = ExtResource("1_7qv7r") diff --git a/client/gui/menus/scoreboard.gd b/client/gui/menus/scoreboard.gd new file mode 100644 index 00000000..464705b5 --- /dev/null +++ b/client/gui/menus/scoreboard.gd @@ -0,0 +1,49 @@ +# Hurry Curry! - a game about cooking +# Copyright (C) 2026 Hurry Curry! Contributors +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, version 3 of the License only. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. +# +extends Menu + +@onready var table: GridContainer = $OuterMargin/Panel/InnerMargin/VBoxContainer/ScrollContainer/Table +@onready var title: Label = $OuterMargin/Panel/InnerMargin/VBoxContainer/Title +@onready var play_count: Label = $OuterMargin/Panel/InnerMargin/VBoxContainer/PlayCount + +@export var font: Font + +func _ready() -> void: + super() + var i = 1 + title.text = tr("c.menu.scoreboard.title").format([data.map]) + play_count.text = tr("c.menu.scoreboard.finish_count").format([int(data.plays)]) + for entry in data.best: + var tt = "" + for key in entry.score: + tt += "%s: %d\n" % [tr("c.score.%s" % key), entry.score[key]] + print(tt) + push_label("%d." % i, tt) + push_label("%d" % entry.score.points, tt) + push_label(", ".join(entry.players), tt) + i += 1 + +func push_label(text: String, tooltip: String): + var label = Label.new() + label.add_theme_font_size_override("font_size", 21) + label.add_theme_font_override("font", font) + label.mouse_filter = Control.MOUSE_FILTER_STOP + label.text = text + label.tooltip_text = tooltip + table.add_child(label) + +func _on_back_pressed() -> void: + exit() diff --git a/client/gui/menus/scoreboard.gd.uid b/client/gui/menus/scoreboard.gd.uid new file mode 100644 index 00000000..53f2b288 --- /dev/null +++ b/client/gui/menus/scoreboard.gd.uid @@ -0,0 +1 @@ +uid://d3dd83ooacgmw diff --git a/client/gui/menus/scoreboard.tscn b/client/gui/menus/scoreboard.tscn new file mode 100644 index 00000000..c2b6a5d9 --- /dev/null +++ b/client/gui/menus/scoreboard.tscn @@ -0,0 +1,114 @@ +[gd_scene format=3 uid="uid://cgevgyr5out81"] + +[ext_resource type="Script" uid="uid://d3dd83ooacgmw" path="res://gui/menus/scoreboard.gd" id="1_8iwl3"] +[ext_resource type="Script" uid="uid://byshs20og68tn" path="res://gui/components/smart_margin_container.gd" id="1_bfqap"] +[ext_resource type="Material" uid="uid://beea1pc5nt67r" path="res://gui/resources/materials/dark_blur_material.tres" id="2_s6kc8"] +[ext_resource type="Script" uid="uid://cmncjc06kadpe" path="res://gui/components/blur_setup.gd" id="3_8iwl3"] +[ext_resource type="Script" uid="uid://bd7bylb2t2m0" path="res://gui/components/touch_scroll_container.gd" id="5_c3g22"] +[ext_resource type="FontFile" uid="uid://5ixo6b3bd3km" path="res://gui/resources/fonts/font-josefin-sans.woff2" id="6_b3vhr"] +[ext_resource type="FontVariation" uid="uid://cl6m4hqsnrpav" path="res://gui/resources/fonts/sansita-swashed-bold.tres" id="7_tlf07"] + +[sub_resource type="Theme" id="Theme_grptf"] + +[sub_resource type="FontVariation" id="FontVariation_t5x0r"] +base_font = ExtResource("7_tlf07") +variation_opentype = { +2003265652: 800 +} + +[sub_resource type="FontVariation" id="FontVariation_tlf07"] +base_font = ExtResource("6_b3vhr") +variation_opentype = { +2003265652: 700 +} + +[node name="Scoreboard" type="Control" unique_id=510306535] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme = SubResource("Theme_grptf") +script = ExtResource("1_8iwl3") +support_anim = false + +[node name="OuterMargin" type="MarginContainer" parent="." unique_id=869412596] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 50 +theme_override_constants/margin_top = 50 +theme_override_constants/margin_right = 50 +theme_override_constants/margin_bottom = 50 +script = ExtResource("1_bfqap") + +[node name="Panel" type="Panel" parent="OuterMargin" unique_id=1557970649] +material = ExtResource("2_s6kc8") +layout_mode = 2 +script = ExtResource("3_8iwl3") + +[node name="InnerMargin" type="MarginContainer" parent="OuterMargin/Panel" unique_id=2023236197] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 50 +theme_override_constants/margin_top = 50 +theme_override_constants/margin_right = 50 +theme_override_constants/margin_bottom = 50 + +[node name="VBoxContainer" type="VBoxContainer" parent="OuterMargin/Panel/InnerMargin" unique_id=2137087020] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="Title" type="Label" parent="OuterMargin/Panel/InnerMargin/VBoxContainer" unique_id=1471975030] +layout_mode = 2 +theme_override_fonts/font = SubResource("FontVariation_t5x0r") +theme_override_font_sizes/font_size = 48 +text = "Scoreboard for placeholder" +horizontal_alignment = 1 + +[node name="PlayCount" type="Label" parent="OuterMargin/Panel/InnerMargin/VBoxContainer" unique_id=1041103739] +layout_mode = 2 +text = "123 games were played on this map" +horizontal_alignment = 1 + +[node name="ScrollContainer" type="ScrollContainer" parent="OuterMargin/Panel/InnerMargin/VBoxContainer" unique_id=394287120] +layout_mode = 2 +size_flags_vertical = 3 +script = ExtResource("5_c3g22") + +[node name="Table" type="GridContainer" parent="OuterMargin/Panel/InnerMargin/VBoxContainer/ScrollContainer" unique_id=1680462103] +layout_mode = 2 +columns = 3 + +[node name="Rank" type="Label" parent="OuterMargin/Panel/InnerMargin/VBoxContainer/ScrollContainer/Table" unique_id=1490761538] +layout_mode = 2 +theme_override_fonts/font = SubResource("FontVariation_tlf07") +theme_override_font_sizes/font_size = 21 +text = "c.menu.scoreboard.rank" + +[node name="Points" type="Label" parent="OuterMargin/Panel/InnerMargin/VBoxContainer/ScrollContainer/Table" unique_id=1705556425] +layout_mode = 2 +theme_override_fonts/font = SubResource("FontVariation_tlf07") +theme_override_font_sizes/font_size = 21 +text = "c.score.points" + +[node name="Players" type="Label" parent="OuterMargin/Panel/InnerMargin/VBoxContainer/ScrollContainer/Table" unique_id=118623876] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_fonts/font = SubResource("FontVariation_tlf07") +theme_override_font_sizes/font_size = 21 +text = "c.menu.scoreboard.players" + +[node name="Back" type="Button" parent="OuterMargin/Panel/InnerMargin/VBoxContainer" unique_id=859010245] +layout_mode = 2 +text = "c.menu.back" + +[connection signal="pressed" from="OuterMargin/Panel/InnerMargin/VBoxContainer/Back" to="." method="_on_back_pressed"] diff --git a/client/gui/menus/screen_info.tscn b/client/gui/menus/screen_info.tscn new file mode 100644 index 00000000..c05598d9 --- /dev/null +++ b/client/gui/menus/screen_info.tscn @@ -0,0 +1,62 @@ +[gd_scene format=3 uid="uid://dgtdfctc0x78v"] + +[ext_resource type="Shader" uid="uid://b7p7umdb51hhn" path="res://gui/resources/shaders/clouds_canvas_item.gdshader" id="1_ogbng"] + +[sub_resource type="FastNoiseLite" id="FastNoiseLite_ogbng"] +frequency = 0.004 + +[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_07dxw"] +width = 834 +height = 480 +generate_mipmaps = false +noise = SubResource("FastNoiseLite_ogbng") +seamless = true + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_86n4b"] +shader = ExtResource("1_ogbng") +shader_parameter/noise = SubResource("NoiseTexture2D_07dxw") +shader_parameter/ccloud = Color(0.63119745, 0.6848105, 0.72822344, 1) +shader_parameter/csky = Color(0.2257854, 0.2183806, 0.60477614, 1) + +[node name="ScreenInfo" type="Control" unique_id=1334476146] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="ColorRect" type="ColorRect" parent="." unique_id=642803588] +material = SubResource("ShaderMaterial_86n4b") +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="MarginContainer" type="MarginContainer" parent="." unique_id=2116706251] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 64 +theme_override_constants/margin_top = 64 +theme_override_constants/margin_right = 64 +theme_override_constants/margin_bottom = 64 + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer" unique_id=1504875155] +layout_mode = 2 + +[node name="RichTextLabel" type="RichTextLabel" parent="MarginContainer/VBoxContainer" unique_id=489259053] +layout_mode = 2 +size_flags_vertical = 3 +bbcode_enabled = true +text = "[font_size=48][b]Example server[/b] + +This is an example motd. Enjoy![/font_size]" +fit_content = true +horizontal_alignment = 1 +vertical_alignment = 1 diff --git a/client/gui/menus/settings/button_setting.gd b/client/gui/menus/settings/button_setting.gd index e8a2ab42..6d7f9f2f 100644 --- a/client/gui/menus/settings/button_setting.gd +++ b/client/gui/menus/settings/button_setting.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/client/gui/menus/settings/dropdown_setting.gd b/client/gui/menus/settings/dropdown_setting.gd index bf4c3d48..dce4e4b3 100644 --- a/client/gui/menus/settings/dropdown_setting.gd +++ b/client/gui/menus/settings/dropdown_setting.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -17,17 +17,20 @@ class_name DropdownSetting extends GameSetting var options: Array +var tooltips: Array -func _init(new_id: String, new_default, new_options: Array): +func _init(new_id: String, new_default, new_options: Array, new_tooltips = null): super(new_id, new_default) options = new_options + tooltips = new_tooltips if new_tooltips else [] func create_row(): var row = super() row.value_node = OptionButton.new() row.value_node.clip_text = true - for i in options: row.value_node.add_item(tr(nskey + "." + i)) - Settings.hook_changed_init(key, "preview", + for k in options: row.value_node.add_item(tr(nskey + "." + k)) + for i in range(tooltips.size()): row.value_node.set_item_tooltip(i, tooltips[i]) + Settings.hook_changed_init(key, row.value_node, func(value): if is_instance_valid(row): row.value_node.select(options.find(value)) diff --git a/client/gui/menus/settings/game_setting.gd b/client/gui/menus/settings/game_setting.gd index d0b38b34..e9be3f45 100644 --- a/client/gui/menus/settings/game_setting.gd +++ b/client/gui/menus/settings/game_setting.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -35,7 +35,7 @@ func create_row(): if hide_reset(): row.hide_reset = true else: row.reset.connect(func(): Settings.write(key, default)) - Settings.hook_changed_init(key, "preview_reset", func (_value): + Settings.hook_changed_init(key, row, func (_value): if is_instance_valid(row): row.set_reset_disabled(is_default()) ) return row diff --git a/client/gui/menus/settings/input/input_manager.gd b/client/gui/menus/settings/input/input_manager.gd index b0b80a39..6700029a 100644 --- a/client/gui/menus/settings/input/input_manager.gd +++ b/client/gui/menus/settings/input/input_manager.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -25,7 +25,7 @@ enum EventType { func action_list() -> Array: # Array[String] return InputMap.get_actions().filter(func isBuiltIn(k: String): return !k.begins_with("ui_")).map(func (x): return str(x)) -func update_input_map(action: String): +func update_input_map(_value, action: String): if not action in action_list(): return InputMap.action_erase_events(action) for event in Settings.read("input.%s" % action): diff --git a/client/gui/menus/settings/input/input_setting.gd b/client/gui/menus/settings/input/input_setting.gd index 2fb4af3d..e689cbf2 100644 --- a/client/gui/menus/settings/input/input_setting.gd +++ b/client/gui/menus/settings/input/input_setting.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -27,7 +27,7 @@ func create_row(): row.value_node = INPUT_VALUE_NODE_SCENE.instantiate() # Manual initial update without update() since that needs to wait for _ready row.value_node.value = Settings.read(key) - Settings.hook_changed(key, "preview", + Settings.hook_changed(key, row.value_node, func(value): if is_instance_valid(row): row.value_node.value = value diff --git a/client/gui/menus/settings/input/input_value_node.gd b/client/gui/menus/settings/input/input_value_node.gd index fe5768cf..6034d7cc 100644 --- a/client/gui/menus/settings/input/input_value_node.gd +++ b/client/gui/menus/settings/input/input_value_node.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/client/gui/menus/settings/input/input_value_node.tscn b/client/gui/menus/settings/input/input_value_node.tscn index 1b2e89c4..11997d6d 100644 --- a/client/gui/menus/settings/input/input_value_node.tscn +++ b/client/gui/menus/settings/input/input_value_node.tscn @@ -1,19 +1,19 @@ -[gd_scene load_steps=3 format=3 uid="uid://c6r0nv5daq7wc"] +[gd_scene format=3 uid="uid://c6r0nv5daq7wc"] [ext_resource type="Script" uid="uid://ckb78voiq05e3" path="res://gui/menus/settings/input/input_value_node.gd" id="1_snxax"] [ext_resource type="Texture2D" uid="uid://cnfjbowd2i02r" path="res://gui/resources/icons/plus.svg" id="2_3vlvc"] -[node name="InputValueNode" type="VBoxContainer"] +[node name="InputValueNode" type="VBoxContainer" unique_id=533450939] offset_right = 128.0 offset_bottom = 31.0 theme_override_constants/separation = 0 script = ExtResource("1_snxax") -[node name="ActionsContainer" type="VBoxContainer" parent="."] +[node name="ActionsContainer" type="VBoxContainer" parent="." unique_id=1714871417] layout_mode = 2 theme_override_constants/separation = 0 -[node name="Add" type="Button" parent="."] +[node name="Add" type="Button" parent="." unique_id=1977567965] custom_minimum_size = Vector2(128, 0) layout_mode = 2 size_flags_vertical = 3 diff --git a/client/gui/menus/settings/number_setting.gd b/client/gui/menus/settings/number_setting.gd index 48dd0a82..85f3f363 100644 --- a/client/gui/menus/settings/number_setting.gd +++ b/client/gui/menus/settings/number_setting.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -32,7 +32,7 @@ func create_row(): input.max_value = max_value input.value_changed.connect(func(value): Settings.write(key, value as int)) - Settings.hook_changed_init(key, "preview", + Settings.hook_changed_init(key, input, func(v): if is_instance_valid(input): input.value = v diff --git a/client/gui/menus/settings/path_setting.gd b/client/gui/menus/settings/path_setting.gd index 37492ed7..81d79777 100644 --- a/client/gui/menus/settings/path_setting.gd +++ b/client/gui/menus/settings/path_setting.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/client/gui/menus/settings/preset_row.gd b/client/gui/menus/settings/preset_row.gd index ad878d00..5b83a9a2 100644 --- a/client/gui/menus/settings/preset_row.gd +++ b/client/gui/menus/settings/preset_row.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/client/gui/menus/settings/range_setting.gd b/client/gui/menus/settings/range_setting.gd index 2d7e88b4..c400aa2c 100644 --- a/client/gui/menus/settings/range_setting.gd +++ b/client/gui/menus/settings/range_setting.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -35,7 +35,7 @@ func create_row(): row.value_node.max_value = max_value row.value_node.tick_count = abs(max_value - min_value) if tick_count == null else tick_count row.value_node.step = 0 if smooth else (1 if tick_count == null else abs(max_value - min_value) / (tick_count - 1)) - Settings.hook_changed_init(key, "preview", + Settings.hook_changed_init(key, row.value_node, func(value): if is_instance_valid(row): row.value_node.value = value diff --git a/client/gui/menus/settings/settings.gd b/client/gui/menus/settings/settings.gd index 7523b9fb..1099ba1d 100644 --- a/client/gui/menus/settings/settings.gd +++ b/client/gui/menus/settings/settings.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -35,6 +35,6 @@ func _process(_dt): func _on_back_pressed(): exit() -func exit(): +func exit(exit_data = null): Settings.save() - super() + super(exit_data) diff --git a/client/gui/menus/settings/settings.tscn b/client/gui/menus/settings/settings.tscn index 71549464..c9cc4a26 100644 --- a/client/gui/menus/settings/settings.tscn +++ b/client/gui/menus/settings/settings.tscn @@ -1,23 +1,21 @@ -[gd_scene load_steps=6 format=3 uid="uid://8ic77jmadadj"] +[gd_scene format=3 uid="uid://8ic77jmadadj"] -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://gui/resources/theme/theme.tres" id="1_1vjiw"] [ext_resource type="Script" uid="uid://bbqmsf8u5rhtn" path="res://gui/menus/settings/settings.gd" id="2_5xn7x"] [ext_resource type="Script" uid="uid://byshs20og68tn" path="res://gui/components/smart_margin_container.gd" id="3_h533i"] [ext_resource type="Material" uid="uid://beea1pc5nt67r" path="res://gui/resources/materials/dark_blur_material.tres" id="4_b0x33"] [ext_resource type="Script" uid="uid://cmncjc06kadpe" path="res://gui/components/blur_setup.gd" id="5_dvivs"] -[node name="SettingsMenu" type="Control"] +[node name="SettingsMenu" type="Control" unique_id=47869629] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -theme = ExtResource("1_1vjiw") script = ExtResource("2_5xn7x") support_anim = false -[node name="OuterGap" type="MarginContainer" parent="."] +[node name="OuterGap" type="MarginContainer" parent="." unique_id=116100814] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -27,12 +25,12 @@ grow_vertical = 2 theme_override_constants/margin_left = 80 script = ExtResource("3_h533i") -[node name="Panel" type="Panel" parent="OuterGap"] +[node name="Panel" type="Panel" parent="OuterGap" unique_id=686950833] material = ExtResource("4_b0x33") layout_mode = 2 script = ExtResource("5_dvivs") -[node name="InnerGap" type="MarginContainer" parent="OuterGap/Panel"] +[node name="InnerGap" type="MarginContainer" parent="OuterGap/Panel" unique_id=475296017] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -44,16 +42,16 @@ theme_override_constants/margin_top = 40 theme_override_constants/margin_right = 40 theme_override_constants/margin_bottom = 40 -[node name="VBoxContainer" type="VBoxContainer" parent="OuterGap/Panel/InnerGap"] +[node name="VBoxContainer" type="VBoxContainer" parent="OuterGap/Panel/InnerGap" unique_id=1596642785] layout_mode = 2 -[node name="Title" type="Label" parent="OuterGap/Panel/InnerGap/VBoxContainer"] +[node name="Title" type="Label" parent="OuterGap/Panel/InnerGap/VBoxContainer" unique_id=1055890814] layout_mode = 2 size_flags_horizontal = 0 theme_override_font_sizes/font_size = 36 text = "c.menu.settings" -[node name="Back" type="Button" parent="OuterGap/Panel/InnerGap/VBoxContainer"] +[node name="Back" type="Button" parent="OuterGap/Panel/InnerGap/VBoxContainer" unique_id=285069063] layout_mode = 2 size_flags_vertical = 8 text = "c.settings.apply" diff --git a/client/gui/menus/settings/settings_category.gd b/client/gui/menus/settings/settings_category.gd index 28a0e75b..3801b4f1 100644 --- a/client/gui/menus/settings/settings_category.gd +++ b/client/gui/menus/settings/settings_category.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/client/gui/menus/settings/settings_root.gd b/client/gui/menus/settings/settings_root.gd index 3f7fc027..972cc1f6 100644 --- a/client/gui/menus/settings/settings_root.gd +++ b/client/gui/menus/settings/settings_root.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/client/gui/menus/settings/settings_row.gd b/client/gui/menus/settings/settings_row.gd index 15555eb0..4003ab5f 100644 --- a/client/gui/menus/settings/settings_row.gd +++ b/client/gui/menus/settings/settings_row.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/client/gui/menus/settings/settings_row.tscn b/client/gui/menus/settings/settings_row.tscn index 09378ab6..f72ca0f5 100644 --- a/client/gui/menus/settings/settings_row.tscn +++ b/client/gui/menus/settings/settings_row.tscn @@ -1,6 +1,6 @@ -[gd_scene load_steps=7 format=3 uid="uid://o5e5vpem8w0k"] +[gd_scene format=3 uid="uid://o5e5vpem8w0k"] -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://gui/resources/theme/theme.tres" id="1_iij3k"] +[ext_resource type="StyleBox" uid="uid://d1xhwgrptnlli" path="res://gui/resources/style/panel_button_backround_style.tres" id="1_ik3io"] [ext_resource type="Script" uid="uid://b3m1f76o5qo68" path="res://gui/menus/settings/settings_row.gd" id="2_l8i7p"] [ext_resource type="FontFile" uid="uid://5ixo6b3bd3km" path="res://gui/resources/fonts/font-josefin-sans.woff2" id="3_7k5da"] [ext_resource type="Texture2D" uid="uid://cucnmy0j5n8l8" path="res://gui/resources/icons/reset.svg" id="4_bj3dr"] @@ -11,27 +11,27 @@ content_margin_left = 16.0 [sub_resource type="FontVariation" id="FontVariation_o6i7s"] base_font = ExtResource("3_7k5da") -[node name="SettingsRow" type="PanelContainer"] +[node name="SettingsRow" type="PanelContainer" unique_id=1948353988] offset_right = 105.0 offset_bottom = 23.0 size_flags_horizontal = 3 -theme = ExtResource("1_iij3k") +theme_override_styles/panel = ExtResource("1_ik3io") script = ExtResource("2_l8i7p") -[node name="HBoxContainer" type="HBoxContainer" parent="."] +[node name="HBoxContainer" type="HBoxContainer" parent="." unique_id=523957987] layout_mode = 2 -[node name="Label" type="Label" parent="HBoxContainer"] +[node name="Label" type="Label" parent="HBoxContainer" unique_id=1327916149] layout_mode = 2 size_flags_horizontal = 3 theme_override_styles/normal = SubResource("StyleBoxEmpty_pk3rs") -[node name="BoxContainer" type="BoxContainer" parent="HBoxContainer"] +[node name="BoxContainer" type="BoxContainer" parent="HBoxContainer" unique_id=926679424] custom_minimum_size = Vector2(300, 50) layout_mode = 2 alignment = 2 -[node name="Reset" type="Button" parent="HBoxContainer"] +[node name="Reset" type="Button" parent="HBoxContainer" unique_id=1056996279] layout_mode = 2 theme_override_fonts/font = SubResource("FontVariation_o6i7s") theme_override_font_sizes/font_size = 24 diff --git a/client/gui/menus/settings/text_setting.gd b/client/gui/menus/settings/text_setting.gd index de0ef218..1be2bbc1 100644 --- a/client/gui/menus/settings/text_setting.gd +++ b/client/gui/menus/settings/text_setting.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -27,7 +27,7 @@ func create_row(): var input := LineEdit.new() input.placeholder_text = placeholder input.text_changed.connect(func(text): Settings.write(key, text)) - Settings.hook_changed_init(key, "preview", + Settings.hook_changed_init(key, input, func(text): if is_instance_valid(input): var pos = input.caret_column diff --git a/client/gui/menus/settings/toggle_setting.gd b/client/gui/menus/settings/toggle_setting.gd index fa60ca74..b0dbd352 100644 --- a/client/gui/menus/settings/toggle_setting.gd +++ b/client/gui/menus/settings/toggle_setting.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -23,7 +23,7 @@ func create_row(): var row = super() row.value_node = CheckButton.new() row.value_node.pressed.connect(func(): Settings.write(key, row.value_node.button_pressed)) - Settings.hook_changed_init(key, "preview", + Settings.hook_changed_init(key, row.value_node, func(value): if is_instance_valid(row): row.value_node.button_pressed = value diff --git a/client/gui/menus/setup/hairstyle_preview.gd b/client/gui/menus/setup/hairstyle_preview.gd index eee3a9f2..7f85f03a 100644 --- a/client/gui/menus/setup/hairstyle_preview.gd +++ b/client/gui/menus/setup/hairstyle_preview.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/client/gui/menus/setup/hairstyle_preview.tscn b/client/gui/menus/setup/hairstyle_preview.tscn index ee4a65e9..81fe79b7 100644 --- a/client/gui/menus/setup/hairstyle_preview.tscn +++ b/client/gui/menus/setup/hairstyle_preview.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=7 format=3 uid="uid://dfon56nwd2tgn"] +[gd_scene format=3 uid="uid://dfon56nwd2tgn"] [ext_resource type="Script" uid="uid://dvveoqur81l0s" path="res://gui/menus/setup/hairstyle_preview.gd" id="1_0qdmv"] [ext_resource type="Shader" uid="uid://qjrh2imc53u1" path="res://gui/resources/shaders/grayscale.gdshader" id="1_sf0gc"] @@ -12,44 +12,44 @@ viewport_path = NodePath("HairViewport") [sub_resource type="ButtonGroup" id="ButtonGroup_c5p7t"] -[node name="HairstylePreview" type="VBoxContainer"] +[node name="HairstylePreview" type="VBoxContainer" unique_id=528079266] offset_right = 40.0 offset_bottom = 40.0 script = ExtResource("1_0qdmv") -[node name="Preview" type="TextureRect" parent="."] +[node name="Preview" type="TextureRect" parent="." unique_id=533401392] material = SubResource("ShaderMaterial_entrs") layout_mode = 2 texture = SubResource("ViewportTexture_giuq2") -[node name="Select" type="CheckBox" parent="."] +[node name="Select" type="CheckBox" parent="." unique_id=1919288280] layout_mode = 2 button_group = SubResource("ButtonGroup_c5p7t") text = "Hairstyle 1" -[node name="HairViewport" type="SubViewport" parent="."] +[node name="HairViewport" type="SubViewport" parent="." unique_id=1740411305] own_world_3d = true transparent_bg = true msaa_3d = 1 size = Vector2i(128, 128) -[node name="Node3D" type="Node3D" parent="HairViewport"] +[node name="Node3D" type="Node3D" parent="HairViewport" unique_id=880401079] -[node name="Camera3D" type="Camera3D" parent="HairViewport/Node3D"] +[node name="Camera3D" type="Camera3D" parent="HairViewport/Node3D" unique_id=1793031655] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.75, 1.5) fov = 25.5 -[node name="Character" parent="HairViewport/Node3D" instance=ExtResource("2_jtitc")] +[node name="Character" parent="HairViewport/Node3D" unique_id=186667018 instance=ExtResource("2_jtitc")] -[node name="SpotLight3D" type="SpotLight3D" parent="HairViewport/Node3D"] +[node name="SpotLight3D" type="SpotLight3D" parent="HairViewport/Node3D" unique_id=1171647836] transform = Transform3D(0.866025, 0, -0.5, 0, 1, 0, 0.5, 0, 0.866025, -2, 0, 2) -[node name="SpotLight3D2" type="SpotLight3D" parent="HairViewport/Node3D"] +[node name="SpotLight3D2" type="SpotLight3D" parent="HairViewport/Node3D" unique_id=2048802047] transform = Transform3D(0.876399, 0, 0.481585, 0, 1, 0, -0.481585, 0, 0.876399, 2, 0.499189, 2) light_color = Color(0.857819, 0.80038, 0.775519, 1) light_energy = 4.11 -[node name="SpotLight3D3" type="SpotLight3D" parent="HairViewport/Node3D"] +[node name="SpotLight3D3" type="SpotLight3D" parent="HairViewport/Node3D" unique_id=302072119] transform = Transform3D(-0.965926, 0, -0.258819, -0.129409, 0.866025, 0.482963, 0.224144, 0.5, -0.836516, -1, 2, -2) light_color = Color(0.540595, 0.865144, 1, 1) light_energy = 8.2 diff --git a/client/gui/menus/setup/setup.gd b/client/gui/menus/setup/setup.gd index 36972870..bf970029 100644 --- a/client/gui/menus/setup/setup.gd +++ b/client/gui/menus/setup/setup.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/client/gui/menus/setup/setup.tscn b/client/gui/menus/setup/setup.tscn index 763a6676..9254e9d3 100644 --- a/client/gui/menus/setup/setup.tscn +++ b/client/gui/menus/setup/setup.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=16 format=3 uid="uid://ddl3efikvqp66"] +[gd_scene format=3 uid="uid://ddl3efikvqp66"] [ext_resource type="Script" uid="uid://dxn6ow6hiwhbf" path="res://gui/menus/setup/setup.gd" id="1_mo46n"] [ext_resource type="Theme" uid="uid://ci2qajdoa1an1" path="res://gui/resources/theme/paper.tres" id="1_yq0aa"] @@ -63,7 +63,7 @@ corner_radius_bottom_left = 10 [sub_resource type="FontVariation" id="FontVariation_2cc7p"] base_font = ExtResource("3_2vg4d") -[node name="SetupMenu" type="Control"] +[node name="SetupMenu" type="Control" unique_id=404427509] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 @@ -72,13 +72,11 @@ grow_horizontal = 2 grow_vertical = 2 script = ExtResource("1_mo46n") -[node name="AnimationPlayer" type="AnimationPlayer" parent="."] -libraries = { -&"": SubResource("AnimationLibrary_wjgak") -} +[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=801678418] +libraries/ = SubResource("AnimationLibrary_wjgak") speed_scale = 2.0 -[node name="ScrollContainer" type="ScrollContainer" parent="."] +[node name="ScrollContainer" type="ScrollContainer" parent="." unique_id=453732115] clip_contents = false layout_mode = 1 anchors_preset = 15 @@ -90,13 +88,13 @@ follow_focus = true horizontal_scroll_mode = 0 script = ExtResource("2_4caf2") -[node name="Control" type="Control" parent="ScrollContainer"] +[node name="Control" type="Control" parent="ScrollContainer" unique_id=926239249] custom_minimum_size = Vector2(0, 1500) layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 -[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Control"] +[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Control" unique_id=193277072] layout_mode = 1 anchors_preset = 8 anchor_left = 0.5 @@ -113,7 +111,7 @@ rotation = 0.0174533 theme = ExtResource("1_yq0aa") texture = SubResource("NoiseTexture2D_bvvl7") -[node name="Hole1" type="Panel" parent="ScrollContainer/Control/TextureRect"] +[node name="Hole1" type="Panel" parent="ScrollContainer/Control/TextureRect" unique_id=1669256894] layout_mode = 1 anchors_preset = 8 anchor_left = 0.5 @@ -128,7 +126,7 @@ grow_horizontal = 2 grow_vertical = 2 theme_override_styles/panel = SubResource("StyleBoxFlat_e7xn5") -[node name="Hole2" type="Panel" parent="ScrollContainer/Control/TextureRect"] +[node name="Hole2" type="Panel" parent="ScrollContainer/Control/TextureRect" unique_id=1933964118] layout_mode = 1 anchors_preset = 8 anchor_left = 0.5 @@ -143,7 +141,7 @@ grow_horizontal = 2 grow_vertical = 2 theme_override_styles/panel = SubResource("StyleBoxFlat_e7xn5") -[node name="PaperMargin" type="MarginContainer" parent="ScrollContainer/Control/TextureRect"] +[node name="PaperMargin" type="MarginContainer" parent="ScrollContainer/Control/TextureRect" unique_id=259726363] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -151,26 +149,26 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -[node name="Contents" type="VBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin"] +[node name="Contents" type="VBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin" unique_id=762897518] layout_mode = 2 -[node name="Title" type="Label" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +[node name="Title" type="Label" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents" unique_id=444263773] layout_mode = 2 size_flags_horizontal = 4 theme_override_font_sizes/font_size = 30 text = "c.setup.contract_title" -[node name="Sep" type="HSeparator" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +[node name="Sep" type="HSeparator" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents" unique_id=597860934] layout_mode = 2 -[node name="Intro" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +[node name="Intro" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents" unique_id=1526857931] layout_mode = 2 bbcode_enabled = true text = "c.setup.contract_desc" fit_content = true scroll_active = false -[node name="Name" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +[node name="Name" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents" unique_id=1957936520] layout_mode = 2 bbcode_enabled = true text = "c.setup.name" @@ -178,19 +176,18 @@ fit_content = true scroll_active = false text_direction = 3 -[node name="NameEntry" type="HBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +[node name="NameEntry" type="HBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents" unique_id=981353664] layout_mode = 2 -tooltip_text = "c.setup.name.desc" -[node name="LineEdit" type="LineEdit" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/NameEntry"] +[node name="LineEdit" type="LineEdit" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/NameEntry" unique_id=656391196] custom_minimum_size = Vector2(300, 30) layout_mode = 2 max_length = 32 -[node name="Control" type="Control" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/NameEntry"] +[node name="Control" type="Control" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/NameEntry" unique_id=1004452718] layout_mode = 2 -[node name="Position" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +[node name="Position" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents" unique_id=2100745661] layout_mode = 2 bbcode_enabled = true text = "c.setup.position" @@ -198,17 +195,17 @@ fit_content = true scroll_active = false text_direction = 3 -[node name="PositionEntry" type="HBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +[node name="PositionEntry" type="HBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents" unique_id=699954849] layout_mode = 2 -[node name="LineEdit" type="LineEdit" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/PositionEntry"] +[node name="LineEdit" type="LineEdit" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/PositionEntry" unique_id=1006902347] custom_minimum_size = Vector2(300, 30) layout_mode = 2 theme_override_colors/font_color = Color(0.458824, 0, 0, 1) theme_override_colors/font_uneditable_color = Color(0.458824, 0, 0, 1) editable = false -[node name="LineEdit2" type="Label" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/PositionEntry/LineEdit"] +[node name="LineEdit2" type="Label" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/PositionEntry/LineEdit" unique_id=931716188] custom_minimum_size = Vector2(300, 30) layout_mode = 1 offset_left = 9.97753 @@ -219,7 +216,7 @@ theme_override_colors/font_color = Color(0.458824, 0, 0, 1) theme_override_fonts/font = ExtResource("3_2vg4d") text = "c.setup.position.value" -[node name="Uniform" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +[node name="Uniform" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents" unique_id=134922495] layout_mode = 2 bbcode_enabled = true text = "c.setup.uniform" @@ -227,11 +224,11 @@ fit_content = true scroll_active = false text_direction = 3 -[node name="SelectUniform" type="HBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +[node name="SelectUniform" type="HBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents" unique_id=1348732855] layout_mode = 2 alignment = 1 -[node name="Experience" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +[node name="Experience" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents" unique_id=1585821122] layout_mode = 2 bbcode_enabled = true text = "c.setup.experience" @@ -239,16 +236,16 @@ fit_content = true scroll_active = false text_direction = 3 -[node name="SelectExperience" type="HBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +[node name="SelectExperience" type="HBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents" unique_id=1160761410] layout_mode = 2 alignment = 1 -[node name="CheckBox" type="CheckBox" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/SelectExperience"] +[node name="CheckBox" type="CheckBox" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/SelectExperience" unique_id=2127551975] layout_mode = 2 text = "c.setup.experience.skip" text_direction = 3 -[node name="Duties" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +[node name="Duties" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents" unique_id=1120701239] layout_mode = 2 bbcode_enabled = true text = "c.setup.duties" @@ -256,7 +253,7 @@ fit_content = true scroll_active = false text_direction = 3 -[node name="Terms" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +[node name="Terms" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents" unique_id=2064820043] layout_mode = 2 bbcode_enabled = true text = "c.setup.additional_terms" @@ -264,7 +261,7 @@ fit_content = true scroll_active = false text_direction = 3 -[node name="Compensation" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +[node name="Compensation" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents" unique_id=395129177] layout_mode = 2 bbcode_enabled = true text = "c.setup.compensation" @@ -272,14 +269,14 @@ fit_content = true scroll_active = false text_direction = 3 -[node name="CompensationEntry" type="HBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +[node name="CompensationEntry" type="HBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents" unique_id=1052789456] layout_mode = 2 -[node name="Spacer" type="Control" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/CompensationEntry"] +[node name="Spacer" type="Control" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/CompensationEntry" unique_id=217082601] custom_minimum_size = Vector2(15.045, 0) layout_mode = 2 -[node name="Text1" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/CompensationEntry"] +[node name="Text1" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/CompensationEntry" unique_id=1462759622] custom_minimum_size = Vector2(100.08, 0) layout_mode = 2 bbcode_enabled = true @@ -288,13 +285,13 @@ fit_content = true scroll_active = false autowrap_mode = 0 -[node name="LineEdit" type="LineEdit" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/CompensationEntry"] +[node name="LineEdit" type="LineEdit" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/CompensationEntry" unique_id=92292513] custom_minimum_size = Vector2(50, 30) layout_mode = 2 theme_override_colors/font_uneditable_color = Color(0.478431, 0, 0, 1) editable = false -[node name="LineEdit2" type="Label" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/CompensationEntry/LineEdit"] +[node name="LineEdit2" type="Label" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/CompensationEntry/LineEdit" unique_id=1393543854] custom_minimum_size = Vector2(50, 30) layout_mode = 1 offset_left = 9.55965 @@ -305,27 +302,27 @@ theme_override_colors/font_color = Color(0.478431, 0, 0, 1) theme_override_fonts/font = ExtResource("3_2vg4d") text = "c.setup.compensation.salary" -[node name="Text2" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/CompensationEntry"] +[node name="Text2" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/CompensationEntry" unique_id=1170626801] custom_minimum_size = Vector2(100.08, 0) layout_mode = 2 bbcode_enabled = true text = "c.setup.compensation.salary.suffix" scroll_active = false -[node name="Spacer" type="Control" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +[node name="Spacer" type="Control" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents" unique_id=1081095665] custom_minimum_size = Vector2(0, 200) layout_mode = 2 -[node name="Signatures" type="HBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +[node name="Signatures" type="HBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents" unique_id=1621874485] layout_mode = 2 -[node name="EmployerMargin" type="MarginContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures"] +[node name="EmployerMargin" type="MarginContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures" unique_id=1739540174] layout_mode = 2 -[node name="Sign" type="VBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployerMargin"] +[node name="Sign" type="VBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployerMargin" unique_id=1040025870] layout_mode = 2 -[node name="Desc" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployerMargin/Sign"] +[node name="Desc" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployerMargin/Sign" unique_id=531586924] layout_mode = 2 theme_override_font_sizes/normal_font_size = 15 bbcode_enabled = true @@ -334,7 +331,7 @@ fit_content = true scroll_active = false text_direction = 3 -[node name="Signature" type="Label" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployerMargin/Sign"] +[node name="Signature" type="Label" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployerMargin/Sign" unique_id=883266746] custom_minimum_size = Vector2(200, 80) layout_mode = 2 theme_override_colors/font_color = Color(0.415686, 0.0253044, 0.135441, 1) @@ -344,16 +341,16 @@ text = "c.setup.frank_signature" horizontal_alignment = 1 vertical_alignment = 1 -[node name="Underline" type="HSeparator" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployerMargin/Sign"] +[node name="Underline" type="HSeparator" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployerMargin/Sign" unique_id=1504477549] layout_mode = 2 -[node name="EmployeeMargin" type="MarginContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures"] +[node name="EmployeeMargin" type="MarginContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures" unique_id=669831450] layout_mode = 2 -[node name="Sign" type="VBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployeeMargin"] +[node name="Sign" type="VBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployeeMargin" unique_id=2121728827] layout_mode = 2 -[node name="Desc" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployeeMargin/Sign"] +[node name="Desc" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployeeMargin/Sign" unique_id=20375357] layout_mode = 2 theme_override_font_sizes/normal_font_size = 15 bbcode_enabled = true @@ -362,41 +359,41 @@ fit_content = true scroll_active = false text_direction = 3 -[node name="Signature" type="Button" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployeeMargin/Sign" groups=["no_click_sound"]] +[node name="Signature" type="Button" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployeeMargin/Sign" unique_id=237647876 groups=["no_click_sound"]] custom_minimum_size = Vector2(200, 80) layout_mode = 2 text = "c.setup.user_signature" -[node name="Underline" type="HSeparator" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployeeMargin/Sign"] +[node name="Underline" type="HSeparator" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployeeMargin/Sign" unique_id=1899750452] layout_mode = 2 -[node name="Back" type="Button" parent="."] +[node name="Back" type="Button" parent="." unique_id=529132579] layout_mode = 1 offset_right = 106.0 offset_bottom = 31.0 text = "c.menu.back" -[node name="Page" type="AudioStreamPlayer" parent="."] +[node name="Page" type="AudioStreamPlayer" parent="." unique_id=1328578081] stream = ExtResource("5_xac6d") volume_db = -16.0 autoplay = true -[node name="Sign" type="AudioStreamPlayer" parent="."] +[node name="Sign" type="AudioStreamPlayer" parent="." unique_id=83399550] stream = ExtResource("6_wf0gh") volume_db = -16.0 -[node name="Background" type="Node3D" parent="."] +[node name="Background" type="Node3D" parent="." unique_id=2140117190] -[node name="Camera3D" type="Camera3D" parent="Background"] +[node name="Camera3D" type="Camera3D" parent="Background" unique_id=178945527] transform = Transform3D(1, 0, 0, 0, 0.9781476, 0.2079117, 0, -0.2079117, 0.9781476, 0, 1.125, 2.75) fov = 40.0 -[node name="OmniLight3D" type="OmniLight3D" parent="Background"] +[node name="OmniLight3D" type="OmniLight3D" parent="Background" unique_id=848182505] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.9320438, 1.5322332, 4.4919252) light_color = Color(0.91730624, 0.87936515, 0.8454916, 1) omni_range = 16.873302 -[node name="KitchenBackground" parent="Background" instance=ExtResource("7_k81bu")] +[node name="KitchenBackground" parent="Background" unique_id=506434831 instance=ExtResource("7_k81bu")] transform = Transform3D(0.8660254, 0, 0.5, 0, 1, 0, -0.5, 0, 0.8660254, 0, 0, 0) [connection signal="pressed" from="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployeeMargin/Sign/Signature" to="." method="_on_sign_pressed"] diff --git a/client/gui/menus/transition/scene_transition.gd b/client/gui/menus/transition/scene_transition.gd index 332647b5..ffb0c8c5 100644 --- a/client/gui/menus/transition/scene_transition.gd +++ b/client/gui/menus/transition/scene_transition.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -30,6 +30,10 @@ func _ready(): $black.visible = true text.visible = true text.text = "" + Settings.hook_changed_init("ui.transition_speed", self, func(v): + black_anim.speed_scale = v + text_anim.speed_scale = v + ) func set_loading_text(s: String): text.text = s diff --git a/client/gui/menus/transition/scene_transition.tscn b/client/gui/menus/transition/scene_transition.tscn index dab16084..f7a81183 100644 --- a/client/gui/menus/transition/scene_transition.tscn +++ b/client/gui/menus/transition/scene_transition.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=11 format=3 uid="uid://bg2d78ycorcqk"] +[gd_scene format=3 uid="uid://bg2d78ycorcqk"] [ext_resource type="Script" uid="uid://ciml1u2x4f1ci" path="res://gui/menus/transition/scene_transition.gd" id="1_fpbwj"] [ext_resource type="Shader" uid="uid://bmxrbbw18xq7u" path="res://gui/menus/transition/text_loading_anim.gdshader" id="2_g21ck"] @@ -81,7 +81,7 @@ shader = ExtResource("2_g21ck") [sub_resource type="LabelSettings" id="LabelSettings_e6dcd"] font_size = 34 -[node name="SceneTransition" type="Control"] +[node name="SceneTransition" type="Control" unique_id=1141390469] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 @@ -90,13 +90,10 @@ grow_horizontal = 2 grow_vertical = 2 script = ExtResource("1_fpbwj") -[node name="black_fader" type="AnimationPlayer" parent="."] -libraries = { -&"": SubResource("AnimationLibrary_00tv0") -} -speed_scale = 4.0 +[node name="black_fader" type="AnimationPlayer" parent="." unique_id=209744426] +libraries/ = SubResource("AnimationLibrary_00tv0") -[node name="black" type="ColorRect" parent="."] +[node name="black" type="ColorRect" parent="." unique_id=275752521] visible = false layout_mode = 1 anchors_preset = 15 @@ -107,13 +104,10 @@ grow_vertical = 2 mouse_filter = 2 color = Color(0, 0, 0, 1) -[node name="text_fader" type="AnimationPlayer" parent="."] -libraries = { -&"": SubResource("AnimationLibrary_pea72") -} -speed_scale = 4.0 +[node name="text_fader" type="AnimationPlayer" parent="." unique_id=1775963619] +libraries/ = SubResource("AnimationLibrary_pea72") -[node name="text_margin" type="MarginContainer" parent="."] +[node name="text_margin" type="MarginContainer" parent="." unique_id=1336652601] layout_mode = 1 anchors_preset = 2 anchor_top = 1.0 @@ -127,7 +121,7 @@ theme_override_constants/margin_top = 50 theme_override_constants/margin_right = 50 theme_override_constants/margin_bottom = 50 -[node name="text" type="Label" parent="text_margin"] +[node name="text" type="Label" parent="text_margin" unique_id=1553303999] modulate = Color(1, 1, 1, 0) material = SubResource("ShaderMaterial_00tv0") layout_mode = 2 diff --git a/client/gui/overlays/announce_title.gd b/client/gui/overlays/announce_title.gd index 66d5434b..b9e7c542 100644 --- a/client/gui/overlays/announce_title.gd +++ b/client/gui/overlays/announce_title.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/client/gui/overlays/announce_title.tscn b/client/gui/overlays/announce_title.tscn index 79ec11e8..b2e4dcc6 100644 --- a/client/gui/overlays/announce_title.tscn +++ b/client/gui/overlays/announce_title.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=10 format=3 uid="uid://c7pykhpdhgs64"] +[gd_scene format=3 uid="uid://c7pykhpdhgs64"] [ext_resource type="Script" uid="uid://ci08whhm2ej1m" path="res://gui/overlays/announce_title.gd" id="1_6bcyw"] [ext_resource type="FontFile" uid="uid://bo4vh5xkpvrh1" path="res://gui/resources/fonts/font-sansita-swashed.woff2" id="2_037n2"] @@ -320,13 +320,13 @@ _data = { &"fade_out_quick": SubResource("Animation_deqe4") } -[node name="AnnounceTitle" type="Control"] +[node name="AnnounceTitle" type="Control" unique_id=343666759] visible = false layout_mode = 3 anchors_preset = 0 script = ExtResource("1_6bcyw") -[node name="Center" type="Control" parent="."] +[node name="Center" type="Control" parent="." unique_id=1028083340] layout_mode = 1 anchors_preset = 8 anchor_left = 0.5 @@ -336,11 +336,11 @@ anchor_bottom = 0.5 grow_horizontal = 2 grow_vertical = 2 -[node name="Node2D" type="Node2D" parent="Center"] +[node name="Node2D" type="Node2D" parent="Center" unique_id=2095678670] modulate = Color(1, 1, 1, 0) scale = Vector2(1e-05, 1e-05) -[node name="Label" type="Label" parent="Center/Node2D"] +[node name="Label" type="Label" parent="Center/Node2D" unique_id=267605128] anchors_preset = 8 anchor_left = 0.5 anchor_top = 0.5 @@ -361,14 +361,12 @@ text = "GO!" horizontal_alignment = 1 vertical_alignment = 1 -[node name="AnimationPlayer" type="AnimationPlayer" parent="."] -libraries = { -&"": SubResource("AnimationLibrary_deqe4") -} +[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=237178568] +libraries/ = SubResource("AnimationLibrary_deqe4") -[node name="PreperationTimer" type="Timer" parent="."] +[node name="PreperationTimer" type="Timer" parent="." unique_id=806142906] one_shot = true -[node name="InitialDelay" type="Timer" parent="."] +[node name="InitialDelay" type="Timer" parent="." unique_id=1150912956] wait_time = 0.5 one_shot = true diff --git a/client/gui/overlays/chat.gd b/client/gui/overlays/chat.gd index 676337a6..a831cf2c 100644 --- a/client/gui/overlays/chat.gd +++ b/client/gui/overlays/chat.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/client/gui/overlays/chat.tscn b/client/gui/overlays/chat.tscn index 068d0ee4..b0bd9728 100644 --- a/client/gui/overlays/chat.tscn +++ b/client/gui/overlays/chat.tscn @@ -1,11 +1,10 @@ -[gd_scene load_steps=5 format=3 uid="uid://xcxbmynn8mhi"] +[gd_scene format=3 uid="uid://xcxbmynn8mhi"] -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://gui/resources/theme/theme.tres" id="1_lmy51"] [ext_resource type="Script" uid="uid://bgt04y4ncl1fv" path="res://gui/overlays/chat.gd" id="2_3543w"] [ext_resource type="Material" uid="uid://beea1pc5nt67r" path="res://gui/resources/materials/dark_blur_material.tres" id="3_15i2y"] [ext_resource type="Script" uid="uid://cmncjc06kadpe" path="res://gui/components/blur_setup.gd" id="4_3rmhr"] -[node name="ChatPreview" type="Control"] +[node name="ChatPreview" type="Control" unique_id=1086008487] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 @@ -13,27 +12,26 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 mouse_filter = 2 -theme = ExtResource("1_lmy51") script = ExtResource("2_3543w") -[node name="MarginContainer" type="MarginContainer" parent="."] -layout_mode = 2 +[node name="MarginContainer" type="MarginContainer" parent="." unique_id=468015652] +layout_mode = 0 anchor_bottom = 1.0 offset_right = 296.0 grow_vertical = 2 -[node name="ScrollContainer" type="ScrollContainer" parent="MarginContainer"] +[node name="ScrollContainer" type="ScrollContainer" parent="MarginContainer" unique_id=1928434577] layout_mode = 2 horizontal_scroll_mode = 0 -[node name="PanelContainer" type="PanelContainer" parent="MarginContainer/ScrollContainer"] +[node name="PanelContainer" type="PanelContainer" parent="MarginContainer/ScrollContainer" unique_id=547642679] material = ExtResource("3_15i2y") layout_mode = 2 size_flags_horizontal = 3 -size_flags_vertical = 0 +size_flags_vertical = 10 mouse_filter = 2 script = ExtResource("4_3rmhr") -[node name="Messages" type="VBoxContainer" parent="MarginContainer/ScrollContainer/PanelContainer"] +[node name="Messages" type="VBoxContainer" parent="MarginContainer/ScrollContainer/PanelContainer" unique_id=76448729] layout_mode = 2 mouse_filter = 2 diff --git a/client/gui/overlays/controls_visualization/controller/controller_explanation.gd b/client/gui/overlays/controls_visualization/controller/controller_explanation.gd index 84e93cfa..cb1a876e 100644 --- a/client/gui/overlays/controls_visualization/controller/controller_explanation.gd +++ b/client/gui/overlays/controls_visualization/controller/controller_explanation.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/client/gui/overlays/controls_visualization/controller/controller_explanation.tscn b/client/gui/overlays/controls_visualization/controller/controller_explanation.tscn index 410f2592..dbe17ee3 100644 --- a/client/gui/overlays/controls_visualization/controller/controller_explanation.tscn +++ b/client/gui/overlays/controls_visualization/controller/controller_explanation.tscn @@ -1,11 +1,11 @@ -[gd_scene load_steps=5 format=3 uid="uid://ceex0cpjrb81p"] +[gd_scene format=3 uid="uid://ceex0cpjrb81p"] [ext_resource type="Script" uid="uid://dsg537e6dc68" path="res://gui/overlays/controls_visualization/controller/controller_explanation.gd" id="1_n0s1n"] [ext_resource type="FontVariation" uid="uid://cl6m4hqsnrpav" path="res://gui/resources/fonts/sansita-swashed-bold.tres" id="2_ewgm4"] [ext_resource type="Texture2D" uid="uid://cf8hrxilqe2ih" path="res://gui/overlays/controls_visualization/arrow.svg" id="3_565r1"] [ext_resource type="Texture2D" uid="uid://doo07i13vtb34" path="res://gui/overlays/controls_visualization/controller/controller.svg" id="5_nalwd"] -[node name="ControllerExplanation" type="Control"] +[node name="ControllerExplanation" type="Control" unique_id=225005545] custom_minimum_size = Vector2(0, 450) layout_mode = 3 anchors_preset = 15 @@ -16,7 +16,7 @@ grow_horizontal = 2 grow_vertical = 2 script = ExtResource("1_n0s1n") -[node name="Control" type="Control" parent="."] +[node name="Control" type="Control" parent="." unique_id=612138847] layout_mode = 1 anchors_preset = 8 anchor_left = 0.5 @@ -26,40 +26,40 @@ anchor_bottom = 0.5 grow_horizontal = 2 grow_vertical = 2 -[node name="Node2D" type="Node2D" parent="Control"] +[node name="Node2D" type="Node2D" parent="Control" unique_id=1382260045] position = Vector2(0, 50) -[node name="Controller" type="Sprite2D" parent="Control/Node2D"] +[node name="Controller" type="Sprite2D" parent="Control/Node2D" unique_id=443484705] scale = Vector2(0.4, 0.4) texture = ExtResource("5_nalwd") -[node name="Arrow" type="Sprite2D" parent="Control/Node2D"] +[node name="Arrow" type="Sprite2D" parent="Control/Node2D" unique_id=2024226522] position = Vector2(-250, -150) rotation = 1.5707964 scale = Vector2(0.5, 0.5) texture = ExtResource("3_565r1") -[node name="Arrow4" type="Sprite2D" parent="Control/Node2D"] +[node name="Arrow4" type="Sprite2D" parent="Control/Node2D" unique_id=366803430] position = Vector2(45, -150) scale = Vector2(0.5, -0.5) texture = ExtResource("3_565r1") -[node name="Arrow2" type="Sprite2D" parent="Control/Node2D"] +[node name="Arrow2" type="Sprite2D" parent="Control/Node2D" unique_id=2011085377] position = Vector2(260, -140) rotation = 1.5707963 scale = Vector2(0.5, -0.5) texture = ExtResource("3_565r1") -[node name="Arrow3" type="Sprite2D" parent="Control/Node2D"] +[node name="Arrow3" type="Sprite2D" parent="Control/Node2D" unique_id=1350514919] position = Vector2(215, 20) rotation = -1.5707964 scale = Vector2(0.5, 0.5) texture = ExtResource("3_565r1") -[node name="Move" type="Node2D" parent="Control/Node2D"] +[node name="Move" type="Node2D" parent="Control/Node2D" unique_id=1101261466] position = Vector2(-330, -175) -[node name="Label" type="Label" parent="Control/Node2D/Move"] +[node name="Label" type="Label" parent="Control/Node2D/Move" unique_id=1806122210] anchors_preset = 6 anchor_left = 1.0 anchor_top = 0.5 @@ -75,10 +75,10 @@ theme_override_font_sizes/font_size = 40 text = "c.controls_explanation.move" horizontal_alignment = 2 -[node name="Boost" type="Node2D" parent="Control/Node2D"] +[node name="Boost" type="Node2D" parent="Control/Node2D" unique_id=1174801668] position = Vector2(335, -165) -[node name="Label" type="Label" parent="Control/Node2D/Boost"] +[node name="Label" type="Label" parent="Control/Node2D/Boost" unique_id=372533033] anchors_preset = 4 anchor_top = 0.5 anchor_bottom = 0.5 @@ -90,10 +90,10 @@ theme_override_fonts/font = ExtResource("2_ewgm4") theme_override_font_sizes/font_size = 40 text = "c.controls_explanation.boost" -[node name="InteractRight" type="Node2D" parent="Control/Node2D"] +[node name="InteractRight" type="Node2D" parent="Control/Node2D" unique_id=629169846] position = Vector2(290, 25) -[node name="Label" type="Label" parent="Control/Node2D/InteractRight"] +[node name="Label" type="Label" parent="Control/Node2D/InteractRight" unique_id=1237574916] anchors_preset = 4 anchor_top = 0.5 anchor_bottom = 0.5 @@ -105,10 +105,10 @@ theme_override_fonts/font = ExtResource("2_ewgm4") theme_override_font_sizes/font_size = 40 text = "c.controls_explanation.interact_right" -[node name="InteractLeft" type="Node2D" parent="Control/Node2D"] +[node name="InteractLeft" type="Node2D" parent="Control/Node2D" unique_id=1696365379] position = Vector2(20, -250) -[node name="Label" type="Label" parent="Control/Node2D/InteractLeft"] +[node name="Label" type="Label" parent="Control/Node2D/InteractLeft" unique_id=558541274] anchors_preset = 8 anchor_left = 0.5 anchor_top = 0.5 diff --git a/client/gui/overlays/controls_visualization/device_explanation.gd b/client/gui/overlays/controls_visualization/device_explanation.gd index 7bfe2fb4..ae39c3b6 100644 --- a/client/gui/overlays/controls_visualization/device_explanation.gd +++ b/client/gui/overlays/controls_visualization/device_explanation.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/client/gui/overlays/controls_visualization/explanation.gd b/client/gui/overlays/controls_visualization/explanation.gd index 77147f1d..20d60dc5 100644 --- a/client/gui/overlays/controls_visualization/explanation.gd +++ b/client/gui/overlays/controls_visualization/explanation.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -20,8 +20,6 @@ var profile_name: String var using_joypad: bool var two_handed: bool -@onready var game: Game = $"../Game" - @onready var title: Label = $MarginContainer/PanelContainer/SmartMarginContainer/VBoxContainer/Title @onready var keyboard_explanation: KeyboardExplanation = $MarginContainer/PanelContainer/SmartMarginContainer/VBoxContainer/KeyboardExplanation @onready var controller_explanation: ControllerExplanation = $MarginContainer/PanelContainer/SmartMarginContainer/VBoxContainer/ControllerExplanation @@ -39,6 +37,4 @@ func _ready(): super() func _on_accept_pressed() -> void: - Profile.write(profile_name, true) - game.mp.send_ready() exit() diff --git a/client/gui/overlays/controls_visualization/explanation.tscn b/client/gui/overlays/controls_visualization/explanation.tscn index e102fa85..87cfd024 100644 --- a/client/gui/overlays/controls_visualization/explanation.tscn +++ b/client/gui/overlays/controls_visualization/explanation.tscn @@ -1,6 +1,5 @@ -[gd_scene load_steps=8 format=3 uid="uid://c7g5gpiyofmu8"] +[gd_scene format=3 uid="uid://c7g5gpiyofmu8"] -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://gui/resources/theme/theme.tres" id="1_81hfk"] [ext_resource type="Script" uid="uid://bs2xryd5vamjf" path="res://gui/overlays/controls_visualization/explanation.gd" id="2_lxysr"] [ext_resource type="Script" uid="uid://byshs20og68tn" path="res://gui/components/smart_margin_container.gd" id="2_m528b"] [ext_resource type="Material" uid="uid://beea1pc5nt67r" path="res://gui/resources/materials/dark_blur_material.tres" id="3_pomap"] @@ -8,18 +7,17 @@ [ext_resource type="PackedScene" uid="uid://wwj1ow1f437s" path="res://gui/overlays/controls_visualization/keyboard/keyboard_explanation.tscn" id="5_v3ijr"] [ext_resource type="PackedScene" uid="uid://ceex0cpjrb81p" path="res://gui/overlays/controls_visualization/controller/controller_explanation.tscn" id="7_yuxcv"] -[node name="Explanation" type="Control"] +[node name="Explanation" type="Control" unique_id=1844082160] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -theme = ExtResource("1_81hfk") script = ExtResource("2_lxysr") support_anim = false -[node name="MarginContainer" type="MarginContainer" parent="."] +[node name="MarginContainer" type="MarginContainer" parent="." unique_id=1783444226] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -29,38 +27,38 @@ grow_vertical = 2 script = ExtResource("2_m528b") metadata/_custom_type_script = "uid://byshs20og68tn" -[node name="PanelContainer" type="PanelContainer" parent="MarginContainer"] +[node name="PanelContainer" type="PanelContainer" parent="MarginContainer" unique_id=1011034861] material = ExtResource("3_pomap") layout_mode = 2 script = ExtResource("4_v3ijr") -[node name="SmartMarginContainer" type="MarginContainer" parent="MarginContainer/PanelContainer"] +[node name="SmartMarginContainer" type="MarginContainer" parent="MarginContainer/PanelContainer" unique_id=412197848] layout_mode = 2 script = ExtResource("2_m528b") metadata/_custom_type_script = "uid://byshs20og68tn" -[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/PanelContainer/SmartMarginContainer"] +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/PanelContainer/SmartMarginContainer" unique_id=801432498] layout_mode = 2 -[node name="Title" type="Label" parent="MarginContainer/PanelContainer/SmartMarginContainer/VBoxContainer"] +[node name="Title" type="Label" parent="MarginContainer/PanelContainer/SmartMarginContainer/VBoxContainer" unique_id=1143098368] layout_mode = 2 theme_override_font_sizes/font_size = 36 text = "c.settings.input" horizontal_alignment = 1 -[node name="KeyboardExplanation" parent="MarginContainer/PanelContainer/SmartMarginContainer/VBoxContainer" instance=ExtResource("5_v3ijr")] +[node name="KeyboardExplanation" parent="MarginContainer/PanelContainer/SmartMarginContainer/VBoxContainer" unique_id=1601826141 instance=ExtResource("5_v3ijr")] visible = false layout_mode = 2 -[node name="ControllerExplanation" parent="MarginContainer/PanelContainer/SmartMarginContainer/VBoxContainer" instance=ExtResource("7_yuxcv")] +[node name="ControllerExplanation" parent="MarginContainer/PanelContainer/SmartMarginContainer/VBoxContainer" unique_id=2048880330 instance=ExtResource("7_yuxcv")] visible = false layout_mode = 2 -[node name="Spacer" type="Control" parent="MarginContainer/PanelContainer/SmartMarginContainer/VBoxContainer"] +[node name="Spacer" type="Control" parent="MarginContainer/PanelContainer/SmartMarginContainer/VBoxContainer" unique_id=846502741] layout_mode = 2 size_flags_vertical = 3 -[node name="Accept" type="Button" parent="MarginContainer/PanelContainer/SmartMarginContainer/VBoxContainer"] +[node name="Accept" type="Button" parent="MarginContainer/PanelContainer/SmartMarginContainer/VBoxContainer" unique_id=1036973256] layout_mode = 2 size_flags_horizontal = 4 text = "c.menu.accept" diff --git a/client/gui/overlays/controls_visualization/keyboard/keyboard_button.tscn b/client/gui/overlays/controls_visualization/keyboard/keyboard_button.tscn index e4462464..09f1eb04 100644 --- a/client/gui/overlays/controls_visualization/keyboard/keyboard_button.tscn +++ b/client/gui/overlays/controls_visualization/keyboard/keyboard_button.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=2 format=3 uid="uid://dj7tqrgpdja42"] +[gd_scene format=3 uid="uid://dj7tqrgpdja42"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ilwpo"] content_margin_left = 5.0 @@ -17,7 +17,7 @@ corner_radius_bottom_right = 15 corner_radius_bottom_left = 15 shadow_size = 3 -[node name="KeyboardButton" type="Button"] +[node name="KeyboardButton" type="Button" unique_id=744392589] custom_minimum_size = Vector2(75, 75) offset_right = 8.0 offset_bottom = 8.0 diff --git a/client/gui/overlays/controls_visualization/keyboard/keyboard_explanation.gd b/client/gui/overlays/controls_visualization/keyboard/keyboard_explanation.gd index 5d6dfb42..eb536556 100644 --- a/client/gui/overlays/controls_visualization/keyboard/keyboard_explanation.gd +++ b/client/gui/overlays/controls_visualization/keyboard/keyboard_explanation.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/client/gui/overlays/controls_visualization/keyboard/keyboard_explanation.tscn b/client/gui/overlays/controls_visualization/keyboard/keyboard_explanation.tscn index 54001686..3c68c8fe 100644 --- a/client/gui/overlays/controls_visualization/keyboard/keyboard_explanation.tscn +++ b/client/gui/overlays/controls_visualization/keyboard/keyboard_explanation.tscn @@ -1,11 +1,11 @@ -[gd_scene load_steps=5 format=3 uid="uid://wwj1ow1f437s"] +[gd_scene format=3 uid="uid://wwj1ow1f437s"] [ext_resource type="Script" uid="uid://dekpmw0i03eyi" path="res://gui/overlays/controls_visualization/keyboard/keyboard_explanation.gd" id="1_ubxjd"] [ext_resource type="PackedScene" uid="uid://dj7tqrgpdja42" path="res://gui/overlays/controls_visualization/keyboard/keyboard_button.tscn" id="2_8nrgi"] [ext_resource type="FontVariation" uid="uid://cl6m4hqsnrpav" path="res://gui/resources/fonts/sansita-swashed-bold.tres" id="3_nvtkh"] [ext_resource type="Texture2D" uid="uid://cf8hrxilqe2ih" path="res://gui/overlays/controls_visualization/arrow.svg" id="4_mjakv"] -[node name="KeyboardExplanation" type="Control"] +[node name="KeyboardExplanation" type="Control" unique_id=651660867] custom_minimum_size = Vector2(0, 450) layout_mode = 3 anchors_preset = 15 @@ -15,7 +15,7 @@ grow_horizontal = 2 grow_vertical = 2 script = ExtResource("1_ubxjd") -[node name="VBoxContainer" type="HBoxContainer" parent="."] +[node name="VBoxContainer" type="HBoxContainer" parent="." unique_id=484836512] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -23,17 +23,17 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -[node name="Control" type="Control" parent="VBoxContainer"] +[node name="Control" type="Control" parent="VBoxContainer" unique_id=1305117984] custom_minimum_size = Vector2(400, 375) layout_mode = 2 size_flags_vertical = 4 -[node name="WASD" type="Node2D" parent="VBoxContainer/Control"] +[node name="WASD" type="Node2D" parent="VBoxContainer/Control" unique_id=1579800839] -[node name="Node2D" type="Node2D" parent="VBoxContainer/Control/WASD"] +[node name="Node2D" type="Node2D" parent="VBoxContainer/Control/WASD" unique_id=341970939] position = Vector2(200, 100) -[node name="KeyboardButton" parent="VBoxContainer/Control/WASD/Node2D" instance=ExtResource("2_8nrgi")] +[node name="KeyboardButton" parent="VBoxContainer/Control/WASD/Node2D" unique_id=2048931801 instance=ExtResource("2_8nrgi")] anchors_preset = 8 anchor_left = 0.5 anchor_top = 0.5 @@ -47,10 +47,10 @@ grow_horizontal = 2 grow_vertical = 2 text = "W" -[node name="Node2D2" type="Node2D" parent="VBoxContainer/Control/WASD"] +[node name="Node2D2" type="Node2D" parent="VBoxContainer/Control/WASD" unique_id=799400559] position = Vector2(200, 175) -[node name="KeyboardButton" parent="VBoxContainer/Control/WASD/Node2D2" instance=ExtResource("2_8nrgi")] +[node name="KeyboardButton" parent="VBoxContainer/Control/WASD/Node2D2" unique_id=33904465 instance=ExtResource("2_8nrgi")] anchors_preset = 8 anchor_left = 0.5 anchor_top = 0.5 @@ -64,10 +64,10 @@ grow_horizontal = 2 grow_vertical = 2 text = "S" -[node name="Node2D3" type="Node2D" parent="VBoxContainer/Control/WASD"] +[node name="Node2D3" type="Node2D" parent="VBoxContainer/Control/WASD" unique_id=217001624] position = Vector2(125, 175) -[node name="KeyboardButton" parent="VBoxContainer/Control/WASD/Node2D3" instance=ExtResource("2_8nrgi")] +[node name="KeyboardButton" parent="VBoxContainer/Control/WASD/Node2D3" unique_id=98593509 instance=ExtResource("2_8nrgi")] anchors_preset = 8 anchor_left = 0.5 anchor_top = 0.5 @@ -80,10 +80,10 @@ offset_bottom = 24.5 grow_horizontal = 2 grow_vertical = 2 -[node name="Node2D4" type="Node2D" parent="VBoxContainer/Control/WASD"] +[node name="Node2D4" type="Node2D" parent="VBoxContainer/Control/WASD" unique_id=1178217426] position = Vector2(275, 175) -[node name="KeyboardButton" parent="VBoxContainer/Control/WASD/Node2D4" instance=ExtResource("2_8nrgi")] +[node name="KeyboardButton" parent="VBoxContainer/Control/WASD/Node2D4" unique_id=670344825 instance=ExtResource("2_8nrgi")] anchors_preset = 8 anchor_left = 0.5 anchor_top = 0.5 @@ -97,10 +97,10 @@ grow_horizontal = 2 grow_vertical = 2 text = "D" -[node name="Node2D5" type="Node2D" parent="VBoxContainer/Control/WASD"] +[node name="Node2D5" type="Node2D" parent="VBoxContainer/Control/WASD" unique_id=1418657218] position = Vector2(200, 275) -[node name="Label" type="Label" parent="VBoxContainer/Control/WASD/Node2D5"] +[node name="Label" type="Label" parent="VBoxContainer/Control/WASD/Node2D5" unique_id=2144646890] anchors_preset = 8 anchor_left = 0.5 anchor_top = 0.5 @@ -116,22 +116,22 @@ theme_override_fonts/font = ExtResource("3_nvtkh") theme_override_font_sizes/font_size = 40 text = "c.controls_explanation.move" -[node name="Spacer" type="Control" parent="VBoxContainer"] +[node name="Spacer" type="Control" parent="VBoxContainer" unique_id=1026478006] layout_mode = 2 size_flags_horizontal = 3 -[node name="Control2" type="Control" parent="VBoxContainer"] +[node name="Control2" type="Control" parent="VBoxContainer" unique_id=1412018875] custom_minimum_size = Vector2(750, 450) layout_mode = 2 size_flags_vertical = 4 -[node name="JKL" type="Node2D" parent="VBoxContainer/Control2"] +[node name="JKL" type="Node2D" parent="VBoxContainer/Control2" unique_id=1177184769] position = Vector2(150, 0) -[node name="K" type="Node2D" parent="VBoxContainer/Control2/JKL"] +[node name="K" type="Node2D" parent="VBoxContainer/Control2/JKL" unique_id=774521440] position = Vector2(200, 175) -[node name="KeyboardButton" parent="VBoxContainer/Control2/JKL/K" instance=ExtResource("2_8nrgi")] +[node name="KeyboardButton" parent="VBoxContainer/Control2/JKL/K" unique_id=1633407160 instance=ExtResource("2_8nrgi")] anchors_preset = 8 anchor_left = 0.5 anchor_top = 0.5 @@ -145,10 +145,10 @@ grow_horizontal = 2 grow_vertical = 2 text = "K" -[node name="J" type="Node2D" parent="VBoxContainer/Control2/JKL"] +[node name="J" type="Node2D" parent="VBoxContainer/Control2/JKL" unique_id=1136751368] position = Vector2(125, 175) -[node name="KeyboardButton" parent="VBoxContainer/Control2/JKL/J" instance=ExtResource("2_8nrgi")] +[node name="KeyboardButton" parent="VBoxContainer/Control2/JKL/J" unique_id=1132698164 instance=ExtResource("2_8nrgi")] anchors_preset = 8 anchor_left = 0.5 anchor_top = 0.5 @@ -162,10 +162,10 @@ grow_horizontal = 2 grow_vertical = 2 text = "J" -[node name="L" type="Node2D" parent="VBoxContainer/Control2/JKL"] +[node name="L" type="Node2D" parent="VBoxContainer/Control2/JKL" unique_id=1442550083] position = Vector2(275, 175) -[node name="KeyboardButton" parent="VBoxContainer/Control2/JKL/L" instance=ExtResource("2_8nrgi")] +[node name="KeyboardButton" parent="VBoxContainer/Control2/JKL/L" unique_id=1327035512 instance=ExtResource("2_8nrgi")] anchors_preset = 8 anchor_left = 0.5 anchor_top = 0.5 @@ -179,10 +179,10 @@ grow_horizontal = 2 grow_vertical = 2 text = "L" -[node name="LeftHand" type="Node2D" parent="VBoxContainer/Control2/JKL"] +[node name="LeftHand" type="Node2D" parent="VBoxContainer/Control2/JKL" unique_id=1230277954] position = Vector2(25, 375) -[node name="Label" type="Label" parent="VBoxContainer/Control2/JKL/LeftHand"] +[node name="Label" type="Label" parent="VBoxContainer/Control2/JKL/LeftHand" unique_id=228034435] anchors_preset = 8 anchor_left = 0.5 anchor_top = 0.5 @@ -198,10 +198,10 @@ theme_override_fonts/font = ExtResource("3_nvtkh") theme_override_font_sizes/font_size = 40 text = "c.controls_explanation.interact_left" -[node name="RightHand" type="Node2D" parent="VBoxContainer/Control2/JKL"] +[node name="RightHand" type="Node2D" parent="VBoxContainer/Control2/JKL" unique_id=359568535] position = Vector2(375, 375) -[node name="Label" type="Label" parent="VBoxContainer/Control2/JKL/RightHand"] +[node name="Label" type="Label" parent="VBoxContainer/Control2/JKL/RightHand" unique_id=500510356] anchors_preset = 8 anchor_left = 0.5 anchor_top = 0.5 @@ -217,10 +217,10 @@ theme_override_fonts/font = ExtResource("3_nvtkh") theme_override_font_sizes/font_size = 40 text = "c.controls_explanation.interact_right" -[node name="Boost" type="Node2D" parent="VBoxContainer/Control2/JKL"] +[node name="Boost" type="Node2D" parent="VBoxContainer/Control2/JKL" unique_id=394841057] position = Vector2(335, 65) -[node name="Label" type="Label" parent="VBoxContainer/Control2/JKL/Boost"] +[node name="Label" type="Label" parent="VBoxContainer/Control2/JKL/Boost" unique_id=2055301401] anchors_preset = 4 anchor_top = 0.5 anchor_bottom = 0.5 @@ -232,17 +232,17 @@ theme_override_fonts/font = ExtResource("3_nvtkh") theme_override_font_sizes/font_size = 40 text = "c.controls_explanation.boost" -[node name="Sprite2D" type="Sprite2D" parent="VBoxContainer/Control2/JKL"] +[node name="Sprite2D" type="Sprite2D" parent="VBoxContainer/Control2/JKL" unique_id=1855495404] position = Vector2(50, 275) scale = Vector2(0.5, 0.5) texture = ExtResource("4_mjakv") -[node name="Sprite2D2" type="Sprite2D" parent="VBoxContainer/Control2/JKL"] +[node name="Sprite2D2" type="Sprite2D" parent="VBoxContainer/Control2/JKL" unique_id=770199290] position = Vector2(350, 275) scale = Vector2(-0.5, 0.5) texture = ExtResource("4_mjakv") -[node name="Sprite2D3" type="Sprite2D" parent="VBoxContainer/Control2/JKL"] +[node name="Sprite2D3" type="Sprite2D" parent="VBoxContainer/Control2/JKL" unique_id=495337642] position = Vector2(250, 90) rotation = -1.5707964 scale = Vector2(-0.5, 0.5) diff --git a/client/gui/overlays/debug/debug.gd b/client/gui/overlays/debug/debug.gd index 3a37a1b7..51bd0a48 100644 --- a/client/gui/overlays/debug/debug.gd +++ b/client/gui/overlays/debug/debug.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -16,7 +16,7 @@ extends RichTextLabel func _ready(): - Settings.hook_changed_init("graphics.debug_info", "main", func (v): + Settings.hook_changed_init("graphics.debug_info", self, func (v): visible = v RenderingServer.viewport_set_measure_render_time(get_viewport().get_viewport_rid(), visible) ) diff --git a/client/gui/overlays/debug/debug.tscn b/client/gui/overlays/debug/debug.tscn index c794c161..0013f4ad 100644 --- a/client/gui/overlays/debug/debug.tscn +++ b/client/gui/overlays/debug/debug.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=6 format=3 uid="uid://3lytexnfrub6"] +[gd_scene format=3 uid="uid://3lytexnfrub6"] [ext_resource type="Script" uid="uid://bpmdfuqjtwf5v" path="res://gui/overlays/debug/debug.gd" id="1_62otr"] [ext_resource type="Script" uid="uid://byshs20og68tn" path="res://gui/components/smart_margin_container.gd" id="1_c21gy"] @@ -11,7 +11,8 @@ variation_opentype = { 2003265652: 700 } -[node name="SmartMarginContainer" type="MarginContainer"] +[node name="SmartMarginContainer" type="MarginContainer" unique_id=207473556] +z_index = 99 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 @@ -25,7 +26,7 @@ theme_override_constants/margin_bottom = 10 script = ExtResource("1_c21gy") metadata/_custom_type_script = "uid://byshs20og68tn" -[node name="Debug" type="RichTextLabel" parent="."] +[node name="Debug" type="RichTextLabel" parent="." unique_id=599133286] visible = false layout_mode = 2 mouse_filter = 2 @@ -33,7 +34,7 @@ theme_override_colors/font_outline_color = Color(0, 0, 0, 1) theme_override_constants/outline_size = 10 script = ExtResource("1_62otr") -[node name="DebugPie" type="Control" parent="."] +[node name="DebugPie" type="Control" parent="." unique_id=1967345075] visible = false layout_mode = 2 size_flags_horizontal = 8 diff --git a/client/gui/overlays/debug/debug_pie.gd b/client/gui/overlays/debug/debug_pie.gd index 02201776..ce32c93a 100644 --- a/client/gui/overlays/debug/debug_pie.gd +++ b/client/gui/overlays/debug/debug_pie.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/client/gui/overlays/debug/pie.tscn b/client/gui/overlays/debug/pie.tscn index 69872d72..bb65703c 100644 --- a/client/gui/overlays/debug/pie.tscn +++ b/client/gui/overlays/debug/pie.tscn @@ -1,6 +1,6 @@ [gd_scene format=3 uid="uid://27qwbrf7mh7i"] -[node name="DebugPie" type="Control"] +[node name="DebugPie" type="Control" unique_id=12646477] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 diff --git a/client/gui/overlays/lobby/lobby.gd b/client/gui/overlays/lobby/lobby.gd deleted file mode 100644 index 2b40cada..00000000 --- a/client/gui/overlays/lobby/lobby.gd +++ /dev/null @@ -1,181 +0,0 @@ -# Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, version 3 of the License only. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. -# -extends Control -class_name Lobby - -const MAX_BOT_COUNT_PER_TYPE: int = 3 -const PLAYER = preload("res://gui/overlays/lobby/player.tscn") - -var map_count -var selected_map := 0 -var selected_map_name: String - -var bots_enabled := false -var bot_counts := {} -var bot_reset_buttons := {} -var bot_inc_buttons := {} -var bot_dec_buttons := {} - -@onready var game: Game = $"../../Game" # TODO -@onready var player_container = $PlayerList/VBoxContainer/Players - -@onready var map_name_label = $Sidebar/Bottom/MarginContainer/VBoxContainer/HBoxContainer/Map/Name -@onready var map_player_label = $Sidebar/Bottom/MarginContainer/VBoxContainer/HBoxContainer/Map/Players -@onready var map_difficulty_label = $Sidebar/Bottom/MarginContainer/VBoxContainer/HBoxContainer/Map/Difficulty -@onready var map_list_container = $Sidebar/Bottom/MarginContainer/VBoxContainer/MapList/VBoxContainer - -@onready var prev_map = $Sidebar/Bottom/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/Left -@onready var next_map = $Sidebar/Bottom/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer2/Right - -@onready var bots_container = $Sidebar/Bottom/MarginContainer/VBoxContainer/Bots -@onready var bot_settings = $Sidebar/Bottom/MarginContainer/VBoxContainer/Bots/ScrollContainerCustom/BotSettings -@onready var bot_settings_conainer = $Sidebar/Bottom/MarginContainer/VBoxContainer/Bots/ScrollContainerCustom - -func _ready(): - game.update_players.connect(update_players) - initialize() - game.data_updated.connect(initialize) - game.join_state_updated.connect(_update_visible) - game.in_lobby_updated.connect(_update_visible) - _update_visible(false) - check_for_music() - -func initialize(): - map_count = game.maps.size() - - for c in map_list_container.get_children(): - c.queue_free() - for c in bot_settings.get_children(): - c.queue_free() - - var i := 0 - for m in game.maps: - var b := Button.new() - b.name = m[0] - b.text = "%s (%d)" % [m[1]["name"], m[1]["players"]] - b.pressed.connect(select_map.bind(i)) - b.focus_entered.connect(select_map.bind(i)) - map_list_container.add_child(b) - i += 1 - select_map(0) - - for algo_id: String in game.bot_algos: - if algo_id == "customer" or algo_id == "test": - continue - - bot_counts[algo_id] = 0 - - var h := HBoxContainer.new() - h.name = algo_id - var add := Button.new() - add.text = "+" - var reset := Button.new() - reset.size_flags_horizontal = SIZE_EXPAND_FILL - var remove := Button.new() - remove.text = "-" - bot_reset_buttons[algo_id] = reset - bot_inc_buttons[algo_id] = add - bot_dec_buttons[algo_id] = remove - update_bot_reset_text(algo_id) - add.pressed.connect(increase_bot_count.bind(algo_id)) - reset.pressed.connect(reset_bot_count.bind(algo_id)) - remove.pressed.connect(decrease_bot_count.bind(algo_id)) - h.add_child(remove) - h.add_child(reset) - h.add_child(add) - bot_settings.add_child(h) - -func select_map(i: int): - if i >= map_count: - return - selected_map = i - var map_data: Dictionary = game.maps[i][1] - map_name_label.text = map_data["name"] - map_player_label.text = tr("c.map.players_recommended").format([roundi(map_data["players"])]) - map_difficulty_label.text = tr("c.map.difficulty.%d" % (map_data["difficulty"] - 1)) - selected_map_name = game.maps[i][0] - if not game.menu.covered: - map_list_container.get_child(i).grab_focus() - -func increase_bot_count(algo_id: String): - bot_counts[algo_id] += 1 - update_bot_reset_text(algo_id) - -func decrease_bot_count(algo_id: String): - bot_counts[algo_id] -= 1 - update_bot_reset_text(algo_id) - -func reset_bot_count(algo_id: String): - bot_counts[algo_id] = 0 - update_bot_reset_text(algo_id) - -func update_bot_reset_text(algo_id: String): - var display_name: String = tr("s.bot.%s" % algo_id) - bot_reset_buttons[algo_id].text = "%s (%d)" % [display_name, bot_counts[algo_id]] - bot_inc_buttons[algo_id].disabled = not bot_counts[algo_id] < MAX_BOT_COUNT_PER_TYPE - bot_dec_buttons[algo_id].disabled = not bot_counts[algo_id] > 0 - -func update_players(player_list: Dictionary): - for i in player_container.get_children(): - i.queue_free() - - for i in player_list.keys(): - var p: PlayerTag = PLAYER.instantiate() - player_container.add_child(p) - p.setup(player_list[i].username) - -func _input(_event): - if not visible: - return - - if Input.is_action_just_pressed("previous") and not prev_map.disabled: - prev_map.emit_signal("pressed") - elif Input.is_action_just_pressed("next") and not next_map.disabled: - next_map.emit_signal("pressed") - -func _on_left_pressed(): - selected_map = (selected_map - 1) % map_count - select_map(selected_map) - -func _on_right_pressed(): - selected_map = (selected_map + 1) % map_count - select_map(selected_map) - -func _on_start_pressed(): - if selected_map_name != null: - var start_msg := "/start %s" % selected_map_name - - if bots_enabled: - for k in bot_counts.keys(): - for i in range(bot_counts[k]): - start_msg += "\ncreate-bot %s" % k - - game.mp.send_chat(game.my_player_id, start_msg) - Sound.play_music("stop") # TODO: Game music enter - -func _update_visible(_state: bool): - visible = game.in_lobby and game.join_state == Game.JoinState.JOINED - -func check_for_music(): - if visible: - Sound.play_music("Lobby") - else: - Sound.play_music("stop") # TODO: Game music enter - -func _on_enable_bots_toggled(toggled_on): - bots_enabled = toggled_on - bot_settings_conainer.visible = toggled_on - bots_container.size_flags_vertical = SIZE_EXPAND_FILL if toggled_on else SIZE_FILL diff --git a/client/gui/overlays/lobby/lobby.gd.uid b/client/gui/overlays/lobby/lobby.gd.uid deleted file mode 100644 index b92e8681..00000000 --- a/client/gui/overlays/lobby/lobby.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://bssjvsu44l0fn diff --git a/client/gui/overlays/lobby/lobby.tscn b/client/gui/overlays/lobby/lobby.tscn deleted file mode 100644 index 28959838..00000000 --- a/client/gui/overlays/lobby/lobby.tscn +++ /dev/null @@ -1,182 +0,0 @@ -[gd_scene load_steps=16 format=3 uid="uid://bc50la65ntifb"] - -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://gui/resources/theme/theme.tres" id="1_u18ke"] -[ext_resource type="Script" uid="uid://bssjvsu44l0fn" path="res://gui/overlays/lobby/lobby.gd" id="2_7657i"] -[ext_resource type="StyleBox" uid="uid://de80aw86emnql" path="res://gui/resources/style/lobby_panel_override.tres" id="3_6iqoe"] -[ext_resource type="Material" uid="uid://beea1pc5nt67r" path="res://gui/resources/materials/dark_blur_material.tres" id="3_esmbx"] -[ext_resource type="Texture2D" uid="uid://35rd5gamtyqm" path="res://gui/resources/icons/arrow.svg" id="3_jxleg"] -[ext_resource type="Texture2D" uid="uid://j75dbytlbju" path="res://gui/resources/icons/arrow_pressed.svg" id="4_eapmn"] -[ext_resource type="Script" uid="uid://cmncjc06kadpe" path="res://gui/components/blur_setup.gd" id="5_am8pt"] -[ext_resource type="Texture2D" uid="uid://b33qmctbpf48g" path="res://gui/resources/icons/arrow_hover.svg" id="5_odwav"] -[ext_resource type="Script" uid="uid://byshs20og68tn" path="res://gui/components/smart_margin_container.gd" id="6_7mu2u"] -[ext_resource type="Texture2D" uid="uid://by3qsrpxnfq4w" path="res://gui/resources/icons/arrow_focus.svg" id="6_tulu3"] -[ext_resource type="FontFile" uid="uid://5ixo6b3bd3km" path="res://gui/resources/fonts/font-josefin-sans.woff2" id="8_cwbpa"] -[ext_resource type="Texture2D" uid="uid://bsx6fo7mv2u6a" path="res://gui/resources/icons/controller_x.svg" id="9_q14bw"] -[ext_resource type="Script" uid="uid://bd7bylb2t2m0" path="res://gui/components/touch_scroll_container.gd" id="10_bgene"] -[ext_resource type="Script" uid="uid://b1eomxildrq30" path="res://gui/components/controller_button.gd" id="12_7mu2u"] - -[sub_resource type="FontVariation" id="FontVariation_5xxr2"] -base_font = ExtResource("8_cwbpa") -variation_opentype = { -2003265652: 700 -} - -[node name="Lobby" type="Control" groups=["no_auto_focus"]] -layout_mode = 3 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -theme = ExtResource("1_u18ke") -script = ExtResource("2_7657i") - -[node name="PlayerList" type="MarginContainer" parent="."] -layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -mouse_filter = 2 -theme_override_constants/margin_left = 342 -theme_override_constants/margin_top = 32 -theme_override_constants/margin_right = 342 -theme_override_constants/margin_bottom = 32 - -[node name="VBoxContainer" type="VBoxContainer" parent="PlayerList"] -layout_mode = 2 - -[node name="Players" type="HBoxContainer" parent="PlayerList/VBoxContainer"] -layout_mode = 2 -alignment = 1 - -[node name="Sidebar" type="HBoxContainer" parent="."] -layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -alignment = 2 - -[node name="Bottom" type="PanelContainer" parent="Sidebar"] -material = ExtResource("3_esmbx") -layout_mode = 2 -theme_override_styles/panel = ExtResource("3_6iqoe") -script = ExtResource("5_am8pt") - -[node name="MarginContainer" type="MarginContainer" parent="Sidebar/Bottom"] -layout_mode = 2 -script = ExtResource("6_7mu2u") - -[node name="VBoxContainer" type="VBoxContainer" parent="Sidebar/Bottom/MarginContainer"] -layout_mode = 2 -theme_override_constants/separation = 24 - -[node name="HBoxContainer" type="HBoxContainer" parent="Sidebar/Bottom/MarginContainer/VBoxContainer"] -layout_direction = 2 -layout_mode = 2 -alignment = 1 - -[node name="VBoxContainer" type="VBoxContainer" parent="Sidebar/Bottom/MarginContainer/VBoxContainer/HBoxContainer"] -layout_mode = 2 -alignment = 1 - -[node name="Left" type="TextureButton" parent="Sidebar/Bottom/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer"] -custom_minimum_size = Vector2(19, 28) -layout_mode = 2 -focus_mode = 0 -texture_normal = ExtResource("3_jxleg") -texture_pressed = ExtResource("4_eapmn") -texture_hover = ExtResource("5_odwav") -texture_focused = ExtResource("6_tulu3") -ignore_texture_size = true -stretch_mode = 4 -flip_h = true - -[node name="Map" type="VBoxContainer" parent="Sidebar/Bottom/MarginContainer/VBoxContainer/HBoxContainer"] -layout_mode = 2 - -[node name="Name" type="Label" parent="Sidebar/Bottom/MarginContainer/VBoxContainer/HBoxContainer/Map"] -custom_minimum_size = Vector2(200, 0) -layout_mode = 2 -theme_override_fonts/font = SubResource("FontVariation_5xxr2") -theme_override_font_sizes/font_size = 24 -text = "Map name" -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="Players" type="Label" parent="Sidebar/Bottom/MarginContainer/VBoxContainer/HBoxContainer/Map"] -layout_mode = 2 -text = "Players" -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="Difficulty" type="Label" parent="Sidebar/Bottom/MarginContainer/VBoxContainer/HBoxContainer/Map"] -layout_mode = 2 -text = "Difficulty" -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="VBoxContainer2" type="VBoxContainer" parent="Sidebar/Bottom/MarginContainer/VBoxContainer/HBoxContainer"] -layout_mode = 2 -alignment = 1 - -[node name="Right" type="TextureButton" parent="Sidebar/Bottom/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer2"] -custom_minimum_size = Vector2(19, 28) -layout_mode = 2 -focus_mode = 0 -texture_normal = ExtResource("3_jxleg") -texture_pressed = ExtResource("4_eapmn") -texture_hover = ExtResource("5_odwav") -texture_focused = ExtResource("6_tulu3") -ignore_texture_size = true -stretch_mode = 4 - -[node name="MapList" type="ScrollContainer" parent="Sidebar/Bottom/MarginContainer/VBoxContainer"] -layout_mode = 2 -size_flags_vertical = 3 -script = ExtResource("10_bgene") - -[node name="VBoxContainer" type="VBoxContainer" parent="Sidebar/Bottom/MarginContainer/VBoxContainer/MapList"] -layout_mode = 2 -size_flags_horizontal = 3 - -[node name="Bots" type="VBoxContainer" parent="Sidebar/Bottom/MarginContainer/VBoxContainer"] -layout_mode = 2 - -[node name="EnableBots" type="CheckButton" parent="Sidebar/Bottom/MarginContainer/VBoxContainer/Bots"] -layout_mode = 2 -text = "c.menu.lobby.enable_bots" - -[node name="ScrollContainerCustom" type="ScrollContainer" parent="Sidebar/Bottom/MarginContainer/VBoxContainer/Bots"] -visible = false -layout_mode = 2 -size_flags_vertical = 3 -script = ExtResource("10_bgene") - -[node name="BotSettings" type="VBoxContainer" parent="Sidebar/Bottom/MarginContainer/VBoxContainer/Bots/ScrollContainerCustom"] -layout_mode = 2 -size_flags_horizontal = 3 -size_flags_vertical = 3 - -[node name="VBoxContainer" type="VBoxContainer" parent="Sidebar/Bottom/MarginContainer/VBoxContainer"] -layout_mode = 2 -theme_override_constants/separation = 15 -alignment = 1 - -[node name="Start" type="Button" parent="Sidebar/Bottom/MarginContainer/VBoxContainer/VBoxContainer"] -layout_mode = 2 -text = "c.menu.lobby.start" -expand_icon = true -script = ExtResource("12_7mu2u") -controller_texture = ExtResource("9_q14bw") -press_action = "start_game" -metadata/_custom_type_script = "uid://b1eomxildrq30" - -[connection signal="visibility_changed" from="." to="." method="check_for_music"] -[connection signal="pressed" from="Sidebar/Bottom/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/Left" to="." method="_on_left_pressed"] -[connection signal="pressed" from="Sidebar/Bottom/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer2/Right" to="." method="_on_right_pressed"] -[connection signal="toggled" from="Sidebar/Bottom/MarginContainer/VBoxContainer/Bots/EnableBots" to="." method="_on_enable_bots_toggled"] -[connection signal="pressed" from="Sidebar/Bottom/MarginContainer/VBoxContainer/VBoxContainer/Start" to="." method="_on_start_pressed"] diff --git a/client/gui/overlays/lobby/player.gd b/client/gui/overlays/lobby/player.gd index 175d6341..5b2b50e4 100644 --- a/client/gui/overlays/lobby/player.gd +++ b/client/gui/overlays/lobby/player.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/client/gui/overlays/lobby/player.tscn b/client/gui/overlays/lobby/player.tscn index aa8997a1..4c924fb9 100644 --- a/client/gui/overlays/lobby/player.tscn +++ b/client/gui/overlays/lobby/player.tscn @@ -1,6 +1,6 @@ -[gd_scene load_steps=6 format=3 uid="uid://gmldnel4xbxy"] +[gd_scene format=3 uid="uid://gmldnel4xbxy"] -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://gui/resources/theme/theme.tres" id="1_flfqn"] +[ext_resource type="Material" uid="uid://beea1pc5nt67r" path="res://gui/resources/materials/dark_blur_material.tres" id="1_jy1rs"] [ext_resource type="Texture2D" uid="uid://222w1wha75od" path="res://gui/resources/icons/user.webp" id="2_mnaqt"] [ext_resource type="Script" uid="uid://buxb488rr2ncs" path="res://gui/overlays/lobby/player.gd" id="2_w3lyk"] @@ -14,29 +14,29 @@ corner_radius_bottom_left = 16 [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_3yp6e"] content_margin_right = 8.0 -[node name="Player" type="PanelContainer"] -offset_right = 40.0 +[node name="Player" type="PanelContainer" unique_id=141359444] +material = ExtResource("1_jy1rs") +offset_right = 98.0 offset_bottom = 40.0 -theme = ExtResource("1_flfqn") theme_override_styles/panel = SubResource("StyleBoxFlat_1227j") script = ExtResource("2_w3lyk") -[node name="MarginContainer" type="MarginContainer" parent="."] +[node name="MarginContainer" type="MarginContainer" parent="." unique_id=2016059636] layout_mode = 2 theme_override_constants/margin_left = 4 theme_override_constants/margin_top = 4 theme_override_constants/margin_right = 4 theme_override_constants/margin_bottom = 4 -[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer"] +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer" unique_id=1039786929] layout_mode = 2 -[node name="Icon" type="TextureRect" parent="MarginContainer/HBoxContainer"] +[node name="Icon" type="TextureRect" parent="MarginContainer/HBoxContainer" unique_id=1840719777] layout_mode = 2 texture = ExtResource("2_mnaqt") expand_mode = 2 -[node name="Label" type="Label" parent="MarginContainer/HBoxContainer"] +[node name="Label" type="Label" parent="MarginContainer/HBoxContainer" unique_id=895904561] layout_mode = 2 theme_override_styles/normal = SubResource("StyleBoxEmpty_3yp6e") text = "Player" diff --git a/client/gui/overlays/overlays.gd b/client/gui/overlays/overlays.gd index 9971ea53..fc24fb2d 100644 --- a/client/gui/overlays/overlays.gd +++ b/client/gui/overlays/overlays.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -17,7 +17,7 @@ extends Control class_name Overlays func _ready(): - Settings.hook_changed_init("ui.hide_overlays", "main", func (v): visible = not v) + Settings.hook_changed_init("ui.hide_overlays", self, func (v): visible = not v) func _input(_event): if Input.is_action_just_pressed("toggle_overlay"): diff --git a/client/gui/overlays/overlays.tscn b/client/gui/overlays/overlays.tscn index 93717736..158ec403 100644 --- a/client/gui/overlays/overlays.tscn +++ b/client/gui/overlays/overlays.tscn @@ -1,15 +1,14 @@ -[gd_scene load_steps=9 format=3 uid="uid://cr26jennm5c0c"] +[gd_scene format=3 uid="uid://cr26jennm5c0c"] [ext_resource type="Script" uid="uid://bkvtm1jlme6jf" path="res://gui/overlays/overlays.gd" id="1_dcvak"] [ext_resource type="PackedScene" uid="uid://xcxbmynn8mhi" path="res://gui/overlays/chat.tscn" id="1_n4uhr"] [ext_resource type="PackedScene" uid="uid://bpikve6wlsjfl" path="res://gui/overlays/score.tscn" id="2_whygm"] [ext_resource type="PackedScene" uid="uid://dcrr1rwdwbkq8" path="res://gui/overlays/pinned_messages.tscn" id="3_dcvak"] -[ext_resource type="PackedScene" uid="uid://bc50la65ntifb" path="res://gui/overlays/lobby/lobby.tscn" id="4_jwd7s"] [ext_resource type="PackedScene" uid="uid://c7pykhpdhgs64" path="res://gui/overlays/announce_title.tscn" id="5_whygm"] [ext_resource type="PackedScene" uid="uid://b21nrnkygiyjt" path="res://gui/overlays/popup_message/popup_message.tscn" id="7_jwd7s"] [ext_resource type="PackedScene" uid="uid://3lytexnfrub6" path="res://gui/overlays/debug/debug.tscn" id="8_8ouu3"] -[node name="Overlays" type="Control"] +[node name="Overlays" type="Control" unique_id=2071182967] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 @@ -18,19 +17,16 @@ grow_horizontal = 2 grow_vertical = 2 script = ExtResource("1_dcvak") -[node name="ChatPreview" parent="." instance=ExtResource("1_n4uhr")] +[node name="PinnedMessages" parent="." unique_id=1769024201 instance=ExtResource("3_dcvak")] layout_mode = 1 -[node name="Score" parent="." instance=ExtResource("2_whygm")] +[node name="Score" parent="." unique_id=2068981342 instance=ExtResource("2_whygm")] layout_mode = 1 -[node name="PinnedMessages" parent="." instance=ExtResource("3_dcvak")] +[node name="ChatPreview" parent="." unique_id=1306284704 instance=ExtResource("1_n4uhr")] layout_mode = 1 -[node name="Lobby" parent="." instance=ExtResource("4_jwd7s")] -layout_mode = 1 - -[node name="AnnounceTitle" parent="." instance=ExtResource("5_whygm")] +[node name="AnnounceTitle" parent="." unique_id=1456313117 instance=ExtResource("5_whygm")] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -38,8 +34,8 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -[node name="PopupMessage" parent="." instance=ExtResource("7_jwd7s")] +[node name="PopupMessage" parent="." unique_id=1024925196 instance=ExtResource("7_jwd7s")] layout_mode = 1 -[node name="Debug" parent="." instance=ExtResource("8_8ouu3")] +[node name="Debug" parent="." unique_id=2125601218 instance=ExtResource("8_8ouu3")] layout_mode = 1 diff --git a/client/gui/overlays/pinned_messages.gd b/client/gui/overlays/pinned_messages.gd index fe82f904..1cca455d 100644 --- a/client/gui/overlays/pinned_messages.gd +++ b/client/gui/overlays/pinned_messages.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/client/gui/overlays/pinned_messages.tscn b/client/gui/overlays/pinned_messages.tscn index 318c9b85..a09eddee 100644 --- a/client/gui/overlays/pinned_messages.tscn +++ b/client/gui/overlays/pinned_messages.tscn @@ -1,8 +1,8 @@ -[gd_scene load_steps=2 format=3 uid="uid://dcrr1rwdwbkq8"] +[gd_scene format=3 uid="uid://dcrr1rwdwbkq8"] [ext_resource type="Script" uid="uid://c0k6f1wkynbkd" path="res://gui/overlays/pinned_messages.gd" id="1_q0jkk"] -[node name="PinnedItemMessages" type="Control"] +[node name="PinnedItemMessages" type="Control" unique_id=1436447205] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 @@ -12,7 +12,7 @@ grow_vertical = 2 mouse_filter = 2 script = ExtResource("1_q0jkk") -[node name="HBoxContainer" type="HBoxContainer" parent="."] +[node name="HBoxContainer" type="HBoxContainer" parent="." unique_id=15845709] layout_direction = 2 layout_mode = 1 anchors_preset = 10 diff --git a/client/gui/overlays/popup_message/font_variation.tres b/client/gui/overlays/popup_message/font_variation.tres new file mode 100644 index 00000000..84254e1c --- /dev/null +++ b/client/gui/overlays/popup_message/font_variation.tres @@ -0,0 +1,10 @@ +[gd_resource type="FontVariation" format=3 uid="uid://c4g6ucr5piwy1"] + +[ext_resource type="FontFile" uid="uid://bk704sc5gkrb3" path="res://gui/resources/fonts/font-azaret-mono.woff2" id="1_gewoj"] + +[resource] +resource_local_to_scene = true +base_font = ExtResource("1_gewoj") +variation_opentype = { +2003265652: 400 +} diff --git a/client/gui/overlays/popup_message/popup_message.gd b/client/gui/overlays/popup_message/popup_message.gd index 4ea5aa2f..0fd88b78 100644 --- a/client/gui/overlays/popup_message/popup_message.gd +++ b/client/gui/overlays/popup_message/popup_message.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -22,17 +22,20 @@ var positional_messages = {} @onready var positional_messages_node: Control = $Positional @onready var server_msg = $Static/VBox/ServerMessage -@onready var server_msg_label: Label = $Static/VBox/ServerMessage/CenterContainer/Label +@onready var server_hint = $Static/VBox/ServerHint @onready var server_msg_timer: Timer = $ServerMessage @onready var game: Game = $"../../Game" # TODO func _process(_delta: float): for pos: Vector2 in positional_messages.keys(): + var camera: Camera3D = get_viewport().get_camera_3d() var msg: PositionalMessage = positional_messages[pos] var pos_3d = Vector3(pos.x + 0.5, 1.5, pos.y + 0.5) - var pos_2d = get_viewport().get_camera_3d().unproject_position(pos_3d) - + var pos_2d = camera.unproject_position(pos_3d) + var behind = camera.is_position_behind(pos_3d) + + msg.node_2d.visible = not behind msg.node_2d.position = pos_2d.clamp( Vector2.ZERO + 0.5 * msg.node.size, Vector2(get_viewport_rect().size) - 0.5 * msg.node.size @@ -42,17 +45,20 @@ func _process(_delta: float): msg.last_size = msg.node.size msg.node.position = -0.5 * msg.last_size -func display_server_msg(msg: String, auto_remove := true): +func display_server_hint(msg): + server_hint.show() + server_hint.set_text(msg) + +func display_server_msg(msg, auto_remove := true): server_msg.show() - server_msg_label.text = msg - + server_msg.set_text(msg) if auto_remove: server_msg_timer.start() func _on_server_timeout() -> void: clear_server_msg() -func display_server_msg_positional(text: String, pos: Vector2, use_monospace: bool): +func display_server_hint_positional(text, pos: Vector2, use_monospace: bool): var msg := PositionalMessage.new() msg.node = SERVER_MESSAGE_SCENE.instantiate() msg.node_2d = Node2D.new() @@ -63,10 +69,13 @@ func display_server_msg_positional(text: String, pos: Vector2, use_monospace: bo msg.position = pos positional_messages[pos] = msg -func clear_server_msg(position_ = null): +func clear_server_msg(): + server_msg_timer.stop() + server_msg.hide() + +func clear_server_hint(position_ = null): if position_ == null: - server_msg_timer.stop() - server_msg.hide() + server_hint.hide() else: if position_ in positional_messages: var msg: PositionalMessage = positional_messages[position_] diff --git a/client/gui/overlays/popup_message/popup_message.tscn b/client/gui/overlays/popup_message/popup_message.tscn index fab35e3e..dd6c1bc8 100644 --- a/client/gui/overlays/popup_message/popup_message.tscn +++ b/client/gui/overlays/popup_message/popup_message.tscn @@ -1,10 +1,9 @@ -[gd_scene load_steps=4 format=3 uid="uid://b21nrnkygiyjt"] +[gd_scene format=3 uid="uid://b21nrnkygiyjt"] -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://gui/resources/theme/theme.tres" id="1_a1566"] [ext_resource type="Script" uid="uid://c2cx41lrgf5b0" path="res://gui/overlays/popup_message/popup_message.gd" id="2_sbew6"] [ext_resource type="PackedScene" uid="uid://dq61p3a8og2b6" path="res://gui/overlays/popup_message/server_message.tscn" id="3_m3rok"] -[node name="PopupMessage" type="Control"] +[node name="PopupMessage" type="Control" unique_id=739397547] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 @@ -14,11 +13,11 @@ grow_vertical = 2 mouse_filter = 2 script = ExtResource("2_sbew6") -[node name="ServerMessage" type="Timer" parent="."] +[node name="ServerMessage" type="Timer" parent="." unique_id=265858330] wait_time = 5.0 one_shot = true -[node name="Static" type="MarginContainer" parent="."] +[node name="Static" type="MarginContainer" parent="." unique_id=138464647] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -26,17 +25,20 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 mouse_filter = 2 -theme = ExtResource("1_a1566") -[node name="VBox" type="VBoxContainer" parent="Static"] +[node name="VBox" type="VBoxContainer" parent="Static" unique_id=312654300] layout_mode = 2 mouse_filter = 2 -[node name="ServerMessage" parent="Static/VBox" instance=ExtResource("3_m3rok")] +[node name="ServerMessage" parent="Static/VBox" unique_id=337238699 instance=ExtResource("3_m3rok")] visible = false layout_mode = 2 -[node name="Positional" type="Control" parent="."] +[node name="ServerHint" parent="Static/VBox" unique_id=704424213 instance=ExtResource("3_m3rok")] +visible = false +layout_mode = 2 + +[node name="Positional" type="Control" parent="." unique_id=610159147] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 diff --git a/client/gui/overlays/popup_message/server_message.gd b/client/gui/overlays/popup_message/server_message.gd index a0688dc5..a17ff612 100644 --- a/client/gui/overlays/popup_message/server_message.gd +++ b/client/gui/overlays/popup_message/server_message.gd @@ -1,13 +1,69 @@ +# Hurry Curry! - a game about cooking +# Copyright (C) 2026 Hurry Curry! Contributors +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, version 3 of the License only. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. +# extends BlurSetup class_name ServerMessage const DEFAULT_FONT = preload("res://gui/resources/fonts/font-josefin-sans.woff2") const MONOSPACE_FONT = preload("res://gui/resources/fonts/font-azaret-mono.woff2") +const RENDERER = preload("res://gui/components/message/renderer.tscn") -@onready var label: Label = $CenterContainer/Label +@onready var flow: VFlowContainer = $CenterContainer/VFlowContainer -func set_text(text: String, use_monospace := true): - label.text = text - var font: FontVariation = label.get_theme_font("font") +func set_text(text, use_monospace := true): + for c: Node in flow.get_children(): + c.queue_free() + if text is String: + flow.add_child(build_label(text, use_monospace)) + elif text is Array: + for e: MessageParser in text: + var c: Control = build_message(e, use_monospace) + c.size_flags_horizontal = Control.SIZE_SHRINK_BEGIN + c.size_flags_vertical = Control.SIZE_EXPAND_FILL + flow.add_child(c) + +static func font_size(use_monospace: bool): + return 16 if use_monospace else 20 + +func build_label(text: String, use_monospace: bool) -> Label: + var label = Label.new() + var font: FontVariation = preload("res://gui/overlays/popup_message/font_variation.tres") + var sb := StyleBoxEmpty.new() font.base_font = MONOSPACE_FONT if use_monospace else DEFAULT_FONT - label.add_theme_font_size_override("font_size", 16 if use_monospace else 20) + label.add_theme_font_size_override("font_size", font_size(use_monospace)) + label.add_theme_font_override("font", font) + label.add_theme_color_override("font_color", Color.BLACK) + label.add_theme_stylebox_override("normal", sb) + label.autowrap_mode = TextServer.AUTOWRAP_OFF + label.text = text + label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER + label.update_minimum_size() + return label + +func build_message(m: MessageParser, use_monospace: bool) -> Control: + match m.kind: + MessageParser.Kind.ITEM: + var r: Renderer = RENDERER.instantiate() + r.get_node("SubViewport").size = Vector2i.ONE * font_size(use_monospace) * 2 + r.setup_item(m.result) + return r + MessageParser.Kind.TILE: + var r: Renderer = RENDERER.instantiate() + r.get_node("SubViewport").size = Vector2i.ONE * font_size(use_monospace) * 2 + r.setup_tile([m.result]) + return r + MessageParser.Kind.TEXT: + return build_label(m.result, use_monospace) + return null diff --git a/client/gui/overlays/popup_message/server_message.tscn b/client/gui/overlays/popup_message/server_message.tscn index 255c5e56..e64cad79 100644 --- a/client/gui/overlays/popup_message/server_message.tscn +++ b/client/gui/overlays/popup_message/server_message.tscn @@ -1,8 +1,7 @@ -[gd_scene load_steps=8 format=3 uid="uid://dq61p3a8og2b6"] +[gd_scene format=3 uid="uid://dq61p3a8og2b6"] [ext_resource type="Shader" uid="uid://cwldxegcj55if" path="res://gui/resources/shaders/blur_mix.gdshader" id="1_qv8ew"] [ext_resource type="Script" uid="uid://dfgwh7x7sqc21" path="res://gui/overlays/popup_message/server_message.gd" id="2_csqo8"] -[ext_resource type="FontFile" uid="uid://bk704sc5gkrb3" path="res://gui/resources/fonts/font-azaret-mono.woff2" id="3_dw20j"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_q3bbd"] shader = ExtResource("1_qv8ew") @@ -19,35 +18,27 @@ corner_radius_top_right = 16 corner_radius_bottom_right = 16 corner_radius_bottom_left = 16 -[sub_resource type="FontVariation" id="FontVariation_qfltj"] -resource_local_to_scene = true -base_font = ExtResource("3_dw20j") -variation_opentype = { -2003265652: 400 -} - -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_3rgop"] -content_margin_left = 32.0 -content_margin_top = 8.0 -content_margin_right = 32.0 -content_margin_bottom = 8.0 - -[node name="ServerMessage" type="PanelContainer"] +[node name="ServerMessage" type="PanelContainer" unique_id=241738499] material = SubResource("ShaderMaterial_q3bbd") +offset_right = 210.0 +offset_bottom = 35.0 size_flags_horizontal = 4 size_flags_vertical = 0 mouse_filter = 2 theme_override_styles/panel = SubResource("StyleBoxFlat_vq4dg") script = ExtResource("2_csqo8") -[node name="CenterContainer" type="CenterContainer" parent="."] +[node name="CenterContainer" type="MarginContainer" parent="." unique_id=1965686626] layout_mode = 2 mouse_filter = 2 +theme_override_constants/margin_left = 32 +theme_override_constants/margin_top = 8 +theme_override_constants/margin_right = 32 +theme_override_constants/margin_bottom = 8 -[node name="Label" type="Label" parent="CenterContainer"] +[node name="VFlowContainer" type="VFlowContainer" parent="CenterContainer" unique_id=1522041734] +layout_direction = 1 layout_mode = 2 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_fonts/font = SubResource("FontVariation_qfltj") -theme_override_font_sizes/font_size = 16 -theme_override_styles/normal = SubResource("StyleBoxEmpty_3rgop") -text = "Server message" +theme_override_constants/h_separation = 0 +theme_override_constants/v_separation = 0 +last_wrap_alignment = 2 diff --git a/client/gui/overlays/score.gd b/client/gui/overlays/score.gd index f66ae559..a5207746 100644 --- a/client/gui/overlays/score.gd +++ b/client/gui/overlays/score.gd @@ -1,5 +1,5 @@ # Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors +# Copyright (C) 2026 Hurry Curry! Contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/client/gui/overlays/score.tscn b/client/gui/overlays/score.tscn index fcdfb514..db3e8723 100644 --- a/client/gui/overlays/score.tscn +++ b/client/gui/overlays/score.tscn @@ -1,6 +1,5 @@ -[gd_scene load_steps=6 format=3 uid="uid://bpikve6wlsjfl"] +[gd_scene format=3 uid="uid://bpikve6wlsjfl"] -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://gui/resources/theme/theme.tres" id="1_4kujw"] [ext_resource type="Script" uid="uid://mcgg3q0l03dx" path="res://gui/overlays/score.gd" id="2_kbjds"] [ext_resource type="Texture2D" uid="uid://chxkwohi56cxx" path="res://gui/resources/shaders/paper.tres" id="3_oum5g"] [ext_resource type="FontFile" uid="uid://bo4vh5xkpvrh1" path="res://gui/resources/fonts/font-sansita-swashed.woff2" id="3_u54fv"] @@ -8,7 +7,7 @@ [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_04ujj"] bg_color = Color(0, 0, 0, 0) -[node name="ScoreOverlay" type="PanelContainer"] +[node name="ScoreOverlay" type="PanelContainer" unique_id=1846677990] layout_direction = 2 anchors_preset = 15 anchor_right = 1.0 @@ -16,22 +15,21 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 mouse_filter = 2 -theme = ExtResource("1_4kujw") theme_override_styles/panel = SubResource("StyleBoxFlat_04ujj") script = ExtResource("2_kbjds") -[node name="GameTime" type="Timer" parent="."] +[node name="GameTime" type="Timer" parent="." unique_id=210885742] wait_time = 30.0 -[node name="WarningTime" type="Timer" parent="."] +[node name="WarningTime" type="Timer" parent="." unique_id=2123014988] one_shot = true -[node name="Score" type="Control" parent="."] +[node name="Score" type="Control" parent="." unique_id=2011529559] layout_mode = 2 size_flags_horizontal = 8 size_flags_vertical = 0 -[node name="Paper" type="TextureRect" parent="Score"] +[node name="Paper" type="TextureRect" parent="Score" unique_id=1153834916] layout_mode = 1 anchors_preset = 8 anchor_left = 0.5 @@ -47,7 +45,7 @@ grow_vertical = 2 rotation = 0.0610865 texture = ExtResource("3_oum5g") -[node name="Margin" type="MarginContainer" parent="Score/Paper"] +[node name="Margin" type="MarginContainer" parent="Score/Paper" unique_id=1572878834] layout_mode = 1 anchors_preset = 2 anchor_top = 1.0 @@ -58,27 +56,27 @@ grow_vertical = 0 theme_override_constants/margin_left = 10 theme_override_constants/margin_bottom = 10 -[node name="Lines" type="VBoxContainer" parent="Score/Paper/Margin"] +[node name="Lines" type="VBoxContainer" parent="Score/Paper/Margin" unique_id=837263051] layout_direction = 1 layout_mode = 2 size_flags_horizontal = 0 size_flags_vertical = 8 -[node name="Line1" type="HBoxContainer" parent="Score/Paper/Margin/Lines"] +[node name="Line1" type="HBoxContainer" parent="Score/Paper/Margin/Lines" unique_id=994156258] layout_mode = 2 -[node name="Label" type="Label" parent="Score/Paper/Margin/Lines/Line1"] +[node name="Label" type="Label" parent="Score/Paper/Margin/Lines/Line1" unique_id=1286515503] layout_mode = 2 theme_override_colors/font_color = Color(0, 0, 0, 1) theme_override_fonts/font = ExtResource("3_u54fv") theme_override_font_sizes/font_size = 25 -text = "c.score.completed" +text = "c.score.demands_completed" -[node name="Spacer" type="Control" parent="Score/Paper/Margin/Lines/Line1"] +[node name="Spacer" type="Control" parent="Score/Paper/Margin/Lines/Line1" unique_id=1404497590] layout_mode = 2 size_flags_horizontal = 3 -[node name="Completed" type="Label" parent="Score/Paper/Margin/Lines/Line1"] +[node name="Completed" type="Label" parent="Score/Paper/Margin/Lines/Line1" unique_id=1103013403] auto_translate_mode = 2 custom_minimum_size = Vector2(100, 0) layout_mode = 2 @@ -88,21 +86,21 @@ theme_override_font_sizes/font_size = 35 text = "0" horizontal_alignment = 1 -[node name="Line2" type="HBoxContainer" parent="Score/Paper/Margin/Lines"] +[node name="Line2" type="HBoxContainer" parent="Score/Paper/Margin/Lines" unique_id=1837168386] layout_mode = 2 -[node name="Label" type="Label" parent="Score/Paper/Margin/Lines/Line2"] +[node name="Label" type="Label" parent="Score/Paper/Margin/Lines/Line2" unique_id=655498209] layout_mode = 2 theme_override_colors/font_color = Color(0, 0, 0, 1) theme_override_fonts/font = ExtResource("3_u54fv") theme_override_font_sizes/font_size = 25 -text = "c.score.failed" +text = "c.score.demands_failed" -[node name="Spacer" type="Control" parent="Score/Paper/Margin/Lines/Line2"] +[node name="Spacer" type="Control" parent="Score/Paper/Margin/Lines/Line2" unique_id=1118920525] layout_mode = 2 size_flags_horizontal = 3 -[node name="Failed" type="Label" parent="Score/Paper/Margin/Lines/Line2"] +[node name="Failed" type="Label" parent="Score/Paper/Margin/Lines/Line2" unique_id=820452433] auto_translate_mode = 2 custom_minimum_size = Vector2(100, 0) layout_mode = 2 @@ -112,21 +110,21 @@ theme_override_font_sizes/font_size = 35 text = "0" horizontal_alignment = 1 -[node name="Line3" type="HBoxContainer" parent="Score/Paper/Margin/Lines"] +[node name="Line3" type="HBoxContainer" parent="Score/Paper/Margin/Lines" unique_id=395828137] layout_mode = 2 -[node name="Label" type="Label" parent="Score/Paper/Margin/Lines/Line3"] +[node name="Label" type="Label" parent="Score/Paper/Margin/Lines/Line3" unique_id=692176995] layout_mode = 2 theme_override_colors/font_color = Color(0, 0, 0, 1) theme_override_fonts/font = ExtResource("3_u54fv") theme_override_font_sizes/font_size = 35 text = "c.score.points" -[node name="Spacer" type="Control" parent="Score/Paper/Margin/Lines/Line3"] +[node name="Spacer" type="Control" parent="Score/Paper/Margin/Lines/Line3" unique_id=1198568818] layout_mode = 2 size_flags_horizontal = 3 -[node name="Points" type="Label" parent="Score/Paper/Margin/Lines/Line3"] +[node name="Points" type="Label" parent="Score/Paper/Margin/Lines/Line3" unique_id=1181984380] auto_translate_mode = 2 custom_minimum_size = Vector2(100, 0) layout_mode = 2 @@ -136,12 +134,12 @@ theme_override_font_sizes/font_size = 45 text = "0" horizontal_alignment = 1 -[node name="Time" type="Control" parent="."] +[node name="Time" type="Control" parent="." unique_id=374078299] layout_mode = 2 size_flags_horizontal = 8 size_flags_vertical = 8 -[node name="Paper" type="TextureRect" parent="Time"] +[node name="Paper" type="TextureRect" parent="Time" unique_id=594422819] layout_mode = 1 anchors_preset = 8 anchor_left = 0.5 @@ -157,17 +155,17 @@ grow_vertical = 2 rotation = 0.0610865 texture = ExtResource("3_oum5g") -[node name="Node2D" type="Node2D" parent="Time/Paper"] +[node name="Node2D" type="Node2D" parent="Time/Paper" unique_id=1716596348] position = Vector2(95, 30) -[node name="Line" type="HBoxContainer" parent="Time/Paper/Node2D"] +[node name="Line" type="HBoxContainer" parent="Time/Paper/Node2D" unique_id=1351708448] anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -[node name="Minutes" type="Label" parent="Time/Paper/Node2D/Line"] +[node name="Minutes" type="Label" parent="Time/Paper/Node2D/Line" unique_id=1901555605] auto_translate_mode = 2 layout_mode = 2 theme_override_colors/font_color = Color(0, 0, 0, 1) @@ -176,7 +174,7 @@ theme_override_font_sizes/font_size = 45 text = "05" horizontal_alignment = 2 -[node name="Colon" type="Label" parent="Time/Paper/Node2D/Line"] +[node name="Colon" type="Label" parent="Time/Paper/Node2D/Line" unique_id=2075984843] auto_translate_mode = 2 layout_mode = 2 theme_override_colors/font_color = Color(0, 0, 0, 1) @@ -185,7 +183,7 @@ theme_override_font_sizes/font_size = 45 text = ":" horizontal_alignment = 1 -[node name="Seconds" type="Label" parent="Time/Paper/Node2D/Line"] +[node name="Seconds" type="Label" parent="Time/Paper/Node2D/Line" unique_id=1543571528] auto_translate_mode = 2 layout_mode = 2 theme_override_colors/font_color = Color(0, 0, 0, 1) @@ -193,7 +191,7 @@ theme_override_fonts/font = ExtResource("3_u54fv") theme_override_font_sizes/font_size = 45 text = "00" -[node name="PulsatingTime" type="Timer" parent="Time/Paper/Node2D/Line"] +[node name="PulsatingTime" type="Timer" parent="Time/Paper/Node2D/Line" unique_id=660955497] wait_time = 0.5 [connection signal="timeout" from="WarningTime" to="." method="_on_warning_time_timeout"] diff --git a/client/gui/resources/fonts/sansita-swashed-bold.tres b/client/gui/resources/fonts/sansita-swashed-bold.tres index 17903145..d0bb5003 100644 --- a/client/gui/resources/fonts/sansita-swashed-bold.tres +++ b/client/gui/resources/fonts/sansita-swashed-bold.tres @@ -1,4 +1,4 @@ -[gd_resource type="FontVariation" load_steps=2 format=3 uid="uid://cl6m4hqsnrpav"] +[gd_resource type="FontVariation" format=3 uid="uid://cl6m4hqsnrpav"] [ext_resource type="FontFile" uid="uid://bo4vh5xkpvrh1" path="res://gui/resources/fonts/font-sansita-swashed.woff2" id="1_x5a5j"] diff --git a/client/gui/resources/materials/blur_material.tres b/client/gui/resources/materials/blur_material.tres index b6ebf183..2ebc3385 100644 --- a/client/gui/resources/materials/blur_material.tres +++ b/client/gui/resources/materials/blur_material.tres @@ -1,4 +1,4 @@ -[gd_resource type="ShaderMaterial" load_steps=2 format=3 uid="uid://2j8a0c0a2ta5"] +[gd_resource type="ShaderMaterial" format=3 uid="uid://2j8a0c0a2ta5"] [ext_resource type="Shader" uid="uid://cwldxegcj55if" path="res://gui/resources/shaders/blur_mix.gdshader" id="1_d16rd"] diff --git a/client/gui/resources/materials/dark_blur_material.tres b/client/gui/resources/materials/dark_blur_material.tres index 9a59c614..e6a74077 100644 --- a/client/gui/resources/materials/dark_blur_material.tres +++ b/client/gui/resources/materials/dark_blur_material.tres @@ -1,11 +1,11 @@ -[gd_resource type="ShaderMaterial" load_steps=2 format=3 uid="uid://beea1pc5nt67r"] +[gd_resource type="ShaderMaterial" format=3 uid="uid://beea1pc5nt67r"] [ext_resource type="Shader" uid="uid://cwldxegcj55if" path="res://gui/resources/shaders/blur_mix.gdshader" id="1_cynu0"] [resource] shader = ExtResource("1_cynu0") shader_parameter/blur_amount = 3.5 -shader_parameter/mix_amount = 0.5 +shader_parameter/mix_amount = 0.6 shader_parameter/mix_amount_no_blur = 0.7 shader_parameter/color_over = Color(0, 0, 0, 1) shader_parameter/enable_blur = false diff --git a/client/gui/resources/materials/grayscale_material.tres b/client/gui/resources/materials/grayscale_material.tres index 236ad443..819894b8 100644 --- a/client/gui/resources/materials/grayscale_material.tres +++ b/client/gui/resources/materials/grayscale_material.tres @@ -1,4 +1,4 @@ -[gd_resource type="ShaderMaterial" load_steps=2 format=3 uid="uid://bplhkekj6rebp"] +[gd_resource type="ShaderMaterial" format=3 uid="uid://bplhkekj6rebp"] [ext_resource type="Shader" uid="uid://qjrh2imc53u1" path="res://gui/resources/shaders/grayscale.gdshader" id="1_u0c2c"] diff --git a/client/gui/resources/materials/printed_material.tres b/client/gui/resources/materials/printed_material.tres index 3cc4a88c..1648e6cc 100644 --- a/client/gui/resources/materials/printed_material.tres +++ b/client/gui/resources/materials/printed_material.tres @@ -1,4 +1,4 @@ -[gd_resource type="ShaderMaterial" load_steps=2 format=3 uid="uid://dogdyoqrmy6ft"] +[gd_resource type="ShaderMaterial" format=3 uid="uid://dogdyoqrmy6ft"] [ext_resource type="Shader" uid="uid://5p1xlwoc8qe5" path="res://gui/resources/shaders/printed.gdshader" id="1_sevww"] diff --git a/client/gui/resources/shaders/blur_mix.gdshader b/client/gui/resources/shaders/blur_mix.gdshader index 97686a54..fc29603f 100644 --- a/client/gui/resources/shaders/blur_mix.gdshader +++ b/client/gui/resources/shaders/blur_mix.gdshader @@ -1,6 +1,6 @@ /* Hurry Curry! - a game about cooking - Copyright (C) 2025 Hurry Curry! Contributors + Copyright (C) 2026 Hurry Curry! Contributors This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by @@ -27,6 +27,7 @@ uniform bool enable_blur; void fragment() { if (enable_blur) { vec4 blurred = textureLod(SCREEN_TEXTURE, SCREEN_UV, blur_amount); + blurred.a = 1.; COLOR = mix(blurred, color_over, mix_amount); } else { COLOR = mix(texture(SCREEN_TEXTURE, SCREEN_UV), color_over, mix_amount_no_blur); diff --git a/client/gui/resources/shaders/clouds_canvas_item.gdshader b/client/gui/resources/shaders/clouds_canvas_item.gdshader new file mode 100644 index 00000000..b5868b74 --- /dev/null +++ b/client/gui/resources/shaders/clouds_canvas_item.gdshader @@ -0,0 +1,35 @@ +/* + Hurry Curry! - a game about cooking + Copyright (C) 2026 Hurry Curry! Contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, version 3 of the License only. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. + +*/ +shader_type canvas_item; + +uniform sampler2D noise : source_color, repeat_enable; +uniform vec4 ccloud : source_color; +uniform vec4 csky : source_color; + +void fragment() { + vec2 uv = UV * 0.9; + uv += TIME * vec2(0.01,0.02); + + float f = texture(noise, uv).x; + f = 1. - f; + f = pow(f, 1.5); + f = floor(f*5.)/5.; + f = pow(f, 2.); + + COLOR = mix(csky, ccloud, f); +} diff --git a/client/gui/resources/shaders/clouds_canvas_item.gdshader.uid b/client/gui/resources/shaders/clouds_canvas_item.gdshader.uid new file mode 100644 index 00000000..1b5ea7f0 --- /dev/null +++ b/client/gui/resources/shaders/clouds_canvas_item.gdshader.uid @@ -0,0 +1 @@ +uid://b7p7umdb51hhn diff --git a/client/gui/resources/shaders/grayscale.gdshader b/client/gui/resources/shaders/grayscale.gdshader index c058e7bf..61ae539c 100644 --- a/client/gui/resources/shaders/grayscale.gdshader +++ b/client/gui/resources/shaders/grayscale.gdshader @@ -1,6 +1,6 @@ /* Hurry Curry! - a game about cooking - Copyright (C) 2025 Hurry Curry! Contributors + Copyright (C) 2026 Hurry Curry! Contributors This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by diff --git a/client/gui/resources/shaders/paper.tres b/client/gui/resources/shaders/paper.tres index f99aec03..c2102a14 100644 --- a/client/gui/resources/shaders/paper.tres +++ b/client/gui/resources/shaders/paper.tres @@ -1,4 +1,4 @@ -[gd_resource type="NoiseTexture2D" load_steps=3 format=3 uid="uid://chxkwohi56cxx"] +[gd_resource type="NoiseTexture2D" format=3 uid="uid://chxkwohi56cxx"] [sub_resource type="Gradient" id="Gradient_pkrjd"] colors = PackedColorArray(0.917969, 0.866454, 0.770122, 1, 0.832031, 0.781817, 0.666307, 1) diff --git a/client/gui/resources/shaders/printed.gdshader b/client/gui/resources/shaders/printed.gdshader index c24cb679..adcabb7b 100644 --- a/client/gui/resources/shaders/printed.gdshader +++ b/client/gui/resources/shaders/printed.gdshader @@ -1,6 +1,6 @@ /* Hurry Curry! - a game about cooking - Copyright (C) 2025 Hurry Curry! Contributors + Copyright (C) 2026 Hurry Curry! Contributors This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by diff --git a/client/gui/resources/style/error_focus_style.tres b/client/gui/resources/style/error_focus_style.tres index f7c44505..c1472895 100644 --- a/client/gui/resources/style/error_focus_style.tres +++ b/client/gui/resources/style/error_focus_style.tres @@ -5,13 +5,13 @@ content_margin_left = 10.0 content_margin_top = 10.0 content_margin_right = 10.0 content_margin_bottom = 10.0 -bg_color = Color(1, 0, 0, 0.12549) +bg_color = Color(0.36078432, 0, 0, 0) border_width_left = 2 border_width_top = 2 border_width_right = 2 border_width_bottom = 2 border_color = Color(1, 0.81804, 0.818076, 1) -corner_radius_top_left = 5 -corner_radius_top_right = 5 -corner_radius_bottom_right = 5 -corner_radius_bottom_left = 5 +corner_radius_top_left = 8 +corner_radius_top_right = 8 +corner_radius_bottom_right = 8 +corner_radius_bottom_left = 8 diff --git a/client/gui/resources/style/error_normal_style.tres b/client/gui/resources/style/error_normal_style.tres new file mode 100644 index 00000000..a22ca2ee --- /dev/null +++ b/client/gui/resources/style/error_normal_style.tres @@ -0,0 +1,13 @@ +[gd_resource type="StyleBoxFlat" format=3 uid="uid://c7jksrejojryo"] + +[resource] +content_margin_left = 10.0 +content_margin_top = 10.0 +content_margin_right = 10.0 +content_margin_bottom = 10.0 +bg_color = Color(0.36078432, 0, 0, 0.2509804) +border_color = Color(1, 0.81804, 0.818076, 1) +corner_radius_top_left = 8 +corner_radius_top_right = 8 +corner_radius_bottom_right = 8 +corner_radius_bottom_left = 8 diff --git a/client/gui/resources/style/focus_style.tres b/client/gui/resources/style/focus_style.tres index a01843fe..a8169f9d 100644 --- a/client/gui/resources/style/focus_style.tres +++ b/client/gui/resources/style/focus_style.tres @@ -5,13 +5,13 @@ 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) +bg_color = Color(0.03137255, 0.03137255, 0.03137255, 0) 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 +corner_radius_top_left = 8 +corner_radius_top_right = 8 +corner_radius_bottom_right = 8 +corner_radius_bottom_left = 8 diff --git a/client/gui/resources/style/hover_style.tres b/client/gui/resources/style/hover_style.tres index 963ee2ca..2d65f39a 100644 --- a/client/gui/resources/style/hover_style.tres +++ b/client/gui/resources/style/hover_style.tres @@ -5,8 +5,8 @@ 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 +bg_color = Color(1, 1, 1, 0.1254902) +corner_radius_top_left = 8 +corner_radius_top_right = 8 +corner_radius_bottom_right = 8 +corner_radius_bottom_left = 8 diff --git a/client/gui/resources/style/normal_style.tres b/client/gui/resources/style/normal_style.tres index 96aecc8e..3d1da731 100644 --- a/client/gui/resources/style/normal_style.tres +++ b/client/gui/resources/style/normal_style.tres @@ -5,8 +5,8 @@ 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 +bg_color = Color(0.03137255, 0.03137255, 0.03137255, 0.2509804) +corner_radius_top_left = 8 +corner_radius_top_right = 8 +corner_radius_bottom_right = 8 +corner_radius_bottom_left = 8 diff --git a/client/gui/resources/style/panel_button_backround_style.tres b/client/gui/resources/style/panel_button_backround_style.tres new file mode 100644 index 00000000..6b27ca1e --- /dev/null +++ b/client/gui/resources/style/panel_button_backround_style.tres @@ -0,0 +1,8 @@ +[gd_resource type="StyleBoxFlat" format=3 uid="uid://d1xhwgrptnlli"] + +[resource] +bg_color = Color(0, 0, 0, 0.6) +corner_radius_top_left = 8 +corner_radius_top_right = 8 +corner_radius_bottom_right = 8 +corner_radius_bottom_left = 8 diff --git a/client/gui/resources/style/panel_style.tres b/client/gui/resources/style/panel_style.tres index d1f27667..f12ec8bf 100644 --- a/client/gui/resources/style/panel_style.tres +++ b/client/gui/resources/style/panel_style.tres @@ -2,7 +2,7 @@ [resource] bg_color = Color(0, 0, 0, 0.6) -corner_radius_top_left = 8 -corner_radius_top_right = 8 -corner_radius_bottom_right = 8 -corner_radius_bottom_left = 8 +corner_radius_top_left = 16 +corner_radius_top_right = 16 +corner_radius_bottom_right = 16 +corner_radius_bottom_left = 16 diff --git a/client/gui/resources/style/paper_panel_style.tres b/client/gui/resources/style/paper_panel_style.tres index effa2310..4336d5b1 100644 --- a/client/gui/resources/style/paper_panel_style.tres +++ b/client/gui/resources/style/paper_panel_style.tres @@ -1,4 +1,4 @@ -[gd_resource type="StyleBoxTexture" load_steps=2 format=3 uid="uid://bqhs5wtdp2oax"] +[gd_resource type="StyleBoxTexture" format=3 uid="uid://bqhs5wtdp2oax"] [ext_resource type="Texture2D" uid="uid://chxkwohi56cxx" path="res://gui/resources/shaders/paper.tres" id="1_u1kqj"] diff --git a/client/gui/resources/style/lobby_panel_override.tres b/client/gui/resources/style/square_panel_override.tres index 04fd16b0..04fd16b0 100644 --- a/client/gui/resources/style/lobby_panel_override.tres +++ b/client/gui/resources/style/square_panel_override.tres diff --git a/client/gui/resources/theme/theme.tres b/client/gui/resources/theme/default.tres index ca87a81c..2b3344b1 100644 --- a/client/gui/resources/theme/theme.tres +++ b/client/gui/resources/theme/default.tres @@ -1,4 +1,4 @@ -[gd_resource type="Theme" load_steps=12 format=3 uid="uid://b0qmvo504e457"] +[gd_resource type="Theme" format=3 uid="uid://b0qmvo504e457"] [ext_resource type="FontFile" uid="uid://5ixo6b3bd3km" path="res://gui/resources/fonts/font-josefin-sans.woff2" id="1_f8qb0"] [ext_resource type="StyleBox" uid="uid://b86kbd3pfkd5w" path="res://gui/resources/style/focus_style.tres" id="1_x88rs"] @@ -32,7 +32,9 @@ variation_embolden = 0.7 [sub_resource type="FontVariation" id="FontVariation_lyo8w"] base_font = ExtResource("1_f8qb0") -variation_embolden = 1.25 +variation_opentype = { +2003265652: 500 +} spacing_top = 5 [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_or5ri"] @@ -55,7 +57,7 @@ CheckButton/styles/pressed = ExtResource("2_8fwoi") HSeparator/styles/separator = SubResource("StyleBoxLine_emtvk") Label/font_sizes/font_size = 16 LineEdit/styles/focus = ExtResource("1_x88rs") -LineEdit/styles/normal = SubResource("StyleBoxFlat_25x32") +LineEdit/styles/normal = ExtResource("2_8fwoi") LineEdit/styles/read_only = SubResource("StyleBoxFlat_25x32") MarginContainer/constants/margin_bottom = 32 MarginContainer/constants/margin_left = 32 diff --git a/client/gui/resources/theme/paper.tres b/client/gui/resources/theme/paper.tres index 41417f39..480f6f46 100644 --- a/client/gui/resources/theme/paper.tres +++ b/client/gui/resources/theme/paper.tres @@ -1,4 +1,4 @@ -[gd_resource type="Theme" load_steps=17 format=3 uid="uid://ci2qajdoa1an1"] +[gd_resource type="Theme" format=3 uid="uid://ci2qajdoa1an1"] [ext_resource type="FontFile" uid="uid://bo4vh5xkpvrh1" path="res://gui/resources/fonts/font-sansita-swashed.woff2" id="1_koj1m"] [ext_resource type="FontFile" uid="uid://5ixo6b3bd3km" path="res://gui/resources/fonts/font-josefin-sans.woff2" id="1_tc8bk"] |