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/*
|
||||||
!dist/.gitkeep
|
!dist/.gitkeep
|
||||||
|
|
||||||
|
screenshot.png.import
|
||||||
|
|
||||||
|
|
|
@ -231,7 +231,7 @@ func _on_open_shader_dialog_file_selected(path):
|
||||||
Globals.shader = shader
|
Globals.shader = shader
|
||||||
Globals.target_viewport.update()
|
Globals.target_viewport.update()
|
||||||
update()
|
update()
|
||||||
last_save_filepath = ""
|
last_save_filepath = path
|
||||||
|
|
||||||
func _on_save_shader_dialog_file_selected(path):
|
func _on_save_shader_dialog_file_selected(path):
|
||||||
var file = FileAccess.open(path, FileAccess.WRITE)
|
var file = FileAccess.open(path, FileAccess.WRITE)
|
||||||
|
|
|
@ -20,15 +20,12 @@ func _on_open_image_dialog_file_selected(path):
|
||||||
image_viewport.set_original_image(img)
|
image_viewport.set_original_image(img)
|
||||||
image_viewport.update()
|
image_viewport.update()
|
||||||
camera.fit_image()
|
camera.fit_image()
|
||||||
last_save_filepath = ""
|
last_save_filepath = path
|
||||||
else:
|
else:
|
||||||
print("An error occured!")
|
print("An error occured!")
|
||||||
|
|
||||||
func _on_save_image_button_pressed():
|
func _on_save_image_button_pressed():
|
||||||
if image_viewport.get_result() != null:
|
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()
|
ui_control_filesave.show()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue