1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

Added fill area option for the bucket tool - this restores the old "paint all pixels of the same color" tool's functionality

This commit is contained in:
OverloadedOrama 2019-12-04 00:14:14 +02:00
parent 532f6c75ed
commit 700f287edc
4 changed files with 128 additions and 66 deletions

View file

@ -176,32 +176,32 @@ custom_constants/separation = 32
[node name="MenusAndTools" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools"] [node name="MenusAndTools" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools"]
editor/display_folded = true editor/display_folded = true
margin_right = 226.0 margin_right = 244.0
margin_bottom = 125.0 margin_bottom = 125.0
custom_constants/separation = 17 custom_constants/separation = 17
[node name="SelectionTools" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools"] [node name="SelectionTools" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools"]
margin_right = 226.0 margin_right = 244.0
margin_bottom = 54.0 margin_bottom = 54.0
[node name="VBoxContainer" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools/SelectionTools"] [node name="VBoxContainer" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools/SelectionTools"]
margin_right = 226.0 margin_right = 244.0
margin_bottom = 18.0 margin_bottom = 18.0
custom_constants/separation = 0 custom_constants/separation = 0
[node name="SelectionTools" type="Label" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools/SelectionTools/VBoxContainer"] [node name="SelectionTools" type="Label" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools/SelectionTools/VBoxContainer"]
margin_right = 226.0 margin_right = 244.0
margin_bottom = 14.0 margin_bottom = 14.0
text = "Selection Tools" text = "Selection Tools"
[node name="HSeparator6" type="HSeparator" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools/SelectionTools/VBoxContainer"] [node name="HSeparator6" type="HSeparator" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools/SelectionTools/VBoxContainer"]
margin_top = 14.0 margin_top = 14.0
margin_right = 226.0 margin_right = 244.0
margin_bottom = 18.0 margin_bottom = 18.0
[node name="SelectionToolsContainer2" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools/SelectionTools"] [node name="SelectionToolsContainer2" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools/SelectionTools"]
margin_top = 22.0 margin_top = 22.0
margin_right = 226.0 margin_right = 244.0
margin_bottom = 54.0 margin_bottom = 54.0
[node name="RectSelect" type="TextureButton" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools/SelectionTools/SelectionToolsContainer2"] [node name="RectSelect" type="TextureButton" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools/SelectionTools/SelectionToolsContainer2"]
@ -216,27 +216,27 @@ texture_normal = ExtResource( 2 )
[node name="DrawTools" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools"] [node name="DrawTools" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools"]
margin_top = 71.0 margin_top = 71.0
margin_right = 226.0 margin_right = 244.0
margin_bottom = 125.0 margin_bottom = 125.0
[node name="VBoxContainer" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools/DrawTools"] [node name="VBoxContainer" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools/DrawTools"]
margin_right = 226.0 margin_right = 244.0
margin_bottom = 18.0 margin_bottom = 18.0
custom_constants/separation = 0 custom_constants/separation = 0
[node name="DrawTools" type="Label" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools/DrawTools/VBoxContainer"] [node name="DrawTools" type="Label" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools/DrawTools/VBoxContainer"]
margin_right = 226.0 margin_right = 244.0
margin_bottom = 14.0 margin_bottom = 14.0
text = "Draw Tools" text = "Draw Tools"
[node name="HSeparator5" type="HSeparator" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools/DrawTools/VBoxContainer"] [node name="HSeparator5" type="HSeparator" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools/DrawTools/VBoxContainer"]
margin_top = 14.0 margin_top = 14.0
margin_right = 226.0 margin_right = 244.0
margin_bottom = 18.0 margin_bottom = 18.0
[node name="PaintToolsContainer" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools/DrawTools"] [node name="PaintToolsContainer" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools/DrawTools"]
margin_top = 22.0 margin_top = 22.0
margin_right = 226.0 margin_right = 244.0
margin_bottom = 54.0 margin_bottom = 54.0
[node name="Pencil" type="TextureButton" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools/DrawTools/PaintToolsContainer"] [node name="Pencil" type="TextureButton" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools/DrawTools/PaintToolsContainer"]
@ -283,19 +283,19 @@ texture_normal = ExtResource( 6 )
[node name="ToolOptions" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools"] [node name="ToolOptions" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools"]
margin_top = 157.0 margin_top = 157.0
margin_right = 226.0 margin_right = 244.0
margin_bottom = 612.0 margin_bottom = 612.0
size_flags_vertical = 3 size_flags_vertical = 3
custom_constants/separation = 0 custom_constants/separation = 0
[node name="ColorPickersCenter" type="CenterContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions"] [node name="ColorPickersCenter" type="CenterContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions"]
editor/display_folded = true editor/display_folded = true
margin_right = 226.0 margin_right = 244.0
margin_bottom = 32.0 margin_bottom = 32.0
[node name="ColorPickersHorizontal" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/ColorPickersCenter"] [node name="ColorPickersHorizontal" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/ColorPickersCenter"]
margin_left = 36.0 margin_left = 45.0
margin_right = 189.0 margin_right = 198.0
margin_bottom = 32.0 margin_bottom = 32.0
[node name="LeftColorPickerButton" type="ColorPickerButton" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/ColorPickersCenter/ColorPickersHorizontal"] [node name="LeftColorPickerButton" type="ColorPickerButton" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/ColorPickersCenter/ColorPickersHorizontal"]
@ -348,25 +348,25 @@ color = Color( 1, 1, 1, 1 )
[node name="HSeparator" type="HSeparator" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions"] [node name="HSeparator" type="HSeparator" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions"]
margin_top = 32.0 margin_top = 32.0
margin_right = 226.0 margin_right = 244.0
margin_bottom = 36.0 margin_bottom = 36.0
[node name="LeftToolOptions" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions"] [node name="LeftToolOptions" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions"]
margin_top = 36.0 margin_top = 36.0
margin_right = 226.0 margin_right = 244.0
margin_bottom = 243.0 margin_bottom = 243.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
[node name="LeftLabel" type="Label" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/LeftToolOptions"] [node name="LeftLabel" type="Label" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/LeftToolOptions"]
margin_right = 226.0 margin_right = 244.0
margin_bottom = 14.0 margin_bottom = 14.0
text = "Left tool options" text = "Left tool options"
align = 1 align = 1
[node name="LeftIndicatorCheckbox" type="CheckBox" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/LeftToolOptions"] [node name="LeftIndicatorCheckbox" type="CheckBox" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/LeftToolOptions"]
margin_top = 18.0 margin_top = 18.0
margin_right = 226.0 margin_right = 244.0
margin_bottom = 42.0 margin_bottom = 42.0
hint_tooltip = "Show left mouse indicator when drawing" hint_tooltip = "Show left mouse indicator when drawing"
mouse_default_cursor_shape = 2 mouse_default_cursor_shape = 2
@ -376,7 +376,7 @@ text = "Left cursor"
[node name="LeftBrushType" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/LeftToolOptions"] [node name="LeftBrushType" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/LeftToolOptions"]
editor/display_folded = true editor/display_folded = true
margin_top = 46.0 margin_top = 46.0
margin_right = 226.0 margin_right = 244.0
margin_bottom = 78.0 margin_bottom = 78.0
[node name="LeftBrushTypeButton" type="TextureButton" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/LeftToolOptions/LeftBrushType"] [node name="LeftBrushTypeButton" type="TextureButton" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/LeftToolOptions/LeftBrushType"]
@ -403,7 +403,7 @@ text = "Brush: Pixel"
[node name="LeftBrushSize" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/LeftToolOptions"] [node name="LeftBrushSize" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/LeftToolOptions"]
editor/display_folded = true editor/display_folded = true
margin_top = 82.0 margin_top = 82.0
margin_right = 226.0 margin_right = 244.0
margin_bottom = 106.0 margin_bottom = 106.0
[node name="BrushSizeLabel" type="Label" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/LeftToolOptions/LeftBrushSize"] [node name="BrushSizeLabel" type="Label" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/LeftToolOptions/LeftBrushSize"]
@ -465,10 +465,29 @@ margin_bottom = 15.0
rect_pivot_offset = Vector2( -90, -47 ) rect_pivot_offset = Vector2( -90, -47 )
text = "C" text = "C"
[node name="LeftFillArea" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/LeftToolOptions"]
visible = false
margin_top = 110.0
margin_right = 244.0
margin_bottom = 148.0
[node name="FillAreaLabel" type="Label" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/LeftToolOptions/LeftFillArea"]
margin_right = 244.0
margin_bottom = 14.0
text = "Fill area:"
[node name="LeftFillAreaOptions" type="OptionButton" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/LeftToolOptions/LeftFillArea"]
margin_top = 18.0
margin_right = 244.0
margin_bottom = 38.0
text = "Area of the same color"
items = [ "Area of the same color", null, false, 0, null, "All pixels of the same color", null, false, 1, null ]
selected = 0
[node name="LeftMirroring" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/LeftToolOptions"] [node name="LeftMirroring" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/LeftToolOptions"]
editor/display_folded = true editor/display_folded = true
margin_top = 110.0 margin_top = 110.0
margin_right = 226.0 margin_right = 244.0
margin_bottom = 134.0 margin_bottom = 134.0
[node name="LeftHorizontalMirroring" type="CheckBox" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/LeftToolOptions/LeftMirroring"] [node name="LeftHorizontalMirroring" type="CheckBox" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/LeftToolOptions/LeftMirroring"]
@ -488,25 +507,25 @@ text = "Vert. Mirror"
[node name="HSeparator2" type="HSeparator" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions"] [node name="HSeparator2" type="HSeparator" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions"]
margin_top = 243.0 margin_top = 243.0
margin_right = 226.0 margin_right = 244.0
margin_bottom = 247.0 margin_bottom = 247.0
[node name="RightToolOptions" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions"] [node name="RightToolOptions" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions"]
margin_top = 247.0 margin_top = 247.0
margin_right = 226.0 margin_right = 244.0
margin_bottom = 455.0 margin_bottom = 455.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
[node name="RightLabel" type="Label" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions"] [node name="RightLabel" type="Label" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions"]
margin_right = 226.0 margin_right = 244.0
margin_bottom = 14.0 margin_bottom = 14.0
text = "Right tool options" text = "Right tool options"
align = 1 align = 1
[node name="RightIndicatorCheckbox" type="CheckBox" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions"] [node name="RightIndicatorCheckbox" type="CheckBox" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions"]
margin_top = 18.0 margin_top = 18.0
margin_right = 226.0 margin_right = 244.0
margin_bottom = 42.0 margin_bottom = 42.0
hint_tooltip = "Show right mouse indicator when drawing" hint_tooltip = "Show right mouse indicator when drawing"
mouse_default_cursor_shape = 2 mouse_default_cursor_shape = 2
@ -514,7 +533,7 @@ text = "Right cursor"
[node name="RightBrushType" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions"] [node name="RightBrushType" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions"]
margin_top = 46.0 margin_top = 46.0
margin_right = 226.0 margin_right = 244.0
margin_bottom = 78.0 margin_bottom = 78.0
[node name="RightBrushTypeButton" type="TextureButton" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions/RightBrushType"] [node name="RightBrushTypeButton" type="TextureButton" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions/RightBrushType"]
@ -540,7 +559,7 @@ text = "Brush: Pixel"
[node name="RightBrushSize" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions"] [node name="RightBrushSize" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions"]
margin_top = 82.0 margin_top = 82.0
margin_right = 226.0 margin_right = 244.0
margin_bottom = 106.0 margin_bottom = 106.0
[node name="BrushSizeLabel" type="Label" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions/RightBrushSize"] [node name="BrushSizeLabel" type="Label" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions/RightBrushSize"]
@ -601,10 +620,29 @@ margin_bottom = 15.0
rect_pivot_offset = Vector2( -90, -47 ) rect_pivot_offset = Vector2( -90, -47 )
text = "C" text = "C"
[node name="RightFillArea" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions"]
visible = false
margin_top = 110.0
margin_right = 244.0
margin_bottom = 148.0
[node name="FillAreaLabel" type="Label" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions/RightFillArea"]
margin_right = 244.0
margin_bottom = 14.0
text = "Fill area:"
[node name="RightFillAreaOptions" type="OptionButton" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions/RightFillArea"]
margin_top = 18.0
margin_right = 244.0
margin_bottom = 38.0
text = "Area of the same color"
items = [ "Area of the same color", null, false, 0, null, "All pixels of the same color", null, false, 1, null ]
selected = 0
[node name="RightMirroring" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions"] [node name="RightMirroring" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions"]
editor/display_folded = true editor/display_folded = true
margin_top = 110.0 margin_top = 110.0
margin_right = 226.0 margin_right = 244.0
margin_bottom = 134.0 margin_bottom = 134.0
[node name="RightHorizontalMirroring" type="CheckBox" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions/RightMirroring"] [node name="RightHorizontalMirroring" type="CheckBox" parent="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions/RightMirroring"]
@ -1387,12 +1425,14 @@ align = 1
[connection signal="pressed" from="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/LeftToolOptions/LeftBrushType/LeftBrushTypeButton" to="." method="_on_LeftBrushTypeButton_pressed"] [connection signal="pressed" from="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/LeftToolOptions/LeftBrushType/LeftBrushTypeButton" to="." method="_on_LeftBrushTypeButton_pressed"]
[connection signal="value_changed" from="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/LeftToolOptions/LeftBrushSize/LeftBrushSizeEdit" to="." method="_on_LeftBrushSizeEdit_value_changed"] [connection signal="value_changed" from="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/LeftToolOptions/LeftBrushSize/LeftBrushSizeEdit" to="." method="_on_LeftBrushSizeEdit_value_changed"]
[connection signal="value_changed" from="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/LeftToolOptions/LeftColorInterpolation/InterpolateColor/LeftInterpolateFactor" to="." method="_on_LeftInterpolateFactor_value_changed"] [connection signal="value_changed" from="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/LeftToolOptions/LeftColorInterpolation/InterpolateColor/LeftInterpolateFactor" to="." method="_on_LeftInterpolateFactor_value_changed"]
[connection signal="item_selected" from="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/LeftToolOptions/LeftFillArea/LeftFillAreaOptions" to="." method="_on_LeftFillAreaOptions_item_selected"]
[connection signal="toggled" from="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/LeftToolOptions/LeftMirroring/LeftHorizontalMirroring" to="." method="_on_LeftHorizontalMirroring_toggled"] [connection signal="toggled" from="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/LeftToolOptions/LeftMirroring/LeftHorizontalMirroring" to="." method="_on_LeftHorizontalMirroring_toggled"]
[connection signal="toggled" from="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/LeftToolOptions/LeftMirroring/LeftVerticalMirroring" to="." method="_on_LeftVerticalMirroring_toggled"] [connection signal="toggled" from="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/LeftToolOptions/LeftMirroring/LeftVerticalMirroring" to="." method="_on_LeftVerticalMirroring_toggled"]
[connection signal="toggled" from="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions/RightIndicatorCheckbox" to="." method="_on_RightIndicatorCheckbox_toggled"] [connection signal="toggled" from="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions/RightIndicatorCheckbox" to="." method="_on_RightIndicatorCheckbox_toggled"]
[connection signal="pressed" from="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions/RightBrushType/RightBrushTypeButton" to="." method="_on_RightBrushTypeButton_pressed"] [connection signal="pressed" from="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions/RightBrushType/RightBrushTypeButton" to="." method="_on_RightBrushTypeButton_pressed"]
[connection signal="value_changed" from="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions/RightBrushSize/RightBrushSizeEdit" to="." method="_on_RightBrushSizeEdit_value_changed"] [connection signal="value_changed" from="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions/RightBrushSize/RightBrushSizeEdit" to="." method="_on_RightBrushSizeEdit_value_changed"]
[connection signal="value_changed" from="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions/RightColorInterpolation/InterpolateColor/RightInterpolateFactor" to="." method="_on_RightInterpolateFactor_value_changed"] [connection signal="value_changed" from="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions/RightColorInterpolation/InterpolateColor/RightInterpolateFactor" to="." method="_on_RightInterpolateFactor_value_changed"]
[connection signal="item_selected" from="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions/RightFillArea/RightFillAreaOptions" to="." method="_on_RightFillAreaOptions_item_selected"]
[connection signal="toggled" from="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions/RightMirroring/RightHorizontalMirroring" to="." method="_on_RightHorizontalMirroring_toggled"] [connection signal="toggled" from="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions/RightMirroring/RightHorizontalMirroring" to="." method="_on_RightHorizontalMirroring_toggled"]
[connection signal="toggled" from="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions/RightMirroring/RightVerticalMirroring" to="." method="_on_RightVerticalMirroring_toggled"] [connection signal="toggled" from="MenuAndUI/UI/ToolPanel/Tools/ToolOptions/RightToolOptions/RightMirroring/RightVerticalMirroring" to="." method="_on_RightVerticalMirroring_toggled"]
[connection signal="pressed" from="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HorizontalRuler" to="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HorizontalRuler" method="_on_HorizontalRuler_pressed"] [connection signal="pressed" from="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HorizontalRuler" to="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HorizontalRuler" method="_on_HorizontalRuler_pressed"]

View file

@ -83,12 +83,15 @@ func _process(delta) -> void:
var mouse_in_canvas := point_in_rectangle(mouse_pos, location, location + size) var mouse_in_canvas := point_in_rectangle(mouse_pos, location, location + size)
var current_mouse_button := "None" var current_mouse_button := "None"
var current_action := "None" var current_action := "None"
var fill_area := 0 #For the bucket tool
if Input.is_mouse_button_pressed(BUTTON_LEFT): if Input.is_mouse_button_pressed(BUTTON_LEFT):
current_mouse_button = "left_mouse" current_mouse_button = "left_mouse"
current_action = Global.current_left_tool current_action = Global.current_left_tool
fill_area = Global.left_fill_area
elif Input.is_mouse_button_pressed(BUTTON_RIGHT): elif Input.is_mouse_button_pressed(BUTTON_RIGHT):
current_mouse_button = "right_mouse" current_mouse_button = "right_mouse"
current_action = Global.current_right_tool current_action = Global.current_right_tool
fill_area = Global.right_fill_area
if Global.current_frame == frame: if Global.current_frame == frame:
if !mouse_in_canvas: if !mouse_in_canvas:
@ -136,46 +139,46 @@ func _process(delta) -> void:
pencil_and_eraser(mouse_pos, Color(0, 0, 0, 0), current_mouse_button) pencil_and_eraser(mouse_pos, Color(0, 0, 0, 0), current_mouse_button)
"Bucket": "Bucket":
if mouse_in_canvas && Global.can_draw && Global.has_focus && Global.current_frame == frame: if mouse_in_canvas && Global.can_draw && Global.has_focus && Global.current_frame == frame:
var current_color : Color if fill_area == 0: #Paint the specific area of the same color
var horizontal_mirror := false var current_color : Color
var vertical_mirror := false var horizontal_mirror := false
var mirror_x := size.x - mouse_pos.x - 1 var vertical_mirror := false
var mirror_y := size.y - mouse_pos.y - 1 var mirror_x := size.x - mouse_pos.x - 1
if current_mouse_button == "left_mouse": var mirror_y := size.y - mouse_pos.y - 1
current_color = Global.left_color_picker.color if current_mouse_button == "left_mouse":
horizontal_mirror = Global.left_horizontal_mirror current_color = Global.left_color_picker.color
vertical_mirror = Global.left_vertical_mirror horizontal_mirror = Global.left_horizontal_mirror
elif current_mouse_button == "right_mouse": vertical_mirror = Global.left_vertical_mirror
current_color = Global.right_color_picker.color elif current_mouse_button == "right_mouse":
horizontal_mirror = Global.right_horizontal_mirror current_color = Global.right_color_picker.color
vertical_mirror = Global.right_vertical_mirror horizontal_mirror = Global.right_horizontal_mirror
vertical_mirror = Global.right_vertical_mirror
flood_fill(mouse_pos, layers[current_layer_index][0].get_pixelv(mouse_pos), current_color) flood_fill(mouse_pos, layers[current_layer_index][0].get_pixelv(mouse_pos), current_color)
if horizontal_mirror: if horizontal_mirror:
var pos := Vector2(mirror_x, mouse_pos.y) var pos := Vector2(mirror_x, mouse_pos.y)
flood_fill(pos, layers[current_layer_index][0].get_pixelv(pos), current_color) flood_fill(pos, layers[current_layer_index][0].get_pixelv(pos), current_color)
if vertical_mirror: if vertical_mirror:
var pos := Vector2(mouse_pos.x, mirror_y) var pos := Vector2(mouse_pos.x, mirror_y)
flood_fill(pos, layers[current_layer_index][0].get_pixelv(pos), current_color) flood_fill(pos, layers[current_layer_index][0].get_pixelv(pos), current_color)
if horizontal_mirror && vertical_mirror: if horizontal_mirror && vertical_mirror:
var pos := Vector2(mirror_x, mirror_y) var pos := Vector2(mirror_x, mirror_y)
flood_fill(pos, layers[current_layer_index][0].get_pixelv(pos), current_color) flood_fill(pos, layers[current_layer_index][0].get_pixelv(pos), current_color)
"PaintAllPixelsSameColor": else: #Paint all pixels of the same color
if mouse_in_canvas && Global.can_draw && Global.has_focus && Global.current_frame == frame: var current_color : Color
var current_color : Color if current_mouse_button == "left_mouse":
if current_mouse_button == "left_mouse": current_color = Global.left_color_picker.color
current_color = Global.left_color_picker.color elif current_mouse_button == "right_mouse":
elif current_mouse_button == "right_mouse": current_color = Global.right_color_picker.color
current_color = Global.right_color_picker.color
var pixel_color : Color = layers[current_layer_index][0].get_pixelv(mouse_pos) var pixel_color : Color = layers[current_layer_index][0].get_pixelv(mouse_pos)
for xx in size.x: for xx in size.x:
for yy in size.y: for yy in size.y:
var c : Color = layers[current_layer_index][0].get_pixel(xx, yy) var c : Color = layers[current_layer_index][0].get_pixel(xx, yy)
if c == pixel_color: if c == pixel_color:
layers[current_layer_index][0].set_pixel(xx, yy, current_color) layers[current_layer_index][0].set_pixel(xx, yy, current_color)
sprite_changed_this_frame = true sprite_changed_this_frame = true
"LightenDarken": "LightenDarken":
if mouse_in_canvas && Global.can_draw && Global.has_focus && Global.current_frame == frame: if mouse_in_canvas && Global.can_draw && Global.has_focus && Global.current_frame == frame:
var pixel_color : Color = layers[current_layer_index][0].get_pixelv(mouse_pos) var pixel_color : Color = layers[current_layer_index][0].get_pixelv(mouse_pos)

View file

@ -72,6 +72,9 @@ var right_color_interpolation_container : Container
var left_interpolate_slider : HSlider var left_interpolate_slider : HSlider
var right_interpolate_slider : HSlider var right_interpolate_slider : HSlider
var left_fill_area_container : Container
var right_fill_area_container : Container
var left_mirror_container : Container var left_mirror_container : Container
var right_mirror_container : Container var right_mirror_container : Container
@ -106,6 +109,10 @@ var current_right_brush_type = BRUSH_TYPES.PIXEL
var brushes_popup : Popup var brushes_popup : Popup
var file_brush_container : GridContainer var file_brush_container : GridContainer
var project_brush_container : GridContainer var project_brush_container : GridContainer
var left_fill_area := 0
var right_fill_area := 0
# warning-ignore:unused_class_variable # warning-ignore:unused_class_variable
var left_horizontal_mirror := false var left_horizontal_mirror := false
# warning-ignore:unused_class_variable # warning-ignore:unused_class_variable
@ -177,6 +184,9 @@ func _ready() -> void:
left_interpolate_slider = find_node_by_name(left_color_interpolation_container, "LeftInterpolateFactor") left_interpolate_slider = find_node_by_name(left_color_interpolation_container, "LeftInterpolateFactor")
right_interpolate_slider = find_node_by_name(right_color_interpolation_container, "RightInterpolateFactor") right_interpolate_slider = find_node_by_name(right_color_interpolation_container, "RightInterpolateFactor")
left_fill_area_container = find_node_by_name(left_tool_options_container, "LeftFillArea")
right_fill_area_container = find_node_by_name(right_tool_options_container, "RightFillArea")
left_mirror_container = find_node_by_name(left_tool_options_container, "LeftMirroring") left_mirror_container = find_node_by_name(left_tool_options_container, "LeftMirroring")
right_mirror_container = find_node_by_name(right_tool_options_container, "RightMirroring") right_mirror_container = find_node_by_name(right_tool_options_container, "RightMirroring")

View file

@ -614,6 +614,7 @@ func _on_Tool_pressed(tool_pressed : BaseButton, mouse_press := true, key_for_le
Global.left_brush_size_container.visible = true Global.left_brush_size_container.visible = true
Global.left_mirror_container.visible = true Global.left_mirror_container.visible = true
elif current_action == "Bucket": elif current_action == "Bucket":
Global.left_fill_area_container.visible = true
Global.left_mirror_container.visible = true Global.left_mirror_container.visible = true
elif current_action == "LightenDarken": elif current_action == "LightenDarken":
Global.left_brush_size_container.visible = true Global.left_brush_size_container.visible = true
@ -637,6 +638,7 @@ func _on_Tool_pressed(tool_pressed : BaseButton, mouse_press := true, key_for_le
Global.right_brush_size_container.visible = true Global.right_brush_size_container.visible = true
Global.right_mirror_container.visible = true Global.right_mirror_container.visible = true
elif current_action == "Bucket": elif current_action == "Bucket":
Global.right_fill_area_container.visible = true
Global.right_mirror_container.visible = true Global.right_mirror_container.visible = true
elif current_action == "LightenDarken": elif current_action == "LightenDarken":
Global.right_brush_size_container.visible = true Global.right_brush_size_container.visible = true
@ -922,6 +924,12 @@ func update_left_custom_brush() -> void:
func update_right_custom_brush() -> void: func update_right_custom_brush() -> void:
Global.update_right_custom_brush() Global.update_right_custom_brush()
func _on_LeftFillAreaOptions_item_selected(ID : int) -> void:
Global.left_fill_area = ID
func _on_RightFillAreaOptions_item_selected(ID : int) -> void:
Global.right_fill_area = ID
func _on_LeftHorizontalMirroring_toggled(button_pressed) -> void: func _on_LeftHorizontalMirroring_toggled(button_pressed) -> void:
Global.left_horizontal_mirror = button_pressed Global.left_horizontal_mirror = button_pressed
func _on_LeftVerticalMirroring_toggled(button_pressed) -> void: func _on_LeftVerticalMirroring_toggled(button_pressed) -> void:
@ -939,3 +947,4 @@ func _exit_tree() -> void:
config_cache.set_value("window", "position", OS.window_position) config_cache.set_value("window", "position", OS.window_position)
config_cache.set_value("window", "size", OS.window_size) config_cache.set_value("window", "size", OS.window_size)
config_cache.save("user://cache.ini") config_cache.save("user://cache.ini")