aboutsummaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authortpart <tpart120@proton.me>2026-03-11 21:13:50 +0100
committertpart <tpart120@proton.me>2026-03-11 21:13:56 +0100
commit93fbbf687de7e3b3b27e150c455cef2ac4d4c303 (patch)
tree19a1fc79597f9a9476732559341f509b94adcef4 /client
parent185b08984ec63009b1be65959c903dc60ace5d9a (diff)
downloadhurrycurry-93fbbf687de7e3b3b27e150c455cef2ac4d4c303.tar
hurrycurry-93fbbf687de7e3b3b27e150c455cef2ac4d4c303.tar.bz2
hurrycurry-93fbbf687de7e3b3b27e150c455cef2ac4d4c303.tar.zst
Add button-base and both button model variants
Diffstat (limited to 'client')
-rw-r--r--client/map/tile_factory.gd2
-rw-r--r--client/map/tiles/button/accept.svg4
-rw-r--r--client/map/tiles/button/accept.svg.import45
-rw-r--r--client/map/tiles/button/button.gd27
-rw-r--r--client/map/tiles/button/button.gd.uid1
-rw-r--r--client/map/tiles/button/button.tscn36
-rw-r--r--client/map/tiles/button/button_dynamic_accept.resbin0 -> 8442 bytes
-rw-r--r--client/map/tiles/button/button_dynamic_cancel.resbin0 -> 8439 bytes
-rw-r--r--client/map/tiles/button/button_model.gd28
-rw-r--r--client/map/tiles/button/button_model.gd.uid1
-rw-r--r--client/map/tiles/button/button_static.resbin0 -> 4629 bytes
-rw-r--r--client/map/tiles/button/cancel.svg4
-rw-r--r--client/map/tiles/button/cancel.svg.import45
-rw-r--r--client/map/tiles/button_base.resbin0 -> 2646 bytes
-rw-r--r--client/map/tiles/button_base.tscn9
15 files changed, 202 insertions, 0 deletions
diff --git a/client/map/tile_factory.gd b/client/map/tile_factory.gd
index e2138cbf..ae8b9d49 100644
--- a/client/map/tile_factory.gd
+++ b/client/map/tile_factory.gd
@@ -58,6 +58,8 @@ func produce(raw_name: String, position: Vector2i, neighbors: Array, below_tile_
match tile_name.name:
"book": return CounterBase.new(ctx, preload("res://map/tiles/book.tscn"))
+ "button": return Button_.new(ctx)
+ "button-base": return GenericTile.new(ctx, preload("res://map/tiles/button_base.tscn"))
"ceiling-lamp": return GenericTile.new(ctx, preload("res://map/tiles/ceiling_lamp.tscn"))
"chair": return Chair.new(ctx)
"chandelier": return GenericTile.new(ctx, preload("res://map/tiles/chandelier.tscn"))
diff --git a/client/map/tiles/button/accept.svg b/client/map/tiles/button/accept.svg
new file mode 100644
index 00000000..c703ae9a
--- /dev/null
+++ b/client/map/tiles/button/accept.svg
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg" height="128px" viewBox="0 -960 960 960" width="128px">
+ <rect width="960" height="960" x="0" y="-960" fill="#00A300"/>
+ <path fill="#FFFFFF" d="m382-388 321-321q19-19 45-19t45 19q19 19 19 45t-19 45L427-253q-19 19-45 19t-45-19L167-423q-19-19-19-45t19-45q19-19 45-19t45 19l125 125Z"/>
+</svg>
diff --git a/client/map/tiles/button/accept.svg.import b/client/map/tiles/button/accept.svg.import
new file mode 100644
index 00000000..010d0f2a
--- /dev/null
+++ b/client/map/tiles/button/accept.svg.import
@@ -0,0 +1,45 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://c1rx5o81pcv8g"
+path.s3tc="res://.godot/imported/accept.svg-3967b4e72211bf837c252cb2420fcd55.s3tc.ctex"
+path.etc2="res://.godot/imported/accept.svg-3967b4e72211bf837c252cb2420fcd55.etc2.ctex"
+metadata={
+"imported_formats": ["s3tc_bptc", "etc2_astc"],
+"vram_texture": true
+}
+
+[deps]
+
+source_file="res://map/tiles/button/accept.svg"
+dest_files=["res://.godot/imported/accept.svg-3967b4e72211bf837c252cb2420fcd55.s3tc.ctex", "res://.godot/imported/accept.svg-3967b4e72211bf837c252cb2420fcd55.etc2.ctex"]
+
+[params]
+
+compress/mode=2
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/uastc_level=0
+compress/rdo_quality_loss=0.0
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=true
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/channel_remap/red=0
+process/channel_remap/green=1
+process/channel_remap/blue=2
+process/channel_remap/alpha=3
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=0
+svg/scale=1.0
+editor/scale_with_editor_scale=false
+editor/convert_colors_with_editor_theme=false
diff --git a/client/map/tiles/button/button.gd b/client/map/tiles/button/button.gd
new file mode 100644
index 00000000..b806f58f
--- /dev/null
+++ b/client/map/tiles/button/button.gd
@@ -0,0 +1,27 @@
+# Hurry Curry! - a game about cooking
+# Copyright (C) 2025 Hurry Curry! contributors
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, version 3 of the License only.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+#
+class_name Button_
+extends Tile
+
+#static func interact_target() -> Vector3:
+# return Vector3(0, 0.25, 0)
+
+var button: ButtonModel = load("res://map/tiles/button/button.tscn").instantiate()
+
+func _init(ctx: TileFactory.TileCC):
+ super(ctx)
+ base.add_child(button)
+ button.set_up(ctx.tile_name.variant)
diff --git a/client/map/tiles/button/button.gd.uid b/client/map/tiles/button/button.gd.uid
new file mode 100644
index 00000000..1475ad20
--- /dev/null
+++ b/client/map/tiles/button/button.gd.uid
@@ -0,0 +1 @@
+uid://dyxxrus52yxxi
diff --git a/client/map/tiles/button/button.tscn b/client/map/tiles/button/button.tscn
new file mode 100644
index 00000000..c8ba94ac
--- /dev/null
+++ b/client/map/tiles/button/button.tscn
@@ -0,0 +1,36 @@
+[gd_scene format=3 uid="uid://nhmmgqwlmc8g"]
+
+[ext_resource type="ArrayMesh" uid="uid://cgq0beass0omg" path="res://map/tiles/button/button_static.res" id="1_tihjt"]
+[ext_resource type="Script" uid="uid://c06qln7x5266q" path="res://map/tiles/button/button_model.gd" id="1_ubqac"]
+[ext_resource type="ArrayMesh" uid="uid://dhaxbrl6a0vg" path="res://map/tiles/button/button_dynamic_cancel.res" id="2_ubqac"]
+[ext_resource type="ArrayMesh" uid="uid://u6ugrx5nrfj7" path="res://map/tiles/button/button_dynamic_accept.res" id="3_lxai3"]
+
+[node name="Button" type="Node3D" unique_id=1558887746]
+script = ExtResource("1_ubqac")
+
+[node name="StaticMesh" type="MeshInstance3D" parent="." unique_id=1131117450]
+transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0.55, 0)
+mesh = ExtResource("1_tihjt")
+
+[node name="Dynamic" type="Node3D" parent="." unique_id=509704898]
+
+[node name="Reject" type="MeshInstance3D" parent="Dynamic" unique_id=1474668033]
+transform = Transform3D(0.375, 0, 0, 0, 0.5, 0, 0, 0, 0.375, 0, 0.525, 0)
+visible = false
+mesh = ExtResource("2_ubqac")
+
+[node name="Accept" type="MeshInstance3D" parent="Dynamic" unique_id=1159246571]
+transform = Transform3D(0.375, 0, 0, 0, 0.5, 0, 0, 0, 0.375, 0, 0.525, 0)
+mesh = ExtResource("3_lxai3")
+
+[node name="DynamicPressed" type="MeshInstance3D" parent="." unique_id=90564715]
+transform = Transform3D(0.75, 0, 0, 0, 1, 0, 0, 0, 0.75, 0, 1.0500001, 0)
+visible = false
+mesh = ExtResource("2_ubqac")
+
+[node name="OmniLight3D" type="OmniLight3D" parent="DynamicPressed" unique_id=172878339]
+transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.52889466, 0)
+light_color = Color(1, 0, 0, 1)
+omni_range = 2.0
+
+[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=326186226]
diff --git a/client/map/tiles/button/button_dynamic_accept.res b/client/map/tiles/button/button_dynamic_accept.res
new file mode 100644
index 00000000..21440b95
--- /dev/null
+++ b/client/map/tiles/button/button_dynamic_accept.res
Binary files differ
diff --git a/client/map/tiles/button/button_dynamic_cancel.res b/client/map/tiles/button/button_dynamic_cancel.res
new file mode 100644
index 00000000..d17c4dd3
--- /dev/null
+++ b/client/map/tiles/button/button_dynamic_cancel.res
Binary files differ
diff --git a/client/map/tiles/button/button_model.gd b/client/map/tiles/button/button_model.gd
new file mode 100644
index 00000000..f571d599
--- /dev/null
+++ b/client/map/tiles/button/button_model.gd
@@ -0,0 +1,28 @@
+# Hurry Curry! - a game about cooking
+# Copyright (C) 2025 Hurry Curry! contributors
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, version 3 of the License only.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+#
+class_name ButtonModel
+extends Node3D
+
+func set_up(variant: String):
+ match variant:
+ "accept":
+ $Dynamic/Accept.visible = true
+ $Dynamic/Reject.visible = false
+ "reject":
+ $Dynamic/Accept.visible = false
+ $Dynamic/Reject.visible = true
+ _:
+ push_error("Unrecognized button variant: %s" % variant)
diff --git a/client/map/tiles/button/button_model.gd.uid b/client/map/tiles/button/button_model.gd.uid
new file mode 100644
index 00000000..c9555c31
--- /dev/null
+++ b/client/map/tiles/button/button_model.gd.uid
@@ -0,0 +1 @@
+uid://c06qln7x5266q
diff --git a/client/map/tiles/button/button_static.res b/client/map/tiles/button/button_static.res
new file mode 100644
index 00000000..23ec99ec
--- /dev/null
+++ b/client/map/tiles/button/button_static.res
Binary files differ
diff --git a/client/map/tiles/button/cancel.svg b/client/map/tiles/button/cancel.svg
new file mode 100644
index 00000000..4f62fa5f
--- /dev/null
+++ b/client/map/tiles/button/cancel.svg
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg" height="128px" viewBox="0 -960 960 960" width="128px">
+ <rect width="960" height="960" x="0" y="-960" fill="#EA0026"/>
+ <path fill="#FFFFFF" d="M480-392 300-212q-18 18-44 18t-44-18q-18-18-18-44t18-44l180-180-180-180q-18-18-18-44t18-44q18-18 44-18t44 18l180 180 180-180q18-18 44-18t44 18q18 18 18 44t-18 44L568-480l180 180q18 18 18 44t-18 44q-18 18-44 18t-44-18L480-392Z"/>
+</svg>
diff --git a/client/map/tiles/button/cancel.svg.import b/client/map/tiles/button/cancel.svg.import
new file mode 100644
index 00000000..98ab8ec5
--- /dev/null
+++ b/client/map/tiles/button/cancel.svg.import
@@ -0,0 +1,45 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://blp5workmjdpi"
+path.s3tc="res://.godot/imported/cancel.svg-c3c8e16f267e99928c19f8a5251da6ef.s3tc.ctex"
+path.etc2="res://.godot/imported/cancel.svg-c3c8e16f267e99928c19f8a5251da6ef.etc2.ctex"
+metadata={
+"imported_formats": ["s3tc_bptc", "etc2_astc"],
+"vram_texture": true
+}
+
+[deps]
+
+source_file="res://map/tiles/button/cancel.svg"
+dest_files=["res://.godot/imported/cancel.svg-c3c8e16f267e99928c19f8a5251da6ef.s3tc.ctex", "res://.godot/imported/cancel.svg-c3c8e16f267e99928c19f8a5251da6ef.etc2.ctex"]
+
+[params]
+
+compress/mode=2
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/uastc_level=0
+compress/rdo_quality_loss=0.0
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=true
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/channel_remap/red=0
+process/channel_remap/green=1
+process/channel_remap/blue=2
+process/channel_remap/alpha=3
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=0
+svg/scale=1.0
+editor/scale_with_editor_scale=false
+editor/convert_colors_with_editor_theme=false
diff --git a/client/map/tiles/button_base.res b/client/map/tiles/button_base.res
new file mode 100644
index 00000000..ba909081
--- /dev/null
+++ b/client/map/tiles/button_base.res
Binary files differ
diff --git a/client/map/tiles/button_base.tscn b/client/map/tiles/button_base.tscn
new file mode 100644
index 00000000..8e3efbab
--- /dev/null
+++ b/client/map/tiles/button_base.tscn
@@ -0,0 +1,9 @@
+[gd_scene format=3 uid="uid://bfbq0lsh7gp21"]
+
+[ext_resource type="ArrayMesh" uid="uid://d3867ya8moxb5" path="res://map/tiles/button_base.res" id="1_yvd7h"]
+
+[node name="ButtonBase" type="Node3D" unique_id=1753800164]
+
+[node name="Mesh" type="MeshInstance3D" parent="." unique_id=305913322]
+transform = Transform3D(-2.1855694e-08, 0.5, -2.1855694e-08, 0, -2.1855694e-08, -0.5, -0.5, -2.1855694e-08, 9.553427e-16, 0, 0, 0)
+mesh = ExtResource("1_yvd7h")