diff options
Diffstat (limited to 'client/gui/menus')
76 files changed, 1602 insertions, 646 deletions
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 |