Import palette file dialog added

This commit is contained in:
CheetoHead 2019-12-18 09:43:11 -05:00
parent b08452034d
commit 9a65960994
16 changed files with 242 additions and 47 deletions

View file

@ -1,10 +1,13 @@
[gd_scene load_steps=4 format=2]
[gd_scene load_steps=6 format=2]
[ext_resource path="res://Scripts/EditPalettePopup.gd" type="Script" id=1]
[ext_resource path="res://Assets/Graphics/Timeline/New_Frame.png" type="Texture" id=2]
[ext_resource path="res://Assets/Graphics/Layers/delete_layer.png" type="Texture" id=3]
[ext_resource path="res://Assets/Graphics/Palette/new_swatch_button.png" type="Texture" id=2]
[ext_resource path="res://Assets/Graphics/Palette/new_swatch_button_hover.png" type="Texture" id=3]
[ext_resource path="res://Assets/Graphics/Palette/remove_swatch_button.png" type="Texture" id=4]
[ext_resource path="res://Assets/Graphics/Palette/remove_swatch_button_hover.png" type="Texture" id=5]
[node name="EditPalettePopup" type="WindowDialog"]
visible = true
margin_right = 600.0
margin_bottom = 550.0
rect_min_size = Vector2( 600, 550 )
@ -22,19 +25,17 @@ size_flags_horizontal = 3
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
margin_right = 580.0
margin_bottom = 482.0
margin_bottom = 478.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 = 290.0
margin_bottom = 478.0
[node name="Panel" type="Panel" parent="VBoxContainer/HBoxContainer"]
margin_left = 294.0
margin_right = 540.0
margin_bottom = 482.0
margin_right = 556.0
margin_bottom = 478.0
size_flags_horizontal = 3
[node name="EditPaletteGridContainer" type="GridContainer" parent="VBoxContainer/HBoxContainer/Panel"]
@ -45,71 +46,73 @@ size_flags_vertical = 3
columns = 8
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer"]
margin_left = 544.0
margin_left = 560.0
margin_right = 580.0
margin_bottom = 482.0
margin_bottom = 478.0
[node name="AddSwatchButton" type="TextureButton" parent="VBoxContainer/HBoxContainer/VBoxContainer"]
margin_right = 36.0
margin_bottom = 36.0
margin_right = 20.0
margin_bottom = 20.0
texture_normal = ExtResource( 2 )
texture_hover = ExtResource( 3 )
[node name="RemoveSwatchButton" type="TextureButton" parent="VBoxContainer/HBoxContainer/VBoxContainer"]
margin_top = 40.0
margin_right = 36.0
margin_bottom = 72.0
texture_normal = ExtResource( 3 )
margin_top = 24.0
margin_right = 20.0
margin_bottom = 44.0
texture_normal = ExtResource( 4 )
texture_hover = ExtResource( 5 )
[node name="HBoxContainer3" type="HBoxContainer" parent="VBoxContainer"]
margin_top = 486.0
margin_top = 482.0
margin_right = 580.0
margin_bottom = 503.0
margin_bottom = 506.0
[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer3"]
margin_top = 1.0
margin_right = 68.0
margin_bottom = 16.0
margin_top = 5.0
margin_right = 79.0
margin_bottom = 19.0
text = "Color Name:"
[node name="EditPaletteColorNameLineEdit" type="LineEdit" parent="VBoxContainer/HBoxContainer3"]
margin_left = 72.0
margin_left = 83.0
margin_right = 580.0
margin_bottom = 17.0
margin_bottom = 24.0
size_flags_horizontal = 3
[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer"]
margin_top = 507.0
margin_top = 510.0
margin_right = 580.0
margin_bottom = 530.0
size_flags_horizontal = 3
[node name="SpacerControl" type="Control" parent="VBoxContainer/HBoxContainer2"]
margin_right = 159.0
margin_bottom = 23.0
margin_right = 156.0
margin_bottom = 20.0
size_flags_horizontal = 3
[node name="EditPaletteSaveButton" type="Button" parent="VBoxContainer/HBoxContainer2"]
margin_left = 163.0
margin_left = 160.0
margin_right = 201.0
margin_bottom = 23.0
margin_bottom = 20.0
text = "Save"
[node name="SpacerControl2" type="Control" parent="VBoxContainer/HBoxContainer2"]
margin_left = 205.0
margin_right = 364.0
margin_bottom = 23.0
margin_right = 361.0
margin_bottom = 20.0
size_flags_horizontal = 3
[node name="EditPaletteCancelButton" type="Button" parent="VBoxContainer/HBoxContainer2"]
margin_left = 368.0
margin_right = 417.0
margin_bottom = 23.0
margin_left = 365.0
margin_right = 419.0
margin_bottom = 20.0
text = "Cancel"
[node name="SpacerControl3" type="Control" parent="VBoxContainer/HBoxContainer2"]
margin_left = 421.0
margin_left = 423.0
margin_right = 580.0
margin_bottom = 23.0
margin_bottom = 20.0
size_flags_horizontal = 3
[connection signal="color_changed" from="VBoxContainer/HBoxContainer/EditPaletteColorPicker" to="." method="_on_EditPaletteColorPicker_color_changed"]
[connection signal="pressed" from="VBoxContainer/HBoxContainer/VBoxContainer/AddSwatchButton" to="." method="_on_AddSwatchButton_pressed"]

View file

@ -12,14 +12,14 @@ margin_right = 365.0
margin_bottom = 34.0
[node name="Label" type="Label" parent="HBoxContainer2"]
margin_top = 4.0
margin_right = 77.0
margin_bottom = 19.0
margin_top = 6.0
margin_right = 91.0
margin_bottom = 20.0
text = "Palette Name:"
[node name="NewPaletteNameLineEdit" type="LineEdit" parent="HBoxContainer2"]
margin_left = 81.0
margin_right = 307.0
margin_bottom = 23.0
margin_left = 95.0
margin_right = 357.0
margin_bottom = 26.0
size_flags_horizontal = 3
expand_to_text_length = true

View file

@ -0,0 +1,13 @@
[gd_scene format=2]
[node name="PaletteImportFileDialog" type="FileDialog"]
anchor_right = 1.0
anchor_bottom = 1.0
rect_min_size = Vector2( 500, 300 )
window_title = "Open a File"
resizable = true
mode = 0
access = 2
filters = PoolStringArray( "*.json ; JavaScript Object Notation", "*.gpl ; Gimp Palette Library" )
current_dir = "D:/GitHub/Pixelorama"
current_path = "D:/GitHub/Pixelorama/"