diff --git a/Poisson.gd b/Poisson.gd index 80ec297..f2f01f8 100644 --- a/Poisson.gd +++ b/Poisson.gd @@ -16,13 +16,13 @@ var points = [] signal new_poisson(points) func _ready(): - reset_options(str(default_width), str(default_height), str(default_spacing)) + reset_options(default_width, default_height, default_spacing) pass func reset_options(width, height, spacing): - $HBoxContainer/Properties/width/width_edit.text = width - $HBoxContainer/Properties/height/height_edit.text = height - $HBoxContainer/Properties/spacing/spacing_edit.text = spacing + $HBoxContainer/Properties/width/width_edit.text = str(width) + $HBoxContainer/Properties/height/height_edit.text = str(height) + $HBoxContainer/Properties/spacing/spacing_edit.text = str(spacing) func set_data(width, height, spacing): data.width = width @@ -59,5 +59,6 @@ func _on_OpenFileDialog_file_selected(path): file.open(path, 1) var new_data = file.get_var() set_data(new_data.width, new_data.height, new_data.spacing) + reset_options(new_data.width, new_data.height, new_data.spacing) points = file.get_var() emit_signal("new_poisson", points)