aboutsummaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/global.gd1
-rw-r--r--client/makefile6
-rw-r--r--client/menu/play.gd12
-rw-r--r--client/menu/popup.gd31
-rw-r--r--client/menu/popup.tscn (renamed from client/menu/warning_popup.tscn)23
-rw-r--r--client/menu/rating/rating.tscn2
-rw-r--r--client/menu/setup.gd7
-rw-r--r--client/menu/warning_popup.gd8
-rw-r--r--client/player/character/character.gd21
-rw-r--r--client/player/character/robot/body.resbin30064 -> 0 bytes
10 files changed, 70 insertions, 41 deletions
diff --git a/client/global.gd b/client/global.gd
index 1d6fb630..6ea4f7dc 100644
--- a/client/global.gd
+++ b/client/global.gd
@@ -29,6 +29,7 @@ var default_profile := {
"character": 0,
"last_server_url": "",
"tutorial_ingredients_played": [],
+ "registry_asked": false,
"hints": {
"has_moved": false,
"has_boosted": false,
diff --git a/client/makefile b/client/makefile
index b7524ff0..bde22f11 100644
--- a/client/makefile
+++ b/client/makefile
@@ -14,7 +14,7 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
.PHONY: assets clean all locales
-all: assets locales icons/adaptive-background.png icons/adaptive-foreground.png
+all: .godot/import-finished assets locales icons/adaptive-background.png icons/adaptive-foreground.png
assets: menu/book/book_01.webp
locales: $(patsubst ../locale/%.ini,po/%.po,$(wildcard ../locale/*.ini))
@@ -24,6 +24,10 @@ clean:
rm -f menu/book/book_*.webp
rm -f icons/adaptive-foreground.png icons/adaptive-background.png
+.godot/import-finished:
+ godot --headless --import project.godot
+ touch $@
+
menu/book/book_01.webp:
@echo Downloading recipe book...
@mkdir -p menu/book
diff --git a/client/menu/play.gd b/client/menu/play.gd
index 1abd0bbc..9cf1bbaa 100644
--- a/client/menu/play.gd
+++ b/client/menu/play.gd
@@ -39,6 +39,18 @@ func _ready():
update_server_list_loading(ServerList.loading)
super()
+ if not Global.get_profile("registry_asked"):
+ var data := MenuPopup.Data.new()
+ data.text = tr("c.play.allow_query_registry")
+ var allow_button := Button.new()
+ allow_button.text = tr("c.menu.accept")
+ var deny_button := Button.new()
+ deny_button.text = tr("c.menu.deny")
+ allow_button.pressed.connect(func(): Global.set_setting("online.use_registry", true))
+ deny_button.pressed.connect(func(): Global.set_setting("online.use_registry", false))
+ data.buttons = [deny_button, allow_button]
+ await submenu("res://menu/popup.tscn", data)
+ Global.set_profile("registry_asked", true)
ServerList.start()
func update_server_list(lists: Array[Array]):
diff --git a/client/menu/popup.gd b/client/menu/popup.gd
new file mode 100644
index 00000000..5b3a60ac
--- /dev/null
+++ b/client/menu/popup.gd
@@ -0,0 +1,31 @@
+# Hurry Curry! - a game about cooking
+# Copyright 2024 nokoe
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, version 3 of the License only.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+#
+extends Menu
+class_name MenuPopup
+
+@onready var message := $CenterContainer/Panel/MarginContainer/VBoxContainer/Message
+@onready var button_container := $CenterContainer/Panel/MarginContainer/VBoxContainer/HBoxContainer
+
+class Data:
+ var buttons: Array[Button]
+ var text: String
+
+func _ready():
+ var setup: Data = self.data
+ for i in setup.buttons:
+ button_container.add_child(i)
+ i.pressed.connect(exit)
+ message.text = setup.text
diff --git a/client/menu/warning_popup.tscn b/client/menu/popup.tscn
index 4fd2fbba..85db4897 100644
--- a/client/menu/warning_popup.tscn
+++ b/client/menu/popup.tscn
@@ -1,18 +1,18 @@
-[gd_scene load_steps=4 format=3 uid="uid://0v2olkwpm150"]
+[gd_scene load_steps=4 format=3 uid="uid://lwtym0pbc17g"]
-[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme.tres" id="1_yk5xc"]
-[ext_resource type="Script" path="res://menu/warning_popup.gd" id="2_2vobb"]
-[ext_resource type="Material" uid="uid://beea1pc5nt67r" path="res://menu/theme/dark_blur_material.tres" id="3_5wavk"]
+[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme.tres" id="1_m0d0r"]
+[ext_resource type="Script" path="res://menu/popup.gd" id="2_1h10j"]
+[ext_resource type="Material" uid="uid://beea1pc5nt67r" path="res://menu/theme/dark_blur_material.tres" id="3_iouvy"]
-[node name="WarningPopup" type="Control"]
+[node name="Popup" 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_yk5xc")
-script = ExtResource("2_2vobb")
+theme = ExtResource("1_m0d0r")
+script = ExtResource("2_1h10j")
support_anim = false
[node name="CenterContainer" type="CenterContainer" parent="."]
@@ -24,7 +24,7 @@ grow_horizontal = 2
grow_vertical = 2
[node name="Panel" type="PanelContainer" parent="CenterContainer"]
-material = ExtResource("3_5wavk")
+material = ExtResource("3_iouvy")
layout_mode = 2
[node name="MarginContainer" type="MarginContainer" parent="CenterContainer/Panel"]
@@ -42,10 +42,3 @@ horizontal_alignment = 1
[node name="HBoxContainer" type="HBoxContainer" parent="CenterContainer/Panel/MarginContainer/VBoxContainer"]
layout_mode = 2
alignment = 1
-
-[node name="Accept" type="Button" parent="CenterContainer/Panel/MarginContainer/VBoxContainer/HBoxContainer"]
-layout_mode = 2
-theme_override_font_sizes/font_size = 16
-text = "Accept"
-
-[connection signal="pressed" from="CenterContainer/Panel/MarginContainer/VBoxContainer/HBoxContainer/Accept" to="." method="_on_accept_pressed"]
diff --git a/client/menu/rating/rating.tscn b/client/menu/rating/rating.tscn
index 69edba88..780cf261 100644
--- a/client/menu/rating/rating.tscn
+++ b/client/menu/rating/rating.tscn
@@ -120,7 +120,7 @@ alignment = 1
[node name="Close" type="Button" parent="MarginContainer/PanelContainer/VBoxContainer/HBoxContainer"]
layout_mode = 2
-text = "c.menu.rating.accept"
+text = "c.menu.accept"
[node name="StarTimer" type="Timer" parent="."]
wait_time = 0.5
diff --git a/client/menu/setup.gd b/client/menu/setup.gd
index fbf0bfce..580902da 100644
--- a/client/menu/setup.gd
+++ b/client/menu/setup.gd
@@ -60,7 +60,12 @@ func check():
func _on_sign_pressed():
if check() != null: # TODO show error message
- await submenu("res://menu/warning_popup.tscn", check())
+ var data := MenuPopup.Data.new()
+ data.text = check()
+ var accept_button := Button.new()
+ accept_button.text = tr("c.menu.accept")
+ data.buttons = [accept_button]
+ await submenu("res://menu/popup.tscn", data)
return
sign_button.disabled = true
diff --git a/client/menu/warning_popup.gd b/client/menu/warning_popup.gd
deleted file mode 100644
index fd23a30a..00000000
--- a/client/menu/warning_popup.gd
+++ /dev/null
@@ -1,8 +0,0 @@
-extends Menu
-class_name WarningPopup
-
-func _ready():
- $CenterContainer/Panel/MarginContainer/VBoxContainer/Message.text = self.data
-
-func _on_accept_pressed():
- exit()
diff --git a/client/player/character/character.gd b/client/player/character/character.gd
index 65275549..cd41e7ff 100644
--- a/client/player/character/character.gd
+++ b/client/player/character/character.gd
@@ -19,7 +19,6 @@ class_name Character
const DEFAULT_MAIN_MESH = preload("res://player/character/default/main.res")
const CUSTOMER_MAIN_MESH = preload("res://player/character/customer_body.res")
-const ROBOT_MAIN_MESH = preload("res://player/character/robot/body.res")
const WALK_ANIM_STRENGTH := 0.05
const WALK_ANIM_SPEED:= 15.0
@@ -105,22 +104,14 @@ func _process(delta):
func set_style(id: int):
var p = ParsedStyle.new(id)
- set_customer(p.customer)
- set_robot(p.robot)
+ main.mesh = CUSTOMER_MAIN_MESH if p.customer else DEFAULT_MAIN_MESH
+ if p.customer:
+ tie.queue_free()
+ head_robot.visible = p.robot
+ head_default.visible = not p.robot
for h in hairstyles: h.hide()
hairstyles[p.hair].show()
- $Main.get_active_material(0).albedo_color = colors[p.color]
-
-func set_customer(b: bool):
- if b:
- main.mesh = CUSTOMER_MAIN_MESH
- tie.queue_free()
- else: pass # TODO
-
-func set_robot(b: bool):
- head_robot.visible = b
- head_default.visible = not b
- main.mesh = ROBOT_MAIN_MESH if b else DEFAULT_MAIN_MESH
+ $Main.get_active_material(0).albedo_color = Color(0.349, 0.349, 0.349) if p.robot else colors[p.color]
func play_animation(name_: String):
current_animation = name_
diff --git a/client/player/character/robot/body.res b/client/player/character/robot/body.res
deleted file mode 100644
index b82147d3..00000000
--- a/client/player/character/robot/body.res
+++ /dev/null
Binary files differ