mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-21 23:18:11 +00:00
Add a screenshot feature (#439)
This commit is contained in:
@@ -183,7 +183,8 @@ func setup_config_dirs() -> void:
|
||||
"logs",
|
||||
"marathon_recordings",
|
||||
"resource_packs",
|
||||
"saves"
|
||||
"saves",
|
||||
"screenshots"
|
||||
]
|
||||
|
||||
for d in dirs:
|
||||
@@ -244,6 +245,14 @@ func _process(delta: float) -> void:
|
||||
AudioManager.play_global_sfx("switch")
|
||||
debug_mode = true
|
||||
log_comment("Debug Mode enabled! some bugs may occur!")
|
||||
|
||||
if Input.is_action_just_pressed("ui_screenshot"):
|
||||
take_screenshot()
|
||||
|
||||
func take_screenshot() -> void:
|
||||
var img: Image = get_viewport().get_texture().get_image()
|
||||
var filename = Global.config_path.path_join("screenshots/screenshot_" + str(int(Time.get_unix_time_from_system())) + ".png")
|
||||
var err = img.save_png(filename)
|
||||
|
||||
func handle_p_switch(delta: float) -> void:
|
||||
if p_switch_active and get_tree().paused == false:
|
||||
|
@@ -478,6 +478,11 @@ ui_reset_keybindings={
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194336,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
ui_screenshot={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194333,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[internationalization]
|
||||
|
||||
|
Reference in New Issue
Block a user