Get content for Save from code_editor.text instead of Globals.shader.code - fixes #6

This commit is contained in:
ChaoticByte 2024-06-21 10:38:31 +02:00
parent 367dbe163c
commit d866fd1fe8
No known key found for this signature in database

View file

@ -236,7 +236,7 @@ func _on_open_shader_dialog_file_selected(path: String):
func _on_save_shader_dialog_file_selected(path):
print("Save ", path)
var file = FileAccess.open(path, FileAccess.WRITE)
var content = Globals.shader.code
var content = code_editor.text
file.store_string(content)
if "/" in path: # update current working directory
Globals.cwd = path.substr(0, path.rfind("/"))