1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-02-13 17:23:08 +00:00
Pixelorama/src/Palette/EditPaletteDialog.tscn
Emmanouil Papadeas 0cb98f6e2e
Revert palette file format back to JSON (#967)
* Some static typing and use notification to check if the theme has changed in swatches

* Use Vector2i for scrolling, hide scrollbars in the node properties

* More static typing improvements

* More static typing & docstring improvements, remove some methods from Palettes.gd

* [WIP] Go back to json for palettes instead of tres

* Revert back to using dictionaries for palette colors instead of array

Reverts part of the previous commit

* Read width & height from files, don't store the name

* Fix palette renaming

* Copy non-json palettes into json files

* Fix palette duplication

* Add a new _fill_imported_palette_with_colors() to avoid duplicate code in import file methods

* Fix palette file importing when not initialising

* Export palettes as images

* Replace "tres" with "json" filter in the open sprite dialog

* When exporting a palette as an image, automatically set the file name to the palette name

* Replace default palette files with json

* Remove the Global.palette_panel variable, use signals instead.

* Static typing in signals

* Fix warning in Palettes.gd

* Fix formatting

* Add missing comments to the palette files

* Update Palettes.gd

* A few more static typing improvements
2023-12-23 00:28:35 +02:00

132 lines
4.4 KiB
Plaintext

[gd_scene load_steps=2 format=3 uid="uid://c0p84w7umxwt1"]
[ext_resource type="Script" path="res://src/Palette/EditPaletteDialog.gd" id="1"]
[node name="EditPaletteDialog" type="ConfirmationDialog"]
title = "Edit Palette"
size = Vector2i(421, 371)
exclusive = false
popup_window = true
script = ExtResource("1")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 8.0
offset_top = 8.0
offset_right = -8.0
offset_bottom = -49.0
[node name="PaletteMetadata" type="GridContainer" parent="VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
columns = 2
[node name="NameLabel" type="Label" parent="VBoxContainer/PaletteMetadata"]
custom_minimum_size = Vector2(50, 0)
layout_mode = 2
text = "Name:"
[node name="Name" type="LineEdit" parent="VBoxContainer/PaletteMetadata"]
custom_minimum_size = Vector2(0, 24)
layout_mode = 2
size_flags_horizontal = 3
[node name="CommentLabel" type="Label" parent="VBoxContainer/PaletteMetadata"]
custom_minimum_size = Vector2(50, 0)
layout_mode = 2
size_flags_vertical = 0
text = "Comment:"
[node name="Comment" type="TextEdit" parent="VBoxContainer/PaletteMetadata"]
custom_minimum_size = Vector2(0, 75)
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="WidthLabel" type="Label" parent="VBoxContainer/PaletteMetadata"]
layout_mode = 2
text = "Width:"
[node name="Width" type="SpinBox" parent="VBoxContainer/PaletteMetadata"]
custom_minimum_size = Vector2(0, 24)
layout_mode = 2
size_flags_horizontal = 3
min_value = 1.0
max_value = 64.0
value = 1.0
[node name="HeightLabel" type="Label" parent="VBoxContainer/PaletteMetadata"]
layout_mode = 2
text = "Height:"
[node name="Height" type="SpinBox" parent="VBoxContainer/PaletteMetadata"]
custom_minimum_size = Vector2(0, 24)
layout_mode = 2
size_flags_horizontal = 3
min_value = 1.0
max_value = 64.0
value = 1.0
[node name="PathLabel" type="Label" parent="VBoxContainer/PaletteMetadata"]
layout_mode = 2
text = "Path:"
[node name="Path" type="TextEdit" parent="VBoxContainer/PaletteMetadata"]
custom_minimum_size = Vector2(0, 50)
layout_mode = 2
size_flags_horizontal = 3
editable = false
[node name="SizeReducedWarning" type="Label" parent="VBoxContainer"]
custom_minimum_size = Vector2(0, 27)
layout_mode = 2
theme_override_colors/font_color = Color(1, 0.603922, 0.603922, 1)
text = "Reducing palette size will reset positions of colors.
Colors that don't fit in new palette size will be lost!"
horizontal_alignment = 1
vertical_alignment = 2
[node name="AlreadyExistsWarning" type="Label" parent="VBoxContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 0.603922, 0.603922, 1)
text = "Palette with the same name and path already exists!"
horizontal_alignment = 1
vertical_alignment = 1
[node name="DeleteConfirmation" type="ConfirmationDialog" parent="."]
size = Vector2i(445, 105)
exclusive = false
popup_window = true
ok_button_text = "Delete Permanently"
[node name="Label" type="Label" parent="DeleteConfirmation"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 8.0
offset_top = 8.0
offset_right = -8.0
offset_bottom = -49.0
grow_horizontal = 2
grow_vertical = 2
text = "Delete Palette?"
horizontal_alignment = 1
vertical_alignment = 1
[node name="ExportFileDialog" type="FileDialog" parent="."]
size = Vector2i(677, 400)
access = 2
filters = PackedStringArray("*.png ; PNG Image", "*.jpg,*.jpeg ; JPEG Image", "*.webp ; WebP Image")
[connection signal="confirmed" from="." to="." method="_on_EditPaletteDialog_confirmed"]
[connection signal="custom_action" from="." to="." method="_on_EditPaletteDialog_custom_action"]
[connection signal="visibility_changed" from="." to="." method="_on_EditPaletteDialog_visibility_changed"]
[connection signal="text_changed" from="VBoxContainer/PaletteMetadata/Name" to="." method="_on_Name_text_changed"]
[connection signal="value_changed" from="VBoxContainer/PaletteMetadata/Width" to="." method="_on_size_value_changed"]
[connection signal="value_changed" from="VBoxContainer/PaletteMetadata/Height" to="." method="_on_size_value_changed"]
[connection signal="confirmed" from="DeleteConfirmation" to="." method="_on_delete_confirmation_confirmed"]
[connection signal="custom_action" from="DeleteConfirmation" to="." method="_on_delete_confirmation_custom_action"]
[connection signal="file_selected" from="ExportFileDialog" to="." method="_on_export_file_dialog_file_selected"]