Fixed json crash and text issue in EditPalettePopup

Importing a non-palette json file no longer crashes the app. Enabled autowrap for a label in EditPalettePopup because some translated text were pushing the boundaries of the dialog window.
This commit is contained in:
OverloadedOrama 2020-06-05 01:40:21 +03:00
parent 802f423067
commit 83916f8913
7 changed files with 1456 additions and 1458 deletions

View file

@ -5,9 +5,6 @@
[ext_resource path="res://assets/graphics/dark_themes/timeline/remove_frame.png" type="Texture" id=3]
[ext_resource path="res://assets/graphics/palette/palette_button_fill.png" type="Texture" id=6]
[node name="EditPalettePopup" type="WindowDialog"]
margin_right = 600.0
margin_bottom = 550.0
@ -31,10 +28,8 @@ margin_bottom = 462.0
size_flags_vertical = 3
[node name="EditPaletteColorPicker" type="ColorPicker" parent="VBoxContainer/HBoxContainer"]
margin_left = 4.0
margin_top = 4.0
margin_right = 4.0
margin_bottom = 4.0
margin_right = 308.0
margin_bottom = 462.0
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer"]
margin_left = 312.0
@ -73,6 +68,7 @@ margin_right = 244.0
margin_bottom = 426.0
text = "Use current left & right colors"
align = 1
autowrap = true
[node name="CenterContainer" type="CenterContainer" parent="VBoxContainer/HBoxContainer/VBoxContainer"]
margin_top = 430.0

View file

@ -143,8 +143,9 @@ func deserialize(input_string : String): # -> Palette
result.comments = data.comments
if data.has("editable"):
result.editable = data.editable
for color_data in data.colors:
result.add_color(color_data.data, color_data.name)
if data.has("colors"):
for color_data in data.colors:
result.add_color(color_data.data, color_data.name)
return result