aboutsummaryrefslogtreecommitdiff
path: root/client/gui/menus/game.gd
diff options
context:
space:
mode:
Diffstat (limited to 'client/gui/menus/game.gd')
-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()