mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 19:44:42 -04:00
UndoRedo - Unstable with bugs
Started working on UndoRedo. Currently works with basic drawing/erasing/bucket filling as well as the rectangle selection tool, custom brushes and copying/pasting. May not work with multiple layers and frames and it does not work with the rest of the tools and buttons. Also does not work when pressing both mouse buttons at the same time, or when the cursor is outside the canvas when drawing.
This commit is contained in:
parent
6350995385
commit
7b8c6bbf00
9 changed files with 227 additions and 186 deletions
101
Main.tscn
101
Main.tscn
|
@ -16,13 +16,13 @@ anchor_bottom = 1.0
|
|||
script = ExtResource( 1 )
|
||||
|
||||
[node name="UI" type="HBoxContainer" parent="."]
|
||||
editor/display_folded = true
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
size_flags_horizontal = 3
|
||||
custom_constants/separation = 0
|
||||
|
||||
[node name="ToolPanel" type="Panel" parent="UI"]
|
||||
editor/display_folded = true
|
||||
margin_right = 230.0
|
||||
margin_bottom = 600.0
|
||||
rect_min_size = Vector2( 230, 0 )
|
||||
|
@ -35,13 +35,13 @@ size_flags_horizontal = 3
|
|||
size_flags_vertical = 3
|
||||
|
||||
[node name="MenusAndTools" type="VBoxContainer" parent="UI/ToolPanel/Tools"]
|
||||
margin_right = 242.0
|
||||
margin_right = 230.0
|
||||
margin_bottom = 266.0
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="MenuItems" type="HBoxContainer" parent="UI/ToolPanel/Tools/MenusAndTools"]
|
||||
editor/display_folded = true
|
||||
margin_right = 242.0
|
||||
margin_right = 230.0
|
||||
margin_bottom = 20.0
|
||||
|
||||
[node name="FileMenu" type="MenuButton" parent="UI/ToolPanel/Tools/MenusAndTools/MenuItems"]
|
||||
|
@ -72,13 +72,11 @@ mouse_default_cursor_shape = 2
|
|||
text = "Help"
|
||||
|
||||
[node name="PaintToolsContainer" type="HBoxContainer" parent="UI/ToolPanel/Tools/MenusAndTools"]
|
||||
editor/display_folded = true
|
||||
margin_top = 24.0
|
||||
margin_right = 242.0
|
||||
margin_right = 230.0
|
||||
margin_bottom = 44.0
|
||||
|
||||
[node name="Pencil" type="Button" parent="UI/ToolPanel/Tools/MenusAndTools/PaintToolsContainer"]
|
||||
editor/display_folded = true
|
||||
margin_right = 51.0
|
||||
margin_bottom = 20.0
|
||||
hint_tooltip = "P for left mouse button
|
||||
|
@ -94,7 +92,6 @@ centered = false
|
|||
offset = Vector2( 0, -10 )
|
||||
|
||||
[node name="Eraser" type="Button" parent="UI/ToolPanel/Tools/MenusAndTools/PaintToolsContainer"]
|
||||
editor/display_folded = true
|
||||
margin_left = 55.0
|
||||
margin_right = 106.0
|
||||
margin_bottom = 20.0
|
||||
|
@ -121,9 +118,8 @@ button_mask = 3
|
|||
text = "Bucket"
|
||||
|
||||
[node name="ColorToolsContainer" type="HBoxContainer" parent="UI/ToolPanel/Tools/MenusAndTools"]
|
||||
editor/display_folded = true
|
||||
margin_top = 48.0
|
||||
margin_right = 242.0
|
||||
margin_right = 230.0
|
||||
margin_bottom = 68.0
|
||||
|
||||
[node name="PaintAllPixelsSameColor" type="Button" parent="UI/ToolPanel/Tools/MenusAndTools/ColorToolsContainer"]
|
||||
|
@ -148,9 +144,8 @@ button_mask = 3
|
|||
text = "Lighten/Darken"
|
||||
|
||||
[node name="SelectionToolsContainer2" type="HBoxContainer" parent="UI/ToolPanel/Tools/MenusAndTools"]
|
||||
editor/display_folded = true
|
||||
margin_top = 72.0
|
||||
margin_right = 242.0
|
||||
margin_right = 230.0
|
||||
margin_bottom = 92.0
|
||||
|
||||
[node name="RectSelect" type="Button" parent="UI/ToolPanel/Tools/MenusAndTools/SelectionToolsContainer2"]
|
||||
|
@ -165,30 +160,29 @@ text = "RectSelect"
|
|||
|
||||
[node name="HSeparator" type="HSeparator" parent="UI/ToolPanel/Tools"]
|
||||
margin_top = 270.0
|
||||
margin_right = 242.0
|
||||
margin_right = 230.0
|
||||
margin_bottom = 274.0
|
||||
|
||||
[node name="ToolOptions" type="HBoxContainer" parent="UI/ToolPanel/Tools"]
|
||||
editor/display_folded = true
|
||||
margin_top = 278.0
|
||||
margin_right = 242.0
|
||||
margin_right = 230.0
|
||||
margin_bottom = 544.0
|
||||
size_flags_vertical = 3
|
||||
custom_constants/separation = 0
|
||||
|
||||
[node name="LeftToolOptions" type="VBoxContainer" parent="UI/ToolPanel/Tools/ToolOptions"]
|
||||
margin_right = 119.0
|
||||
margin_right = 113.0
|
||||
margin_bottom = 266.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="LeftLabel" type="Label" parent="UI/ToolPanel/Tools/ToolOptions/LeftToolOptions"]
|
||||
margin_right = 119.0
|
||||
margin_right = 113.0
|
||||
margin_bottom = 14.0
|
||||
text = "Left tool options"
|
||||
|
||||
[node name="LeftIndicatorCheckbox" type="CheckBox" parent="UI/ToolPanel/Tools/ToolOptions/LeftToolOptions"]
|
||||
margin_top = 18.0
|
||||
margin_right = 119.0
|
||||
margin_right = 113.0
|
||||
margin_bottom = 42.0
|
||||
hint_tooltip = "Show left mouse indicator when drawing"
|
||||
mouse_default_cursor_shape = 2
|
||||
|
@ -207,13 +201,13 @@ size_flags_vertical = 0
|
|||
|
||||
[node name="BrushSizeLabel" type="Label" parent="UI/ToolPanel/Tools/ToolOptions/LeftToolOptions"]
|
||||
margin_top = 82.0
|
||||
margin_right = 119.0
|
||||
margin_right = 113.0
|
||||
margin_bottom = 96.0
|
||||
text = "Brush size: "
|
||||
|
||||
[node name="LeftBrushSizeEdit" type="SpinBox" parent="UI/ToolPanel/Tools/ToolOptions/LeftToolOptions"]
|
||||
margin_top = 100.0
|
||||
margin_right = 119.0
|
||||
margin_right = 113.0
|
||||
margin_bottom = 124.0
|
||||
mouse_default_cursor_shape = 2
|
||||
min_value = 1.0
|
||||
|
@ -222,14 +216,14 @@ suffix = "px"
|
|||
|
||||
[node name="ColorComesFrom" type="Label" parent="UI/ToolPanel/Tools/ToolOptions/LeftToolOptions"]
|
||||
margin_top = 128.0
|
||||
margin_right = 119.0
|
||||
margin_right = 113.0
|
||||
margin_bottom = 142.0
|
||||
text = "Brush color from"
|
||||
|
||||
[node name="InterpolateColor" type="HBoxContainer" parent="UI/ToolPanel/Tools/ToolOptions/LeftToolOptions"]
|
||||
editor/display_folded = true
|
||||
margin_top = 146.0
|
||||
margin_right = 119.0
|
||||
margin_right = 113.0
|
||||
margin_bottom = 162.0
|
||||
|
||||
[node name="BrushColorLabel" type="Label" parent="UI/ToolPanel/Tools/ToolOptions/LeftToolOptions/InterpolateColor"]
|
||||
|
@ -241,7 +235,7 @@ text = "B"
|
|||
|
||||
[node name="LeftInterpolateFactor" type="HSlider" parent="UI/ToolPanel/Tools/ToolOptions/LeftToolOptions/InterpolateColor"]
|
||||
margin_left = 13.0
|
||||
margin_right = 107.0
|
||||
margin_right = 101.0
|
||||
margin_bottom = 16.0
|
||||
hint_tooltip = "Choose if the brush's color should come from the brush itself (left), or the currently selected color (right)"
|
||||
size_flags_horizontal = 3
|
||||
|
@ -251,44 +245,44 @@ value = 0.5
|
|||
ticks_on_borders = true
|
||||
|
||||
[node name="SelectedColorLabel" type="Label" parent="UI/ToolPanel/Tools/ToolOptions/LeftToolOptions/InterpolateColor"]
|
||||
margin_left = 111.0
|
||||
margin_left = 105.0
|
||||
margin_top = 1.0
|
||||
margin_right = 119.0
|
||||
margin_right = 113.0
|
||||
margin_bottom = 15.0
|
||||
rect_pivot_offset = Vector2( -90, -47 )
|
||||
text = "C"
|
||||
|
||||
[node name="LeftHorizontalMirroring" type="CheckBox" parent="UI/ToolPanel/Tools/ToolOptions/LeftToolOptions"]
|
||||
margin_top = 166.0
|
||||
margin_right = 119.0
|
||||
margin_right = 113.0
|
||||
margin_bottom = 190.0
|
||||
text = "Horiz. Mirror"
|
||||
|
||||
[node name="LeftVerticalMirroring" type="CheckBox" parent="UI/ToolPanel/Tools/ToolOptions/LeftToolOptions"]
|
||||
margin_top = 194.0
|
||||
margin_right = 119.0
|
||||
margin_right = 113.0
|
||||
margin_bottom = 218.0
|
||||
text = "Vert. Mirror"
|
||||
|
||||
[node name="VSeparator" type="VSeparator" parent="UI/ToolPanel/Tools/ToolOptions"]
|
||||
margin_left = 119.0
|
||||
margin_right = 123.0
|
||||
margin_left = 113.0
|
||||
margin_right = 117.0
|
||||
margin_bottom = 266.0
|
||||
|
||||
[node name="RightToolOptions" type="VBoxContainer" parent="UI/ToolPanel/Tools/ToolOptions"]
|
||||
margin_left = 123.0
|
||||
margin_right = 242.0
|
||||
margin_left = 117.0
|
||||
margin_right = 230.0
|
||||
margin_bottom = 266.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="RightLabel" type="Label" parent="UI/ToolPanel/Tools/ToolOptions/RightToolOptions"]
|
||||
margin_right = 119.0
|
||||
margin_right = 113.0
|
||||
margin_bottom = 14.0
|
||||
text = "Right tool options"
|
||||
|
||||
[node name="RightIndicatorCheckbox" type="CheckBox" parent="UI/ToolPanel/Tools/ToolOptions/RightToolOptions"]
|
||||
margin_top = 18.0
|
||||
margin_right = 119.0
|
||||
margin_right = 113.0
|
||||
margin_bottom = 42.0
|
||||
hint_tooltip = "Show right mouse indicator when drawing"
|
||||
mouse_default_cursor_shape = 2
|
||||
|
@ -306,13 +300,13 @@ size_flags_vertical = 0
|
|||
|
||||
[node name="BrushSizeLabel" type="Label" parent="UI/ToolPanel/Tools/ToolOptions/RightToolOptions"]
|
||||
margin_top = 82.0
|
||||
margin_right = 119.0
|
||||
margin_right = 113.0
|
||||
margin_bottom = 96.0
|
||||
text = "Brush size: "
|
||||
|
||||
[node name="RightBrushSizeEdit" type="SpinBox" parent="UI/ToolPanel/Tools/ToolOptions/RightToolOptions"]
|
||||
margin_top = 100.0
|
||||
margin_right = 119.0
|
||||
margin_right = 113.0
|
||||
margin_bottom = 124.0
|
||||
mouse_default_cursor_shape = 2
|
||||
min_value = 1.0
|
||||
|
@ -321,14 +315,14 @@ suffix = "px"
|
|||
|
||||
[node name="ColorComesFrom" type="Label" parent="UI/ToolPanel/Tools/ToolOptions/RightToolOptions"]
|
||||
margin_top = 128.0
|
||||
margin_right = 119.0
|
||||
margin_right = 113.0
|
||||
margin_bottom = 142.0
|
||||
text = "Brush color from"
|
||||
|
||||
[node name="InterpolateColor" type="HBoxContainer" parent="UI/ToolPanel/Tools/ToolOptions/RightToolOptions"]
|
||||
editor/display_folded = true
|
||||
margin_top = 146.0
|
||||
margin_right = 119.0
|
||||
margin_right = 113.0
|
||||
margin_bottom = 162.0
|
||||
|
||||
[node name="BrushColorLabel" type="Label" parent="UI/ToolPanel/Tools/ToolOptions/RightToolOptions/InterpolateColor"]
|
||||
|
@ -340,7 +334,7 @@ text = "B"
|
|||
|
||||
[node name="RightInterpolateFactor" type="HSlider" parent="UI/ToolPanel/Tools/ToolOptions/RightToolOptions/InterpolateColor"]
|
||||
margin_left = 13.0
|
||||
margin_right = 107.0
|
||||
margin_right = 101.0
|
||||
margin_bottom = 16.0
|
||||
hint_tooltip = "Choose if the brush's color should come from the brush itself (left), or the currently selected color (right)"
|
||||
size_flags_horizontal = 3
|
||||
|
@ -350,34 +344,33 @@ value = 0.5
|
|||
ticks_on_borders = true
|
||||
|
||||
[node name="SelectedColorLabel" type="Label" parent="UI/ToolPanel/Tools/ToolOptions/RightToolOptions/InterpolateColor"]
|
||||
margin_left = 111.0
|
||||
margin_left = 105.0
|
||||
margin_top = 1.0
|
||||
margin_right = 119.0
|
||||
margin_right = 113.0
|
||||
margin_bottom = 15.0
|
||||
rect_pivot_offset = Vector2( -90, -47 )
|
||||
text = "C"
|
||||
|
||||
[node name="RightHorizontalMirroring" type="CheckBox" parent="UI/ToolPanel/Tools/ToolOptions/RightToolOptions"]
|
||||
margin_top = 166.0
|
||||
margin_right = 119.0
|
||||
margin_right = 113.0
|
||||
margin_bottom = 190.0
|
||||
text = "Horiz. Mirror"
|
||||
|
||||
[node name="RightVerticalMirroring" type="CheckBox" parent="UI/ToolPanel/Tools/ToolOptions/RightToolOptions"]
|
||||
margin_top = 194.0
|
||||
margin_right = 119.0
|
||||
margin_right = 113.0
|
||||
margin_bottom = 218.0
|
||||
text = "Vert. Mirror"
|
||||
|
||||
[node name="HSeparator2" type="HSeparator" parent="UI/ToolPanel/Tools"]
|
||||
margin_top = 548.0
|
||||
margin_right = 242.0
|
||||
margin_right = 230.0
|
||||
margin_bottom = 552.0
|
||||
|
||||
[node name="BrushesContainer" type="ScrollContainer" parent="UI/ToolPanel/Tools"]
|
||||
editor/display_folded = true
|
||||
margin_top = 556.0
|
||||
margin_right = 242.0
|
||||
margin_right = 230.0
|
||||
margin_bottom = 592.0
|
||||
size_flags_horizontal = 3
|
||||
scroll_vertical_enabled = false
|
||||
|
@ -402,7 +395,7 @@ offset = Vector2( 28, 0 )
|
|||
|
||||
[node name="HSeparator3" type="HSeparator" parent="UI/ToolPanel/Tools"]
|
||||
margin_top = 596.0
|
||||
margin_right = 242.0
|
||||
margin_right = 230.0
|
||||
margin_bottom = 600.0
|
||||
|
||||
[node name="CanvasAndTimeline" type="VBoxContainer" parent="UI"]
|
||||
|
@ -412,6 +405,7 @@ margin_bottom = 600.0
|
|||
size_flags_horizontal = 3
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="UI/CanvasAndTimeline"]
|
||||
editor/display_folded = true
|
||||
margin_right = 634.0
|
||||
margin_bottom = 464.0
|
||||
size_flags_horizontal = 3
|
||||
|
@ -472,7 +466,6 @@ zoom = Vector2( 0.15, 0.15 )
|
|||
script = ExtResource( 6 )
|
||||
|
||||
[node name="AnimationTimeline" type="Panel" parent="UI/CanvasAndTimeline"]
|
||||
editor/display_folded = true
|
||||
margin_top = 468.0
|
||||
margin_right = 634.0
|
||||
margin_bottom = 600.0
|
||||
|
@ -868,8 +861,8 @@ resizable = true
|
|||
mode = 0
|
||||
access = 2
|
||||
filters = PoolStringArray( "*.pxo ; Pixelorama Project" )
|
||||
current_dir = "/home/danielnaoexiste/Documents/Prog/Pixelorama"
|
||||
current_path = "/home/danielnaoexiste/Documents/Prog/Pixelorama/"
|
||||
current_dir = "C:/Users/Overloaded/Dropbox/Orama Founding Members/εταιρικα αρχεια/Godot Projects/Pixelorama"
|
||||
current_path = "C:/Users/Overloaded/Dropbox/Orama Founding Members/εταιρικα αρχεια/Godot Projects/Pixelorama/"
|
||||
|
||||
[node name="SaveSprite" type="FileDialog" parent="."]
|
||||
anchor_left = 0.5
|
||||
|
@ -883,8 +876,8 @@ margin_bottom = 48.0
|
|||
resizable = true
|
||||
access = 2
|
||||
filters = PoolStringArray( "*.pxo ; Pixelorama Project" )
|
||||
current_dir = "/home/danielnaoexiste/Documents/Prog/Pixelorama"
|
||||
current_path = "/home/danielnaoexiste/Documents/Prog/Pixelorama/"
|
||||
current_dir = "C:/Users/Overloaded/Dropbox/Orama Founding Members/εταιρικα αρχεια/Godot Projects/Pixelorama"
|
||||
current_path = "C:/Users/Overloaded/Dropbox/Orama Founding Members/εταιρικα αρχεια/Godot Projects/Pixelorama/"
|
||||
|
||||
[node name="ImportSprites" type="FileDialog" parent="."]
|
||||
margin_right = 515.0
|
||||
|
@ -894,8 +887,8 @@ resizable = true
|
|||
mode = 1
|
||||
access = 2
|
||||
filters = PoolStringArray( "*jpg, *.png ; JPG, PNG Images" )
|
||||
current_dir = "/home/danielnaoexiste/Documents/Prog/Pixelorama"
|
||||
current_path = "/home/danielnaoexiste/Documents/Prog/Pixelorama/"
|
||||
current_dir = "C:/Users/Overloaded/Dropbox/Orama Founding Members/εταιρικα αρχεια/Godot Projects/Pixelorama"
|
||||
current_path = "C:/Users/Overloaded/Dropbox/Orama Founding Members/εταιρικα αρχεια/Godot Projects/Pixelorama/"
|
||||
|
||||
[node name="ExportSprites" type="FileDialog" parent="."]
|
||||
anchor_left = 0.5
|
||||
|
@ -910,8 +903,8 @@ window_title = "Export sprite"
|
|||
resizable = true
|
||||
access = 2
|
||||
filters = PoolStringArray( "*.png ; PNG Image" )
|
||||
current_dir = "/home/danielnaoexiste/Documents/Prog/Pixelorama"
|
||||
current_path = "/home/danielnaoexiste/Documents/Prog/Pixelorama/"
|
||||
current_dir = "C:/Users/Overloaded/Dropbox/Orama Founding Members/εταιρικα αρχεια/Godot Projects/Pixelorama"
|
||||
current_path = "C:/Users/Overloaded/Dropbox/Orama Founding Members/εταιρικα αρχεια/Godot Projects/Pixelorama/"
|
||||
|
||||
[node name="ScaleImage" type="ConfirmationDialog" parent="."]
|
||||
editor/display_folded = true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue