fix: Remember the location a shader was loaded from & improve functionality
This commit is contained in:
parent
1304ecd198
commit
68185fa9ec
3 changed files with 5 additions and 6 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -16,3 +16,5 @@ mono_crash.*.json
|
|||
dist/*
|
||||
!dist/.gitkeep
|
||||
|
||||
screenshot.png.import
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue