mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 07:14:42 -04:00
CreateNewImage now remembers the last created canvas size - Closes #178
The default image width, height and fill color are being used only when the program first launches. After that, if the user creates an image with changed settings, these settings are being kept.
This commit is contained in:
parent
c6ccbd4868
commit
ea717cfea7
4 changed files with 5 additions and 13 deletions
|
@ -53,7 +53,11 @@ var TStrings ={
|
|||
|
||||
|
||||
func _ready() -> void:
|
||||
width_value.value = Global.default_image_width
|
||||
height_value.value = Global.default_image_height
|
||||
fill_color_node.color = Global.default_fill_color
|
||||
fill_color_node.get_picker().presets_visible = false
|
||||
|
||||
ratio_box.connect("pressed", self, "_on_RatioCheckBox_toggled", [ratio_box.pressed])
|
||||
templates_options.connect("item_selected", self, "_on_TemplatesOptions_item_selected")
|
||||
|
||||
|
@ -84,17 +88,6 @@ func _on_CreateNewImage_confirmed() -> void:
|
|||
Global.canvas.camera_zoom()
|
||||
|
||||
|
||||
func _on_CreateNewImage_about_to_show() -> void:
|
||||
width_value.value = Global.default_image_width
|
||||
height_value.value = Global.default_image_height
|
||||
fill_color_node.color = Global.default_fill_color
|
||||
templates_options.selected = Templates.TDefault
|
||||
ratio_box.pressed = false
|
||||
for spin_box in [width_value, height_value]:
|
||||
if spin_box.is_connected("value_changed", self, "_on_SizeValue_value_changed"):
|
||||
spin_box.disconnect("value_changed", self, "_on_SizeValue_value_changed")
|
||||
|
||||
|
||||
var aspect_ratio: float
|
||||
|
||||
func _on_RatioCheckBox_toggled(_button_pressed: bool) -> void:
|
||||
|
|
|
@ -119,5 +119,4 @@ margin_bottom = 128.0
|
|||
rect_min_size = Vector2( 64, 20 )
|
||||
mouse_default_cursor_shape = 2
|
||||
color = Color( 0, 0, 0, 0 )
|
||||
[connection signal="about_to_show" from="." to="." method="_on_CreateNewImage_about_to_show"]
|
||||
[connection signal="confirmed" from="." to="." method="_on_CreateNewImage_confirmed"]
|
||||
|
|
|
@ -196,7 +196,6 @@ func add_brush() -> void:
|
|||
dir.list_dir_begin()
|
||||
var curr_file := dir.get_next()
|
||||
while curr_file != "":
|
||||
print(curr_file)
|
||||
if curr_file.begins_with("%") and brush_name in curr_file:
|
||||
random_brushes.append(curr_file)
|
||||
curr_file = dir.get_next()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue