From 69cce2c92e067595d862c479104df6e966a1e8ee Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 1 Jul 2024 15:46:13 +0200 Subject: refactor menu system yet again --- client/menu/character.gd | 76 ++++++++ client/menu/character.tscn | 159 ++++++++++++++++ client/menu/character_menu.gd | 77 -------- client/menu/character_menu.tscn | 159 ---------------- client/menu/credits.gd | 60 +++++++ client/menu/credits.tscn | 58 ++++++ client/menu/credits_menu.gd | 60 ------- client/menu/credits_menu.tscn | 58 ------ client/menu/entry.gd | 29 +++ client/menu/entry.tscn | 12 ++ client/menu/error.gd | 8 + client/menu/error.tscn | 66 +++++++ client/menu/error_menu.gd | 8 - client/menu/error_menu.tscn | 66 ------- client/menu/game.gd | 8 + client/menu/game.tscn | 16 ++ client/menu/ingame.gd | 35 ++++ client/menu/ingame.tscn | 129 +++++++++++++ client/menu/ingame_menu.gd | 27 --- client/menu/ingame_menu.tscn | 118 ------------ client/menu/main.gd | 100 +++++++++++ client/menu/main.tscn | 117 ++++++++++++ client/menu/main_menu.gd | 98 ---------- client/menu/main_menu.tscn | 114 ------------ client/menu/menu.gd | 89 +++++++++ client/menu/menu.tscn | 8 + client/menu/menu_manager.gd | 68 ------- client/menu/menu_manager.tscn | 34 ---- client/menu/scene_transition.gd | 58 ++---- client/menu/scene_transition.tscn | 59 ++---- client/menu/settings.gd | 56 ++++++ client/menu/settings.tscn | 64 +++++++ client/menu/settings_menu.gd | 59 ------ client/menu/settings_menu.tscn | 64 ------- client/menu/setup.gd | 49 +++++ client/menu/setup.tscn | 369 ++++++++++++++++++++++++++++++++++++++ client/menu/setup_menu.gd | 49 ----- client/menu/setup_menu.tscn | 369 -------------------------------------- 38 files changed, 1543 insertions(+), 1510 deletions(-) create mode 100644 client/menu/character.gd create mode 100644 client/menu/character.tscn delete mode 100644 client/menu/character_menu.gd delete mode 100644 client/menu/character_menu.tscn create mode 100644 client/menu/credits.gd create mode 100644 client/menu/credits.tscn delete mode 100644 client/menu/credits_menu.gd delete mode 100644 client/menu/credits_menu.tscn create mode 100644 client/menu/entry.gd create mode 100644 client/menu/entry.tscn create mode 100644 client/menu/error.gd create mode 100644 client/menu/error.tscn delete mode 100644 client/menu/error_menu.gd delete mode 100644 client/menu/error_menu.tscn create mode 100644 client/menu/game.gd create mode 100644 client/menu/game.tscn create mode 100644 client/menu/ingame.gd create mode 100644 client/menu/ingame.tscn delete mode 100644 client/menu/ingame_menu.gd delete mode 100644 client/menu/ingame_menu.tscn create mode 100644 client/menu/main.gd create mode 100644 client/menu/main.tscn delete mode 100644 client/menu/main_menu.gd delete mode 100644 client/menu/main_menu.tscn create mode 100644 client/menu/menu.gd create mode 100644 client/menu/menu.tscn delete mode 100644 client/menu/menu_manager.gd delete mode 100644 client/menu/menu_manager.tscn create mode 100644 client/menu/settings.gd create mode 100644 client/menu/settings.tscn delete mode 100644 client/menu/settings_menu.gd delete mode 100644 client/menu/settings_menu.tscn create mode 100644 client/menu/setup.gd create mode 100644 client/menu/setup.tscn delete mode 100644 client/menu/setup_menu.gd delete mode 100644 client/menu/setup_menu.tscn (limited to 'client/menu') diff --git a/client/menu/character.gd b/client/menu/character.gd new file mode 100644 index 00000000..b6999acd --- /dev/null +++ b/client/menu/character.gd @@ -0,0 +1,76 @@ +# Undercooked - a game about cooking +# Copyright 2024 metamuffin +# +# 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 . +# +extends Menu + +@onready var character: Character = $Node3D/Character +@onready var num_hairstyles := character.hairstyles.keys().size() +@onready var back_button := $VBoxContainer/bottom_panel/back +@onready var map: Map = $Node3D/Map +@onready var username_edit = $VBoxContainer/top_panel/a/username + +func _ready(): + super() + $VBoxContainer/top_panel/a/username.text = Global.profile["username"] + character.select_hairstyle(Global.profile["character"]) + init_map() + +func init_map(): + var map_tile = func (t): match t: + ".": return "floor" + "=": return "counter" + "s": return "stove" + "c": return "chair" + "t": return "table" + "o": return "oven" + "#": return "wall" + _: push_error("unknown tile: ", t) + var tiles = [ + "...............", + "###############", + "=oo==ss===.ctc#", + "..............#", + ".............=#", + ".............=#", + ".............=#" + ].map(func (l): return Array(l.split("")).map(map_tile)) + var gt = func (e): return null if e[1] >= tiles.size() else null if e[0] >= tiles[e[1]].size() else tiles[e[1]][e[0]] + var co = Vector2i(floor(tiles[0].size() / 2), floor(tiles.size() - 2)) + for y in tiles.size(): + for x in tiles[y].size(): + map.set_tile(Vector2i(x,y) - co, gt.call([x,y]), [[x,y-1],[x-1,y],[x,y+1],[x+1,y]].map(gt)) + +func _input(_event): + if Input.is_action_just_pressed("ui_cancel"): + _on_back_pressed() + +func _on_back_pressed(): + if username_edit.text == "": + OS.alert("Username cannot be empty.") + return + + Global.profile["username"] = username_edit.text + Global.save_profile() + replace_menu("res://menu/main.tscn") + +func _on_character_back_pressed(): + Global.profile["character"] = (Global.profile["character"] - 1) % num_hairstyles + character.select_hairstyle(Global.profile["character"]) + Global.save_profile() + +func _on_character_forward_pressed(): + Global.profile["character"] = (Global.profile["character"] + 1) % num_hairstyles + character.select_hairstyle(Global.profile["character"]) + Global.save_profile() diff --git a/client/menu/character.tscn b/client/menu/character.tscn new file mode 100644 index 00000000..891b5842 --- /dev/null +++ b/client/menu/character.tscn @@ -0,0 +1,159 @@ +[gd_scene load_steps=11 format=3 uid="uid://1f7xpirm5d28"] + +[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme.tres" id="1_ak2pw"] +[ext_resource type="Script" path="res://menu/character.gd" id="1_brhd1"] +[ext_resource type="PackedScene" uid="uid://b4gone8fu53r7" path="res://map/map.tscn" id="3_6mc88"] +[ext_resource type="PackedScene" uid="uid://b3hhir2fvnunu" path="res://player/character/character.tscn" id="3_odq7n"] +[ext_resource type="PackedScene" uid="uid://bg2d78ycorcqk" path="res://menu/scene_transition.tscn" id="4_c0ocf"] +[ext_resource type="Texture2D" uid="uid://35rd5gamtyqm" path="res://menu/arrow.svg" id="5_kvd7k"] +[ext_resource type="Texture2D" uid="uid://j75dbytlbju" path="res://menu/arrow_pressed.svg" id="5_xpff8"] +[ext_resource type="Texture2D" uid="uid://b33qmctbpf48g" path="res://menu/arrow_hover.svg" id="6_soj8g"] +[ext_resource type="Texture2D" uid="uid://by3qsrpxnfq4w" path="res://menu/arrow_focus.svg" id="6_u31hl"] + +[sub_resource type="Environment" id="Environment_ex25y"] +background_mode = 1 +background_color = Color(0.145548, 0.151043, 0.207031, 1) + +[node name="CharacterMenu" type="Control"] +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="WorldEnvironment" type="WorldEnvironment" parent="Node3D"] +environment = SubResource("Environment_ex25y") + +[node name="Camera3D" type="Camera3D" parent="Node3D"] +transform = Transform3D(1, 0, 0, 0, 0.977046, 0.21303, 0, -0.21303, 0.977046, 0, 1.137, 2.703) +current = true +fov = 41.8 + +[node name="Map" parent="Node3D" instance=ExtResource("3_6mc88")] +transform = Transform3D(0.866025, 0, 0.5, 0, 1, 0, -0.5, 0, 0.866025, 0, 0, 0) + +[node name="Character" parent="Node3D" instance=ExtResource("3_odq7n")] + +[node name="SpotLight3D" type="SpotLight3D" parent="Node3D"] +transform = Transform3D(0.631535, -0.571246, 0.524254, 0.0428654, 0.700843, 0.712026, -0.774162, -0.427197, 0.467093, 1.79161, 3.07541, 1.58055) +light_energy = 2.689 +spot_range = 20.159 +spot_angle = 17.9256 + +[node name="SpotLight3D2" type="SpotLight3D" parent="Node3D"] +transform = Transform3D(0.32457, 0.109091, -0.93955, 0.0604837, 0.9889, 0.135716, 0.943926, -0.100877, 0.314369, -5.22608, 2.10824, 2.35824) +light_energy = 2.689 +spot_range = 20.159 +spot_angle = 17.9256 + +[node name="SpotLight3D3" type="SpotLight3D" parent="Node3D"] +transform = Transform3D(0.114088, -0.0173997, 0.993318, 0.0610452, 0.99808, 0.0104718, -0.991594, 0.0594426, 0.114931, 8.10732, 0.437069, 2.35824) +light_energy = 2.689 +spot_range = 20.159 +spot_angle = 17.9256 + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="top_panel" type="Panel" parent="VBoxContainer"] +custom_minimum_size = Vector2(0, 100) +layout_mode = 2 + +[node name="a" type="VBoxContainer" parent="VBoxContainer/top_panel"] +layout_mode = 1 +anchors_preset = 5 +anchor_left = 0.5 +anchor_right = 0.5 +offset_left = -213.0 +offset_top = 13.0 +offset_right = 216.0 +offset_bottom = 110.0 +grow_horizontal = 2 + +[node name="Label" type="Label" parent="VBoxContainer/top_panel/a"] +layout_mode = 2 +text = "Username" +horizontal_alignment = 1 + +[node name="username" type="LineEdit" parent="VBoxContainer/top_panel/a"] +layout_mode = 2 +max_length = 16 + +[node name="Spacer" type="MarginContainer" parent="VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 +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="VBoxContainer/Spacer"] +layout_mode = 2 +alignment = 1 + +[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/Spacer/VBoxContainer"] +layout_mode = 2 +alignment = 1 + +[node name="Back" type="TextureButton" parent="VBoxContainer/Spacer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +focus_neighbor_right = NodePath("../Forward") +texture_normal = ExtResource("5_kvd7k") +texture_pressed = ExtResource("5_xpff8") +texture_hover = ExtResource("6_soj8g") +texture_focused = ExtResource("6_u31hl") +flip_h = true + +[node name="Spacer" type="Control" parent="VBoxContainer/Spacer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="Forward" type="TextureButton" parent="VBoxContainer/Spacer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +focus_neighbor_left = NodePath("../Back") +texture_normal = ExtResource("5_kvd7k") +texture_pressed = ExtResource("5_xpff8") +texture_hover = ExtResource("6_soj8g") +texture_focused = ExtResource("6_u31hl") + +[node name="bottom_panel" type="Panel" parent="VBoxContainer"] +custom_minimum_size = Vector2(0, 75) +layout_mode = 2 + +[node name="back" type="Button" parent="VBoxContainer/bottom_panel"] +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -39.5 +offset_top = -22.0 +offset_right = 39.5 +offset_bottom = 22.0 +grow_horizontal = 2 +grow_vertical = 2 +size_flags_vertical = 8 +text = "Back" + +[node name="SceneTransition" parent="." instance=ExtResource("4_c0ocf")] +visible = false +layout_mode = 1 + +[connection signal="focus_entered" from="VBoxContainer/Spacer/VBoxContainer/HBoxContainer/Back" to="." method="_on_back_focus_entered"] +[connection signal="focus_exited" from="VBoxContainer/Spacer/VBoxContainer/HBoxContainer/Back" to="." method="_on_back_focus_exited"] +[connection signal="pressed" from="VBoxContainer/Spacer/VBoxContainer/HBoxContainer/Back" to="." method="_on_character_back_pressed"] +[connection signal="focus_entered" from="VBoxContainer/Spacer/VBoxContainer/HBoxContainer/Forward" to="." method="_on_forward_focus_entered"] +[connection signal="focus_exited" from="VBoxContainer/Spacer/VBoxContainer/HBoxContainer/Forward" to="." method="_on_forward_focus_exited"] +[connection signal="pressed" from="VBoxContainer/Spacer/VBoxContainer/HBoxContainer/Forward" to="." method="_on_character_forward_pressed"] +[connection signal="pressed" from="VBoxContainer/bottom_panel/back" to="." method="_on_back_pressed"] diff --git a/client/menu/character_menu.gd b/client/menu/character_menu.gd deleted file mode 100644 index 8c42a404..00000000 --- a/client/menu/character_menu.gd +++ /dev/null @@ -1,77 +0,0 @@ -# Undercooked - a game about cooking -# Copyright 2024 metamuffin -# -# 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 . -# -extends Control - -@onready var character: Character = $Node3D/Character -@onready var num_hairstyles := character.hairstyles.keys().size() -@onready var back_button := $VBoxContainer/bottom_panel/back -@onready var map: Map = $Node3D/Map -@onready var username_edit = $VBoxContainer/top_panel/a/username - -func _ready(): - $VBoxContainer/top_panel/a/username.text = Global.profile["username"] - character.select_hairstyle(Global.profile["character"]) - Global.focus_first_button(self) - init_map() - -func init_map(): - var map_tile = func (t): match t: - ".": return "floor" - "=": return "counter" - "s": return "stove" - "c": return "chair" - "t": return "table" - "o": return "oven" - "#": return "wall" - _: push_error("unknown tile: ", t) - var tiles = [ - "...............", - "###############", - "=oo==ss===.ctc#", - "..............#", - ".............=#", - ".............=#", - ".............=#" - ].map(func (l): return Array(l.split("")).map(map_tile)) - var gt = func (e): return null if e[1] >= tiles.size() else null if e[0] >= tiles[e[1]].size() else tiles[e[1]][e[0]] - var co = Vector2i(floor(tiles[0].size() / 2), floor(tiles.size() - 2)) - for y in tiles.size(): - for x in tiles[y].size(): - map.set_tile(Vector2i(x,y) - co, gt.call([x,y]), [[x,y-1],[x-1,y],[x,y+1],[x+1,y]].map(gt)) - -func _input(_event): - if Input.is_action_just_pressed("ui_cancel"): - _on_back_pressed() - -func _on_back_pressed(): - if username_edit.text == "": - OS.alert("Username cannot be empty.") - return - - Global.profile["username"] = username_edit.text - Global.save_profile() - Global.fade_next = true - $SceneTransition.transition_to("res://menu/menu_manager.tscn") - -func _on_character_back_pressed(): - Global.profile["character"] = (Global.profile["character"] - 1) % num_hairstyles - character.select_hairstyle(Global.profile["character"]) - Global.save_profile() - -func _on_character_forward_pressed(): - Global.profile["character"] = (Global.profile["character"] + 1) % num_hairstyles - character.select_hairstyle(Global.profile["character"]) - Global.save_profile() diff --git a/client/menu/character_menu.tscn b/client/menu/character_menu.tscn deleted file mode 100644 index 4c38ffaf..00000000 --- a/client/menu/character_menu.tscn +++ /dev/null @@ -1,159 +0,0 @@ -[gd_scene load_steps=11 format=3 uid="uid://1f7xpirm5d28"] - -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme.tres" id="1_ak2pw"] -[ext_resource type="Script" path="res://menu/character_menu.gd" id="1_brhd1"] -[ext_resource type="PackedScene" uid="uid://b4gone8fu53r7" path="res://map/map.tscn" id="3_6mc88"] -[ext_resource type="PackedScene" uid="uid://b3hhir2fvnunu" path="res://player/character/character.tscn" id="3_odq7n"] -[ext_resource type="PackedScene" uid="uid://bg2d78ycorcqk" path="res://menu/scene_transition.tscn" id="4_c0ocf"] -[ext_resource type="Texture2D" uid="uid://35rd5gamtyqm" path="res://menu/arrow.svg" id="5_kvd7k"] -[ext_resource type="Texture2D" uid="uid://j75dbytlbju" path="res://menu/arrow_pressed.svg" id="5_xpff8"] -[ext_resource type="Texture2D" uid="uid://b33qmctbpf48g" path="res://menu/arrow_hover.svg" id="6_soj8g"] -[ext_resource type="Texture2D" uid="uid://by3qsrpxnfq4w" path="res://menu/arrow_focus.svg" id="6_u31hl"] - -[sub_resource type="Environment" id="Environment_ex25y"] -background_mode = 1 -background_color = Color(0.145548, 0.151043, 0.207031, 1) - -[node name="CharacterMenu" type="Control"] -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="WorldEnvironment" type="WorldEnvironment" parent="Node3D"] -environment = SubResource("Environment_ex25y") - -[node name="Camera3D" type="Camera3D" parent="Node3D"] -transform = Transform3D(1, 0, 0, 0, 0.977046, 0.21303, 0, -0.21303, 0.977046, 0, 1.137, 2.703) -current = true -fov = 41.8 - -[node name="Map" parent="Node3D" instance=ExtResource("3_6mc88")] -transform = Transform3D(0.866025, 0, 0.5, 0, 1, 0, -0.5, 0, 0.866025, 0, 0, 0) - -[node name="Character" parent="Node3D" instance=ExtResource("3_odq7n")] - -[node name="SpotLight3D" type="SpotLight3D" parent="Node3D"] -transform = Transform3D(0.631535, -0.571246, 0.524254, 0.0428654, 0.700843, 0.712026, -0.774162, -0.427197, 0.467093, 1.79161, 3.07541, 1.58055) -light_energy = 2.689 -spot_range = 20.159 -spot_angle = 17.9256 - -[node name="SpotLight3D2" type="SpotLight3D" parent="Node3D"] -transform = Transform3D(0.32457, 0.109091, -0.93955, 0.0604837, 0.9889, 0.135716, 0.943926, -0.100877, 0.314369, -5.22608, 2.10824, 2.35824) -light_energy = 2.689 -spot_range = 20.159 -spot_angle = 17.9256 - -[node name="SpotLight3D3" type="SpotLight3D" parent="Node3D"] -transform = Transform3D(0.114088, -0.0173997, 0.993318, 0.0610452, 0.99808, 0.0104718, -0.991594, 0.0594426, 0.114931, 8.10732, 0.437069, 2.35824) -light_energy = 2.689 -spot_range = 20.159 -spot_angle = 17.9256 - -[node name="VBoxContainer" type="VBoxContainer" parent="."] -layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 - -[node name="top_panel" type="Panel" parent="VBoxContainer"] -custom_minimum_size = Vector2(0, 100) -layout_mode = 2 - -[node name="a" type="VBoxContainer" parent="VBoxContainer/top_panel"] -layout_mode = 1 -anchors_preset = 5 -anchor_left = 0.5 -anchor_right = 0.5 -offset_left = -213.0 -offset_top = 13.0 -offset_right = 216.0 -offset_bottom = 110.0 -grow_horizontal = 2 - -[node name="Label" type="Label" parent="VBoxContainer/top_panel/a"] -layout_mode = 2 -text = "Username" -horizontal_alignment = 1 - -[node name="username" type="LineEdit" parent="VBoxContainer/top_panel/a"] -layout_mode = 2 -max_length = 16 - -[node name="Spacer" type="MarginContainer" parent="VBoxContainer"] -layout_mode = 2 -size_flags_vertical = 3 -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="VBoxContainer/Spacer"] -layout_mode = 2 -alignment = 1 - -[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/Spacer/VBoxContainer"] -layout_mode = 2 -alignment = 1 - -[node name="Back" type="TextureButton" parent="VBoxContainer/Spacer/VBoxContainer/HBoxContainer"] -layout_mode = 2 -focus_neighbor_right = NodePath("../Forward") -texture_normal = ExtResource("5_kvd7k") -texture_pressed = ExtResource("5_xpff8") -texture_hover = ExtResource("6_soj8g") -texture_focused = ExtResource("6_u31hl") -flip_h = true - -[node name="Spacer" type="Control" parent="VBoxContainer/Spacer/VBoxContainer/HBoxContainer"] -layout_mode = 2 -size_flags_horizontal = 3 - -[node name="Forward" type="TextureButton" parent="VBoxContainer/Spacer/VBoxContainer/HBoxContainer"] -layout_mode = 2 -focus_neighbor_left = NodePath("../Back") -texture_normal = ExtResource("5_kvd7k") -texture_pressed = ExtResource("5_xpff8") -texture_hover = ExtResource("6_soj8g") -texture_focused = ExtResource("6_u31hl") - -[node name="bottom_panel" type="Panel" parent="VBoxContainer"] -custom_minimum_size = Vector2(0, 75) -layout_mode = 2 - -[node name="back" type="Button" parent="VBoxContainer/bottom_panel"] -layout_mode = 1 -anchors_preset = 8 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -offset_left = -39.5 -offset_top = -22.0 -offset_right = 39.5 -offset_bottom = 22.0 -grow_horizontal = 2 -grow_vertical = 2 -size_flags_vertical = 8 -text = "Back" - -[node name="SceneTransition" parent="." instance=ExtResource("4_c0ocf")] -visible = false -layout_mode = 1 - -[connection signal="focus_entered" from="VBoxContainer/Spacer/VBoxContainer/HBoxContainer/Back" to="." method="_on_back_focus_entered"] -[connection signal="focus_exited" from="VBoxContainer/Spacer/VBoxContainer/HBoxContainer/Back" to="." method="_on_back_focus_exited"] -[connection signal="pressed" from="VBoxContainer/Spacer/VBoxContainer/HBoxContainer/Back" to="." method="_on_character_back_pressed"] -[connection signal="focus_entered" from="VBoxContainer/Spacer/VBoxContainer/HBoxContainer/Forward" to="." method="_on_forward_focus_entered"] -[connection signal="focus_exited" from="VBoxContainer/Spacer/VBoxContainer/HBoxContainer/Forward" to="." method="_on_forward_focus_exited"] -[connection signal="pressed" from="VBoxContainer/Spacer/VBoxContainer/HBoxContainer/Forward" to="." method="_on_character_forward_pressed"] -[connection signal="pressed" from="VBoxContainer/bottom_panel/back" to="." method="_on_back_pressed"] diff --git a/client/menu/credits.gd b/client/menu/credits.gd new file mode 100644 index 00000000..0ab94fd5 --- /dev/null +++ b/client/menu/credits.gd @@ -0,0 +1,60 @@ +# Undercooked - a game about cooking +# Copyright 2024 metamuffin +# +# 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 . +# +extends Menu + +var contributors := ["sofviic", "metamuffin", "nokoe", "tpart"] +var cc_0 := ["kenney.nl", "Kay Lousberg"] +var cc_by_3 := { + "Glasses": "Jeremy Edelblut" +} +var cc_by_4 := { + "Universal UI/Menu Soundpack": "Ellr", + "Pencil, Writing, Close, A.wav": "InspectorJ", + "Page_Turn_24.wav": "Koops" +} + +@onready var label = $MarginContainer/Panel/MarginContainer/VBoxContainer/RichTextLabel + +func _ready(): + super() + contributors.shuffle() + label.text = "[center][b]" + label.text += tr("undercooked - a game about cooking") + label.text += "[/b]\n\n" + label.text += tr("developed by") + label.text += "\n\n[b]" + label.text += ", ".join(contributors) + label.text += "[/b]\n\n" + + for k in cc_by_3.keys(): + var v = cc_by_3[k] + label.text += "[b]\"%s\" by %s[/b]\n" % [k, v] + label.text += tr("Licensed under Creative Commons: By Attribution 3.0 License") + label.text += "\nhttps://creativecommons.org/licenses/by/3.0/\n\n" + + for k in cc_by_4.keys(): + var v = cc_by_4[k] + label.text += "[b]\"%s\" by %s[/b]\n" % [k, v] + label.text += tr("Licensed under Creative Commons: By Attribution 4.0 License") + label.text += "\nhttps://creativecommons.org/licenses/by/4.0/\n\n" + + label.text += "[b]" + label.text += tr("Additional CC0 assets by:") + label.text += "[/b]\n" + label.text += "\n".join(cc_0) + +func _on_back_pressed(): + exit() diff --git a/client/menu/credits.tscn b/client/menu/credits.tscn new file mode 100644 index 00000000..ff44627a --- /dev/null +++ b/client/menu/credits.tscn @@ -0,0 +1,58 @@ +[gd_scene load_steps=4 format=3 uid="uid://7mqbxa054bjv"] + +[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme.tres" id="1_16kk6"] +[ext_resource type="Script" path="res://menu/credits.gd" id="2_alvab"] +[ext_resource type="Material" uid="uid://beea1pc5nt67r" path="res://menu/theme/dark_blur_material.tres" id="3_nwoiv"] + +[node name="CreditsMenu" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme = ExtResource("1_16kk6") +script = ExtResource("2_alvab") + +[node name="MarginContainer" type="MarginContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Panel" type="Panel" parent="MarginContainer"] +material = ExtResource("3_nwoiv") +layout_mode = 2 + +[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/Panel"] +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="MarginContainer/Panel/MarginContainer"] +layout_mode = 2 + +[node name="RichTextLabel" type="RichTextLabel" parent="MarginContainer/Panel/MarginContainer/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 +theme_override_font_sizes/normal_font_size = 22 +theme_override_font_sizes/bold_font_size = 22 +theme_override_font_sizes/italics_font_size = 22 +theme_override_font_sizes/bold_italics_font_size = 22 +theme_override_font_sizes/mono_font_size = 22 +bbcode_enabled = true + +[node name="back" type="Button" parent="MarginContainer/Panel/MarginContainer/VBoxContainer"] +layout_mode = 2 +text = "Back" + +[connection signal="pressed" from="MarginContainer/Panel/MarginContainer/VBoxContainer/back" to="." method="_on_back_pressed"] diff --git a/client/menu/credits_menu.gd b/client/menu/credits_menu.gd deleted file mode 100644 index 59e7bab9..00000000 --- a/client/menu/credits_menu.gd +++ /dev/null @@ -1,60 +0,0 @@ -# Undercooked - a game about cooking -# Copyright 2024 metamuffin -# -# 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 . -# -extends Control - -var contributors := ["sofviic", "metamuffin", "nokoe", "tpart"] -var cc_0 := ["kenney.nl", "Kay Lousberg"] -var cc_by_3 := { - "Glasses": "Jeremy Edelblut" -} -var cc_by_4 := { - "Universal UI/Menu Soundpack": "Ellr", - "Pencil, Writing, Close, A.wav": "InspectorJ", - "Page_Turn_24.wav": "Koops" -} - -@onready var menu_manager: MenuManager = get_parent() -@onready var label = $MarginContainer/Panel/MarginContainer/VBoxContainer/RichTextLabel - -func prepare(): - contributors.shuffle() - label.text = "[center][b]" - label.text += tr("undercooked - a game about cooking") - label.text += "[/b]\n\n" - label.text += tr("developed by") - label.text += "\n\n[b]" - label.text += ", ".join(contributors) - label.text += "[/b]\n\n" - - for k in cc_by_3.keys(): - var v = cc_by_3[k] - label.text += "[b]\"%s\" by %s[/b]\n" % [k, v] - label.text += tr("Licensed under Creative Commons: By Attribution 3.0 License") - label.text += "\nhttps://creativecommons.org/licenses/by/3.0/\n\n" - - for k in cc_by_4.keys(): - var v = cc_by_4[k] - label.text += "[b]\"%s\" by %s[/b]\n" % [k, v] - label.text += tr("Licensed under Creative Commons: By Attribution 4.0 License") - label.text += "\nhttps://creativecommons.org/licenses/by/4.0/\n\n" - - label.text += "[b]" - label.text += tr("Additional CC0 assets by:") - label.text += "[/b]\n" - label.text += "\n".join(cc_0) - -func _on_back_pressed(): - menu_manager.go_back() diff --git a/client/menu/credits_menu.tscn b/client/menu/credits_menu.tscn deleted file mode 100644 index 04797e0d..00000000 --- a/client/menu/credits_menu.tscn +++ /dev/null @@ -1,58 +0,0 @@ -[gd_scene load_steps=4 format=3 uid="uid://7mqbxa054bjv"] - -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme.tres" id="1_emk5o"] -[ext_resource type="Script" path="res://menu/credits_menu.gd" id="1_igs63"] -[ext_resource type="Material" uid="uid://beea1pc5nt67r" path="res://menu/theme/dark_blur_material.tres" id="3_d30oq"] - -[node name="CreditsMenu" type="Control"] -layout_mode = 3 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -theme = ExtResource("1_emk5o") -script = ExtResource("1_igs63") - -[node name="MarginContainer" type="MarginContainer" parent="."] -layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 - -[node name="Panel" type="Panel" parent="MarginContainer"] -material = ExtResource("3_d30oq") -layout_mode = 2 - -[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/Panel"] -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="MarginContainer/Panel/MarginContainer"] -layout_mode = 2 - -[node name="RichTextLabel" type="RichTextLabel" parent="MarginContainer/Panel/MarginContainer/VBoxContainer"] -layout_mode = 2 -size_flags_vertical = 3 -theme_override_font_sizes/normal_font_size = 22 -theme_override_font_sizes/bold_font_size = 22 -theme_override_font_sizes/italics_font_size = 22 -theme_override_font_sizes/bold_italics_font_size = 22 -theme_override_font_sizes/mono_font_size = 22 -bbcode_enabled = true - -[node name="back" type="Button" parent="MarginContainer/Panel/MarginContainer/VBoxContainer"] -layout_mode = 2 -text = "Back" - -[connection signal="pressed" from="MarginContainer/Panel/MarginContainer/VBoxContainer/back" to="." method="_on_back_pressed"] diff --git a/client/menu/entry.gd b/client/menu/entry.gd new file mode 100644 index 00000000..b1620df9 --- /dev/null +++ b/client/menu/entry.gd @@ -0,0 +1,29 @@ +# Undercooked - a game about cooking +# Copyright 2024 metamuffin +# Copyright 2024 tpart +# +# 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 . +# +extends Menu +class_name MenuManager + +func _ready(): + super() + if not Global.get_setting("setup_complete"): + await submenu("res://menu/setup.tscn") + else: + await submenu("res://menu/main.tscn") + get_tree().quit() + +func quit(): + pass diff --git a/client/menu/entry.tscn b/client/menu/entry.tscn new file mode 100644 index 00000000..85b16fbf --- /dev/null +++ b/client/menu/entry.tscn @@ -0,0 +1,12 @@ +[gd_scene load_steps=2 format=3 uid="uid://cd52sr1cmo8oj"] + +[ext_resource type="Script" path="res://menu/entry.gd" id="1_kibw2"] + +[node name="MenuManager" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_kibw2") diff --git a/client/menu/error.gd b/client/menu/error.gd new file mode 100644 index 00000000..84b2e56e --- /dev/null +++ b/client/menu/error.gd @@ -0,0 +1,8 @@ +extends Menu + +func _ready(): + super() + $Panel/contents/mesage.text = Global.error_message + +func _on_return_pressed(): + replace_menu("res://menu/main.tscn") diff --git a/client/menu/error.tscn b/client/menu/error.tscn new file mode 100644 index 00000000..d1bf034d --- /dev/null +++ b/client/menu/error.tscn @@ -0,0 +1,66 @@ +[gd_scene load_steps=5 format=3 uid="uid://cimgn07lbcs4v"] + +[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme.tres" id="1_cabdu"] +[ext_resource type="PackedScene" uid="uid://l4vm07dtda4j" path="res://menu/menu_background.tscn" id="2_5fxol"] +[ext_resource type="Script" path="res://menu/error.gd" id="2_dbe41"] +[ext_resource type="PackedScene" uid="uid://bg2d78ycorcqk" path="res://menu/scene_transition.tscn" id="4_1nbt3"] + +[node name="ErrorMenu" type="Control"] +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="Panel" type="Panel" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="contents" type="VBoxContainer" parent="Panel"] +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -176.5 +offset_top = -49.5 +offset_right = 176.5 +offset_bottom = 49.5 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="title" type="Label" parent="Panel/contents"] +layout_mode = 2 +theme_override_font_sizes/font_size = 61 +text = "Error" +horizontal_alignment = 1 + +[node name="mesage" type="Label" parent="Panel/contents"] +layout_mode = 2 +theme_override_font_sizes/font_size = 24 +text = "This should be the error message." + +[node name="Control" type="Control" parent="Panel/contents"] +custom_minimum_size = Vector2(0, 15.805) +layout_mode = 2 + +[node name="return" type="Button" parent="Panel/contents"] +layout_mode = 2 +size_flags_horizontal = 4 +text = "Return to Main Menu" + +[node name="SceneTransition" parent="." instance=ExtResource("4_1nbt3")] +visible = false +layout_mode = 1 + +[connection signal="pressed" from="Panel/contents/return" to="." method="_on_return_pressed"] diff --git a/client/menu/error_menu.gd b/client/menu/error_menu.gd deleted file mode 100644 index 087261e5..00000000 --- a/client/menu/error_menu.gd +++ /dev/null @@ -1,8 +0,0 @@ -extends Control - -func _ready(): - Global.focus_first_button(self) - $Panel/contents/mesage.text = Global.error_message - -func _on_return_pressed(): - $SceneTransition.transition_to("res://menu/menu_manager.tscn") diff --git a/client/menu/error_menu.tscn b/client/menu/error_menu.tscn deleted file mode 100644 index ea01ddc3..00000000 --- a/client/menu/error_menu.tscn +++ /dev/null @@ -1,66 +0,0 @@ -[gd_scene load_steps=5 format=3 uid="uid://cimgn07lbcs4v"] - -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme.tres" id="1_cabdu"] -[ext_resource type="PackedScene" uid="uid://l4vm07dtda4j" path="res://menu/menu_background.tscn" id="2_5fxol"] -[ext_resource type="Script" path="res://menu/error_menu.gd" id="2_dbe41"] -[ext_resource type="PackedScene" uid="uid://bg2d78ycorcqk" path="res://menu/scene_transition.tscn" id="4_1nbt3"] - -[node name="ErrorMenu" type="Control"] -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="Panel" type="Panel" parent="."] -layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 - -[node name="contents" type="VBoxContainer" parent="Panel"] -layout_mode = 1 -anchors_preset = 8 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -offset_left = -176.5 -offset_top = -49.5 -offset_right = 176.5 -offset_bottom = 49.5 -grow_horizontal = 2 -grow_vertical = 2 - -[node name="title" type="Label" parent="Panel/contents"] -layout_mode = 2 -theme_override_font_sizes/font_size = 61 -text = "Error" -horizontal_alignment = 1 - -[node name="mesage" type="Label" parent="Panel/contents"] -layout_mode = 2 -theme_override_font_sizes/font_size = 24 -text = "This should be the error message." - -[node name="Control" type="Control" parent="Panel/contents"] -custom_minimum_size = Vector2(0, 15.805) -layout_mode = 2 - -[node name="return" type="Button" parent="Panel/contents"] -layout_mode = 2 -size_flags_horizontal = 4 -text = "Return to Main Menu" - -[node name="SceneTransition" parent="." instance=ExtResource("4_1nbt3")] -visible = false -layout_mode = 1 - -[connection signal="pressed" from="Panel/contents/return" to="." method="_on_return_pressed"] diff --git a/client/menu/game.gd b/client/menu/game.gd new file mode 100644 index 00000000..ae44957a --- /dev/null +++ b/client/menu/game.gd @@ -0,0 +1,8 @@ +extends Menu + +func _ready(): + super() + +func _input(_event): + if Input.is_action_just_pressed("pause"): + submenu("res://menu/ingame.tscn") diff --git a/client/menu/game.tscn b/client/menu/game.tscn new file mode 100644 index 00000000..708adf74 --- /dev/null +++ b/client/menu/game.tscn @@ -0,0 +1,16 @@ +[gd_scene load_steps=3 format=3 uid="uid://bbjwoxs71fnsk"] + +[ext_resource type="Script" path="res://menu/game.gd" id="1_cdpsh"] +[ext_resource type="PackedScene" uid="uid://c6krh36hoqfg8" path="res://game.tscn" id="2_uojcy"] + +[node name="GameMenu" 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_cdpsh") +auto_anim = false + +[node name="Game" parent="." instance=ExtResource("2_uojcy")] diff --git a/client/menu/ingame.gd b/client/menu/ingame.gd new file mode 100644 index 00000000..306b15b2 --- /dev/null +++ b/client/menu/ingame.gd @@ -0,0 +1,35 @@ +extends Menu + +@onready var anim = $AnimationPlayer +@onready var options = $Side/Margin/Options + +func _ready(): + super() + +func anim_setup(): pass +func menu_anim_open(): + print("ingame open") + anim.play("activate") + await anim.animation_finished +func menu_anim_exit(): + print("ingame exit") + anim.play_backwards("activate") + await anim.animation_finished + +func _on_resume_pressed(): + exit() + +func _on_main_menu_pressed(): + parent_menu.replace_menu("res://menu/main.tscn") + +func _on_settings_pressed(): + submenu("res://menu/settings.tscn") + +func _on_reconnect_pressed(): + parent_menu.replace_menu("res://menu/game.tscn") + +func _on_quit_pressed(): + quit() + +func _input(event): + if Input.is_action_just_pressed("pause"): exit() diff --git a/client/menu/ingame.tscn b/client/menu/ingame.tscn new file mode 100644 index 00000000..f704f348 --- /dev/null +++ b/client/menu/ingame.tscn @@ -0,0 +1,129 @@ +[gd_scene load_steps=10 format=3 uid="uid://lxlgtjm8hw7v"] + +[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme.tres" id="1_2vmyh"] +[ext_resource type="Script" path="res://menu/ingame.gd" id="2_0h3no"] +[ext_resource type="Shader" path="res://menu/blur_mix.gdshader" id="3_f6s5h"] +[ext_resource type="FontFile" uid="uid://bo4vh5xkpvrh1" path="res://menu/theme/font-sansita-swashed.woff2" id="4_scupw"] + +[sub_resource type="Animation" id="Animation_8sedy"] +length = 0.001 +tracks/0/type = "bezier" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Side:position:x") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"handle_modes": PackedInt32Array(0), +"points": PackedFloat32Array(-400, -0.25, 0, 0.25, 0), +"times": PackedFloat32Array(0) +} + +[sub_resource type="Animation" id="Animation_660jl"] +resource_name = "activate" +tracks/0/type = "bezier" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Side:position:x") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"handle_modes": PackedInt32Array(0, 0), +"points": PackedFloat32Array(-400, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0), +"times": PackedFloat32Array(0, 1) +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_u0kyp"] +_data = { +"RESET": SubResource("Animation_8sedy"), +"activate": SubResource("Animation_660jl") +} + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_o2vtr"] +shader = ExtResource("3_f6s5h") +shader_parameter/blur_amount = 3.5 +shader_parameter/mix_amount = 0.3 +shader_parameter/color_over = null + +[sub_resource type="FontVariation" id="FontVariation_ud3l8"] +base_font = ExtResource("4_scupw") +variation_embolden = 0.5 + +[node name="IngameMenu" type="Control"] +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") +} +speed_scale = 8.0 + +[node name="Side" type="PanelContainer" parent="."] +material = SubResource("ShaderMaterial_o2vtr") +layout_mode = 1 +anchors_preset = 9 +anchor_bottom = 1.0 +offset_left = -400.0 +offset_right = -90.0 +grow_vertical = 2 + +[node name="Margin" type="MarginContainer" parent="Side"] +layout_mode = 2 +theme_override_constants/margin_left = 20 +theme_override_constants/margin_top = 20 +theme_override_constants/margin_right = 20 +theme_override_constants/margin_bottom = 20 + +[node name="Options" type="VBoxContainer" parent="Side/Margin"] +layout_mode = 2 + +[node name="Title" type="Label" parent="Side/Margin/Options"] +layout_mode = 2 +auto_translate = false +theme_override_colors/font_outline_color = Color(0.566408, 0.208917, 0.266045, 1) +theme_override_constants/outline_size = 10 +theme_override_fonts/font = SubResource("FontVariation_ud3l8") +theme_override_font_sizes/font_size = 48 +text = "Undercooked" + +[node name="Spacer" type="Control" parent="Side/Margin/Options"] +custom_minimum_size = Vector2(0, 10) +layout_mode = 2 + +[node name="Resume" type="Button" parent="Side/Margin/Options"] +layout_mode = 2 +text = "Resume" +alignment = 0 + +[node name="Reconnect" type="Button" parent="Side/Margin/Options"] +layout_mode = 2 +text = "Reconnect" +alignment = 0 + +[node name="Settings" type="Button" parent="Side/Margin/Options"] +layout_mode = 2 +text = "Settings" +alignment = 0 + +[node name="MainMenu" type="Button" parent="Side/Margin/Options"] +layout_mode = 2 +text = "Main menu" +alignment = 0 + +[node name="Quit" type="Button" parent="Side/Margin/Options"] +layout_mode = 2 +text = "Quit game" +alignment = 0 + +[connection signal="pressed" from="Side/Margin/Options/Resume" to="." method="_on_resume_pressed"] +[connection signal="pressed" from="Side/Margin/Options/Reconnect" to="." method="_on_reconnect_pressed"] +[connection signal="pressed" from="Side/Margin/Options/Settings" to="." method="_on_settings_pressed"] +[connection signal="pressed" from="Side/Margin/Options/MainMenu" to="." method="_on_main_menu_pressed"] +[connection signal="pressed" from="Side/Margin/Options/Quit" to="." method="_on_quit_pressed"] diff --git a/client/menu/ingame_menu.gd b/client/menu/ingame_menu.gd deleted file mode 100644 index 6fa83a55..00000000 --- a/client/menu/ingame_menu.gd +++ /dev/null @@ -1,27 +0,0 @@ -extends Control - -@onready var anim = $AnimationPlayer -@onready var options = $Side/Margin/Options - -func _ready(): - Global.connect_button_sounds(self) - -func act(): - show() - anim.play("activate") - Global.focus_first_button(options) - -func deact(): - anim.play_backwards("activate") - await anim.animation_finished - hide() - -func _on_main_menu_pressed(): - Global.fade_next = true - get_parent().transition_to("res://menu/menu_manager.tscn") - -func _on_quit_pressed(): - get_parent().quit() - -func _on_reconnect_pressed(): - get_parent().transition_to("res://game.tscn") diff --git a/client/menu/ingame_menu.tscn b/client/menu/ingame_menu.tscn deleted file mode 100644 index 1e9a2f46..00000000 --- a/client/menu/ingame_menu.tscn +++ /dev/null @@ -1,118 +0,0 @@ -[gd_scene load_steps=10 format=3 uid="uid://lxlgtjm8hw7v"] - -[ext_resource type="Script" path="res://menu/ingame_menu.gd" id="1_gd1i3"] -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme.tres" id="1_lb056"] -[ext_resource type="Shader" path="res://menu/blur_mix.gdshader" id="1_o42mc"] -[ext_resource type="FontFile" uid="uid://bo4vh5xkpvrh1" path="res://menu/theme/font-sansita-swashed.woff2" id="4_27kbu"] - -[sub_resource type="Animation" id="Animation_8sedy"] -length = 0.001 -tracks/0/type = "bezier" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("Side:position:x") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"handle_modes": PackedInt32Array(0), -"points": PackedFloat32Array(-400, -0.25, 0, 0.25, 0), -"times": PackedFloat32Array(0) -} - -[sub_resource type="Animation" id="Animation_660jl"] -resource_name = "activate" -tracks/0/type = "bezier" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("Side:position:x") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"handle_modes": PackedInt32Array(0, 0), -"points": PackedFloat32Array(-400, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0), -"times": PackedFloat32Array(0, 1) -} - -[sub_resource type="AnimationLibrary" id="AnimationLibrary_u0kyp"] -_data = { -"RESET": SubResource("Animation_8sedy"), -"activate": SubResource("Animation_660jl") -} - -[sub_resource type="ShaderMaterial" id="ShaderMaterial_o2vtr"] -shader = ExtResource("1_o42mc") -shader_parameter/blur_amount = 3.5 -shader_parameter/mix_amount = 0.3 -shader_parameter/color_over = null - -[sub_resource type="FontVariation" id="FontVariation_ud3l8"] -base_font = ExtResource("4_27kbu") -variation_embolden = 0.5 - -[node name="IngameMenu" type="Control"] -layout_mode = 3 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -theme = ExtResource("1_lb056") -script = ExtResource("1_gd1i3") - -[node name="AnimationPlayer" type="AnimationPlayer" parent="."] -libraries = { -"": SubResource("AnimationLibrary_u0kyp") -} -speed_scale = 8.0 - -[node name="Side" type="PanelContainer" parent="."] -material = SubResource("ShaderMaterial_o2vtr") -layout_mode = 1 -anchors_preset = 9 -anchor_bottom = 1.0 -offset_left = -400.0 -offset_right = -90.0 -offset_bottom = 648.0 -grow_vertical = 2 - -[node name="Margin" type="MarginContainer" parent="Side"] -layout_mode = 2 -theme_override_constants/margin_left = 20 -theme_override_constants/margin_top = 20 -theme_override_constants/margin_right = 20 -theme_override_constants/margin_bottom = 20 - -[node name="Options" type="VBoxContainer" parent="Side/Margin"] -layout_mode = 2 - -[node name="Title" type="Label" parent="Side/Margin/Options"] -layout_mode = 2 -auto_translate = false -theme_override_colors/font_outline_color = Color(0.566408, 0.208917, 0.266045, 1) -theme_override_constants/outline_size = 10 -theme_override_fonts/font = SubResource("FontVariation_ud3l8") -theme_override_font_sizes/font_size = 48 -text = "Undercooked" - -[node name="Spacer" type="Control" parent="Side/Margin/Options"] -custom_minimum_size = Vector2(0, 10) -layout_mode = 2 - -[node name="Reconnect" type="Button" parent="Side/Margin/Options"] -layout_mode = 2 -text = "Reconnect" -alignment = 0 - -[node name="MainMenu" type="Button" parent="Side/Margin/Options"] -layout_mode = 2 -text = "Main menu" -alignment = 0 - -[node name="Quit" type="Button" parent="Side/Margin/Options"] -layout_mode = 2 -text = "Quit game" -alignment = 0 - -[connection signal="pressed" from="Side/Margin/Options/Reconnect" to="." method="_on_reconnect_pressed"] -[connection signal="pressed" from="Side/Margin/Options/MainMenu" to="." method="_on_main_menu_pressed"] -[connection signal="pressed" from="Side/Margin/Options/Quit" to="." method="_on_quit_pressed"] diff --git a/client/menu/main.gd b/client/menu/main.gd new file mode 100644 index 00000000..d3f0f773 --- /dev/null +++ b/client/menu/main.gd @@ -0,0 +1,100 @@ +# Undercooked - a game about cooking +# Copyright 2024 metamuffin +# Copyright 2024 tpart +# +# 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 . +# +extends Menu + +@onready var quit_button = $side/margin/options/quit +@onready var connect_uri = $side/margin/options/connect/uri +@onready var server = $side/margin/options/server +@onready var server_control = $side/margin/options/server/control +@onready var server_connect = $side/margin/options/server/connect + +func _ready(): + super() + if OS.has_feature("web"): + quit_button.hide() + server.hide() + connect_uri.text = Global.profile["last_server_url"] + +func menu_anim_cover(covered): + $side.visible = not covered + +func _on_quit_pressed(): + quit() + +func _on_credits_pressed(): + submenu("res://menu/credits.tscn", true) + +func _on_connect_pressed(): + var url = connect_uri.text + Global.profile["last_server_url"] = url + Global.save_profile() + connect_to(url) + +func _on_quick_connect_pressed(): + if OS.has_feature("JavaScript"): + connect_to(JavaScriptBridge.eval(""" + window.location.protocol.endsWith("s:") + ? `wss://${window.location.host}/` + : `ws://${window.location.hostname}:27032/` + """)) + else: + connect_to("wss://undercooked.metamuffin.org/") + +func connect_to(url): + print("Connecting to %s" % url) + Global.server_url = url + replace_menu("res://menu/game.tscn") + +func _on_change_character_pressed(): + replace_menu("res://menu/character.tscn") + +func _on_settings_pressed(): + submenu("res://menu/settings.tscn", true) + +func _on_server_pressed(): + match Server.state: + Server.State.RUNNING: Server.stop() + Server.State.STOPPED: Server.start() + Server.State.FAILED: Server.start() + +func _on_server_connect_pressed(): + connect_to("ws://127.0.0.1:27032/") + +func _process(_delta): + server_control.disabled = false + server_connect.visible = Server.state == Server.State.RUNNING + server_control.modulate = Color.WHITE + match Server.state: + Server.State.RUNNING: + server_control.text = tr("Stop Server") + server_control.modulate = Color.AQUAMARINE + Server.State.TESTING: + server_control.text = tr("Server (Testing)") + server_control.disabled = true + Server.State.STARTING: + server_control.text = tr("Server is starting...") + server_control.disabled = true + Server.State.STOPPED: + server_control.text = tr("Start Server") + Server.State.FAILED: + server_control.text = tr("Server (Failed)") + server_control.modulate = Color(1,0.4,0.5) + server_control.tooltip_text = tr("The server crashed or exited in some way or another.\nGodot's APIs are so bad however, that we really can't know why that happend.\nYou should try starting the server from the command-line.") + Server.State.UNAVAILABLE: + server_control.text = tr("Server (Unavailable)") + server_control.disabled = true + server_control.tooltip_text = tr("Server binary was not found. Please install the server seperately.") diff --git a/client/menu/main.tscn b/client/menu/main.tscn new file mode 100644 index 00000000..b36e1ddb --- /dev/null +++ b/client/menu/main.tscn @@ -0,0 +1,117 @@ +[gd_scene load_steps=8 format=3 uid="uid://dbj8508whxgwv"] + +[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme.tres" id="1_3qfu3"] +[ext_resource type="Script" path="res://menu/main.gd" id="2_xjnc3"] +[ext_resource type="PackedScene" uid="uid://l4vm07dtda4j" path="res://menu/menu_background.tscn" id="3_4evao"] +[ext_resource type="Material" uid="uid://beea1pc5nt67r" path="res://menu/theme/dark_blur_material.tres" id="4_wf51p"] +[ext_resource type="FontFile" uid="uid://bo4vh5xkpvrh1" path="res://menu/theme/font-sansita-swashed.woff2" id="5_k7bqq"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ukani"] + +[sub_resource type="FontVariation" id="FontVariation_htgmg"] +base_font = ExtResource("5_k7bqq") +variation_embolden = 0.5 + +[node name="MainMenu" type="Control"] +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="side" type="PanelContainer" parent="."] +material = ExtResource("4_wf51p") +layout_mode = 1 +anchors_preset = 9 +anchor_bottom = 1.0 +offset_right = 340.0 +grow_vertical = 2 +theme_override_styles/panel = SubResource("StyleBoxFlat_ukani") + +[node name="margin" type="MarginContainer" parent="side"] +layout_mode = 2 +theme_override_constants/margin_left = 20 +theme_override_constants/margin_top = 20 +theme_override_constants/margin_right = 20 +theme_override_constants/margin_bottom = 20 + +[node name="options" type="VBoxContainer" parent="side/margin"] +layout_mode = 2 + +[node name="title" type="Label" parent="side/margin/options"] +layout_mode = 2 +auto_translate = false +theme_override_colors/font_outline_color = Color(0.566408, 0.208917, 0.266045, 1) +theme_override_constants/outline_size = 10 +theme_override_fonts/font = SubResource("FontVariation_htgmg") +theme_override_font_sizes/font_size = 48 +text = "Undercooked" + +[node name="spacer" type="Control" parent="side/margin/options"] +custom_minimum_size = Vector2(0, 10) +layout_mode = 2 + +[node name="quick_connect" type="Button" parent="side/margin/options"] +layout_mode = 2 +text = "Quick Connect" +alignment = 0 + +[node name="connect" type="HBoxContainer" parent="side/margin/options"] +layout_mode = 2 + +[node name="uri" type="LineEdit" parent="side/margin/options/connect"] +layout_mode = 2 +size_flags_horizontal = 3 +auto_translate = false +placeholder_text = "wss://example.org" + +[node name="connect" type="Button" parent="side/margin/options/connect"] +layout_mode = 2 +text = "Connect" + +[node name="change_character" type="Button" parent="side/margin/options"] +layout_mode = 2 +text = "My Chef" +alignment = 0 + +[node name="settings" type="Button" parent="side/margin/options"] +layout_mode = 2 +text = "Settings" +alignment = 0 + +[node name="server" type="HBoxContainer" parent="side/margin/options"] +layout_mode = 2 + +[node name="control" type="Button" parent="side/margin/options/server"] +layout_mode = 2 +size_flags_horizontal = 3 +text = "Server" +alignment = 0 + +[node name="connect" type="Button" parent="side/margin/options/server"] +layout_mode = 2 +text = "Connect" + +[node name="credits" type="Button" parent="side/margin/options"] +layout_mode = 2 +text = "Credits" +alignment = 0 + +[node name="quit" type="Button" parent="side/margin/options"] +layout_mode = 2 +text = "Quit" +alignment = 0 + +[connection signal="pressed" from="side/margin/options/quick_connect" to="." method="_on_quick_connect_pressed"] +[connection signal="pressed" from="side/margin/options/connect/connect" to="." method="_on_connect_pressed"] +[connection signal="pressed" from="side/margin/options/change_character" to="." method="_on_change_character_pressed"] +[connection signal="pressed" from="side/margin/options/settings" to="." method="_on_settings_pressed"] +[connection signal="pressed" from="side/margin/options/server/control" to="." method="_on_server_pressed"] +[connection signal="pressed" from="side/margin/options/server/connect" to="." method="_on_server_connect_pressed"] +[connection signal="pressed" from="side/margin/options/credits" to="." method="_on_credits_pressed"] +[connection signal="pressed" from="side/margin/options/quit" to="." method="_on_quit_pressed"] diff --git a/client/menu/main_menu.gd b/client/menu/main_menu.gd deleted file mode 100644 index c96d6c13..00000000 --- a/client/menu/main_menu.gd +++ /dev/null @@ -1,98 +0,0 @@ -# Undercooked - a game about cooking -# Copyright 2024 metamuffin -# Copyright 2024 tpart -# -# 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 . -# -extends Control - -@onready var menu_manager: MenuManager = get_parent() - -@onready var quit_button = $side/margin/options/quit -@onready var connect_uri = $side/margin/options/connect/uri -@onready var server = $side/margin/options/server -@onready var server_control = $side/margin/options/server/control -@onready var server_connect = $side/margin/options/server/connect - -func _ready(): - if OS.has_feature("web"): - quit_button.hide() - server.hide() - connect_uri.text = Global.profile["last_server_url"] - -func _on_quit_pressed(): - menu_manager.transition.quit() - -func _on_credits_pressed(): - menu_manager.goto("credits") - -func _on_connect_pressed(): - var url = connect_uri.text - Global.profile["last_server_url"] = url - Global.save_profile() - connect_to(url) - -func _on_quick_connect_pressed(): - if OS.has_feature("JavaScript"): - connect_to(JavaScriptBridge.eval(""" - window.location.protocol.endsWith("s:") - ? `wss://${window.location.host}/` - : `ws://${window.location.hostname}:27032/` - """)) - else: - connect_to("wss://undercooked.metamuffin.org/") - -func connect_to(url): - print("Connecting to %s" % url) - Global.server_url = url - menu_manager.transition.transition_to("res://game.tscn") - -func _on_change_character_pressed(): - menu_manager.transition.transition_to("res://menu/character_menu.tscn") - -func _on_settings_pressed(): - menu_manager.goto("settings") - -func _on_server_pressed(): - match Server.state: - Server.State.RUNNING: Server.stop() - Server.State.STOPPED: Server.start() - Server.State.FAILED: Server.start() - -func _process(_delta): - server_control.disabled = false - server_connect.visible = Server.state == Server.State.RUNNING - server_control.modulate = Color.WHITE - match Server.state: - Server.State.RUNNING: - server_control.text = tr("Stop Server") - server_control.modulate = Color.AQUAMARINE - Server.State.TESTING: - server_control.text = tr("Server (Testing)") - server_control.disabled = true - Server.State.STARTING: - server_control.text = tr("Server is starting...") - server_control.disabled = true - Server.State.STOPPED: - server_control.text = tr("Start Server") - Server.State.FAILED: - server_control.text = tr("Server (Failed)") - server_control.modulate = Color(1,0.4,0.5) - server_control.tooltip_text = tr("The server crashed or exited in some way or another.\nGodot's APIs are so bad however, that we really can't know why that happend.\nYou should try starting the server from the command-line.") - Server.State.UNAVAILABLE: - server_control.text = tr("Server (Unavailable)") - server_control.disabled = true - server_control.tooltip_text = tr("Server binary was not found. Please install the server seperately.") - -func _on_server_connect_pressed(): - connect_to("ws://127.0.0.1:27032/") diff --git a/client/menu/main_menu.tscn b/client/menu/main_menu.tscn deleted file mode 100644 index 36f417f4..00000000 --- a/client/menu/main_menu.tscn +++ /dev/null @@ -1,114 +0,0 @@ -[gd_scene load_steps=7 format=3 uid="uid://dbj8508whxgwv"] - -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme.tres" id="1_nlcpo"] -[ext_resource type="Script" path="res://menu/main_menu.gd" id="2_qot2j"] -[ext_resource type="Material" uid="uid://beea1pc5nt67r" path="res://menu/theme/dark_blur_material.tres" id="3_k58q5"] -[ext_resource type="FontFile" uid="uid://bo4vh5xkpvrh1" path="res://menu/theme/font-sansita-swashed.woff2" id="4_mfs30"] - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ukani"] - -[sub_resource type="FontVariation" id="FontVariation_htgmg"] -base_font = ExtResource("4_mfs30") -variation_embolden = 0.5 - -[node name="MainMenu" type="Control"] -layout_mode = 3 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -theme = ExtResource("1_nlcpo") -script = ExtResource("2_qot2j") - -[node name="side" type="PanelContainer" parent="."] -material = ExtResource("3_k58q5") -layout_mode = 1 -anchors_preset = 9 -anchor_bottom = 1.0 -offset_right = 340.0 -grow_vertical = 2 -theme_override_styles/panel = SubResource("StyleBoxFlat_ukani") - -[node name="margin" type="MarginContainer" parent="side"] -layout_mode = 2 -theme_override_constants/margin_left = 20 -theme_override_constants/margin_top = 20 -theme_override_constants/margin_right = 20 -theme_override_constants/margin_bottom = 20 - -[node name="options" type="VBoxContainer" parent="side/margin"] -layout_mode = 2 - -[node name="title" type="Label" parent="side/margin/options"] -layout_mode = 2 -auto_translate = false -theme_override_colors/font_outline_color = Color(0.566408, 0.208917, 0.266045, 1) -theme_override_constants/outline_size = 10 -theme_override_fonts/font = SubResource("FontVariation_htgmg") -theme_override_font_sizes/font_size = 48 -text = "Undercooked" - -[node name="spacer" type="Control" parent="side/margin/options"] -custom_minimum_size = Vector2(0, 10) -layout_mode = 2 - -[node name="quick_connect" type="Button" parent="side/margin/options"] -layout_mode = 2 -text = "Quick Connect" -alignment = 0 - -[node name="connect" type="HBoxContainer" parent="side/margin/options"] -layout_mode = 2 - -[node name="uri" type="LineEdit" parent="side/margin/options/connect"] -layout_mode = 2 -size_flags_horizontal = 3 -auto_translate = false -placeholder_text = "wss://example.org" - -[node name="connect" type="Button" parent="side/margin/options/connect"] -layout_mode = 2 -text = "Connect" - -[node name="change_character" type="Button" parent="side/margin/options"] -layout_mode = 2 -text = "My Chef" -alignment = 0 - -[node name="settings" type="Button" parent="side/margin/options"] -layout_mode = 2 -text = "Settings" -alignment = 0 - -[node name="server" type="HBoxContainer" parent="side/margin/options"] -layout_mode = 2 - -[node name="control" type="Button" parent="side/margin/options/server"] -layout_mode = 2 -size_flags_horizontal = 3 -text = "Server" -alignment = 0 - -[node name="connect" type="Button" parent="side/margin/options/server"] -layout_mode = 2 -text = "Connect" - -[node name="credits" type="Button" parent="side/margin/options"] -layout_mode = 2 -text = "Credits" -alignment = 0 - -[node name="quit" type="Button" parent="side/margin/options"] -layout_mode = 2 -text = "Quit" -alignment = 0 - -[connection signal="pressed" from="side/margin/options/quick_connect" to="." method="_on_quick_connect_pressed"] -[connection signal="pressed" from="side/margin/options/connect/connect" to="." method="_on_connect_pressed"] -[connection signal="pressed" from="side/margin/options/change_character" to="." method="_on_change_character_pressed"] -[connection signal="pressed" from="side/margin/options/settings" to="." method="_on_settings_pressed"] -[connection signal="pressed" from="side/margin/options/server/control" to="." method="_on_server_pressed"] -[connection signal="pressed" from="side/margin/options/server/connect" to="." method="_on_server_connect_pressed"] -[connection signal="pressed" from="side/margin/options/credits" to="." method="_on_credits_pressed"] -[connection signal="pressed" from="side/margin/options/quit" to="." method="_on_quit_pressed"] diff --git a/client/menu/menu.gd b/client/menu/menu.gd new file mode 100644 index 00000000..a911ca83 --- /dev/null +++ b/client/menu/menu.gd @@ -0,0 +1,89 @@ +class_name Menu +extends Control + + +#enum Anim { NONE, FADE } +#@export var animation: Anim = Anim.NONE +@export var support_anim := true +@export var auto_anim := true + +signal submenu_close() + +const transition_scene = preload("res://menu/scene_transition.tscn") +var transition: SceneTransition +var parent_menu: Menu = null + +func _ready(): + focus_first_button(self) + connect_button_sounds(self) + update_parent_menu(self.get_parent()) + if support_anim: anim_setup() + if auto_anim: menu_anim_open() + +func anim_setup(): + transition = transition_scene.instantiate() + add_child(transition) +func menu_anim_open(): + print("open ", transition) + if transition != null: await transition.fade_in() +func menu_anim_exit(): + print("exit ", transition) + if transition != null: await transition.fade_out() +func menu_anim_cover(state: bool): + pass + +var popup: Menu = null +func submenu(path: String, instant: bool = false): + if popup != null: return + await menu_anim_cover(true) + popup = load(path).instantiate() + if instant: popup.support_anim = false + add_child(popup) + print("Submenu opened ", path) + await submenu_close + print("Submenu closed ", path) + await menu_anim_cover(false) + +func exit(): + await self.menu_anim_exit() + get_parent().submenu_close.emit() + queue_free() + +func quit(): + await exit() + get_parent().quit() + +func replace_menu(path: String): + if popup != null: await popup.exit() + await menu_anim_exit() + get_parent().add_child(load(path).instantiate()) + queue_free() + +var focus_auto_changed := false +func focus_first_button(node: Node) -> bool: + focus_auto_changed = true + if node is Button: + node.grab_focus() + print("Node %s (%s) was selected for focus" % [node.name, node]) + return true + for c in node.get_children(): + if focus_first_button(c): + return true + return false + +func connect_button_sounds(node: Node): + if node is Button: + node.pressed.connect(Sound.play_click) + if node is Button or node is LineEdit or node is Slider: + node.mouse_entered.connect(Sound.play_hover) + for c in node.get_children(): + connect_button_sounds(c) + +func update_parent_menu(node: Node): + if node is Menu: parent_menu = node + elif node.get_parent() != null: update_parent_menu(node.get_parent()) + +#func _input(_event): + #if Input.is_action_just_pressed("ui_cancel"): + #Sound.play_click() + #exit() diff --git a/client/menu/menu.tscn b/client/menu/menu.tscn new file mode 100644 index 00000000..641e5c3a --- /dev/null +++ b/client/menu/menu.tscn @@ -0,0 +1,8 @@ +[gd_scene load_steps=2 format=3 uid="uid://bgo1j6isr7fdy"] + +[ext_resource type="Script" path="res://menu/menu.gd" id="1_le42d"] + +[node name="Menu" type="Control"] +layout_mode = 3 +anchors_preset = 0 +script = ExtResource("1_le42d") diff --git a/client/menu/menu_manager.gd b/client/menu/menu_manager.gd deleted file mode 100644 index bba074f6..00000000 --- a/client/menu/menu_manager.gd +++ /dev/null @@ -1,68 +0,0 @@ -# Undercooked - a game about cooking -# Copyright 2024 metamuffin -# Copyright 2024 tpart -# -# 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 . -# -extends Control -class_name MenuManager - -@onready var menus = { - "main": $MainMenu, - "credits": $CreditsMenu, - "settings": $SettingsMenu -} -@onready var transition: SceneTransition = $SceneTransition - -var menu_stack = ["main"] - -func _ready(): - if not Global.settings["setup_complete"]["value"]: return transition.instant_to("res://menu/setup_menu.tscn") - get_viewport().gui_focus_changed.connect(Sound.play_hover_maybe) - Global.focus_first_button(menus[menu_stack.back()]) - - for m in menus.values(): - Global.connect_button_sounds(m) - - if Global.fade_next: - Global.fade_next = false - transition.fade_in() - -func _input(_event): - if Input.is_action_just_pressed("ui_cancel") && menu_stack.size() > 1: - Sound.play_click() - go_back() - -func goto(menu_name: String): - show_menu(menu_name) - menu_stack.push_back(menu_name) - print("Go to called. Stack: " + str(menu_stack)) - -func go_back(): - menu_stack.pop_back() - if menu_stack.is_empty(): - Global.showError("Menu stack empty") - show_menu(menu_stack.back()) - print("Go back called. Stack: " + str(menu_stack)) - -func show_menu(menu_name: String): - await transition.fade_out() - for k in menus.keys(): - if k == menu_name: - menus[k].show() - if menus[k].has_method("prepare"): - menus[k].prepare() # Optionally run some code - Global.focus_first_button(menus[k]) - else: - menus[k].hide() - await transition.fade_in() diff --git a/client/menu/menu_manager.tscn b/client/menu/menu_manager.tscn deleted file mode 100644 index 56cc6442..00000000 --- a/client/menu/menu_manager.tscn +++ /dev/null @@ -1,34 +0,0 @@ -[gd_scene load_steps=7 format=3 uid="uid://cd52sr1cmo8oj"] - -[ext_resource type="Script" path="res://menu/menu_manager.gd" id="1_c0rjm"] -[ext_resource type="PackedScene" uid="uid://l4vm07dtda4j" path="res://menu/menu_background.tscn" id="2_nf7b6"] -[ext_resource type="PackedScene" uid="uid://dbj8508whxgwv" path="res://menu/main_menu.tscn" id="3_ccpur"] -[ext_resource type="PackedScene" uid="uid://7mqbxa054bjv" path="res://menu/credits_menu.tscn" id="4_xhcd8"] -[ext_resource type="PackedScene" uid="uid://8ic77jmadadj" path="res://menu/settings_menu.tscn" id="5_lifj8"] -[ext_resource type="PackedScene" uid="uid://bg2d78ycorcqk" path="res://menu/scene_transition.tscn" id="6_p4u45"] - -[node name="MenuManager" type="Control"] -layout_mode = 3 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -script = ExtResource("1_c0rjm") - -[node name="MenuBackground" parent="." instance=ExtResource("2_nf7b6")] - -[node name="MainMenu" parent="." instance=ExtResource("3_ccpur")] -layout_mode = 1 - -[node name="CreditsMenu" parent="." instance=ExtResource("4_xhcd8")] -visible = false -layout_mode = 1 - -[node name="SettingsMenu" parent="." instance=ExtResource("5_lifj8")] -visible = false -layout_mode = 1 - -[node name="SceneTransition" parent="." instance=ExtResource("6_p4u45")] -visible = false -layout_mode = 1 diff --git a/client/menu/scene_transition.gd b/client/menu/scene_transition.gd index f68f6aa7..8fe078e6 100644 --- a/client/menu/scene_transition.gd +++ b/client/menu/scene_transition.gd @@ -14,57 +14,35 @@ # along with this program. If not, see . # class_name SceneTransition -extends ColorRect +extends Control -@onready var anim: AnimationPlayer = $animation -@export var ingame = false - -@export var auto_fade_in := true +@onready var anim: AnimationPlayer = $AnimationPlayer var black = true var fading = false +signal close() + func _ready(): - visible = true - if auto_fade_in: fade_in() + $ColorRect.visible = true func fade_in(): - if black: anim.play("fade_in"); fading = true - black = false - if fading: await anim.animation_finished - fading = false + if fading: push_error("transition busy (in)"); return + if not black: push_error("already faded in"); return + fading = true + anim.play_backwards("fade") + await anim.animation_finished self.mouse_filter = Control.MOUSE_FILTER_IGNORE + fading = false; black = false func fade_out(): + if fading: push_error("transition busy (out)"); return + if black: push_error("already faded out"); return + fading = true self.mouse_filter = Control.MOUSE_FILTER_STOP - if not black: anim.play("fade_out"); fading = true - black = true - if fading: await anim.animation_finished - fading = false - -func transition_to(path: String): - await out() - get_tree().change_scene_to_file(path) - -func instant_to(path: String): - get_tree().change_scene_to_file(path) - -func quit(): - await out() - get_tree().quit() - -func out(): - visible = true - if menu.visible: - menu.anim.play_backwards("activate") - await menu.anim.animation_finished - anim.play("fade_out") + anim.play("fade") await anim.animation_finished + fading = false; black = true -@onready var menu = $IngameMenu -func _process(_delta): - if ingame: - if not menu.visible and Input.is_action_just_pressed("pause"): - menu.act() - elif menu.visible and Input.is_action_just_pressed("pause"): - menu.deact() +func _exit_tree(): + if fading: push_error("SceneTransition destroyed while fading") diff --git a/client/menu/scene_transition.tscn b/client/menu/scene_transition.tscn index ddfd6238..4ebf809e 100644 --- a/client/menu/scene_transition.tscn +++ b/client/menu/scene_transition.tscn @@ -1,48 +1,20 @@ -[gd_scene load_steps=7 format=3 uid="uid://bg2d78ycorcqk"] +[gd_scene load_steps=5 format=3 uid="uid://bg2d78ycorcqk"] [ext_resource type="Script" path="res://menu/scene_transition.gd" id="1_fpbwj"] -[ext_resource type="PackedScene" uid="uid://lxlgtjm8hw7v" path="res://menu/ingame_menu.tscn" id="2_aqaj2"] [sub_resource type="Animation" id="Animation_xgn2a"] length = 0.001 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath(".:color") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 0, -"values": [Color(0, 0, 0, 1)] -} -[sub_resource type="Animation" id="Animation_tglmc"] -resource_name = "fade_in" +[sub_resource type="Animation" id="Animation_cq5i2"] +resource_name = "fade" tracks/0/type = "value" tracks/0/imported = false tracks/0/enabled = true -tracks/0/path = NodePath(".:color") +tracks/0/path = NodePath("ColorRect:color") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/keys = { -"times": PackedFloat32Array(0, 0.9), -"transitions": PackedFloat32Array(1, 1), -"update": 0, -"values": [Color(0, 0, 0, 1), Color(0, 0, 0, 0)] -} - -[sub_resource type="Animation" id="Animation_egop8"] -resource_name = "fade_out" -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath(".:color") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 0.9), +"times": PackedFloat32Array(0, 1), "transitions": PackedFloat32Array(1, 1), "update": 0, "values": [Color(0, 0, 0, 0), Color(0, 0, 0, 1)] @@ -51,28 +23,31 @@ tracks/0/keys = { [sub_resource type="AnimationLibrary" id="AnimationLibrary_pea72"] _data = { "RESET": SubResource("Animation_xgn2a"), -"fade_in": SubResource("Animation_tglmc"), -"fade_out": SubResource("Animation_egop8") +"fade": SubResource("Animation_cq5i2") } -[node name="SceneTransition" type="ColorRect"] +[node name="SceneTransition" type="Control"] +layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -mouse_filter = 2 -color = Color(0, 0, 0, 1) script = ExtResource("1_fpbwj") -[node name="animation" type="AnimationPlayer" parent="."] +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] libraries = { "": SubResource("AnimationLibrary_pea72") } speed_scale = 4.0 -[node name="IngameMenu" parent="." instance=ExtResource("2_aqaj2")] +[node name="ColorRect" type="ColorRect" parent="."] visible = false layout_mode = 1 -offset_right = 2304.0 -offset_bottom = 1296.0 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +color = Color(0, 0, 0, 1) diff --git a/client/menu/settings.gd b/client/menu/settings.gd new file mode 100644 index 00000000..66b53f64 --- /dev/null +++ b/client/menu/settings.gd @@ -0,0 +1,56 @@ +# Undercooked - a game about cooking +# Copyright 2024 metamuffin +# +# 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 . +# +extends Menu + +@onready var options: VBoxContainer = $OuterGap/Panel/InnerGap/VBoxContainer/ScrollContainer/Options + +var settings: Dictionary + +func _on_back_pressed(): + for k in settings.keys(): + Global.set_setting(k, settings[k].get_value()) + Global.save_settings() + Global.update_language() + Global.update_fullscreen() + exit() + +func _ready(): + super() + update_rows() + +func update_rows(fix_focus = false): + for c in options.get_children(): + c.queue_free() + + for k in Global.settings.keys(): + var row: SettingsRow = preload("res://menu/settings_row.tscn").instantiate() + row.setup(k, Global.settings, Global.default_settings) + row.connect("apply_preset", apply_preset) + options.add_child(row) + settings[k] = row + + if fix_focus: + await get_tree().process_frame + Global.focus_first_button(self) + +func apply_preset(preset: Dictionary): + for k in settings.keys(): + Global.set_setting(k, settings[k].get_value()) + + for k in preset.keys(): + Global.set_setting(k, preset[k]) + + update_rows(true) diff --git a/client/menu/settings.tscn b/client/menu/settings.tscn new file mode 100644 index 00000000..2b83b3f1 --- /dev/null +++ b/client/menu/settings.tscn @@ -0,0 +1,64 @@ +[gd_scene load_steps=4 format=3 uid="uid://8ic77jmadadj"] + +[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme.tres" id="1_foq3a"] +[ext_resource type="Script" path="res://menu/settings.gd" id="2_3hgm8"] +[ext_resource type="Material" uid="uid://beea1pc5nt67r" path="res://menu/theme/dark_blur_material.tres" id="3_8nykw"] + +[node name="SettingsMenu" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme = ExtResource("1_foq3a") +script = ExtResource("2_3hgm8") + +[node name="OuterGap" type="MarginContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Panel" type="Panel" parent="OuterGap"] +material = ExtResource("3_8nykw") +layout_mode = 2 + +[node name="InnerGap" type="MarginContainer" parent="OuterGap/Panel"] +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 = 40 +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"] +layout_mode = 2 + +[node name="Title" type="Label" parent="OuterGap/Panel/InnerGap/VBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 0 +theme_override_font_sizes/font_size = 36 +text = "Settings" + +[node name="ScrollContainer" type="ScrollContainer" parent="OuterGap/Panel/InnerGap/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="Options" type="VBoxContainer" parent="OuterGap/Panel/InnerGap/VBoxContainer/ScrollContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="Back" type="Button" parent="OuterGap/Panel/InnerGap/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 8 +text = "Save & Apply" + +[connection signal="pressed" from="OuterGap/Panel/InnerGap/VBoxContainer/Back" to="." method="_on_back_pressed"] diff --git a/client/menu/settings_menu.gd b/client/menu/settings_menu.gd deleted file mode 100644 index 9f033d40..00000000 --- a/client/menu/settings_menu.gd +++ /dev/null @@ -1,59 +0,0 @@ -# Undercooked - a game about cooking -# Copyright 2024 metamuffin -# -# 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 . -# -extends Control - -@onready var options: VBoxContainer = $OuterGap/Panel/InnerGap/VBoxContainer/ScrollContainer/Options -@onready var menu_manager: MenuManager = get_parent() - -var settings: Dictionary - -func _on_back_pressed(): - for k in settings.keys(): - Global.set_setting(k, settings[k].get_value()) - Global.save_settings() - Global.update_language() - Global.update_fullscreen() - menu_manager.go_back() - -func _ready(): - update_rows() - -func show_graphis(): - menu_manager.goto("settings_graphics") - -func update_rows(fix_focus = false): - for c in options.get_children(): - c.queue_free() - - for k in Global.settings.keys(): - var row: SettingsRow = preload("res://menu/settings_row.tscn").instantiate() - row.setup(k, Global.settings, Global.default_settings) - row.connect("apply_preset", apply_preset) - options.add_child(row) - settings[k] = row - - if fix_focus: - await get_tree().process_frame - Global.focus_first_button(self) - -func apply_preset(preset: Dictionary): - for k in settings.keys(): - Global.set_setting(k, settings[k].get_value()) - - for k in preset.keys(): - Global.set_setting(k, preset[k]) - - update_rows(true) diff --git a/client/menu/settings_menu.tscn b/client/menu/settings_menu.tscn deleted file mode 100644 index ecaea17c..00000000 --- a/client/menu/settings_menu.tscn +++ /dev/null @@ -1,64 +0,0 @@ -[gd_scene load_steps=4 format=3 uid="uid://8ic77jmadadj"] - -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme.tres" id="1_foq3a"] -[ext_resource type="Script" path="res://menu/settings_menu.gd" id="2_3hgm8"] -[ext_resource type="Material" uid="uid://beea1pc5nt67r" path="res://menu/theme/dark_blur_material.tres" id="3_8nykw"] - -[node name="SettingsMenu" type="Control"] -layout_mode = 3 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -theme = ExtResource("1_foq3a") -script = ExtResource("2_3hgm8") - -[node name="OuterGap" type="MarginContainer" parent="."] -layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 - -[node name="Panel" type="Panel" parent="OuterGap"] -material = ExtResource("3_8nykw") -layout_mode = 2 - -[node name="InnerGap" type="MarginContainer" parent="OuterGap/Panel"] -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 = 40 -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"] -layout_mode = 2 - -[node name="Title" type="Label" parent="OuterGap/Panel/InnerGap/VBoxContainer"] -layout_mode = 2 -size_flags_horizontal = 0 -theme_override_font_sizes/font_size = 36 -text = "Settings" - -[node name="ScrollContainer" type="ScrollContainer" parent="OuterGap/Panel/InnerGap/VBoxContainer"] -layout_mode = 2 -size_flags_vertical = 3 - -[node name="Options" type="VBoxContainer" parent="OuterGap/Panel/InnerGap/VBoxContainer/ScrollContainer"] -layout_mode = 2 -size_flags_horizontal = 3 -size_flags_vertical = 3 - -[node name="Back" type="Button" parent="OuterGap/Panel/InnerGap/VBoxContainer"] -layout_mode = 2 -size_flags_vertical = 8 -text = "Save & Apply" - -[connection signal="pressed" from="OuterGap/Panel/InnerGap/VBoxContainer/Back" to="." method="_on_back_pressed"] diff --git a/client/menu/setup.gd b/client/menu/setup.gd new file mode 100644 index 00000000..565753d8 --- /dev/null +++ b/client/menu/setup.gd @@ -0,0 +1,49 @@ +# Undercooked - a game about cooking +# Copyright 2024 metamuffin +# +# 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 . +# +extends Control + +@onready var anim: AnimationPlayer = $AnimationPlayer +@onready var username: LineEdit = $ScrollContainer/Control/TextureRect/PaperMargin/Contents/NameEntry/LineEdit +@onready var character_opts: Container = $ScrollContainer/Control/TextureRect/PaperMargin/Contents/UniformEntry +@onready var sign: AudioStreamPlayer = $Sign +@onready var sign_button: Button = $ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployeeMargin/Sign/Signature + +func _ready(): + anim.play("paper_slide") + +func _on_sign_pressed(): + var character = -1 + for i in character_opts.get_children().size(): + if character_opts.get_children()[i].button_pressed: + character = i + + if username.text == "": OS.alert("Name field cannot be empty."); return + if character == -1: OS.alert("Hairstyle needs to be selected."); return + + sign_button.disabled = true + + sign.play() + await sign.finished + anim.play_backwards("paper_slide") + await anim.animation_finished + + Global.profile["username"] = username.text + Global.profile["character"] = character + + Global.settings["setup_complete"]["value"] = true + Global.save_profile() + Global.save_settings() + $SceneTransition.transition_to("res://menu/menu_manager.tscn") diff --git a/client/menu/setup.tscn b/client/menu/setup.tscn new file mode 100644 index 00000000..7b38b2a1 --- /dev/null +++ b/client/menu/setup.tscn @@ -0,0 +1,369 @@ +[gd_scene load_steps=16 format=3 uid="uid://ddl3efikvqp66"] + +[ext_resource type="Script" path="res://menu/setup.gd" id="1_mo46n"] +[ext_resource type="Theme" uid="uid://ci2qajdoa1an1" path="res://menu/theme/paper.tres" id="1_yq0aa"] +[ext_resource type="FontFile" uid="uid://bo4vh5xkpvrh1" path="res://menu/theme/font-sansita-swashed.woff2" id="3_2vg4d"] +[ext_resource type="PackedScene" uid="uid://bg2d78ycorcqk" path="res://menu/scene_transition.tscn" id="4_u444t"] +[ext_resource type="AudioStream" uid="uid://do7ii5hx71p0m" path="res://menu/sounds/page.ogg" id="5_xac6d"] +[ext_resource type="AudioStream" uid="uid://5b3noxjmasmu" path="res://menu/sounds/sign.ogg" id="6_wf0gh"] + +[sub_resource type="Animation" id="Animation_m4a1a"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("ScrollContainer:position") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(0, 0)] +} + +[sub_resource type="Animation" id="Animation_s1to2"] +resource_name = "paper_slide" +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("ScrollContainer:position") +tracks/0/interp = 2 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 1), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [Vector2(0, -1800), Vector2(0, 0)] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_wjgak"] +_data = { +"RESET": SubResource("Animation_m4a1a"), +"paper_slide": SubResource("Animation_s1to2") +} + +[sub_resource type="Gradient" id="Gradient_nsc3h"] +colors = PackedColorArray(0.941084, 0.949219, 0.918643, 1, 1, 1, 1, 1) + +[sub_resource type="FastNoiseLite" id="FastNoiseLite_amioi"] + +[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_bvvl7"] +color_ramp = SubResource("Gradient_nsc3h") +noise = SubResource("FastNoiseLite_amioi") + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_e7xn5"] +bg_color = Color(0.196078, 0.196078, 0.235294, 1) +corner_radius_top_left = 10 +corner_radius_top_right = 10 +corner_radius_bottom_right = 10 +corner_radius_bottom_left = 10 + +[sub_resource type="ButtonGroup" id="ButtonGroup_8p5im"] + +[sub_resource type="FontVariation" id="FontVariation_2cc7p"] +base_font = ExtResource("3_2vg4d") + +[node name="SetupMenu" 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_mo46n") + +[node name="ColorRect" type="ColorRect" parent="."] +layout_mode = 2 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +color = Color(0.196078, 0.196078, 0.235294, 1) + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +libraries = { +"": SubResource("AnimationLibrary_wjgak") +} +speed_scale = 2.0 + +[node name="ScrollContainer" type="ScrollContainer" parent="."] +clip_contents = false +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +horizontal_scroll_mode = 0 + +[node name="Control" type="Control" parent="ScrollContainer"] +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"] +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -400.0 +offset_top = -559.57 +offset_right = 400.0 +offset_bottom = 571.801 +grow_horizontal = 2 +grow_vertical = 2 +rotation = 0.0174533 +theme = ExtResource("1_yq0aa") +texture = SubResource("NoiseTexture2D_bvvl7") + +[node name="Hole1" type="Panel" parent="ScrollContainer/Control/TextureRect"] +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -365.0 +offset_top = -189.686 +offset_right = -345.0 +offset_bottom = -169.686 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_styles/panel = SubResource("StyleBoxFlat_e7xn5") + +[node name="Hole2" type="Panel" parent="ScrollContainer/Control/TextureRect"] +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -365.0 +offset_top = 130.314 +offset_right = -345.0 +offset_bottom = 150.314 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_styles/panel = SubResource("StyleBoxFlat_e7xn5") + +[node name="PaperMargin" type="MarginContainer" parent="ScrollContainer/Control/TextureRect"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Contents" type="VBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin"] +layout_mode = 2 + +[node name="Title" type="Label" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +layout_mode = 2 +size_flags_horizontal = 4 +theme_override_font_sizes/font_size = 30 +text = "EMPLOYMENT CONTRACT" + +[node name="Sep" type="HSeparator" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +layout_mode = 2 + +[node name="Intro" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +layout_mode = 2 +bbcode_enabled = true +text = "This is a binding contract between you (the employee) and Musterfoods Ltd. (the employer) for working as a chef or waiter." +fit_content = true +scroll_active = false + +[node name="Name" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +layout_mode = 2 +bbcode_enabled = true +text = "1. [b]Name of the Employee[/b]" +fit_content = true +scroll_active = false + +[node name="NameEntry" type="HBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +layout_mode = 2 + +[node name="LineEdit" type="LineEdit" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/NameEntry"] +custom_minimum_size = Vector2(300, 30) +layout_mode = 2 +max_length = 64 + +[node name="Control" type="Control" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/NameEntry"] +layout_mode = 2 + +[node name="Position" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +layout_mode = 2 +bbcode_enabled = true +text = "2. [b]Employment Position[/b]" +fit_content = true +scroll_active = false + +[node name="PositionEntry" type="HBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +layout_mode = 2 + +[node name="LineEdit" type="LineEdit" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/PositionEntry"] +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) +text = "Chef / Waiting Staff" +editable = false + +[node name="Control" type="Control" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/PositionEntry"] +layout_mode = 2 + +[node name="Uniform" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +layout_mode = 2 +bbcode_enabled = true +text = "3. [b]Working Uniform.[/b] You must always have one of the following hairstyles." +fit_content = true +scroll_active = false + +[node name="UniformEntry" type="VBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +layout_mode = 2 + +[node name="Style1" type="CheckBox" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/UniformEntry"] +layout_mode = 2 +button_group = SubResource("ButtonGroup_8p5im") +text = "Hairstyle 1" + +[node name="Style2" type="CheckBox" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/UniformEntry"] +layout_mode = 2 +button_group = SubResource("ButtonGroup_8p5im") +text = "Hairstyle 2" + +[node name="Style3" type="CheckBox" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/UniformEntry"] +layout_mode = 2 +button_group = SubResource("ButtonGroup_8p5im") +text = "Hairstyle 3" + +[node name="Duties" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +layout_mode = 2 +bbcode_enabled = true +text = "4. [b]Duties.[/b] It is your duty to serve customers the meal or item that they request. +" +fit_content = true +scroll_active = false + +[node name="Terms" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +layout_mode = 2 +bbcode_enabled = true +text = "5. [b]Additional Terms.[/b] You shall not duplicate plates. (That is [u]NOT[/u] possible!) +" +fit_content = true +scroll_active = false + +[node name="Compensation" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +layout_mode = 2 +bbcode_enabled = true +text = "4. [b]Compensation.[/b] You will be compensated monthly for your work." +fit_content = true +scroll_active = false + +[node name="CompensationEntry" type="HBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +layout_mode = 2 + +[node name="Spacer" type="Control" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/CompensationEntry"] +custom_minimum_size = Vector2(15.045, 0) +layout_mode = 2 + +[node name="Text1" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/CompensationEntry"] +custom_minimum_size = Vector2(100.08, 0) +layout_mode = 2 +bbcode_enabled = true +text = "The salary is" +scroll_active = false + +[node name="LineEdit" type="LineEdit" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/CompensationEntry"] +custom_minimum_size = Vector2(50, 30) +layout_mode = 2 +theme_override_colors/font_uneditable_color = Color(0.478431, 0, 0, 1) +text = "$ 0.00" +editable = false + +[node name="Text2" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/CompensationEntry"] +custom_minimum_size = Vector2(100.08, 0) +layout_mode = 2 +bbcode_enabled = true +text = "per month" +scroll_active = false + +[node name="Spacer" type="Control" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +custom_minimum_size = Vector2(0, 200) +layout_mode = 2 + +[node name="Signatures" type="HBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] +layout_mode = 2 + +[node name="EmployerMargin" type="MarginContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures"] +layout_mode = 2 + +[node name="Sign" type="VBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployerMargin"] +layout_mode = 2 + +[node name="Desc" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployerMargin/Sign"] +layout_mode = 2 +theme_override_font_sizes/normal_font_size = 15 +bbcode_enabled = true +text = "Signature of the Employer: +Musterfoods Ltd. +Frank Miller, Head of HR" +fit_content = true +scroll_active = false + +[node name="Signature" type="Label" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployerMargin/Sign"] +custom_minimum_size = Vector2(200, 80) +layout_mode = 2 +theme_override_colors/font_color = Color(0.415686, 0.0253044, 0.135441, 1) +theme_override_fonts/font = SubResource("FontVariation_2cc7p") +theme_override_font_sizes/font_size = 31 +text = "F.Miller" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="Underline" type="HSeparator" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployerMargin/Sign"] +layout_mode = 2 + +[node name="EmployeeMargin" type="MarginContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures"] +layout_mode = 2 + +[node name="Sign" type="VBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployeeMargin"] +layout_mode = 2 + +[node name="Desc" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployeeMargin/Sign"] +layout_mode = 2 +theme_override_font_sizes/normal_font_size = 15 +bbcode_enabled = true +text = "Signature of the Employee: + + +" +fit_content = true +scroll_active = false + +[node name="Signature" type="Button" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployeeMargin/Sign"] +custom_minimum_size = Vector2(200, 80) +layout_mode = 2 +text = "Click to sign" + +[node name="Underline" type="HSeparator" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployeeMargin/Sign"] +layout_mode = 2 + +[node name="SceneTransition" parent="." instance=ExtResource("4_u444t")] +visible = false +layout_mode = 1 + +[node name="Page" type="AudioStreamPlayer" parent="."] +stream = ExtResource("5_xac6d") +volume_db = -16.0 +autoplay = true + +[node name="Sign" type="AudioStreamPlayer" parent="."] +stream = ExtResource("6_wf0gh") +volume_db = -16.0 + +[connection signal="pressed" from="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployeeMargin/Sign/Signature" to="." method="_on_sign_pressed"] diff --git a/client/menu/setup_menu.gd b/client/menu/setup_menu.gd deleted file mode 100644 index 565753d8..00000000 --- a/client/menu/setup_menu.gd +++ /dev/null @@ -1,49 +0,0 @@ -# Undercooked - a game about cooking -# Copyright 2024 metamuffin -# -# 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 . -# -extends Control - -@onready var anim: AnimationPlayer = $AnimationPlayer -@onready var username: LineEdit = $ScrollContainer/Control/TextureRect/PaperMargin/Contents/NameEntry/LineEdit -@onready var character_opts: Container = $ScrollContainer/Control/TextureRect/PaperMargin/Contents/UniformEntry -@onready var sign: AudioStreamPlayer = $Sign -@onready var sign_button: Button = $ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployeeMargin/Sign/Signature - -func _ready(): - anim.play("paper_slide") - -func _on_sign_pressed(): - var character = -1 - for i in character_opts.get_children().size(): - if character_opts.get_children()[i].button_pressed: - character = i - - if username.text == "": OS.alert("Name field cannot be empty."); return - if character == -1: OS.alert("Hairstyle needs to be selected."); return - - sign_button.disabled = true - - sign.play() - await sign.finished - anim.play_backwards("paper_slide") - await anim.animation_finished - - Global.profile["username"] = username.text - Global.profile["character"] = character - - Global.settings["setup_complete"]["value"] = true - Global.save_profile() - Global.save_settings() - $SceneTransition.transition_to("res://menu/menu_manager.tscn") diff --git a/client/menu/setup_menu.tscn b/client/menu/setup_menu.tscn deleted file mode 100644 index 5f856c28..00000000 --- a/client/menu/setup_menu.tscn +++ /dev/null @@ -1,369 +0,0 @@ -[gd_scene load_steps=16 format=3 uid="uid://ddl3efikvqp66"] - -[ext_resource type="Script" path="res://menu/setup_menu.gd" id="1_mo46n"] -[ext_resource type="Theme" uid="uid://ci2qajdoa1an1" path="res://menu/theme/paper.tres" id="1_yq0aa"] -[ext_resource type="FontFile" uid="uid://bo4vh5xkpvrh1" path="res://menu/theme/font-sansita-swashed.woff2" id="3_2vg4d"] -[ext_resource type="PackedScene" uid="uid://bg2d78ycorcqk" path="res://menu/scene_transition.tscn" id="4_u444t"] -[ext_resource type="AudioStream" uid="uid://do7ii5hx71p0m" path="res://menu/sounds/page.ogg" id="5_xac6d"] -[ext_resource type="AudioStream" uid="uid://5b3noxjmasmu" path="res://menu/sounds/sign.ogg" id="6_wf0gh"] - -[sub_resource type="Animation" id="Animation_m4a1a"] -length = 0.001 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("ScrollContainer:position") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 0, -"values": [Vector2(0, 0)] -} - -[sub_resource type="Animation" id="Animation_s1to2"] -resource_name = "paper_slide" -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("ScrollContainer:position") -tracks/0/interp = 2 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 1), -"transitions": PackedFloat32Array(1, 1), -"update": 0, -"values": [Vector2(0, -1800), Vector2(0, 0)] -} - -[sub_resource type="AnimationLibrary" id="AnimationLibrary_wjgak"] -_data = { -"RESET": SubResource("Animation_m4a1a"), -"paper_slide": SubResource("Animation_s1to2") -} - -[sub_resource type="Gradient" id="Gradient_nsc3h"] -colors = PackedColorArray(0.941084, 0.949219, 0.918643, 1, 1, 1, 1, 1) - -[sub_resource type="FastNoiseLite" id="FastNoiseLite_amioi"] - -[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_bvvl7"] -color_ramp = SubResource("Gradient_nsc3h") -noise = SubResource("FastNoiseLite_amioi") - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_e7xn5"] -bg_color = Color(0.196078, 0.196078, 0.235294, 1) -corner_radius_top_left = 10 -corner_radius_top_right = 10 -corner_radius_bottom_right = 10 -corner_radius_bottom_left = 10 - -[sub_resource type="ButtonGroup" id="ButtonGroup_8p5im"] - -[sub_resource type="FontVariation" id="FontVariation_2cc7p"] -base_font = ExtResource("3_2vg4d") - -[node name="SetupMenu" 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_mo46n") - -[node name="ColorRect" type="ColorRect" parent="."] -layout_mode = 2 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -color = Color(0.196078, 0.196078, 0.235294, 1) - -[node name="AnimationPlayer" type="AnimationPlayer" parent="."] -libraries = { -"": SubResource("AnimationLibrary_wjgak") -} -speed_scale = 2.0 - -[node name="ScrollContainer" type="ScrollContainer" parent="."] -clip_contents = false -layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -horizontal_scroll_mode = 0 - -[node name="Control" type="Control" parent="ScrollContainer"] -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"] -layout_mode = 1 -anchors_preset = 8 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -offset_left = -400.0 -offset_top = -559.57 -offset_right = 400.0 -offset_bottom = 571.801 -grow_horizontal = 2 -grow_vertical = 2 -rotation = 0.0174533 -theme = ExtResource("1_yq0aa") -texture = SubResource("NoiseTexture2D_bvvl7") - -[node name="Hole1" type="Panel" parent="ScrollContainer/Control/TextureRect"] -layout_mode = 1 -anchors_preset = 8 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -offset_left = -365.0 -offset_top = -189.686 -offset_right = -345.0 -offset_bottom = -169.686 -grow_horizontal = 2 -grow_vertical = 2 -theme_override_styles/panel = SubResource("StyleBoxFlat_e7xn5") - -[node name="Hole2" type="Panel" parent="ScrollContainer/Control/TextureRect"] -layout_mode = 1 -anchors_preset = 8 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -offset_left = -365.0 -offset_top = 130.314 -offset_right = -345.0 -offset_bottom = 150.314 -grow_horizontal = 2 -grow_vertical = 2 -theme_override_styles/panel = SubResource("StyleBoxFlat_e7xn5") - -[node name="PaperMargin" type="MarginContainer" parent="ScrollContainer/Control/TextureRect"] -layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 - -[node name="Contents" type="VBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin"] -layout_mode = 2 - -[node name="Title" type="Label" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] -layout_mode = 2 -size_flags_horizontal = 4 -theme_override_font_sizes/font_size = 30 -text = "EMPLOYMENT CONTRACT" - -[node name="Sep" type="HSeparator" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] -layout_mode = 2 - -[node name="Intro" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] -layout_mode = 2 -bbcode_enabled = true -text = "This is a binding contract between you (the employee) and Musterfoods Ltd. (the employer) for working as a chef or waiter." -fit_content = true -scroll_active = false - -[node name="Name" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] -layout_mode = 2 -bbcode_enabled = true -text = "1. [b]Name of the Employee[/b]" -fit_content = true -scroll_active = false - -[node name="NameEntry" type="HBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] -layout_mode = 2 - -[node name="LineEdit" type="LineEdit" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/NameEntry"] -custom_minimum_size = Vector2(300, 30) -layout_mode = 2 -max_length = 64 - -[node name="Control" type="Control" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/NameEntry"] -layout_mode = 2 - -[node name="Position" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] -layout_mode = 2 -bbcode_enabled = true -text = "2. [b]Employment Position[/b]" -fit_content = true -scroll_active = false - -[node name="PositionEntry" type="HBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] -layout_mode = 2 - -[node name="LineEdit" type="LineEdit" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/PositionEntry"] -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) -text = "Chef / Waiting Staff" -editable = false - -[node name="Control" type="Control" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/PositionEntry"] -layout_mode = 2 - -[node name="Uniform" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] -layout_mode = 2 -bbcode_enabled = true -text = "3. [b]Working Uniform.[/b] You must always have one of the following hairstyles." -fit_content = true -scroll_active = false - -[node name="UniformEntry" type="VBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] -layout_mode = 2 - -[node name="Style1" type="CheckBox" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/UniformEntry"] -layout_mode = 2 -button_group = SubResource("ButtonGroup_8p5im") -text = "Hairstyle 1" - -[node name="Style2" type="CheckBox" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/UniformEntry"] -layout_mode = 2 -button_group = SubResource("ButtonGroup_8p5im") -text = "Hairstyle 2" - -[node name="Style3" type="CheckBox" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/UniformEntry"] -layout_mode = 2 -button_group = SubResource("ButtonGroup_8p5im") -text = "Hairstyle 3" - -[node name="Duties" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] -layout_mode = 2 -bbcode_enabled = true -text = "4. [b]Duties.[/b] It is your duty to serve customers the meal or item that they request. -" -fit_content = true -scroll_active = false - -[node name="Terms" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] -layout_mode = 2 -bbcode_enabled = true -text = "5. [b]Additional Terms.[/b] You shall not duplicate plates. (That is [u]NOT[/u] possible!) -" -fit_content = true -scroll_active = false - -[node name="Compensation" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] -layout_mode = 2 -bbcode_enabled = true -text = "4. [b]Compensation.[/b] You will be compensated monthly for your work." -fit_content = true -scroll_active = false - -[node name="CompensationEntry" type="HBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] -layout_mode = 2 - -[node name="Spacer" type="Control" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/CompensationEntry"] -custom_minimum_size = Vector2(15.045, 0) -layout_mode = 2 - -[node name="Text1" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/CompensationEntry"] -custom_minimum_size = Vector2(100.08, 0) -layout_mode = 2 -bbcode_enabled = true -text = "The salary is" -scroll_active = false - -[node name="LineEdit" type="LineEdit" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/CompensationEntry"] -custom_minimum_size = Vector2(50, 30) -layout_mode = 2 -theme_override_colors/font_uneditable_color = Color(0.478431, 0, 0, 1) -text = "$ 0.00" -editable = false - -[node name="Text2" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/CompensationEntry"] -custom_minimum_size = Vector2(100.08, 0) -layout_mode = 2 -bbcode_enabled = true -text = "per month" -scroll_active = false - -[node name="Spacer" type="Control" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] -custom_minimum_size = Vector2(0, 200) -layout_mode = 2 - -[node name="Signatures" type="HBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents"] -layout_mode = 2 - -[node name="EmployerMargin" type="MarginContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures"] -layout_mode = 2 - -[node name="Sign" type="VBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployerMargin"] -layout_mode = 2 - -[node name="Desc" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployerMargin/Sign"] -layout_mode = 2 -theme_override_font_sizes/normal_font_size = 15 -bbcode_enabled = true -text = "Signature of the Employer: -Musterfoods Ltd. -Frank Miller, Head of HR" -fit_content = true -scroll_active = false - -[node name="Signature" type="Label" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployerMargin/Sign"] -custom_minimum_size = Vector2(200, 80) -layout_mode = 2 -theme_override_colors/font_color = Color(0.415686, 0.0253044, 0.135441, 1) -theme_override_fonts/font = SubResource("FontVariation_2cc7p") -theme_override_font_sizes/font_size = 31 -text = "F.Miller" -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="Underline" type="HSeparator" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployerMargin/Sign"] -layout_mode = 2 - -[node name="EmployeeMargin" type="MarginContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures"] -layout_mode = 2 - -[node name="Sign" type="VBoxContainer" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployeeMargin"] -layout_mode = 2 - -[node name="Desc" type="RichTextLabel" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployeeMargin/Sign"] -layout_mode = 2 -theme_override_font_sizes/normal_font_size = 15 -bbcode_enabled = true -text = "Signature of the Employee: - - -" -fit_content = true -scroll_active = false - -[node name="Signature" type="Button" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployeeMargin/Sign"] -custom_minimum_size = Vector2(200, 80) -layout_mode = 2 -text = "Click to sign" - -[node name="Underline" type="HSeparator" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployeeMargin/Sign"] -layout_mode = 2 - -[node name="SceneTransition" parent="." instance=ExtResource("4_u444t")] -visible = false -layout_mode = 1 - -[node name="Page" type="AudioStreamPlayer" parent="."] -stream = ExtResource("5_xac6d") -volume_db = -16.0 -autoplay = true - -[node name="Sign" type="AudioStreamPlayer" parent="."] -stream = ExtResource("6_wf0gh") -volume_db = -16.0 - -[connection signal="pressed" from="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployeeMargin/Sign/Signature" to="." method="_on_sign_pressed"] -- cgit v1.2.3-70-g09d2