aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortpart <tpart120@proton.me>2024-07-04 10:05:04 +0200
committertpart <tpart120@proton.me>2024-07-04 10:05:04 +0200
commit3d2bae03a51f8f96f0983af11ff7bfe693e7dbd9 (patch)
tree1a1ab1733eeadf695cf87913399cd97b88405ace
parent93583ac4d3b8ff2e0068b76582d3fffb426e0781 (diff)
downloadhurrycurry-3d2bae03a51f8f96f0983af11ff7bfe693e7dbd9.tar
hurrycurry-3d2bae03a51f8f96f0983af11ff7bfe693e7dbd9.tar.bz2
hurrycurry-3d2bae03a51f8f96f0983af11ff7bfe693e7dbd9.tar.zst
Add setting to disable shadows
-rw-r--r--client/game.tscn6
-rw-r--r--client/global.gd1
-rw-r--r--client/map/auto_setup/environment_setup.gd (renamed from client/map/environment_setup.gd)0
-rw-r--r--client/map/auto_setup/light_setup.gd24
-rw-r--r--client/menu/menu_background.tscn2
5 files changed, 30 insertions, 3 deletions
diff --git a/client/game.tscn b/client/game.tscn
index 460cde3d..2489e04e 100644
--- a/client/game.tscn
+++ b/client/game.tscn
@@ -1,9 +1,10 @@
-[gd_scene load_steps=11 format=3 uid="uid://c6krh36hoqfg8"]
+[gd_scene load_steps=12 format=3 uid="uid://c6krh36hoqfg8"]
[ext_resource type="Script" path="res://game.gd" id="1_sftfn"]
[ext_resource type="PackedScene" uid="uid://b31mlnao6ybt8" path="res://player/follow_camera.tscn" id="2_s8y6o"]
-[ext_resource type="Script" path="res://map/environment_setup.gd" id="4_hixq3"]
+[ext_resource type="Script" path="res://map/auto_setup/environment_setup.gd" id="4_hixq3"]
[ext_resource type="PackedScene" uid="uid://c0euiv7duqfp4" path="res://player/marker.tscn" id="4_igl0o"]
+[ext_resource type="Script" path="res://map/auto_setup/light_setup.gd" id="5_6fpff"]
[ext_resource type="Script" path="res://multiplayer.gd" id="6_fbxu8"]
[ext_resource type="PackedScene" uid="uid://b4gone8fu53r7" path="res://map/map.tscn" id="6_prg6t"]
[ext_resource type="PackedScene" uid="uid://bpikve6wlsjfl" path="res://menu/overlay.tscn" id="7_7xrr6"]
@@ -41,6 +42,7 @@ script = ExtResource("4_hixq3")
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(-0.412548, 0.834939, -0.364255, 4.90703e-08, 0.399869, 0.916572, 0.910936, 0.37813, -0.164965, 0, 0, 0)
shadow_enabled = true
+script = ExtResource("5_6fpff")
[node name="Marker" parent="." instance=ExtResource("4_igl0o")]
visible = false
diff --git a/client/global.gd b/client/global.gd
index db85a603..a8a34871 100644
--- a/client/global.gd
+++ b/client/global.gd
@@ -50,6 +50,7 @@ var default_settings := {
"taa": ToggleSetting.new(tr("Temporal Anti-Aliasing"), false),
"voxel_gi": ToggleSetting.new(tr("Use VoxelGI (Blocks the game on map update but is more accurate)"), false),
"sdfgi": ToggleSetting.new(tr("Use SDFGI (Doesn't block the game but produces more artifacts)"), false),
+ "shadows": ToggleSetting.new(tr("Enable shadows"), true),
"debug_info": ToggleSetting.new(tr("Display debug info (Framerate, etc.)"), false),
"grass_amount": RangeSetting.new(tr("3D grass amount per grass tile"), 16, 0, 32),
"setup_complete": ToggleSetting.new(tr("Initial setup complete. (Uncheck and restart to reenter)"), false),
diff --git a/client/map/environment_setup.gd b/client/map/auto_setup/environment_setup.gd
index f163588b..f163588b 100644
--- a/client/map/environment_setup.gd
+++ b/client/map/auto_setup/environment_setup.gd
diff --git a/client/map/auto_setup/light_setup.gd b/client/map/auto_setup/light_setup.gd
new file mode 100644
index 00000000..c74fb5ee
--- /dev/null
+++ b/client/map/auto_setup/light_setup.gd
@@ -0,0 +1,24 @@
+# Undercooked - a game about cooking
+# 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 <https://www.gnu.org/licenses/>.
+#
+extends DirectionalLight3D
+class_name LightSetup
+
+func _ready():
+ apply_settings()
+ Global.settings_changed.connect(apply_settings)
+
+func apply_settings():
+ shadow_enabled = Global.get_setting("shadows")
diff --git a/client/menu/menu_background.tscn b/client/menu/menu_background.tscn
index b4abe291..c0335fdc 100644
--- a/client/menu/menu_background.tscn
+++ b/client/menu/menu_background.tscn
@@ -1,7 +1,7 @@
[gd_scene load_steps=12 format=3 uid="uid://l4vm07dtda4j"]
[ext_resource type="Script" path="res://menu/menu_background.gd" id="1_ijsg0"]
-[ext_resource type="Script" path="res://map/environment_setup.gd" id="2_rkilw"]
+[ext_resource type="Script" path="res://map/auto_setup/environment_setup.gd" id="2_rkilw"]
[ext_resource type="Shader" path="res://menu/menu_background.gdshader" id="3_5mp8y"]
[ext_resource type="PackedScene" uid="uid://b4gone8fu53r7" path="res://map/map.tscn" id="3_p80a7"]