aboutsummaryrefslogtreecommitdiff
path: root/client/gui
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/gui
parenta7f70f89b349fd7482a5d9e268f9b60763406e49 (diff)
downloadhurrycurry-1949320e8826f1f2d74f5f5b70eedeb386f937ac.tar
hurrycurry-1949320e8826f1f2d74f5f5b70eedeb386f937ac.tar.bz2
hurrycurry-1949320e8826f1f2d74f5f5b70eedeb386f937ac.tar.zst
Add screenshot and sceneshot
Diffstat (limited to 'client/gui')
-rw-r--r--client/gui/menus/game.gd14
1 files changed, 14 insertions, 0 deletions
diff --git a/client/gui/menus/game.gd b/client/gui/menus/game.gd
index 0bf44484..97c8cc1d 100644
--- a/client/gui/menus/game.gd
+++ b/client/gui/menus/game.gd
@@ -37,6 +37,20 @@ func _input(_event):
await submenu("res://gui/menus/chat.tscn")
chat_preview.visible = true
+ if Input.is_action_just_pressed("screenshot"):
+ get_viewport().get_texture().get_image().save_png(get_shot_path("screenshot-%s.png"))
+ if Input.is_action_just_pressed("sceneshot"):
+ var doc := GLTFDocument.new()
+ var state := GLTFState.new()
+ doc.append_from_scene(game, state)
+ doc.write_to_filesystem(state, get_shot_path("sceneshot-%s.glb"))
+
+func get_shot_path(template: String) -> String:
+ var path = Settings.read("gameplay.screenshot_path")
+ if path == "": path = "user://"
+ var filename = template % Time.get_datetime_string_from_system()
+ return "%s/%s" % [path, filename]
+
func _menu_cover(state):
game.follow_camera.disable_input_menu = state
game.follow_camera.update_disable_input()