aboutsummaryrefslogtreecommitdiff
path: root/client/system
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-09-21 19:41:05 +0200
committermetamuffin <metamuffin@disroot.org>2025-09-21 19:41:13 +0200
commit1949320e8826f1f2d74f5f5b70eedeb386f937ac (patch)
treeea955cd131606528b1abc91cdbc031b1bb501056 /client/system
parenta7f70f89b349fd7482a5d9e268f9b60763406e49 (diff)
downloadhurrycurry-1949320e8826f1f2d74f5f5b70eedeb386f937ac.tar
hurrycurry-1949320e8826f1f2d74f5f5b70eedeb386f937ac.tar.bz2
hurrycurry-1949320e8826f1f2d74f5f5b70eedeb386f937ac.tar.zst
Add screenshot and sceneshot
Diffstat (limited to 'client/system')
-rw-r--r--client/system/gltf_apply_visibility.gd35
-rw-r--r--client/system/gltf_apply_visibility.gd.uid1
-rw-r--r--client/system/settings.gd1
3 files changed, 37 insertions, 0 deletions
diff --git a/client/system/gltf_apply_visibility.gd b/client/system/gltf_apply_visibility.gd
new file mode 100644
index 00000000..5635bf6e
--- /dev/null
+++ b/client/system/gltf_apply_visibility.gd
@@ -0,0 +1,35 @@
+# 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 GLTFDocumentExtension
+class_name GLTFApplyNodeVisibility
+
+# Since Godot 4.5 the KHR_node_visibility extension is
+# required which is not yet supported in Blender, so we
+# pre-apply them by removing meshes from hidden nodes.
+func _export_post(state: GLTFState) -> Error:
+ state.json["extensionsRequired"].erase("KHR_node_visibility")
+ var nodes = state.json["nodes"]
+ for node in nodes:
+ var visible = node.get("extensions", {}).get("KHR_node_visibility", {}).get("visible", true)
+ if not visible: hide_node(nodes, node)
+ return Error.OK
+
+func hide_node(nodes: Array, node: Dictionary):
+ if node.has("mesh"): print("clear mesh")
+ node.erase("mesh")
+ for child_index in node.get("children", []):
+ print("clear child child_index")
+ hide_node(nodes, nodes[child_index])
diff --git a/client/system/gltf_apply_visibility.gd.uid b/client/system/gltf_apply_visibility.gd.uid
new file mode 100644
index 00000000..2dfa14e4
--- /dev/null
+++ b/client/system/gltf_apply_visibility.gd.uid
@@ -0,0 +1 @@
+uid://xi0tf4wav1ky
diff --git a/client/system/settings.gd b/client/system/settings.gd
index 43613de0..a3aece89 100644
--- a/client/system/settings.gd
+++ b/client/system/settings.gd
@@ -30,6 +30,7 @@ static func get_root():
ToggleSetting.new("accessible_movement", false),
ToggleSetting.new("first_person", false),
DropdownSetting.new("interact_target", "dirsnap", ["dir", "dirsnap"]),
+ PathSetting.new("screenshot_path", "", FileDialog.FileMode.FILE_MODE_OPEN_DIR),
]),
SettingsCategory.new("graphics", [
PresetRow.new("preset", {