From 68185fa9ecfd8b202d83aa70988f1b0f5a630f2e Mon Sep 17 00:00:00 2001 From: ChaoticByte Date: Mon, 10 Jun 2024 15:51:02 +0200 Subject: [PATCH] fix: Remember the location a shader was loaded from & improve functionality --- .gitignore | 2 ++ src/Editor.gd | 2 +- src/Main.gd | 7 ++----- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 158b719..99ff9ef 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,5 @@ mono_crash.*.json dist/* !dist/.gitkeep +screenshot.png.import + diff --git a/src/Editor.gd b/src/Editor.gd index ebc1dfa..b2b3d1b 100644 --- a/src/Editor.gd +++ b/src/Editor.gd @@ -231,7 +231,7 @@ func _on_open_shader_dialog_file_selected(path): Globals.shader = shader Globals.target_viewport.update() update() - last_save_filepath = "" + last_save_filepath = path func _on_save_shader_dialog_file_selected(path): var file = FileAccess.open(path, FileAccess.WRITE) diff --git a/src/Main.gd b/src/Main.gd index b9c77cd..1f56020 100644 --- a/src/Main.gd +++ b/src/Main.gd @@ -20,16 +20,13 @@ func _on_open_image_dialog_file_selected(path): image_viewport.set_original_image(img) image_viewport.update() camera.fit_image() - last_save_filepath = "" + last_save_filepath = path else: print("An error occured!") func _on_save_image_button_pressed(): if image_viewport.get_result() != null: - if last_save_filepath == "": - ui_control_filesave.current_file = "output.png" - else: - ui_control_filesave.current_path = last_save_filepath + ui_control_filesave.current_path = last_save_filepath ui_control_filesave.show() func _on_save_image_dialog_file_selected(path):