aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/map/auto_setup/light_setup.gd24
-rw-r--r--client/map/auto_setup/sky_light_setup.gd31
-rw-r--r--client/map/auto_setup/sky_light_setup.gd.uid1
-rw-r--r--client/map/environment/environment.tscn4
-rw-r--r--client/map/tiles/freezer.tscn10
-rw-r--r--client/map/tiles/freezer_model.gd15
-rw-r--r--client/map/tiles/oven.tscn6
-rw-r--r--client/map/tiles/oven_model.gd9
8 files changed, 80 insertions, 20 deletions
diff --git a/client/map/auto_setup/light_setup.gd b/client/map/auto_setup/light_setup.gd
index aeeefb3f..0d71f54b 100644
--- a/client/map/auto_setup/light_setup.gd
+++ b/client/map/auto_setup/light_setup.gd
@@ -17,22 +17,18 @@ extends Light3D
class_name LightSetup
@export var completely_disable_light_if_shadows_disabled := false
+var shadows_enabled: bool
func _ready():
Settings.hook_changed_init("graphics.shadows", "main", apply_settings)
-func apply_settings(setting: bool):
- if completely_disable_light_if_shadows_disabled:
- visible = setting
- shadow_enabled = setting
+func set_visible_(val: bool):
+ if completely_disable_light_if_shadows_disabled and not shadows_enabled:
+ return
+ visible = val
-func set_sky(sky_name: String):
- match sky_name:
- "day":
- light_color = Color.WHITE
- light_energy = 1.
- "night":
- light_color = Color("427a9a")
- light_energy = 0.4
- _:
- push_error("Can not set up light: Unsupported sky name \"%s\"" % sky_name)
+func apply_settings(setting: bool):
+ shadows_enabled = setting
+ if completely_disable_light_if_shadows_disabled and not shadows_enabled:
+ visible = false
+ shadow_enabled = shadows_enabled
diff --git a/client/map/auto_setup/sky_light_setup.gd b/client/map/auto_setup/sky_light_setup.gd
new file mode 100644
index 00000000..cb59fbf1
--- /dev/null
+++ b/client/map/auto_setup/sky_light_setup.gd
@@ -0,0 +1,31 @@
+# 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 LightSetup
+class_name SkyLightSetup
+
+func _ready():
+ super()
+
+func set_sky(sky_name: String):
+ match sky_name:
+ "day":
+ light_color = Color.WHITE
+ light_energy = 1.
+ "night":
+ light_color = Color("427a9a")
+ light_energy = 0.4
+ _:
+ push_error("Can not set up light: Unsupported sky name \"%s\"" % sky_name)
diff --git a/client/map/auto_setup/sky_light_setup.gd.uid b/client/map/auto_setup/sky_light_setup.gd.uid
new file mode 100644
index 00000000..79355f7a
--- /dev/null
+++ b/client/map/auto_setup/sky_light_setup.gd.uid
@@ -0,0 +1 @@
+uid://b8qayruwj51jc
diff --git a/client/map/environment/environment.tscn b/client/map/environment/environment.tscn
index 89575e1a..fe8bdcbc 100644
--- a/client/map/environment/environment.tscn
+++ b/client/map/environment/environment.tscn
@@ -2,7 +2,7 @@
[ext_resource type="Script" uid="uid://drv5el01y7fr" path="res://map/environment/environment.gd" id="1_qy481"]
[ext_resource type="PackedScene" uid="uid://cb4ic3ssk4r8r" path="res://map/environment/world_environment.tscn" id="2_68o16"]
-[ext_resource type="Script" uid="uid://de61uqoinwcyk" path="res://map/auto_setup/light_setup.gd" id="3_53gk2"]
+[ext_resource type="Script" uid="uid://b8qayruwj51jc" path="res://map/auto_setup/sky_light_setup.gd" id="3_fcjh2"]
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_fyrr8"]
emission_shape_offset = Vector3(0, 5, 0)
@@ -79,4 +79,4 @@ draw_pass_1 = SubResource("SphereMesh_4trvf")
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(-0.413104, 0.834517, -0.364591, 0, 0.400349, 0.916363, 0.910684, 0.378553, -0.165386, 0, 0, 0)
shadow_enabled = true
-script = ExtResource("3_53gk2")
+script = ExtResource("3_fcjh2")
diff --git a/client/map/tiles/freezer.tscn b/client/map/tiles/freezer.tscn
index 28895743..604bd439 100644
--- a/client/map/tiles/freezer.tscn
+++ b/client/map/tiles/freezer.tscn
@@ -57,26 +57,34 @@ skeleton = NodePath("")
[node name="OmniLight3D" type="OmniLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.25, 0)
+visible = false
light_color = Color(0.566816, 0.801037, 0.838352, 1)
shadow_enabled = true
+omni_range = 3.0
script = ExtResource("4_1eu4t")
completely_disable_light_if_shadows_disabled = true
[node name="OmniLight3D2" type="OmniLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.6, 0)
+visible = false
light_color = Color(0.566816, 0.801037, 0.838352, 1)
shadow_enabled = true
+omni_range = 3.0
script = ExtResource("4_1eu4t")
completely_disable_light_if_shadows_disabled = true
[node name="OmniLight3D3" type="OmniLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.9, 0)
+visible = false
light_color = Color(0.566816, 0.801037, 0.838352, 1)
shadow_enabled = true
+omni_range = 3.0
script = ExtResource("4_1eu4t")
completely_disable_light_if_shadows_disabled = true
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
-"": SubResource("AnimationLibrary_usga0")
+&"": SubResource("AnimationLibrary_usga0")
}
+
+[connection signal="animation_finished" from="AnimationPlayer" to="." method="_on_animation_player_animation_finished"]
diff --git a/client/map/tiles/freezer_model.gd b/client/map/tiles/freezer_model.gd
index 8fe167b9..4defda9c 100644
--- a/client/map/tiles/freezer_model.gd
+++ b/client/map/tiles/freezer_model.gd
@@ -16,5 +16,18 @@
class_name FreezerModel
extends Node3D
+@onready var anim_player: AnimationPlayer = $AnimationPlayer
+@onready var light_1: OmniLight3D = $OmniLight3D
+@onready var light_2: OmniLight3D = $OmniLight3D2
+@onready var light_3: OmniLight3D = $OmniLight3D3
+
func open():
- $AnimationPlayer.play("open")
+ light_1.set_visible_(true)
+ light_2.set_visible_(true)
+ light_3.set_visible_(true)
+ anim_player.play("open")
+
+func _on_animation_player_animation_finished(_anim_name: StringName) -> void:
+ light_1.set_visible_(false)
+ light_2.set_visible_(false)
+ light_3.set_visible_(false)
diff --git a/client/map/tiles/oven.tscn b/client/map/tiles/oven.tscn
index 5dbaae44..69fea89d 100644
--- a/client/map/tiles/oven.tscn
+++ b/client/map/tiles/oven.tscn
@@ -54,13 +54,17 @@ skeleton = NodePath("")
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
-"": SubResource("AnimationLibrary_io5nw")
+&"": SubResource("AnimationLibrary_io5nw")
}
[node name="OmniLight3D" type="OmniLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.7, 0)
+visible = false
light_color = Color(0.944743, 0.70243, 0.38641, 1)
light_energy = 2.0
shadow_enabled = true
+omni_range = 3.0
script = ExtResource("4_hjc80")
completely_disable_light_if_shadows_disabled = true
+
+[connection signal="animation_finished" from="AnimationPlayer" to="." method="_on_animation_player_animation_finished"]
diff --git a/client/map/tiles/oven_model.gd b/client/map/tiles/oven_model.gd
index 15fe733c..9ad66bd6 100644
--- a/client/map/tiles/oven_model.gd
+++ b/client/map/tiles/oven_model.gd
@@ -16,5 +16,12 @@
class_name OvenModel
extends Node3D
+@onready var anim_player: AnimationPlayer = $AnimationPlayer
+@onready var light_1: OmniLight3D = $OmniLight3D
+
func open():
- $AnimationPlayer.play("open")
+ light_1.set_visible_(true)
+ anim_player.play("open")
+
+func _on_animation_player_animation_finished(_anim_name: StringName) -> void:
+ light_1.set_visible_(false)