mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 09:04:43 -04:00
Ability to get color for palette buttons, when editing a palette, from the currently selected left and right colors
This commit is contained in:
parent
072d2c9461
commit
41d80d503a
5 changed files with 96 additions and 13 deletions
|
@ -1,13 +1,13 @@
|
|||
[gd_scene load_steps=6 format=2]
|
||||
[gd_scene load_steps=7 format=2]
|
||||
|
||||
[ext_resource path="res://Scripts/Palette/EditPalettePopup.gd" type="Script" id=1]
|
||||
[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]
|
||||
[ext_resource path="res://Assets/Graphics/Palette/palette_button_fill.png" type="Texture" id=6]
|
||||
|
||||
[node name="EditPalettePopup" type="WindowDialog"]
|
||||
visible = true
|
||||
margin_right = 600.0
|
||||
margin_bottom = 550.0
|
||||
rect_min_size = Vector2( 600, 570 )
|
||||
|
@ -30,28 +30,89 @@ margin_bottom = 462.0
|
|||
size_flags_vertical = 3
|
||||
|
||||
[node name="EditPaletteColorPicker" type="ColorPicker" parent="VBoxContainer/HBoxContainer"]
|
||||
margin_right = 290.0
|
||||
margin_right = 308.0
|
||||
margin_bottom = 462.0
|
||||
|
||||
[node name="Panel" type="Panel" parent="VBoxContainer/HBoxContainer"]
|
||||
margin_left = 294.0
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer"]
|
||||
margin_left = 312.0
|
||||
margin_right = 556.0
|
||||
margin_bottom = 462.0
|
||||
size_flags_horizontal = 3
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer/HBoxContainer/Panel"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
[node name="Panel" type="Panel" parent="VBoxContainer/HBoxContainer/VBoxContainer"]
|
||||
margin_right = 244.0
|
||||
margin_bottom = 408.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="EditPaletteGridContainer" type="GridContainer" parent="VBoxContainer/HBoxContainer/Panel/ScrollContainer"]
|
||||
margin_right = 262.0
|
||||
margin_bottom = 462.0
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer/HBoxContainer/VBoxContainer/Panel"]
|
||||
margin_right = 244.0
|
||||
margin_bottom = 438.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="EditPaletteGridContainer" type="GridContainer" parent="VBoxContainer/HBoxContainer/VBoxContainer/Panel/ScrollContainer"]
|
||||
margin_right = 244.0
|
||||
margin_bottom = 438.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
columns = 8
|
||||
|
||||
[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer/VBoxContainer"]
|
||||
margin_top = 412.0
|
||||
margin_right = 244.0
|
||||
margin_bottom = 426.0
|
||||
text = "Use current left & right colors"
|
||||
align = 1
|
||||
|
||||
[node name="CenterContainer" type="CenterContainer" parent="VBoxContainer/HBoxContainer/VBoxContainer"]
|
||||
margin_top = 430.0
|
||||
margin_right = 244.0
|
||||
margin_bottom = 462.0
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer/VBoxContainer/CenterContainer"]
|
||||
margin_left = 56.0
|
||||
margin_right = 188.0
|
||||
margin_bottom = 32.0
|
||||
|
||||
[node name="LeftColor" type="Button" parent="VBoxContainer/HBoxContainer/VBoxContainer/CenterContainer/HBoxContainer"]
|
||||
margin_right = 64.0
|
||||
margin_bottom = 32.0
|
||||
rect_min_size = Vector2( 64, 32 )
|
||||
|
||||
[node name="NinePatchRect" type="NinePatchRect" parent="VBoxContainer/HBoxContainer/VBoxContainer/CenterContainer/HBoxContainer/LeftColor"]
|
||||
modulate = Color( 0, 0, 0, 1 )
|
||||
margin_left = 2.0
|
||||
margin_top = 3.0
|
||||
margin_right = 62.0
|
||||
margin_bottom = 29.0
|
||||
texture = ExtResource( 6 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="RightColor" type="Button" parent="VBoxContainer/HBoxContainer/VBoxContainer/CenterContainer/HBoxContainer"]
|
||||
margin_left = 68.0
|
||||
margin_right = 132.0
|
||||
margin_bottom = 32.0
|
||||
rect_min_size = Vector2( 64, 32 )
|
||||
|
||||
[node name="NinePatchRect" type="NinePatchRect" parent="VBoxContainer/HBoxContainer/VBoxContainer/CenterContainer/HBoxContainer/RightColor"]
|
||||
margin_left = 2.0
|
||||
margin_top = 3.0
|
||||
margin_right = 62.0
|
||||
margin_bottom = 29.0
|
||||
texture = ExtResource( 6 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ColorButtons" type="VBoxContainer" parent="VBoxContainer/HBoxContainer"]
|
||||
margin_left = 560.0
|
||||
margin_right = 580.0
|
||||
|
@ -136,6 +197,8 @@ margin_right = 580.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/CenterContainer/HBoxContainer/LeftColor" to="." method="_on_LeftColor_pressed"]
|
||||
[connection signal="pressed" from="VBoxContainer/HBoxContainer/VBoxContainer/CenterContainer/HBoxContainer/RightColor" to="." method="_on_RightColor_pressed"]
|
||||
[connection signal="pressed" from="VBoxContainer/HBoxContainer/ColorButtons/AddSwatchButton" to="." method="_on_AddSwatchButton_pressed"]
|
||||
[connection signal="pressed" from="VBoxContainer/HBoxContainer/ColorButtons/RemoveSwatchButton" to="." method="_on_RemoveSwatchButton_pressed"]
|
||||
[connection signal="text_changed" from="VBoxContainer/PaletteOptions/EditPaletteColorNameLineEdit" to="." method="_on_EditPaletteColorNameLineEdit_text_changed"]
|
||||
|
|
|
@ -22,6 +22,9 @@ action_mode = 0
|
|||
button_mask = 3
|
||||
icon = SubResource( 1 )
|
||||
script = ExtResource( 5 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="NinePatchRect" type="NinePatchRect" parent="."]
|
||||
anchor_right = 1.0
|
||||
|
@ -37,3 +40,6 @@ patch_margin_left = 2
|
|||
patch_margin_top = 2
|
||||
patch_margin_right = 2
|
||||
patch_margin_bottom = 2
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue