diff options
author | tpart <tpart120@proton.me> | 2025-09-21 18:43:39 +0200 |
---|---|---|
committer | tpart <tpart120@proton.me> | 2025-09-21 18:43:39 +0200 |
commit | 443c8aab02735f2e9b9c044f44dd88cb92551fa6 (patch) | |
tree | 3ccb65b418644230fb8e98959beb8539ce0f536a | |
parent | d0863dba87125380467e6c4275343608c716e217 (diff) | |
download | hurrycurry-443c8aab02735f2e9b9c044f44dd88cb92551fa6.tar hurrycurry-443c8aab02735f2e9b9c044f44dd88cb92551fa6.tar.bz2 hurrycurry-443c8aab02735f2e9b9c044f44dd88cb92551fa6.tar.zst |
Use kitchen background in setup menu
-rw-r--r-- | client/gui/menus/character.gd | 28 | ||||
-rw-r--r-- | client/gui/menus/character.tscn | 38 | ||||
-rw-r--r-- | client/gui/menus/setup/setup.tscn | 21 | ||||
-rw-r--r-- | client/map/kitchen_background.gd | 47 | ||||
-rw-r--r-- | client/map/kitchen_background.gd.uid | 1 | ||||
-rw-r--r-- | client/map/kitchen_background.tscn | 35 |
6 files changed, 99 insertions, 71 deletions
diff --git a/client/gui/menus/character.gd b/client/gui/menus/character.gd index 715a7b1f..1029cebd 100644 --- a/client/gui/menus/character.gd +++ b/client/gui/menus/character.gd @@ -17,40 +17,12 @@ extends Menu @onready var character: Character = $Node3D/Character @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 = Profile.read("username") character.set_style(Profile.read("character_style"), "chef") - 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)) - map.flush() func exit(): if username_edit.text == "": diff --git a/client/gui/menus/character.tscn b/client/gui/menus/character.tscn index 7bdf03e6..92a29690 100644 --- a/client/gui/menus/character.tscn +++ b/client/gui/menus/character.tscn @@ -1,19 +1,15 @@ -[gd_scene load_steps=11 format=3 uid="uid://1f7xpirm5d28"] +[gd_scene load_steps=10 format=3 uid="uid://1f7xpirm5d28"] [ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://gui/resources/theme/theme.tres" id="1_ak2pw"] [ext_resource type="Script" uid="uid://bglusga8l5c27" path="res://gui/menus/character.gd" id="1_brhd1"] -[ext_resource type="PackedScene" uid="uid://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://gui/menus/transition/scene_transition.tscn" id="4_c0ocf"] +[ext_resource type="PackedScene" uid="uid://wwu574dq2r8h" path="res://map/kitchen_background.tscn" id="4_oanna"] [ext_resource type="Texture2D" uid="uid://35rd5gamtyqm" path="res://gui/resources/icons/arrow.svg" id="5_kvd7k"] [ext_resource type="Texture2D" uid="uid://j75dbytlbju" path="res://gui/resources/icons/arrow_pressed.svg" id="5_xpff8"] [ext_resource type="Texture2D" uid="uid://b33qmctbpf48g" path="res://gui/resources/icons/arrow_hover.svg" id="6_soj8g"] [ext_resource type="Texture2D" uid="uid://by3qsrpxnfq4w" path="res://gui/resources/icons/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 @@ -26,36 +22,14 @@ script = ExtResource("1_brhd1") [node name="Node3D" type="Node3D" parent="."] -[node name="WorldEnvironment" type="WorldEnvironment" parent="Node3D"] -environment = SubResource("Environment_ex25y") +[node name="Character" parent="Node3D" instance=ExtResource("3_odq7n")] [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) +transform = Transform3D(1, 0, 0, 0, 0.9781476, 0.2079117, 0, -0.2079117, 0.9781476, 0, 1.125, 2.75) 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 +fov = 40.0 -[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="KitchenBackground" parent="Node3D" instance=ExtResource("4_oanna")] [node name="VBoxContainer" type="VBoxContainer" parent="."] layout_mode = 1 diff --git a/client/gui/menus/setup/setup.tscn b/client/gui/menus/setup/setup.tscn index 487f2200..0c2ba0d9 100644 --- a/client/gui/menus/setup/setup.tscn +++ b/client/gui/menus/setup/setup.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=15 format=3 uid="uid://ddl3efikvqp66"] +[gd_scene load_steps=16 format=3 uid="uid://ddl3efikvqp66"] [ext_resource type="Script" uid="uid://dxn6ow6hiwhbf" path="res://gui/menus/setup/setup.gd" id="1_mo46n"] [ext_resource type="Theme" uid="uid://ci2qajdoa1an1" path="res://gui/resources/theme/paper.tres" id="1_yq0aa"] @@ -6,6 +6,7 @@ [ext_resource type="FontFile" uid="uid://bo4vh5xkpvrh1" path="res://gui/resources/fonts/font-sansita-swashed.woff2" id="3_2vg4d"] [ext_resource type="AudioStream" uid="uid://do7ii5hx71p0m" path="res://gui/resources/sounds/page.ogg" id="5_xac6d"] [ext_resource type="AudioStream" uid="uid://5b3noxjmasmu" path="res://gui/resources/sounds/sign.ogg" id="6_wf0gh"] +[ext_resource type="PackedScene" uid="uid://wwu574dq2r8h" path="res://map/kitchen_background.tscn" id="7_k81bu"] [sub_resource type="Animation" id="Animation_m4a1a"] length = 0.001 @@ -49,8 +50,8 @@ 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") +color_ramp = SubResource("Gradient_nsc3h") [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_e7xn5"] bg_color = Color(0.196078, 0.196078, 0.235294, 1) @@ -71,14 +72,6 @@ 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") @@ -211,8 +204,8 @@ 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_uneditable_color = Color(0.458824, 0, 0, 1) theme_override_colors/font_color = Color(0.458824, 0, 0, 1) +theme_override_colors/font_uneditable_color = Color(0.458824, 0, 0, 1) editable = false [node name="LineEdit2" type="Label" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/PositionEntry/LineEdit"] @@ -392,5 +385,11 @@ autoplay = true stream = ExtResource("6_wf0gh") volume_db = -16.0 +[node name="KitchenBackground" parent="." instance=ExtResource("7_k81bu")] + +[node name="Camera3D" type="Camera3D" parent="KitchenBackground"] +transform = Transform3D(1, 0, 0, 0, 0.9781476, 0.2079117, 0, -0.2079117, 0.9781476, 0, 1.125, 2.75) +fov = 40.0 + [connection signal="pressed" from="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployeeMargin/Sign/Signature" to="." method="_on_sign_pressed"] [connection signal="pressed" from="Back" to="." method="_on_back_pressed"] diff --git a/client/map/kitchen_background.gd b/client/map/kitchen_background.gd new file mode 100644 index 00000000..4b728a94 --- /dev/null +++ b/client/map/kitchen_background.gd @@ -0,0 +1,47 @@ +# Hurry Curry! - a game about cooking +# Copyright (C) 2025 Hurry Curry! contributors +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, version 3 of the License only. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. +# +extends Node3D + +@onready var map: Map = $Map + +func _ready() -> void: + 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)) + map.flush() diff --git a/client/map/kitchen_background.gd.uid b/client/map/kitchen_background.gd.uid new file mode 100644 index 00000000..fc17de34 --- /dev/null +++ b/client/map/kitchen_background.gd.uid @@ -0,0 +1 @@ +uid://ddpr5p4c6p8pn diff --git a/client/map/kitchen_background.tscn b/client/map/kitchen_background.tscn new file mode 100644 index 00000000..af046095 --- /dev/null +++ b/client/map/kitchen_background.tscn @@ -0,0 +1,35 @@ +[gd_scene load_steps=4 format=3 uid="uid://wwu574dq2r8h"] + +[ext_resource type="PackedScene" uid="uid://b4gone8fu53r7" path="res://map/map.tscn" id="1_heqla"] +[ext_resource type="Script" uid="uid://ddpr5p4c6p8pn" path="res://map/kitchen_background.gd" id="1_ppf8f"] + +[sub_resource type="Environment" id="Environment_ex25y"] +background_mode = 1 +background_color = Color(0.145548, 0.151043, 0.207031, 1) + +[node name="KitchenBackground" type="Node3D"] +script = ExtResource("1_ppf8f") + +[node name="Map" parent="." instance=ExtResource("1_heqla")] +transform = Transform3D(0.866025, 0, 0.5, 0, 1, 0, -0.5, 0, 0.866025, 0, 0, 0) + +[node name="SpotLight3D" type="SpotLight3D" parent="."] +transform = Transform3D(0.63153476, -0.57124585, 0.52425385, 0.042865384, 0.700843, 0.71202654, -0.7741617, -0.42719722, 0.46709338, 1.79161, 3.07541, 1.58055) +light_energy = 2.689 +spot_range = 20.159 +spot_angle = 17.9256 + +[node name="SpotLight3D2" type="SpotLight3D" parent="."] +transform = Transform3D(0.32456997, 0.109091125, -0.93954957, 0.060483694, 0.9888999, 0.13571544, 0.94392586, -0.100876585, 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="."] +transform = Transform3D(0.11408793, -0.017399698, 0.99331826, 0.061045162, 0.9980801, 0.010471746, -0.9915934, 0.059442576, 0.114931054, 8.10732, 0.437069, 2.35824) +light_energy = 2.689 +spot_range = 20.159 +spot_angle = 17.9256 + +[node name="WorldEnvironment" type="WorldEnvironment" parent="."] +environment = SubResource("Environment_ex25y") |