Fixed godoxel's save file dialog.

This commit is contained in:
Relintai 2022-02-12 22:22:40 +01:00
parent 8b3d15d69c
commit e44e4c1366

View File

@ -1,13 +1,14 @@
tool tool
extends FileDialog extends FileDialog
var canvas #var canvas
var file_path = "" var file_path = ""
func _enter_tree(): #func _enter_tree():
canvas = get_parent().find_node("Canvas") #canvas = get_parent().find_node("Canvas")
#canvas = get_parent().paint_canvas
func _ready(): func _ready():
@ -37,6 +38,7 @@ func _on_SaveFileDialog_confirmed():
func save_file(): func save_file():
var image = Image.new() var image = Image.new()
var canvas = get_parent().paint_canvas
image.create(canvas.canvas_width, canvas.canvas_height, true, Image.FORMAT_RGBA8) image.create(canvas.canvas_width, canvas.canvas_height, true, Image.FORMAT_RGBA8)
image.lock() image.lock()