From 953d002d91656d47307e9c0783fec3bc6bbd92d6 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Sat, 18 Jan 2020 21:06:47 +0200 Subject: [PATCH 01/32] [EXPERIMENTAL] Re-making the timeline Trying to merge layers into the timeline, and eventually add more features like "share layer with all frames", among others. THIS IS NOT FINISHED, IT WILL *NOT* WORK PROPERLY. Once it is finished, this branch will be merged onto master. So far only add layer and add frame work, and even they may have some issues. Undoing also does not work properly yet. The UI is also not finished, as it currently has problems with the scroll containers. --- Main.tscn | 381 ++++++++------------------- Prefabs/AnimationTimeline.tscn | 362 ++++++++++++++++++------- Prefabs/FrameButton.tscn | 24 +- Prefabs/FrameContainer.tscn | 18 ++ Prefabs/LayerContainer.tscn | 49 ++-- Scripts/AnimationTimeline.gd | 130 +++++++-- Scripts/Canvas.gd | 296 ++++++++++----------- Scripts/Dialogs/PreferencesDialog.gd | 4 +- Scripts/FrameButton.gd | 7 +- Scripts/Global.gd | 93 ++++--- Scripts/LayerContainer.gd | 17 +- Scripts/Main.gd | 87 +----- 12 files changed, 758 insertions(+), 710 deletions(-) create mode 100644 Prefabs/FrameContainer.tscn diff --git a/Main.tscn b/Main.tscn index 0f1688558..f494edd68 100644 --- a/Main.tscn +++ b/Main.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=65 format=2] +[gd_scene load_steps=48 format=2] [ext_resource path="res://Themes & Styles/Dark Theme/Dark Theme.tres" type="Theme" id=1] [ext_resource path="res://Scripts/Main.gd" type="Script" id=2] @@ -25,35 +25,18 @@ [ext_resource path="res://Assets/Graphics/Dark Themes/Palette/Edit_Palette.png" type="Texture" id=23] [ext_resource path="res://Assets/Graphics/Dark Themes/Palette/Edit_Palette_Hover.png" type="Texture" id=24] [ext_resource path="res://Scripts/Palette/PaletteContainer.gd" type="Script" id=25] -[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/New_Layer.png" type="Texture" id=26] -[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/New_Layer_Hover.png" type="Texture" id=27] -[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Delete_Layer.png" type="Texture" id=28] -[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Delete_Layer_Hover.png" type="Texture" id=29] -[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Delete_Layer_Disabled.png" type="Texture" id=30] -[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Move_Up.png" type="Texture" id=31] -[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Move_Up_Hover.png" type="Texture" id=32] -[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Move_Up_Disabled.png" type="Texture" id=33] -[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Move_Down.png" type="Texture" id=34] -[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Move_Down_Hover.png" type="Texture" id=35] -[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Move_Down_Disabled.png" type="Texture" id=36] -[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Clone_Layer.png" type="Texture" id=37] -[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Clone_Layer_Hover.png" type="Texture" id=38] -[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Merge_Down.png" type="Texture" id=39] -[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Merge_Down_Hover.png" type="Texture" id=40] -[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Merge_Down_Disabled.png" type="Texture" id=41] -[ext_resource path="res://Prefabs/BrushButton.tscn" type="PackedScene" id=42] -[ext_resource path="res://Prefabs/Dialogs/SplashDialog.tscn" type="PackedScene" id=43] -[ext_resource path="res://Prefabs/Dialogs/CreateNewImage.tscn" type="PackedScene" id=44] -[ext_resource path="res://Prefabs/Dialogs/ImportSprites.tscn" type="PackedScene" id=45] -[ext_resource path="res://Prefabs/Dialogs/ExportSprites.tscn" type="PackedScene" id=46] -[ext_resource path="res://Prefabs/Dialogs/ScaleImage.tscn" type="PackedScene" id=47] -[ext_resource path="res://Prefabs/Dialogs/PreferencesDialog.tscn" type="PackedScene" id=48] -[ext_resource path="res://Prefabs/Dialogs/OutlineDialog.tscn" type="PackedScene" id=49] -[ext_resource path="res://Prefabs/Dialogs/AboutDialog.tscn" type="PackedScene" id=50] -[ext_resource path="res://Prefabs/EditPalettePopup.tscn" type="PackedScene" id=51] -[ext_resource path="res://Prefabs/NewPaletteDialog.tscn" type="PackedScene" id=52] -[ext_resource path="res://Prefabs/PaletteImportFileDialog.tscn" type="PackedScene" id=53] -[ext_resource path="res://Prefabs/Dialogs/RotateImage.tscn" type="PackedScene" id=54] +[ext_resource path="res://Prefabs/BrushButton.tscn" type="PackedScene" id=26] +[ext_resource path="res://Prefabs/Dialogs/SplashDialog.tscn" type="PackedScene" id=27] +[ext_resource path="res://Prefabs/Dialogs/CreateNewImage.tscn" type="PackedScene" id=28] +[ext_resource path="res://Prefabs/Dialogs/ImportSprites.tscn" type="PackedScene" id=29] +[ext_resource path="res://Prefabs/Dialogs/ExportSprites.tscn" type="PackedScene" id=30] +[ext_resource path="res://Prefabs/Dialogs/ScaleImage.tscn" type="PackedScene" id=31] +[ext_resource path="res://Prefabs/Dialogs/PreferencesDialog.tscn" type="PackedScene" id=32] +[ext_resource path="res://Prefabs/Dialogs/OutlineDialog.tscn" type="PackedScene" id=33] +[ext_resource path="res://Prefabs/Dialogs/AboutDialog.tscn" type="PackedScene" id=34] +[ext_resource path="res://Prefabs/EditPalettePopup.tscn" type="PackedScene" id=35] +[ext_resource path="res://Prefabs/NewPaletteDialog.tscn" type="PackedScene" id=36] +[ext_resource path="res://Prefabs/PaletteImportFileDialog.tscn" type="PackedScene" id=37] [sub_resource type="InputEventKey" id=1] scancode = 88 @@ -61,7 +44,7 @@ scancode = 88 [sub_resource type="ShortCut" id=2] shortcut = SubResource( 1 ) -[sub_resource type="Image" id=11] +[sub_resource type="Image" id=3] data = { "data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0,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54,10 @@ data = { } [sub_resource type="ImageTexture" id=4] -image = SubResource( 11 ) +image = SubResource( 3 ) size = Vector2( 32, 32 ) -[sub_resource type="Image" id=12] +[sub_resource type="Image" id=5] data = { "data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), "format": "RGBA8", @@ -84,10 +67,10 @@ data = { } [sub_resource type="ImageTexture" id=6] -image = SubResource( 12 ) +image = SubResource( 5 ) size = Vector2( 32, 32 ) -[sub_resource type="Image" id=13] +[sub_resource type="Image" id=7] data = { "data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), "format": "RGBA8", @@ -99,10 +82,10 @@ data = { [sub_resource type="ImageTexture" id=8] flags = 3 flags = 3 -image = SubResource( 13 ) +image = SubResource( 7 ) size = Vector2( 9, 9 ) -[sub_resource type="Image" id=14] +[sub_resource type="Image" id=9] data = { "data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), "format": "RGBA8", @@ -114,7 +97,7 @@ data = { [sub_resource type="ImageTexture" id=10] flags = 3 flags = 3 -image = SubResource( 14 ) +image = SubResource( 9 ) size = Vector2( 9, 9 ) [node name="Control" type="Control"] @@ -124,7 +107,6 @@ theme = ExtResource( 1 ) script = ExtResource( 2 ) __meta__ = { "_edit_horizontal_guides_": [ ], -"_edit_use_anchors_": false, "_edit_vertical_guides_": [ ] } @@ -134,12 +116,14 @@ anchor_bottom = 1.0 custom_constants/separation = 0 [node name="TopMenuContainer" type="Panel" parent="MenuAndUI"] +editor/display_folded = true margin_right = 1152.0 margin_bottom = 28.0 rect_min_size = Vector2( 0, 28 ) custom_styles/panel = ExtResource( 3 ) [node name="MenuItems" type="HBoxContainer" parent="MenuAndUI/TopMenuContainer"] +editor/display_folded = true margin_left = 2.0 margin_top = 4.0 margin_right = 1010.0 @@ -184,15 +168,13 @@ text = "Help" switch_on_hover = true [node name="HBoxContainer" type="HBoxContainer" parent="MenuAndUI/TopMenuContainer"] +editor/display_folded = true anchor_left = 0.5 anchor_right = 0.5 anchor_bottom = 1.0 margin_left = -65.5 margin_right = 65.5 custom_constants/separation = 20 -__meta__ = { -"_edit_use_anchors_": false -} [node name="ZoomLevel" type="Label" parent="MenuAndUI/TopMenuContainer/HBoxContainer"] margin_top = 6.0 @@ -219,6 +201,7 @@ size_flags_vertical = 3 custom_constants/separation = 0 [node name="ToolPanel" type="Panel" parent="MenuAndUI/UI"] +editor/display_folded = true margin_right = 224.0 margin_bottom = 620.0 rect_min_size = Vector2( 224, 0 ) @@ -236,15 +219,18 @@ custom_constants/autohide = 0 custom_constants/separation = 32 [node name="MenusAndTools" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools"] +editor/display_folded = true margin_right = 208.0 margin_bottom = 127.0 custom_constants/separation = 17 [node name="UtilityTools" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools"] +editor/display_folded = true margin_right = 208.0 margin_bottom = 55.0 [node name="VBoxContainer" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools/UtilityTools"] +editor/display_folded = true margin_right = 208.0 margin_bottom = 19.0 custom_constants/separation = 0 @@ -260,6 +246,7 @@ margin_right = 208.0 margin_bottom = 19.0 [node name="SelectionToolsContainer2" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools/UtilityTools"] +editor/display_folded = true margin_top = 23.0 margin_right = 208.0 margin_bottom = 55.0 @@ -291,6 +278,7 @@ margin_right = 208.0 margin_bottom = 127.0 [node name="VBoxContainer" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools/DrawTools"] +editor/display_folded = true margin_right = 208.0 margin_bottom = 19.0 custom_constants/separation = 0 @@ -306,6 +294,7 @@ margin_right = 208.0 margin_bottom = 19.0 [node name="PaintToolsContainer" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools/DrawTools"] +editor/display_folded = true margin_top = 23.0 margin_right = 208.0 margin_bottom = 55.0 @@ -361,6 +350,7 @@ size_flags_vertical = 3 custom_constants/separation = 8 [node name="ColorButtonsVertical" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions"] +editor/display_folded = true margin_right = 208.0 margin_bottom = 51.0 custom_constants/separation = 2 @@ -434,6 +424,7 @@ margin_right = 208.0 margin_bottom = 63.0 [node name="ScrollContainer" type="ScrollContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions"] +editor/display_folded = true margin_top = 71.0 margin_right = 208.0 margin_bottom = 453.0 @@ -446,6 +437,7 @@ margin_bottom = 352.0 size_flags_horizontal = 3 [node name="LeftToolOptions" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions"] +editor/display_folded = true margin_right = 208.0 margin_bottom = 170.0 @@ -469,11 +461,13 @@ text = "Left pixel indicator" margin_top = 39.0 margin_right = 100.0 margin_bottom = 55.0 +mouse_default_cursor_shape = 2 size_flags_horizontal = 0 pressed = true text = "Show tool icon" [node name="LeftBrushType" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/LeftToolOptions"] +editor/display_folded = true margin_top = 59.0 margin_right = 208.0 margin_bottom = 91.0 @@ -502,6 +496,7 @@ margin_bottom = 23.0 text = "Brush: Pixel" [node name="LeftBrushSize" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/LeftToolOptions"] +editor/display_folded = true margin_top = 95.0 margin_right = 208.0 margin_bottom = 131.0 @@ -538,6 +533,7 @@ align = 1 suffix = "px" [node name="LeftColorInterpolation" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/LeftToolOptions"] +editor/display_folded = true visible = false margin_top = 115.0 margin_right = 208.0 @@ -547,7 +543,6 @@ margin_bottom = 151.0 margin_right = 208.0 margin_bottom = 15.0 hint_tooltip = "COLORFROM_HT" -mouse_filter = 1 text = "Brush color from" [node name="HBoxContainer" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/LeftToolOptions/LeftColorInterpolation"] @@ -573,6 +568,7 @@ value = 100.0 align = 1 [node name="LeftFillArea" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/LeftToolOptions"] +editor/display_folded = true visible = false margin_top = 155.0 margin_right = 208.0 @@ -594,6 +590,7 @@ items = [ "Area of the same color", null, false, 0, null, "All pixels of the sam selected = 0 [node name="LeftLDOptions" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/LeftToolOptions"] +editor/display_folded = true visible = false margin_top = 115.0 margin_right = 208.0 @@ -638,6 +635,7 @@ value = 10.0 align = 1 [node name="LeftColorPickerOptions" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/LeftToolOptions"] +editor/display_folded = true visible = false margin_top = 115.0 margin_right = 208.0 @@ -659,6 +657,7 @@ items = [ "Left Color", null, false, 0, null, "Right Color", null, false, 1, nul selected = 0 [node name="LeftMirroring" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/LeftToolOptions"] +editor/display_folded = true margin_top = 135.0 margin_right = 208.0 margin_bottom = 170.0 @@ -694,6 +693,7 @@ margin_right = 208.0 margin_bottom = 178.0 [node name="RightToolOptions" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions"] +editor/display_folded = true margin_top = 182.0 margin_right = 208.0 margin_bottom = 352.0 @@ -717,11 +717,13 @@ text = "Right pixel indicator" margin_top = 39.0 margin_right = 100.0 margin_bottom = 55.0 +mouse_default_cursor_shape = 2 size_flags_horizontal = 0 pressed = true text = "Show tool icon" [node name="RightBrushType" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/RightToolOptions"] +editor/display_folded = true margin_top = 59.0 margin_right = 208.0 margin_bottom = 91.0 @@ -750,6 +752,7 @@ margin_bottom = 23.0 text = "Brush: Pixel" [node name="RightBrushSize" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/RightToolOptions"] +editor/display_folded = true margin_top = 95.0 margin_right = 208.0 margin_bottom = 131.0 @@ -786,6 +789,7 @@ align = 1 suffix = "px" [node name="RightColorInterpolation" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/RightToolOptions"] +editor/display_folded = true visible = false margin_top = 115.0 margin_right = 208.0 @@ -795,7 +799,6 @@ margin_bottom = 151.0 margin_right = 208.0 margin_bottom = 15.0 hint_tooltip = "COLORFROM_HT" -mouse_filter = 1 text = "Brush color from" [node name="HBoxContainer" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/RightToolOptions/RightColorInterpolation"] @@ -823,6 +826,7 @@ value = 100.0 align = 1 [node name="RightFillArea" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/RightToolOptions"] +editor/display_folded = true visible = false margin_top = 96.0 margin_right = 208.0 @@ -843,6 +847,7 @@ items = [ "Area of the same color", null, false, 0, null, "All pixels of the sam selected = 0 [node name="RightLDOptions" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/RightToolOptions"] +editor/display_folded = true visible = false margin_top = 115.0 margin_right = 208.0 @@ -887,6 +892,7 @@ value = 10.0 align = 1 [node name="RightColorPickerOptions" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/RightToolOptions"] +editor/display_folded = true visible = false margin_top = 115.0 margin_right = 208.0 @@ -908,6 +914,7 @@ items = [ "Left Color", null, false, 0, null, "Right Color", null, false, 1, nul selected = 1 [node name="RightMirroring" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/RightToolOptions"] +editor/display_folded = true margin_top = 135.0 margin_right = 208.0 margin_bottom = 170.0 @@ -945,14 +952,15 @@ size_flags_horizontal = 3 custom_constants/separation = 0 [node name="HViewportContainer" type="HBoxContainer" parent="MenuAndUI/UI/CanvasAndTimeline"] +editor/display_folded = true margin_right = 704.0 -margin_bottom = 478.0 +margin_bottom = 420.0 size_flags_horizontal = 3 size_flags_vertical = 3 [node name="ViewportAndRulers" type="VBoxContainer" parent="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer"] margin_right = 704.0 -margin_bottom = 478.0 +margin_bottom = 420.0 size_flags_horizontal = 3 size_flags_vertical = 3 custom_constants/separation = 0 @@ -971,22 +979,23 @@ enabled_focus_mode = 0 script = ExtResource( 14 ) [node name="HSplitContainer" type="HSplitContainer" parent="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers"] +editor/display_folded = true margin_top = 16.0 margin_right = 704.0 -margin_bottom = 478.0 +margin_bottom = 420.0 size_flags_vertical = 3 custom_constants/autohide = 0 [node name="ViewportandVerticalRuler" type="HBoxContainer" parent="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HSplitContainer"] margin_right = 692.0 -margin_bottom = 462.0 +margin_bottom = 404.0 size_flags_horizontal = 3 size_flags_vertical = 3 custom_constants/separation = 0 [node name="VerticalRuler" type="Button" parent="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HSplitContainer/ViewportandVerticalRuler"] margin_right = 16.0 -margin_bottom = 462.0 +margin_bottom = 404.0 rect_min_size = Vector2( 16, 0 ) focus_mode = 0 mouse_default_cursor_shape = 15 @@ -1001,15 +1010,16 @@ enabled_focus_mode = 0 script = ExtResource( 15 ) [node name="ViewportContainer" type="ViewportContainer" parent="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HSplitContainer/ViewportandVerticalRuler"] +editor/display_folded = true margin_left = 16.0 margin_right = 692.0 -margin_bottom = 462.0 +margin_bottom = 404.0 size_flags_horizontal = 3 size_flags_vertical = 3 stretch = true [node name="Viewport" type="Viewport" parent="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HSplitContainer/ViewportandVerticalRuler/ViewportContainer"] -size = Vector2( 676, 462 ) +size = Vector2( 676, 404 ) handle_input_locally = false usage = 0 render_target_update_mode = 3 @@ -1033,12 +1043,12 @@ script = ExtResource( 18 ) [node name="ViewportContainer2" type="ViewportContainer" parent="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HSplitContainer"] margin_left = 704.0 margin_right = 704.0 -margin_bottom = 462.0 +margin_bottom = 404.0 size_flags_vertical = 3 stretch = true [node name="Viewport" type="Viewport" parent="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HSplitContainer/ViewportContainer2"] -size = Vector2( 0, 462 ) +size = Vector2( 0, 404 ) handle_input_locally = false render_target_update_mode = 3 script = ExtResource( 19 ) @@ -1049,42 +1059,44 @@ zoom = Vector2( 0.15, 0.15 ) script = ExtResource( 17 ) [node name="AnimationTimeline" parent="MenuAndUI/UI/CanvasAndTimeline" instance=ExtResource( 20 )] +margin_top = 420.0 -[node name="LayerPanel" type="Panel" parent="MenuAndUI/UI"] +[node name="RightPanel" type="Panel" parent="MenuAndUI/UI"] margin_left = 928.0 margin_right = 1152.0 margin_bottom = 620.0 rect_min_size = Vector2( 224, 0 ) -[node name="LayersAndMisc" type="VBoxContainer" parent="MenuAndUI/UI/LayerPanel"] +[node name="PreviewAndPalettes" type="VBoxContainer" parent="MenuAndUI/UI/RightPanel"] anchor_right = 1.0 anchor_bottom = 1.0 margin_top = 16.0 -[node name="CanvasPreview" type="ViewportContainer" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc"] +[node name="CanvasPreview" type="ViewportContainer" parent="MenuAndUI/UI/RightPanel/PreviewAndPalettes"] +editor/display_folded = true margin_right = 224.0 margin_bottom = 164.0 rect_min_size = Vector2( 0, 164 ) -[node name="Viewport" type="Viewport" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/CanvasPreview"] +[node name="Viewport" type="Viewport" parent="MenuAndUI/UI/RightPanel/PreviewAndPalettes/CanvasPreview"] size = Vector2( 224, 164 ) transparent_bg = true handle_input_locally = false render_target_update_mode = 3 script = ExtResource( 19 ) -[node name="CameraPreview" type="Camera2D" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/CanvasPreview/Viewport"] +[node name="CameraPreview" type="Camera2D" parent="MenuAndUI/UI/RightPanel/PreviewAndPalettes/CanvasPreview/Viewport"] offset = Vector2( 32, 32 ) current = true zoom = Vector2( 0.15, 0.15 ) script = ExtResource( 17 ) -[node name="HSeparator" type="HSeparator" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc"] +[node name="HSeparator" type="HSeparator" parent="MenuAndUI/UI/RightPanel/PreviewAndPalettes"] margin_top = 168.0 margin_right = 224.0 margin_bottom = 172.0 -[node name="PalettesLabel" type="Label" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc"] +[node name="PalettesLabel" type="Label" parent="MenuAndUI/UI/RightPanel/PreviewAndPalettes"] margin_top = 176.0 margin_right = 224.0 margin_bottom = 191.0 @@ -1093,33 +1105,28 @@ size_flags_vertical = 0 text = "Palettes" align = 1 -[node name="HSeparator2" type="HSeparator" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc"] +[node name="HSeparator2" type="HSeparator" parent="MenuAndUI/UI/RightPanel/PreviewAndPalettes"] margin_top = 195.0 margin_right = 224.0 margin_bottom = 199.0 -[node name="VSplitContainer" type="VSplitContainer" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc"] +[node name="PaletteVBoxContainer" type="VBoxContainer" parent="MenuAndUI/UI/RightPanel/PreviewAndPalettes"] margin_top = 203.0 margin_right = 224.0 margin_bottom = 604.0 -size_flags_vertical = 3 -custom_constants/autohide = 0 - -[node name="PaletteVBoxContainer" type="VBoxContainer" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer"] -margin_right = 224.0 -margin_bottom = 136.0 size_flags_horizontal = 3 +size_flags_vertical = 3 -[node name="CenterContainer" type="CenterContainer" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/PaletteVBoxContainer"] +[node name="CenterContainer" type="CenterContainer" parent="MenuAndUI/UI/RightPanel/PreviewAndPalettes/PaletteVBoxContainer"] margin_right = 224.0 margin_bottom = 32.0 -[node name="PaletteButtons" type="HBoxContainer" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/PaletteVBoxContainer/CenterContainer"] +[node name="PaletteButtons" type="HBoxContainer" parent="MenuAndUI/UI/RightPanel/PreviewAndPalettes/PaletteVBoxContainer/CenterContainer"] margin_left = 24.0 margin_right = 199.0 margin_bottom = 32.0 -[node name="AddPalette" type="TextureButton" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/PaletteVBoxContainer/CenterContainer/PaletteButtons" groups=[ +[node name="AddPalette" type="TextureButton" parent="MenuAndUI/UI/RightPanel/PreviewAndPalettes/PaletteVBoxContainer/CenterContainer/PaletteButtons" groups=[ "UIButtons", ]] margin_right = 32.0 @@ -1130,12 +1137,12 @@ mouse_default_cursor_shape = 2 texture_normal = ExtResource( 21 ) texture_hover = ExtResource( 22 ) -[node name="PopupMenu" type="PopupMenu" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/PaletteVBoxContainer/CenterContainer/PaletteButtons/AddPalette"] +[node name="PopupMenu" type="PopupMenu" parent="MenuAndUI/UI/RightPanel/PreviewAndPalettes/PaletteVBoxContainer/CenterContainer/PaletteButtons/AddPalette"] margin_right = 12.0 margin_bottom = 20.0 items = [ "New Empty Palette", null, 0, false, false, 0, 0, null, "", false, "Import Palette", null, 0, false, false, 1, 0, null, "", false ] -[node name="EditPalette" type="TextureButton" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/PaletteVBoxContainer/CenterContainer/PaletteButtons" groups=[ +[node name="EditPalette" type="TextureButton" parent="MenuAndUI/UI/RightPanel/PreviewAndPalettes/PaletteVBoxContainer/CenterContainer/PaletteButtons" groups=[ "UIButtons", ]] margin_left = 36.0 @@ -1146,7 +1153,7 @@ mouse_default_cursor_shape = 2 texture_normal = ExtResource( 23 ) texture_hover = ExtResource( 24 ) -[node name="PaletteOptionButton" type="OptionButton" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/PaletteVBoxContainer/CenterContainer/PaletteButtons"] +[node name="PaletteOptionButton" type="OptionButton" parent="MenuAndUI/UI/RightPanel/PreviewAndPalettes/PaletteVBoxContainer/CenterContainer/PaletteButtons"] margin_left = 72.0 margin_right = 175.0 margin_bottom = 32.0 @@ -1156,191 +1163,27 @@ hint_tooltip = "CHOOSEPALETTE_HT" mouse_default_cursor_shape = 2 clip_text = true -[node name="ScrollPalette" type="ScrollContainer" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/PaletteVBoxContainer"] +[node name="ScrollPalette" type="ScrollContainer" parent="MenuAndUI/UI/RightPanel/PreviewAndPalettes/PaletteVBoxContainer"] margin_top = 36.0 margin_right = 224.0 -margin_bottom = 136.0 +margin_bottom = 401.0 rect_min_size = Vector2( 0, 100 ) size_flags_horizontal = 3 size_flags_vertical = 3 -[node name="CenterPalette" type="CenterContainer" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/PaletteVBoxContainer/ScrollPalette"] +[node name="CenterPalette" type="CenterContainer" parent="MenuAndUI/UI/RightPanel/PreviewAndPalettes/PaletteVBoxContainer/ScrollPalette"] margin_right = 224.0 size_flags_horizontal = 3 -[node name="PaletteContainer" type="GridContainer" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/PaletteVBoxContainer/ScrollPalette/CenterPalette"] +[node name="PaletteContainer" type="GridContainer" parent="MenuAndUI/UI/RightPanel/PreviewAndPalettes/PaletteVBoxContainer/ScrollPalette/CenterPalette"] margin_left = 112.0 margin_right = 112.0 size_flags_horizontal = 3 columns = 5 script = ExtResource( 25 ) -[node name="VBoxLayerWithLabels" type="VBoxContainer" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer"] -margin_top = 148.0 -margin_right = 224.0 -margin_bottom = 401.0 - -[node name="HSeparator" type="HSeparator" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/VBoxLayerWithLabels"] -margin_right = 224.0 -margin_bottom = 4.0 - -[node name="LayerLabel" type="Label" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/VBoxLayerWithLabels"] -margin_top = 8.0 -margin_right = 224.0 -margin_bottom = 23.0 -size_flags_horizontal = 3 -size_flags_vertical = 0 -text = "Layers" -align = 1 - -[node name="HSeparator2" type="HSeparator" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/VBoxLayerWithLabels"] -margin_top = 27.0 -margin_right = 224.0 -margin_bottom = 31.0 - -[node name="LayerVBoxContainer" type="VBoxContainer" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/VBoxLayerWithLabels"] -margin_top = 35.0 -margin_right = 224.0 -margin_bottom = 253.0 -size_flags_vertical = 3 -custom_constants/separation = 6 - -[node name="CenterLayerButtons" type="CenterContainer" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/VBoxLayerWithLabels/LayerVBoxContainer"] -margin_right = 224.0 -margin_bottom = 32.0 - -[node name="LayerButtons" type="HBoxContainer" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/VBoxLayerWithLabels/LayerVBoxContainer/CenterLayerButtons"] -margin_left = 6.0 -margin_right = 218.0 -margin_bottom = 32.0 - -[node name="AddLayer" type="TextureButton" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/VBoxLayerWithLabels/LayerVBoxContainer/CenterLayerButtons/LayerButtons" groups=[ -"UIButtons", -]] -margin_right = 32.0 -margin_bottom = 32.0 -hint_tooltip = "LAYERNEW_HT" -mouse_default_cursor_shape = 2 -texture_normal = ExtResource( 26 ) -texture_hover = ExtResource( 27 ) - -[node name="RemoveLayer" type="TextureButton" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/VBoxLayerWithLabels/LayerVBoxContainer/CenterLayerButtons/LayerButtons" groups=[ -"UIButtons", -]] -margin_left = 36.0 -margin_right = 68.0 -margin_bottom = 32.0 -hint_tooltip = "LAYERREMOVE_HT" -mouse_default_cursor_shape = 8 -disabled = true -texture_normal = ExtResource( 28 ) -texture_hover = ExtResource( 29 ) -texture_disabled = ExtResource( 30 ) - -[node name="MoveUpLayer" type="TextureButton" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/VBoxLayerWithLabels/LayerVBoxContainer/CenterLayerButtons/LayerButtons" groups=[ -"UIButtons", -]] -margin_left = 72.0 -margin_right = 104.0 -margin_bottom = 32.0 -hint_tooltip = "LAYERUP_HT" -mouse_default_cursor_shape = 8 -disabled = true -texture_normal = ExtResource( 31 ) -texture_hover = ExtResource( 32 ) -texture_disabled = ExtResource( 33 ) - -[node name="MovwDownLayer" type="TextureButton" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/VBoxLayerWithLabels/LayerVBoxContainer/CenterLayerButtons/LayerButtons" groups=[ -"UIButtons", -]] -margin_left = 108.0 -margin_right = 140.0 -margin_bottom = 32.0 -hint_tooltip = "LAYERDOWN_HT" -mouse_default_cursor_shape = 8 -disabled = true -texture_normal = ExtResource( 34 ) -texture_hover = ExtResource( 35 ) -texture_disabled = ExtResource( 36 ) - -[node name="CloneLayer" type="TextureButton" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/VBoxLayerWithLabels/LayerVBoxContainer/CenterLayerButtons/LayerButtons" groups=[ -"UIButtons", -]] -margin_left = 144.0 -margin_right = 176.0 -margin_bottom = 32.0 -hint_tooltip = "LAYERCLONE_HT" -mouse_default_cursor_shape = 2 -texture_normal = ExtResource( 37 ) -texture_hover = ExtResource( 38 ) - -[node name="MergeDownLayer" type="TextureButton" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/VBoxLayerWithLabels/LayerVBoxContainer/CenterLayerButtons/LayerButtons" groups=[ -"UIButtons", -]] -margin_left = 180.0 -margin_right = 212.0 -margin_bottom = 32.0 -hint_tooltip = "LAYERMERGE_HT" -mouse_default_cursor_shape = 8 -disabled = true -texture_normal = ExtResource( 39 ) -texture_hover = ExtResource( 40 ) -texture_disabled = ExtResource( 41 ) - -[node name="OpacityContainer" type="HBoxContainer" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/VBoxLayerWithLabels/LayerVBoxContainer"] -margin_top = 38.0 -margin_right = 224.0 -margin_bottom = 55.0 -custom_constants/separation = 2 -alignment = 1 - -[node name="SpacerControl" type="Control" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/VBoxLayerWithLabels/LayerVBoxContainer/OpacityContainer"] -margin_right = 3.0 -margin_bottom = 17.0 -rect_min_size = Vector2( 3, 0 ) - -[node name="OpacityLabel" type="Label" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/VBoxLayerWithLabels/LayerVBoxContainer/OpacityContainer"] -margin_left = 5.0 -margin_right = 49.0 -margin_bottom = 17.0 -size_flags_vertical = 1 -text = "Opacity:" - -[node name="OpacitySlider" type="HSlider" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/VBoxLayerWithLabels/LayerVBoxContainer/OpacityContainer"] -margin_left = 51.0 -margin_right = 166.0 -margin_bottom = 17.0 -mouse_default_cursor_shape = 2 -size_flags_horizontal = 3 -size_flags_vertical = 1 -value = 100.0 -ticks_on_borders = true - -[node name="OpacitySpinBox" type="SpinBox" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/VBoxLayerWithLabels/LayerVBoxContainer/OpacityContainer"] -margin_left = 168.0 -margin_right = 222.0 -margin_bottom = 17.0 -mouse_default_cursor_shape = 2 -value = 100.0 -align = 1 - -[node name="SpacerControl2" type="Control" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/VBoxLayerWithLabels/LayerVBoxContainer/OpacityContainer"] -margin_left = 224.0 -margin_right = 224.0 -margin_bottom = 17.0 - -[node name="ScrollLayers" type="ScrollContainer" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/VBoxLayerWithLabels/LayerVBoxContainer"] -margin_top = 61.0 -margin_right = 224.0 -margin_bottom = 218.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 - -[node name="VBoxLayerContainer" type="VBoxContainer" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/VBoxLayerWithLabels/LayerVBoxContainer/ScrollLayers"] -margin_right = 224.0 -size_flags_horizontal = 3 - [node name="BrushesPopup" type="Popup" parent="."] +editor/display_folded = true margin_right = 226.0 margin_bottom = 144.0 rect_min_size = Vector2( 0, 144 ) @@ -1363,14 +1206,12 @@ size_flags_horizontal = 3 scroll_horizontal_enabled = false [node name="FileBrushContainer" type="GridContainer" parent="BrushesPopup/TabContainer/File"] -margin_right = 96.0 -margin_bottom = 32.0 columns = 6 -[node name="PixelBrushButton" parent="BrushesPopup/TabContainer/File/FileBrushContainer" instance=ExtResource( 42 )] +[node name="PixelBrushButton" parent="BrushesPopup/TabContainer/File/FileBrushContainer" instance=ExtResource( 26 )] hint_tooltip = "Pixel brush" -[node name="CircleBrushButton" parent="BrushesPopup/TabContainer/File/FileBrushContainer" instance=ExtResource( 42 )] +[node name="CircleBrushButton" parent="BrushesPopup/TabContainer/File/FileBrushContainer" instance=ExtResource( 26 )] margin_left = 32.0 margin_right = 64.0 hint_tooltip = "Filled circle brush" @@ -1380,7 +1221,7 @@ custom_brush_index = -2 [node name="BrushTexture" parent="BrushesPopup/TabContainer/File/FileBrushContainer/CircleBrushButton" index="0"] texture = SubResource( 8 ) -[node name="FilledCircleBrushButton" parent="BrushesPopup/TabContainer/File/FileBrushContainer" instance=ExtResource( 42 )] +[node name="FilledCircleBrushButton" parent="BrushesPopup/TabContainer/File/FileBrushContainer" instance=ExtResource( 26 )] margin_left = 64.0 margin_right = 96.0 hint_tooltip = "Circle brush" @@ -1405,9 +1246,9 @@ scroll_horizontal_enabled = false [node name="ProjectBrushContainer" type="GridContainer" parent="BrushesPopup/TabContainer/Project"] columns = 5 -[node name="SplashDialog" parent="." instance=ExtResource( 43 )] +[node name="SplashDialog" parent="." instance=ExtResource( 27 )] -[node name="CreateNewImage" parent="." instance=ExtResource( 44 )] +[node name="CreateNewImage" parent="." instance=ExtResource( 28 )] [node name="OpenSprite" type="FileDialog" parent="."] margin_right = 515.0 @@ -1436,22 +1277,18 @@ filters = PoolStringArray( "*.pxo ; Pixelorama Project" ) 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" parent="." instance=ExtResource( 45 )] +[node name="ImportSprites" parent="." instance=ExtResource( 29 )] -[node name="ExportSprites" parent="." instance=ExtResource( 46 )] +[node name="ExportSprites" parent="." instance=ExtResource( 30 )] -[node name="ScaleImage" parent="." instance=ExtResource( 47 )] -resizable = true +[node name="ScaleImage" parent="." instance=ExtResource( 31 )] -[node name="PreferencesDialog" parent="." instance=ExtResource( 48 )] +[node name="PreferencesDialog" parent="." instance=ExtResource( 32 )] -[node name="RotateImage" parent="." instance=ExtResource( 54 )] - -[node name="OutlineDialog" parent="." instance=ExtResource( 49 )] +[node name="OutlineDialog" parent="." instance=ExtResource( 33 )] visible = false -resizable = true -[node name="AboutDialog" parent="." instance=ExtResource( 50 )] +[node name="AboutDialog" parent="." instance=ExtResource( 34 )] [node name="QuitDialog" type="ConfirmationDialog" parent="."] margin_right = 200.0 @@ -1472,12 +1309,12 @@ margin_bottom = 60.0 window_title = "Error!" dialog_text = "This is an error message!" -[node name="EditPalettePopup" parent="." instance=ExtResource( 51 )] +[node name="EditPalettePopup" parent="." instance=ExtResource( 35 )] visible = false -[node name="NewPaletteDialog" parent="." instance=ExtResource( 52 )] +[node name="NewPaletteDialog" parent="." instance=ExtResource( 36 )] -[node name="PaletteImportFileDialog" parent="." instance=ExtResource( 53 )] +[node name="PaletteImportFileDialog" parent="." instance=ExtResource( 37 )] filters = PoolStringArray( "*.json ; JavaScript Object Notation", "*.gpl ; Gimp Palette Library", "*.png; Portable Network Graphics" ) current_dir = "C:/Users/Overloaded/Dropbox/Orama Founding Members/εταιρικα αρχεια/Godot Projects/Pixelorama" current_path = "C:/Users/Overloaded/Dropbox/Orama Founding Members/εταιρικα αρχεια/Godot Projects/Pixelorama/" @@ -1529,17 +1366,9 @@ visible = false [connection signal="mouse_exited" from="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HSplitContainer/ViewportandVerticalRuler/ViewportContainer" to="." method="_on_ViewportContainer_mouse_exited"] [connection signal="mouse_entered" from="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HSplitContainer/ViewportContainer2" to="." method="_on_ViewportContainer_mouse_entered"] [connection signal="mouse_exited" from="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HSplitContainer/ViewportContainer2" to="." method="_on_ViewportContainer_mouse_exited"] -[connection signal="pressed" from="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/PaletteVBoxContainer/CenterContainer/PaletteButtons/AddPalette" to="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/PaletteVBoxContainer/ScrollPalette/CenterPalette/PaletteContainer" method="_on_AddPalette_pressed"] -[connection signal="pressed" from="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/PaletteVBoxContainer/CenterContainer/PaletteButtons/EditPalette" to="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/PaletteVBoxContainer/ScrollPalette/CenterPalette/PaletteContainer" method="on_edit_palette"] -[connection signal="item_selected" from="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/PaletteVBoxContainer/CenterContainer/PaletteButtons/PaletteOptionButton" to="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/PaletteVBoxContainer/ScrollPalette/CenterPalette/PaletteContainer" method="_on_PaletteOptionButton_item_selected"] -[connection signal="pressed" from="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/VBoxLayerWithLabels/LayerVBoxContainer/CenterLayerButtons/LayerButtons/AddLayer" to="." method="add_layer"] -[connection signal="pressed" from="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/VBoxLayerWithLabels/LayerVBoxContainer/CenterLayerButtons/LayerButtons/RemoveLayer" to="." method="_on_RemoveLayerButton_pressed"] -[connection signal="pressed" from="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/VBoxLayerWithLabels/LayerVBoxContainer/CenterLayerButtons/LayerButtons/MoveUpLayer" to="." method="change_layer_order" binds= [ 1 ]] -[connection signal="pressed" from="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/VBoxLayerWithLabels/LayerVBoxContainer/CenterLayerButtons/LayerButtons/MovwDownLayer" to="." method="change_layer_order" binds= [ -1 ]] -[connection signal="pressed" from="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/VBoxLayerWithLabels/LayerVBoxContainer/CenterLayerButtons/LayerButtons/CloneLayer" to="." method="add_layer" binds= [ false ]] -[connection signal="pressed" from="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/VBoxLayerWithLabels/LayerVBoxContainer/CenterLayerButtons/LayerButtons/MergeDownLayer" to="." method="_on_MergeLayer_pressed"] -[connection signal="value_changed" from="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/VBoxLayerWithLabels/LayerVBoxContainer/OpacityContainer/OpacitySlider" to="." method="_on_OpacitySlider_value_changed"] -[connection signal="value_changed" from="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/VBoxLayerWithLabels/LayerVBoxContainer/OpacityContainer/OpacitySpinBox" to="." method="_on_OpacitySlider_value_changed"] +[connection signal="pressed" from="MenuAndUI/UI/RightPanel/PreviewAndPalettes/PaletteVBoxContainer/CenterContainer/PaletteButtons/AddPalette" to="MenuAndUI/UI/RightPanel/PreviewAndPalettes/PaletteVBoxContainer/ScrollPalette/CenterPalette/PaletteContainer" method="_on_AddPalette_pressed"] +[connection signal="pressed" from="MenuAndUI/UI/RightPanel/PreviewAndPalettes/PaletteVBoxContainer/CenterContainer/PaletteButtons/EditPalette" to="MenuAndUI/UI/RightPanel/PreviewAndPalettes/PaletteVBoxContainer/ScrollPalette/CenterPalette/PaletteContainer" method="on_edit_palette"] +[connection signal="item_selected" from="MenuAndUI/UI/RightPanel/PreviewAndPalettes/PaletteVBoxContainer/CenterContainer/PaletteButtons/PaletteOptionButton" to="MenuAndUI/UI/RightPanel/PreviewAndPalettes/PaletteVBoxContainer/ScrollPalette/CenterPalette/PaletteContainer" method="_on_PaletteOptionButton_item_selected"] [connection signal="popup_hide" from="SplashDialog" to="." method="_can_draw_true"] [connection signal="popup_hide" from="CreateNewImage" to="." method="_can_draw_true"] [connection signal="file_selected" from="OpenSprite" to="." method="_on_OpenSprite_file_selected"] @@ -1559,7 +1388,9 @@ visible = false [connection signal="popup_hide" from="QuitAndSaveDialog" to="." method="_can_draw_true"] [connection signal="confirmed" from="NewPaletteDialog" to="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/PaletteVBoxContainer/ScrollPalette/CenterPalette/PaletteContainer" method="on_new_palette_confirmed"] [connection signal="file_selected" from="PaletteImportFileDialog" to="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/PaletteVBoxContainer/ScrollPalette/CenterPalette/PaletteContainer" method="on_palette_import_file_selected"] +[connection signal="confirmed" from="NewPaletteDialog" to="MenuAndUI/UI/RightPanel/PreviewAndPalettes/PaletteVBoxContainer/ScrollPalette/CenterPalette/PaletteContainer" method="on_new_palette_confirmed"] +[connection signal="file_selected" from="PaletteImportFileDialog" to="MenuAndUI/UI/RightPanel/PreviewAndPalettes/PaletteVBoxContainer/ScrollPalette/CenterPalette/PaletteContainer" method="on_palette_import_file_selected"] [editable path="BrushesPopup/TabContainer/File/FileBrushContainer/CircleBrushButton"] -[editable path="BrushesPopup/TabContainer/File/FileBrushContainer/FilledCircleBrushButton"] +[editable path="BrushesPopup/TabContainer/File/FileBrushContainer/FilledCircleBrushButton"] \ No newline at end of file diff --git a/Prefabs/AnimationTimeline.tscn b/Prefabs/AnimationTimeline.tscn index 123c0536f..07f6b3f3a 100644 --- a/Prefabs/AnimationTimeline.tscn +++ b/Prefabs/AnimationTimeline.tscn @@ -1,23 +1,39 @@ -[gd_scene load_steps=31 format=2] +[gd_scene load_steps=47 format=2] [ext_resource path="res://Scripts/AnimationTimeline.gd" type="Script" id=1] -[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Go_To_First_Frame.png" type="Texture" id=2] -[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Go_To_First_Frame_Hover.png" type="Texture" id=3] -[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Previous_Frame.png" type="Texture" id=4] -[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Previous_Frame_Hover.png" type="Texture" id=5] -[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Play Backwards.png" type="Texture" id=6] -[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Pause.png" type="Texture" id=7] -[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Play Backwards_Hover.png" type="Texture" id=8] -[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Play.png" type="Texture" id=9] -[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Play_Hover.png" type="Texture" id=10] -[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Next_Frame.png" type="Texture" id=11] -[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Next_Frame_Hover.png" type="Texture" id=12] -[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Go_To_Last_Frame.png" type="Texture" id=13] -[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Go_To_Last_Frame_Hover.png" type="Texture" id=14] -[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Loop_None.png" type="Texture" id=15] -[ext_resource path="res://Scripts/Rulers/TimelineSeconds.gd" type="Script" id=16] -[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/New_Frame.png" type="Texture" id=17] -[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/New_Frame_Hover.png" type="Texture" id=18] +[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/New_Layer.png" type="Texture" id=2] +[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/New_Layer_Hover.png" type="Texture" id=3] +[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Delete_Layer.png" type="Texture" id=4] +[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Delete_Layer_Hover.png" type="Texture" id=5] +[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Delete_Layer_Disabled.png" type="Texture" id=6] +[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Move_Up.png" type="Texture" id=7] +[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Move_Up_Hover.png" type="Texture" id=8] +[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Move_Up_Disabled.png" type="Texture" id=9] +[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Move_Down.png" type="Texture" id=10] +[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Move_Down_Hover.png" type="Texture" id=11] +[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Move_Down_Disabled.png" type="Texture" id=12] +[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Clone_Layer.png" type="Texture" id=13] +[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Clone_Layer_Hover.png" type="Texture" id=14] +[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Merge_Down.png" type="Texture" id=15] +[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Merge_Down_Hover.png" type="Texture" id=16] +[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Merge_Down_Disabled.png" type="Texture" id=17] +[ext_resource path="res://Prefabs/LayerContainer.tscn" type="PackedScene" id=18] +[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/New_Frame.png" type="Texture" id=19] +[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/New_Frame_Hover.png" type="Texture" id=20] +[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Go_To_First_Frame.png" type="Texture" id=21] +[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Go_To_First_Frame_Hover.png" type="Texture" id=22] +[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Previous_Frame.png" type="Texture" id=23] +[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Previous_Frame_Hover.png" type="Texture" id=24] +[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Play Backwards.png" type="Texture" id=25] +[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Pause.png" type="Texture" id=26] +[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Play Backwards_Hover.png" type="Texture" id=27] +[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Play.png" type="Texture" id=28] +[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Play_Hover.png" type="Texture" id=29] +[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Next_Frame.png" type="Texture" id=30] +[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Next_Frame_Hover.png" type="Texture" id=31] +[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Go_To_Last_Frame.png" type="Texture" id=32] +[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Go_To_Last_Frame_Hover.png" type="Texture" id=33] +[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/Loop_None.png" type="Texture" id=34] [sub_resource type="InputEventKey" id=1] control = true @@ -64,19 +80,17 @@ scancode = 16777230 shortcut = SubResource( 11 ) [node name="AnimationTimeline" type="Panel"] -margin_top = 478.0 +margin_top = 438.0 margin_right = 704.0 margin_bottom = 620.0 -rect_min_size = Vector2( 0, 142 ) +rect_min_size = Vector2( 0, 200 ) size_flags_horizontal = 3 script = ExtResource( 1 ) [node name="VSeparator" type="VSeparator" parent="."] -anchor_top = 0.5 -anchor_bottom = 0.5 -margin_top = -71.0 +anchor_bottom = 1.0 margin_right = 4.0 -margin_bottom = 71.0 +size_flags_vertical = 3 [node name="AnimationContainer" type="HBoxContainer" parent="."] anchor_right = 1.0 @@ -86,26 +100,218 @@ margin_top = 4.0 [node name="TimelineContainer" type="VBoxContainer" parent="AnimationContainer"] margin_right = 543.0 -margin_bottom = 138.0 +margin_bottom = 196.0 size_flags_horizontal = 3 -[node name="AnimationButtons" type="HBoxContainer" parent="AnimationContainer/TimelineContainer"] +[node name="FrameLayerButtonContainer" type="HBoxContainer" parent="AnimationContainer/TimelineContainer"] margin_right = 543.0 +margin_bottom = 36.0 + +[node name="LayerButtons" type="HBoxContainer" parent="AnimationContainer/TimelineContainer/FrameLayerButtonContainer"] +margin_right = 326.0 +margin_bottom = 36.0 + +[node name="AddLayer" type="TextureButton" parent="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons" groups=[ +"UIButtons", +]] +margin_right = 32.0 +margin_bottom = 36.0 +hint_tooltip = "LAYERNEW_HT" +mouse_default_cursor_shape = 2 +texture_normal = ExtResource( 2 ) +texture_hover = ExtResource( 3 ) + +[node name="RemoveLayer" type="TextureButton" parent="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons" groups=[ +"UIButtons", +]] +margin_left = 36.0 +margin_right = 68.0 +margin_bottom = 36.0 +hint_tooltip = "LAYERREMOVE_HT" +mouse_default_cursor_shape = 8 +disabled = true +texture_normal = ExtResource( 4 ) +texture_hover = ExtResource( 5 ) +texture_disabled = ExtResource( 6 ) + +[node name="MoveUpLayer" type="TextureButton" parent="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons" groups=[ +"UIButtons", +]] +margin_left = 72.0 +margin_right = 104.0 +margin_bottom = 36.0 +hint_tooltip = "LAYERUP_HT" +mouse_default_cursor_shape = 8 +disabled = true +texture_normal = ExtResource( 7 ) +texture_hover = ExtResource( 8 ) +texture_disabled = ExtResource( 9 ) + +[node name="MovwDownLayer" type="TextureButton" parent="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons" groups=[ +"UIButtons", +]] +margin_left = 108.0 +margin_right = 140.0 +margin_bottom = 36.0 +hint_tooltip = "LAYERDOWN_HT" +mouse_default_cursor_shape = 8 +disabled = true +texture_normal = ExtResource( 10 ) +texture_hover = ExtResource( 11 ) +texture_disabled = ExtResource( 12 ) + +[node name="CloneLayer" type="TextureButton" parent="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons" groups=[ +"UIButtons", +]] +margin_left = 144.0 +margin_right = 176.0 +margin_bottom = 36.0 +hint_tooltip = "LAYERCLONE_HT" +mouse_default_cursor_shape = 2 +texture_normal = ExtResource( 13 ) +texture_hover = ExtResource( 14 ) + +[node name="MergeDownLayer" type="TextureButton" parent="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons" groups=[ +"UIButtons", +]] +margin_left = 180.0 +margin_right = 212.0 +margin_bottom = 36.0 +hint_tooltip = "LAYERMERGE_HT" +mouse_default_cursor_shape = 8 +disabled = true +texture_normal = ExtResource( 15 ) +texture_hover = ExtResource( 16 ) +texture_disabled = ExtResource( 17 ) + +[node name="TagsAndFrameIDs" type="VBoxContainer" parent="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons"] +margin_left = 216.0 +margin_right = 326.0 +margin_bottom = 36.0 + +[node name="AnimationTags" type="VBoxContainer" parent="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons/TagsAndFrameIDs"] +editor/display_folded = true +margin_right = 110.0 +margin_bottom = 36.0 +size_flags_vertical = 0 + +[node name="Line2D" type="Line2D" parent="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons/TagsAndFrameIDs/AnimationTags"] +points = PoolVector2Array( 0, 32, 0, 0, 110, 0, 110, 32 ) +width = 1.0 + +[node name="Label" type="Label" parent="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons/TagsAndFrameIDs/AnimationTags"] +margin_right = 110.0 +margin_bottom = 32.0 +rect_min_size = Vector2( 110, 32 ) +size_flags_vertical = 1 +text = "Animation Tags" +align = 1 +valign = 1 + +[node name="FramesContainer" type="HBoxContainer" parent="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons/TagsAndFrameIDs/AnimationTags"] +margin_top = 36.0 +margin_right = 110.0 +margin_bottom = 36.0 + +[node name="OpacityContainer" type="HBoxContainer" parent="AnimationContainer/TimelineContainer"] +margin_top = 40.0 +margin_right = 543.0 +margin_bottom = 64.0 +custom_constants/separation = 2 + +[node name="OpacityLabel" type="Label" parent="AnimationContainer/TimelineContainer/OpacityContainer"] +margin_right = 53.0 margin_bottom = 24.0 +size_flags_horizontal = 0 +size_flags_vertical = 1 +text = "Opacity:" +valign = 1 + +[node name="OpacitySlider" type="HSlider" parent="AnimationContainer/TimelineContainer/OpacityContainer"] +margin_left = 55.0 +margin_right = 167.0 +margin_bottom = 24.0 +rect_min_size = Vector2( 112, 0 ) +mouse_default_cursor_shape = 2 +size_flags_vertical = 1 +value = 100.0 +ticks_on_borders = true + +[node name="OpacitySpinBox" type="SpinBox" parent="AnimationContainer/TimelineContainer/OpacityContainer"] +margin_left = 169.0 +margin_right = 243.0 +margin_bottom = 24.0 +mouse_default_cursor_shape = 2 +size_flags_vertical = 4 +value = 100.0 +align = 1 + +[node name="FrameIDs" type="HBoxContainer" parent="AnimationContainer/TimelineContainer/OpacityContainer"] +margin_left = 245.0 +margin_right = 281.0 +margin_bottom = 24.0 + +[node name="Label" type="Label" parent="AnimationContainer/TimelineContainer/OpacityContainer/FrameIDs"] +margin_top = 5.0 +margin_right = 36.0 +margin_bottom = 19.0 +rect_min_size = Vector2( 36, 0 ) +text = "1" +align = 1 + +[node name="TimelineScroll" type="ScrollContainer" parent="AnimationContainer/TimelineContainer"] +margin_top = 68.0 +margin_right = 543.0 +margin_bottom = 160.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="LayersAndFrames" type="GridContainer" parent="AnimationContainer/TimelineContainer/TimelineScroll"] +margin_right = 212.0 +margin_bottom = 36.0 +custom_constants/vseparation = 4 +custom_constants/hseparation = 4 +columns = 2 + +[node name="LayerContainer" parent="AnimationContainer/TimelineContainer/TimelineScroll/LayersAndFrames" instance=ExtResource( 18 )] +margin_right = 212.0 + +[node name="HSeparator" type="HSeparator" parent="AnimationContainer/TimelineContainer"] +margin_top = 164.0 +margin_right = 543.0 +margin_bottom = 168.0 + +[node name="AnimationButtons" type="HBoxContainer" parent="AnimationContainer/TimelineContainer"] +margin_top = 172.0 +margin_right = 543.0 +margin_bottom = 196.0 rect_min_size = Vector2( 0, 24 ) [node name="CurrentFrame" type="Label" parent="AnimationContainer/TimelineContainer/AnimationButtons"] margin_top = 5.0 -margin_right = 218.0 +margin_right = 117.0 margin_bottom = 19.0 -size_flags_horizontal = 3 text = "Current frame: 1/1" +[node name="AddFrame" type="TextureButton" parent="AnimationContainer/TimelineContainer/AnimationButtons" groups=[ +"UIButtons", +]] +margin_left = 121.0 +margin_right = 141.0 +margin_bottom = 20.0 +hint_tooltip = "Add a new frame" +mouse_default_cursor_shape = 2 +size_flags_horizontal = 0 +size_flags_vertical = 0 +texture_normal = ExtResource( 19 ) +texture_hover = ExtResource( 20 ) + [node name="PlaybackButtons" type="HBoxContainer" parent="AnimationContainer/TimelineContainer/AnimationButtons"] -margin_left = 222.0 -margin_right = 362.0 +editor/display_folded = true +margin_left = 223.0 +margin_right = 363.0 margin_bottom = 24.0 -size_flags_horizontal = 2 +size_flags_horizontal = 6 [node name="FirstFrame" type="TextureButton" parent="AnimationContainer/TimelineContainer/AnimationButtons/PlaybackButtons" groups=[ "UIButtons", @@ -116,8 +322,8 @@ hint_tooltip = "FIRSTFRAME_HT" mouse_default_cursor_shape = 2 shortcut_in_tooltip = false shortcut = SubResource( 2 ) -texture_normal = ExtResource( 2 ) -texture_hover = ExtResource( 3 ) +texture_normal = ExtResource( 21 ) +texture_hover = ExtResource( 22 ) [node name="PreviousFrame" type="TextureButton" parent="AnimationContainer/TimelineContainer/AnimationButtons/PlaybackButtons" groups=[ "UIButtons", @@ -129,8 +335,8 @@ hint_tooltip = "PREVIOUSFRAME_HT" mouse_default_cursor_shape = 2 shortcut_in_tooltip = false shortcut = SubResource( 4 ) -texture_normal = ExtResource( 4 ) -texture_hover = ExtResource( 5 ) +texture_normal = ExtResource( 23 ) +texture_hover = ExtResource( 24 ) [node name="PlayBackwards" type="TextureButton" parent="AnimationContainer/TimelineContainer/AnimationButtons/PlaybackButtons" groups=[ "UIButtons", @@ -143,9 +349,9 @@ mouse_default_cursor_shape = 2 toggle_mode = true shortcut_in_tooltip = false shortcut = SubResource( 6 ) -texture_normal = ExtResource( 6 ) -texture_pressed = ExtResource( 7 ) -texture_hover = ExtResource( 8 ) +texture_normal = ExtResource( 25 ) +texture_pressed = ExtResource( 26 ) +texture_hover = ExtResource( 27 ) [node name="PlayForward" type="TextureButton" parent="AnimationContainer/TimelineContainer/AnimationButtons/PlaybackButtons" groups=[ "UIButtons", @@ -159,9 +365,9 @@ size_flags_horizontal = 0 toggle_mode = true shortcut_in_tooltip = false shortcut = SubResource( 8 ) -texture_normal = ExtResource( 9 ) -texture_pressed = ExtResource( 7 ) -texture_hover = ExtResource( 10 ) +texture_normal = ExtResource( 28 ) +texture_pressed = ExtResource( 26 ) +texture_hover = ExtResource( 29 ) [node name="NextFrame" type="TextureButton" parent="AnimationContainer/TimelineContainer/AnimationButtons/PlaybackButtons" groups=[ "UIButtons", @@ -173,8 +379,8 @@ hint_tooltip = "NEXTFRAME_HT" mouse_default_cursor_shape = 2 shortcut_in_tooltip = false shortcut = SubResource( 10 ) -texture_normal = ExtResource( 11 ) -texture_hover = ExtResource( 12 ) +texture_normal = ExtResource( 30 ) +texture_hover = ExtResource( 31 ) [node name="LastFrame" type="TextureButton" parent="AnimationContainer/TimelineContainer/AnimationButtons/PlaybackButtons" groups=[ "UIButtons", @@ -186,12 +392,12 @@ hint_tooltip = "LASTFRAME_HT" mouse_default_cursor_shape = 2 shortcut_in_tooltip = false shortcut = SubResource( 12 ) -texture_normal = ExtResource( 13 ) -texture_hover = ExtResource( 14 ) +texture_normal = ExtResource( 32 ) +texture_hover = ExtResource( 33 ) [node name="LoopButtons" type="HBoxContainer" parent="AnimationContainer/TimelineContainer/AnimationButtons"] -margin_left = 444.0 -margin_right = 542.0 +margin_left = 445.0 +margin_right = 543.0 margin_bottom = 24.0 size_flags_horizontal = 0 @@ -214,60 +420,17 @@ margin_right = 98.0 margin_bottom = 24.0 hint_tooltip = "No loop" mouse_default_cursor_shape = 2 -texture_normal = ExtResource( 15 ) - -[node name="HSeparator" type="HSeparator" parent="AnimationContainer/TimelineContainer"] -margin_top = 28.0 -margin_right = 543.0 -margin_bottom = 32.0 - -[node name="TimelineSeconds" type="Control" parent="AnimationContainer/TimelineContainer"] -margin_top = 36.0 -margin_right = 543.0 -margin_bottom = 52.0 -rect_min_size = Vector2( 0, 16 ) -script = ExtResource( 16 ) - -[node name="HSeparator2" type="HSeparator" parent="AnimationContainer/TimelineContainer"] -margin_top = 56.0 -margin_right = 543.0 -margin_bottom = 60.0 - -[node name="FrameAndButtonContainer" type="HBoxContainer" parent="AnimationContainer/TimelineContainer"] -margin_top = 64.0 -margin_right = 543.0 -margin_bottom = 84.0 - -[node name="AddFrame" type="TextureButton" parent="AnimationContainer/TimelineContainer/FrameAndButtonContainer" groups=[ -"UIButtons", -]] -margin_right = 20.0 -margin_bottom = 20.0 -hint_tooltip = "Add a new frame" -mouse_default_cursor_shape = 2 -size_flags_horizontal = 0 -texture_normal = ExtResource( 17 ) -texture_hover = ExtResource( 18 ) - -[node name="ScrollContainer" type="ScrollContainer" parent="AnimationContainer/TimelineContainer/FrameAndButtonContainer"] -margin_left = 24.0 -margin_right = 543.0 -margin_bottom = 20.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -scroll_vertical_enabled = false - -[node name="FrameContainer" type="HBoxContainer" parent="AnimationContainer/TimelineContainer/FrameAndButtonContainer/ScrollContainer"] +texture_normal = ExtResource( 34 ) [node name="VSeparator" type="VSeparator" parent="AnimationContainer"] margin_left = 547.0 margin_right = 551.0 -margin_bottom = 138.0 +margin_bottom = 196.0 [node name="OnionSkinningButtons" type="VBoxContainer" parent="AnimationContainer"] margin_left = 555.0 margin_right = 681.0 -margin_bottom = 138.0 +margin_bottom = 196.0 [node name="OnionSkinning" type="Label" parent="AnimationContainer/OnionSkinningButtons"] margin_right = 126.0 @@ -310,9 +473,18 @@ text = "Blue-Red Mode" [node name="VSeparator2" type="VSeparator" parent="AnimationContainer"] margin_left = 685.0 margin_right = 689.0 -margin_bottom = 138.0 +margin_bottom = 196.0 [node name="AnimationTimer" type="Timer" parent="."] +[connection signal="pressed" from="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons/AddLayer" to="." method="add_layer" binds= [ true ]] +[connection signal="pressed" from="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons/RemoveLayer" to="." method="_on_RemoveLayer_pressed"] +[connection signal="pressed" from="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons/MoveUpLayer" to="." method="change_layer_order" binds= [ 1 ]] +[connection signal="pressed" from="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons/MovwDownLayer" to="." method="change_layer_order" binds= [ -1 ]] +[connection signal="pressed" from="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons/CloneLayer" to="." method="add_layer" binds= [ false ]] +[connection signal="pressed" from="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons/MergeDownLayer" to="." method="_on_MergeDownLayer_pressed"] +[connection signal="value_changed" from="AnimationContainer/TimelineContainer/OpacityContainer/OpacitySlider" to="." method="_on_OpacitySlider_value_changed"] +[connection signal="value_changed" from="AnimationContainer/TimelineContainer/OpacityContainer/OpacitySpinBox" to="." method="_on_OpacitySlider_value_changed"] +[connection signal="pressed" from="AnimationContainer/TimelineContainer/AnimationButtons/AddFrame" to="." method="add_frame"] [connection signal="pressed" from="AnimationContainer/TimelineContainer/AnimationButtons/PlaybackButtons/FirstFrame" to="." method="_on_FirstFrame_pressed"] [connection signal="pressed" from="AnimationContainer/TimelineContainer/AnimationButtons/PlaybackButtons/PreviousFrame" to="." method="_on_PreviousFrame_pressed"] [connection signal="toggled" from="AnimationContainer/TimelineContainer/AnimationButtons/PlaybackButtons/PlayBackwards" to="." method="_on_PlayBackwards_toggled"] @@ -321,8 +493,6 @@ margin_bottom = 138.0 [connection signal="pressed" from="AnimationContainer/TimelineContainer/AnimationButtons/PlaybackButtons/LastFrame" to="." method="_on_LastFrame_pressed"] [connection signal="value_changed" from="AnimationContainer/TimelineContainer/AnimationButtons/LoopButtons/FPSValue" to="." method="_on_FPSValue_value_changed"] [connection signal="pressed" from="AnimationContainer/TimelineContainer/AnimationButtons/LoopButtons/LoopAnim" to="." method="_on_LoopAnim_pressed"] -[connection signal="pressed" from="AnimationContainer/TimelineContainer/FrameAndButtonContainer/AddFrame" to="." method="add_frame"] -[connection signal="gui_input" from="AnimationContainer/TimelineContainer/FrameAndButtonContainer/ScrollContainer" to="AnimationContainer/TimelineContainer/TimelineSeconds" method="_on_ScrollContainer_gui_input"] [connection signal="value_changed" from="AnimationContainer/OnionSkinningButtons/PastOnionSkinning" to="." method="_on_PastOnionSkinning_value_changed"] [connection signal="value_changed" from="AnimationContainer/OnionSkinningButtons/FutureOnionSkinning" to="." method="_on_FutureOnionSkinning_value_changed"] [connection signal="toggled" from="AnimationContainer/OnionSkinningButtons/BlueRedMode" to="." method="_on_BlueRedMode_toggled"] diff --git a/Prefabs/FrameButton.tscn b/Prefabs/FrameButton.tscn index 3f9954f43..c1555f298 100644 --- a/Prefabs/FrameButton.tscn +++ b/Prefabs/FrameButton.tscn @@ -2,13 +2,10 @@ [ext_resource path="res://Scripts/FrameButton.gd" type="Script" id=1] -[node name="Frame" type="VBoxContainer"] -margin_right = 32.0 -margin_bottom = 50.0 - -[node name="FrameButton" type="Button" parent="."] +[node name="FrameButton" type="Button"] +margin_top = 18.0 margin_right = 36.0 -margin_bottom = 36.0 +margin_bottom = 54.0 rect_min_size = Vector2( 36, 36 ) mouse_default_cursor_shape = 2 size_flags_horizontal = 0 @@ -17,7 +14,7 @@ toggle_mode = true button_mask = 7 script = ExtResource( 1 ) -[node name="FrameTexture" type="TextureRect" parent="FrameButton"] +[node name="FrameTexture" type="TextureRect" parent="."] margin_left = 2.0 margin_top = 2.0 margin_right = 34.0 @@ -28,17 +25,10 @@ size_flags_vertical = 0 expand = true stretch_mode = 6 -[node name="PopupMenu" type="PopupMenu" parent="FrameButton"] +[node name="PopupMenu" type="PopupMenu" parent="."] margin_right = 20.0 margin_bottom = 20.0 mouse_default_cursor_shape = 2 items = [ "Remove Frame", null, 0, false, true, -1, 0, null, "", false, "Clone Frame", null, 0, false, false, -1, 0, null, "", false, "Move Left", null, 0, false, true, -1, 0, null, "", false, "Move Right", null, 0, false, true, -1, 0, null, "", false ] - -[node name="FrameID" type="Label" parent="."] -margin_top = 40.0 -margin_right = 36.0 -margin_bottom = 54.0 -text = "0" -align = 1 -[connection signal="pressed" from="FrameButton" to="FrameButton" method="_on_FrameButton_pressed"] -[connection signal="id_pressed" from="FrameButton/PopupMenu" to="FrameButton" method="_on_PopupMenu_id_pressed"] +[connection signal="pressed" from="." to="." method="_on_FrameButton_pressed"] +[connection signal="id_pressed" from="PopupMenu" to="." method="_on_PopupMenu_id_pressed"] diff --git a/Prefabs/FrameContainer.tscn b/Prefabs/FrameContainer.tscn new file mode 100644 index 000000000..01387acad --- /dev/null +++ b/Prefabs/FrameContainer.tscn @@ -0,0 +1,18 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://Prefabs/FrameButton.tscn" type="PackedScene" id=1] + +[node name="FrameContainer" type="VBoxContainer"] +margin_right = 32.0 +margin_bottom = 50.0 + +[node name="FrameID" type="Label" parent="."] +margin_right = 36.0 +margin_bottom = 17.0 +rect_min_size = Vector2( 0, 17 ) +text = "0" +align = 1 + +[node name="FrameButton" parent="." instance=ExtResource( 1 )] +margin_top = 21.0 +margin_bottom = 57.0 diff --git a/Prefabs/LayerContainer.tscn b/Prefabs/LayerContainer.tscn index 460081c84..cc11393b2 100644 --- a/Prefabs/LayerContainer.tscn +++ b/Prefabs/LayerContainer.tscn @@ -5,22 +5,30 @@ [ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Layer_Visible_Hover.png" type="Texture" id=3] [node name="LayerContainer" type="Button"] -margin_right = 160.0 -margin_bottom = 42.0 -rect_min_size = Vector2( 160, 42 ) +margin_right = 210.0 +margin_bottom = 36.0 +rect_min_size = Vector2( 212, 36 ) toggle_mode = true script = ExtResource( 1 ) __meta__ = { "_edit_horizontal_guides_": [ ] } -[node name="VisibilityButton" type="TextureButton" parent="." groups=[ +[node name="HBoxContainer" type="HBoxContainer" parent="."] +anchor_top = 0.5 +anchor_right = 1.0 +anchor_bottom = 0.5 +margin_top = -16.0 +margin_bottom = 16.0 +mouse_default_cursor_shape = 2 +alignment = 1 + +[node name="VisibilityButton" type="TextureButton" parent="HBoxContainer" groups=[ "UIButtons", ]] -margin_left = 6.0 -margin_top = 5.0 -margin_right = 38.0 -margin_bottom = 37.0 +margin_left = 65.0 +margin_right = 97.0 +margin_bottom = 32.0 hint_tooltip = "LAYERVISIBILITY_HT" mouse_default_cursor_shape = 2 size_flags_horizontal = 0 @@ -28,29 +36,10 @@ size_flags_vertical = 4 texture_normal = ExtResource( 2 ) texture_hover = ExtResource( 3 ) -[node name="HBoxContainer" type="HBoxContainer" parent="."] -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -margin_left = -41.0 -margin_top = -16.0 -margin_right = 41.0 -margin_bottom = 16.0 -mouse_default_cursor_shape = 2 - -[node name="TextureRect" type="TextureRect" parent="HBoxContainer"] -margin_right = 32.0 -margin_bottom = 32.0 -rect_min_size = Vector2( 32, 32 ) -size_flags_vertical = 4 -expand = true -stretch_mode = 6 - [node name="Label" type="Label" parent="HBoxContainer"] -margin_left = 36.0 +margin_left = 101.0 margin_top = 9.0 -margin_right = 82.0 +margin_right = 147.0 margin_bottom = 23.0 text = "Layer 0" align = 1 @@ -68,5 +57,5 @@ editable = false caret_blink = true caret_blink_speed = 0.5 [connection signal="pressed" from="." to="." method="_on_LayerContainer_pressed"] -[connection signal="pressed" from="VisibilityButton" to="." method="_on_VisibilityButton_pressed"] +[connection signal="pressed" from="HBoxContainer/VisibilityButton" to="." method="_on_VisibilityButton_pressed"] [connection signal="text_changed" from="HBoxContainer/LineEdit" to="." method="_on_LineEdit_text_changed"] diff --git a/Scripts/AnimationTimeline.gd b/Scripts/AnimationTimeline.gd index 981983742..eaa8a3be4 100644 --- a/Scripts/AnimationTimeline.gd +++ b/Scripts/AnimationTimeline.gd @@ -23,10 +23,10 @@ func add_frame() -> void: Global.undo_redo.add_do_property(Global, "hidden_canvases", Global.hidden_canvases) Global.undo_redo.add_do_property(Global, "canvas", new_canvas) Global.undo_redo.add_do_property(Global, "current_frame", new_canvases.size() - 1) - for child in Global.frame_container.get_children(): - var frame_button = child.get_node("FrameButton") - Global.undo_redo.add_do_property(frame_button, "pressed", false) - Global.undo_redo.add_undo_property(frame_button, "pressed", frame_button.pressed) + for i in range(Global.layers.size()): + for child in Global.layers[i][1].get_children(): + Global.undo_redo.add_do_property(child, "pressed", false) + Global.undo_redo.add_undo_property(child, "pressed", child.pressed) for c in Global.canvases: Global.undo_redo.add_do_property(c, "visible", false) Global.undo_redo.add_undo_property(c, "visible", c.visible) @@ -39,18 +39,15 @@ func add_frame() -> void: func _on_LoopAnim_pressed() -> void: match animation_loop: - 0: - # Make it loop + 0: # Make it loop animation_loop = 1 Global.loop_animation_button.texture_normal = load("res://Assets/Graphics/%s Themes/Timeline/Loop.png" % Global.theme_type) Global.loop_animation_button.hint_tooltip = "Cycle loop" - 1: - # Make it ping-pong + 1: # Make it ping-pong animation_loop = 2 Global.loop_animation_button.texture_normal = load("res://Assets/Graphics/%s Themes/Timeline/Loop_PingPong.png" % Global.theme_type) Global.loop_animation_button.hint_tooltip = "Ping-pong loop" - 2: - # Make it stop + 2: # Make it stop animation_loop = 0 Global.loop_animation_button.texture_normal = load("res://Assets/Graphics/%s Themes/Timeline/Loop_None.png" % Global.theme_type) Global.loop_animation_button.hint_tooltip = "No loop" @@ -101,13 +98,13 @@ func _on_AnimationTimer_timeout() -> void: Global.current_frame += 1 else: match animation_loop: - 0: #No loop + 0: # No loop Global.play_forward.pressed = false Global.play_backwards.pressed = false Global.animation_timer.stop() - 1: #Cycle loop + 1: # Cycle loop Global.current_frame = 0 - 2: #Ping pong loop + 2: # Ping pong loop animation_forward = false _on_AnimationTimer_timeout() @@ -116,13 +113,13 @@ func _on_AnimationTimer_timeout() -> void: Global.current_frame -= 1 else: match animation_loop: - 0: #No loop + 0: # No loop Global.play_backwards.pressed = false Global.play_forward.pressed = false Global.animation_timer.stop() - 1: #Cycle loop + 1: # Cycle loop Global.current_frame = Global.canvases.size() - 1 - 2: #Ping pong loop + 2: # Ping pong loop animation_forward = true _on_AnimationTimer_timeout() @@ -142,3 +139,104 @@ func _on_FutureOnionSkinning_value_changed(value) -> void: func _on_BlueRedMode_toggled(button_pressed) -> void: Global.onion_skinning_blue_red = button_pressed Global.canvas.update() + +# Layer buttons + +func add_layer(is_new := true) -> void: + var new_layer := Image.new() + var layer_name = null + if is_new: + new_layer.create(Global.canvas.size.x, Global.canvas.size.y, false, Image.FORMAT_RGBA8) + else: # clone layer + new_layer.copy_from(Global.canvas.layers[Global.current_layer][0]) + layer_name = Global.canvas.layers[Global.current_layer][2] + " (" + tr("copy") + ")" + new_layer.lock() + var new_layer_tex := ImageTexture.new() + new_layer_tex.create_from_image(new_layer, 0) + + var new_layers : Array = Global.layers.duplicate() + + # Store [layer name, frame container] + new_layers.append([layer_name, HBoxContainer.new()]) + + Global.undos += 1 + Global.undo_redo.create_action("Add Layer") + Global.undo_redo.add_do_property(Global, "current_layer", Global.current_layer + 1) + Global.undo_redo.add_do_property(Global, "layers", new_layers) + + for c in Global.canvases: + var new_canvas_layers : Array = c.layers.duplicate() + # Store [Image, ImageTexture, Visibity boolean, Opacity] + new_canvas_layers.append([new_layer, new_layer_tex, true, 1]) + Global.undo_redo.add_do_property(c, "layers", new_canvas_layers) + Global.undo_redo.add_undo_property(c, "layers", c.layers) + + Global.undo_redo.add_undo_property(Global, "current_layer", Global.current_layer) + Global.undo_redo.add_undo_property(Global, "layers", Global.layers) + + Global.undo_redo.add_undo_method(Global, "undo", [Global.canvas]) + Global.undo_redo.add_do_method(Global, "redo", [Global.canvas]) + Global.undo_redo.commit_action() + +func _on_RemoveLayer_pressed() -> void: + var new_layers : Array = Global.canvas.layers.duplicate() + new_layers.remove(Global.canvas.current_layer_index) + Global.undos += 1 + Global.undo_redo.create_action("Remove Layer") + Global.undo_redo.add_do_property(Global.canvas, "layers", new_layers) + Global.undo_redo.add_undo_property(Global.canvas, "layers", Global.canvas.layers) + + Global.undo_redo.add_undo_method(Global, "undo", [Global.canvas]) + Global.undo_redo.add_do_method(Global, "redo", [Global.canvas]) + Global.undo_redo.commit_action() + +func change_layer_order(rate : int) -> void: + var change = Global.canvas.current_layer_index + rate + + var new_layers : Array = Global.canvas.layers.duplicate() + var temp = new_layers[Global.canvas.current_layer_index] + new_layers[Global.canvas.current_layer_index] = new_layers[change] + new_layers[change] = temp + Global.undo_redo.create_action("Change Layer Order") + Global.undo_redo.add_do_property(Global.canvas, "layers", new_layers) + Global.undo_redo.add_do_property(Global.canvas, "current_layer_index", change) + Global.undo_redo.add_undo_property(Global.canvas, "layers", Global.canvas.layers) + Global.undo_redo.add_undo_property(Global.canvas, "current_layer_index", Global.canvas.current_layer_index) + + Global.undo_redo.add_undo_method(Global, "undo", [Global.canvas]) + Global.undo_redo.add_do_method(Global, "redo", [Global.canvas]) + Global.undo_redo.commit_action() + +func _on_MergeDownLayer_pressed() -> void: + var new_layers : Array = Global.canvas.layers.duplicate() + new_layers.remove(Global.canvas.current_layer_index) + var selected_layer = Global.canvas.layers[Global.canvas.current_layer_index][0] + if Global.canvas.layers[Global.canvas.current_layer_index][4] < 1: # If we have layer transparency + for xx in selected_layer.get_size().x: + for yy in selected_layer.get_size().y: + var pixel_color : Color = selected_layer.get_pixel(xx, yy) + var alpha : float = pixel_color.a * Global.canvas.layers[Global.canvas.current_layer_index][4] + selected_layer.set_pixel(xx, yy, Color(pixel_color.r, pixel_color.g, pixel_color.b, alpha)) + + var new_layer := Image.new() + new_layer.copy_from(Global.canvas.layers[Global.canvas.current_layer_index - 1][0]) + new_layer.lock() + + Global.canvas.blend_rect(new_layer, selected_layer, Rect2(Global.canvas.position, Global.canvas.size), Vector2.ZERO) + + Global.undos += 1 + Global.undo_redo.create_action("Merge Layer") + Global.undo_redo.add_do_property(Global.canvas, "layers", new_layers) + Global.undo_redo.add_do_property(Global.canvas.layers[Global.canvas.current_layer_index - 1][0], "data", new_layer.data) + Global.undo_redo.add_undo_property(Global.canvas, "layers", Global.canvas.layers) + Global.undo_redo.add_undo_property(Global.canvas.layers[Global.canvas.current_layer_index - 1][0], "data", Global.canvas.layers[Global.canvas.current_layer_index - 1][0].data) + + Global.undo_redo.add_undo_method(Global, "undo", [Global.canvas]) + Global.undo_redo.add_do_method(Global, "redo", [Global.canvas]) + Global.undo_redo.commit_action() + +func _on_OpacitySlider_value_changed(value) -> void: + Global.canvas.layers[Global.current_layer][3] = value / 100 + Global.layer_opacity_slider.value = value + Global.layer_opacity_spinbox.value = value + Global.canvas.update() diff --git a/Scripts/Canvas.gd b/Scripts/Canvas.gd index 6ad8dae79..2263899f5 100644 --- a/Scripts/Canvas.gd +++ b/Scripts/Canvas.gd @@ -7,8 +7,6 @@ var location := Vector2.ZERO var size := Vector2(64, 64) var fill_color := Color(0, 0, 0, 0) var frame := 0 setget frame_changed -var frame_button : VBoxContainer -var frame_texture_rect : TextureRect var current_pixel := Vector2.ZERO # pretty much same as mouse_pos, but can be accessed externally var previous_mouse_pos := Vector2.ZERO var previous_mouse_pos_for_lines := Vector2.ZERO @@ -31,40 +29,38 @@ var pen_pressure := 1.0 # For tablet pressure sensitivity # Called when the node enters the scene tree for the first time. func _ready() -> void: - # The sprite itself - if layers.empty(): - var sprite := Image.new() - if Global.is_default_image: - if Global.config_cache.has_section_key("preferences", "default_width"): - size.x = Global.config_cache.get_value("preferences", "default_width") - if Global.config_cache.has_section_key("preferences", "default_height"): - size.y = Global.config_cache.get_value("preferences", "default_height") - if Global.config_cache.has_section_key("preferences", "default_fill_color"): - fill_color = Global.config_cache.get_value("preferences", "default_fill_color") - Global.is_default_image = !Global.is_default_image + var fill_layers := layers.empty() + for i in range(Global.layers.size()): + print(i) + if fill_layers: + # The sprite itself + var sprite := Image.new() + if Global.is_default_image: + if Global.config_cache.has_section_key("preferences", "default_width"): + size.x = Global.config_cache.get_value("preferences", "default_width") + if Global.config_cache.has_section_key("preferences", "default_height"): + size.y = Global.config_cache.get_value("preferences", "default_height") + if Global.config_cache.has_section_key("preferences", "default_fill_color"): + fill_color = Global.config_cache.get_value("preferences", "default_fill_color") + Global.is_default_image = !Global.is_default_image - sprite.create(size.x, size.y, false, Image.FORMAT_RGBA8) - sprite.fill(fill_color) - sprite.lock() + sprite.create(size.x, size.y, false, Image.FORMAT_RGBA8) + sprite.fill(fill_color) + sprite.lock() - var tex := ImageTexture.new() - tex.create_from_image(sprite, 0) + var tex := ImageTexture.new() + tex.create_from_image(sprite, 0) - # Store [Image, ImageTexture, Layer Name, Visibity boolean, Opacity] - layers.append([sprite, tex, tr("Layer") + " 0", true, 1]) + # Store [Image, ImageTexture, Layer Name, Opacity] + layers.append([sprite, tex, 1]) - generate_layer_panels() - - frame_button = load("res://Prefabs/FrameButton.tscn").instance() - frame_button.name = "Frame_%s" % frame - frame_button.get_node("FrameButton").frame = frame - frame_button.get_node("FrameButton").pressed = true - frame_button.get_node("FrameID").text = str(frame + 1) - frame_button.get_node("FrameID").add_color_override("font_color", Color("#3c5d75")) - Global.frame_container.add_child(frame_button) - - frame_texture_rect = Global.find_node_by_name(frame_button, "FrameTexture") - frame_texture_rect.texture = layers[0][1] #ImageTexture current_layer_index + var frame_button = load("res://Prefabs/FrameButton.tscn").instance() + frame_button.frame = frame + frame_button.layer = i + frame_button.pressed = true + #frame_button.get_node("FrameID").text = str(frame + 1) + #frame_button.get_node("FrameID").add_color_override("font_color", Color("#3c5d75")) + Global.layers[i][2].add_child(frame_button) # Only handle camera zoom settings & offset on the first frame if Global.canvases[0] == self: @@ -79,8 +75,8 @@ func _ready() -> void: func _draw() -> void: draw_texture_rect(Global.transparent_background, Rect2(location, size), true) #Draw transparent background - #Onion Skinning - #Past + # Onion Skinning + # Past if Global.onion_skinning_past_rate > 0: var color : Color if Global.onion_skinning_blue_red: @@ -89,11 +85,11 @@ func _draw() -> void: color = Color.white for i in range(1, Global.onion_skinning_past_rate + 1): if Global.current_frame >= i: - for texture in Global.canvases[Global.current_frame - i].layers: + for layer in Global.canvases[Global.current_frame - i].layers: color.a = 0.6/i - draw_texture(texture[1], location, color) + draw_texture(layer[1], location, color) - #Future + # Future if Global.onion_skinning_future_rate > 0: var color : Color if Global.onion_skinning_blue_red: @@ -102,44 +98,44 @@ func _draw() -> void: color = Color.white for i in range(1, Global.onion_skinning_future_rate + 1): if Global.current_frame < Global.canvases.size() - i: - for texture in Global.canvases[Global.current_frame + i].layers: + for layer in Global.canvases[Global.current_frame + i].layers: color.a = 0.6/i - draw_texture(texture[1], location, color) + draw_texture(layer[1], location, color) - #Draw current frame layers - for texture in layers: - var modulate_color := Color(1, 1, 1, texture[4]) - if texture[3]: #if it's visible - draw_texture(texture[1], location, modulate_color) + # Draw current frame layers + for i in range(layers.size()): + var modulate_color := Color(1, 1, 1, layers[i][2]) + if Global.layers[i][1]: # if it's visible + draw_texture(layers[i][1], location, modulate_color) if Global.tile_mode: - draw_texture(texture[1], Vector2(location.x, location.y + size.y), modulate_color) #Down - draw_texture(texture[1], Vector2(location.x - size.x, location.y + size.y), modulate_color) #Down Left - draw_texture(texture[1], Vector2(location.x - size.x, location.y), modulate_color) #Left - draw_texture(texture[1], location - size, modulate_color) #Up left - draw_texture(texture[1], Vector2(location.x, location.y - size.y), modulate_color) #Up - draw_texture(texture[1], Vector2(location.x + size.x, location.y - size.y), modulate_color) #Up right - draw_texture(texture[1], Vector2(location.x + size.x, location.y), modulate_color) #Right - draw_texture(texture[1], location + size, modulate_color) #Down right + draw_texture(layers[i][1], Vector2(location.x, location.y + size.y), modulate_color) #Down + draw_texture(layers[i][1], Vector2(location.x - size.x, location.y + size.y), modulate_color) #Down Left + draw_texture(layers[i][1], Vector2(location.x - size.x, location.y), modulate_color) #Left + draw_texture(layers[i][1], location - size, modulate_color) #Up left + draw_texture(layers[i][1], Vector2(location.x, location.y - size.y), modulate_color) #Up + draw_texture(layers[i][1], Vector2(location.x + size.x, location.y - size.y), modulate_color) #Up right + draw_texture(layers[i][1], Vector2(location.x + size.x, location.y), modulate_color) #Right + draw_texture(layers[i][1], location + size, modulate_color) #Down right - #Idea taken from flurick (on GitHub) + # Idea taken from flurick (on GitHub) if Global.draw_grid: for x in range(0, size.x, Global.grid_width): draw_line(Vector2(x, location.y), Vector2(x, size.y), Global.grid_color, true) for y in range(0, size.y, Global.grid_height): draw_line(Vector2(location.x, y), Vector2(size.x, y), Global.grid_color, true) - #Draw rectangle to indicate the pixel currently being hovered on + # Draw rectangle to indicate the pixel currently being hovered on var mouse_pos := current_pixel if point_in_rectangle(mouse_pos, location, location + size): mouse_pos = mouse_pos.floor() if Global.left_square_indicator_visible && Global.can_draw: - if Global.current_left_brush_type == Global.Brush_Types.PIXEL || Global.current_left_tool == "LightenDarken": + if Global.current_left_brush_type == Global.BRUSH_TYPES.PIXEL || Global.current_left_tool == "LightenDarken": if Global.current_left_tool == "Pencil" || Global.current_left_tool == "Eraser" || Global.current_left_tool == "LightenDarken": var start_pos_x = mouse_pos.x - (Global.left_brush_size >> 1) var start_pos_y = mouse_pos.y - (Global.left_brush_size >> 1) draw_rect(Rect2(start_pos_x, start_pos_y, Global.left_brush_size, Global.left_brush_size), Color.blue, false) - elif Global.current_left_brush_type == Global.Brush_Types.CIRCLE || Global.current_left_brush_type == Global.Brush_Types.FILLED_CIRCLE: + elif Global.current_left_brush_type == Global.BRUSH_TYPES.CIRCLE || Global.current_left_brush_type == Global.BRUSH_TYPES.FILLED_CIRCLE: if Global.current_left_tool == "Pencil" || Global.current_left_tool == "Eraser": draw_set_transform(mouse_pos, rotation, scale) for rect in Global.left_circle_points: @@ -152,12 +148,12 @@ func _draw() -> void: draw_texture(Global.custom_left_brush_texture, dst) if Global.right_square_indicator_visible && Global.can_draw: - if Global.current_right_brush_type == Global.Brush_Types.PIXEL || Global.current_right_tool == "LightenDarken": + if Global.current_right_brush_type == Global.BRUSH_TYPES.PIXEL || Global.current_right_tool == "LightenDarken": if Global.current_right_tool == "Pencil" || Global.current_right_tool == "Eraser" || Global.current_right_tool == "LightenDarken": var start_pos_x = mouse_pos.x - (Global.right_brush_size >> 1) var start_pos_y = mouse_pos.y - (Global.right_brush_size >> 1) draw_rect(Rect2(start_pos_x, start_pos_y, Global.right_brush_size, Global.right_brush_size), Color.red, false) - elif Global.current_right_brush_type == Global.Brush_Types.CIRCLE || Global.current_right_brush_type == Global.Brush_Types.FILLED_CIRCLE: + elif Global.current_right_brush_type == Global.BRUSH_TYPES.CIRCLE || Global.current_right_brush_type == Global.BRUSH_TYPES.FILLED_CIRCLE: if Global.current_right_tool == "Pencil" || Global.current_right_tool == "Eraser": draw_set_transform(mouse_pos, rotation, scale) for rect in Global.right_circle_points: @@ -204,6 +200,7 @@ func _input(event : InputEvent) -> void: pen_pressure = 1 # This causes problems with tablets though sprite_changed_this_frame = false + var sprite : Image = layers[Global.current_layer][0] var mouse_pos := current_pixel var mouse_pos_floored := mouse_pos.floor() var mouse_pos_ceiled := mouse_pos.ceil() @@ -292,9 +289,9 @@ func _input(event : InputEvent) -> void: match current_action: # Handle current tool "Pencil": - pencil_and_eraser(mouse_pos, current_color, current_mouse_button, current_action) + pencil_and_eraser(sprite, mouse_pos, current_color, current_mouse_button, current_action) "Eraser": - pencil_and_eraser(mouse_pos, Color(0, 0, 0, 0), current_mouse_button, current_action) + pencil_and_eraser(sprite, mouse_pos, Color(0, 0, 0, 0), current_mouse_button, current_action) "Bucket": if can_handle: if fill_area == 0: # Paint the specific area of the same color @@ -309,34 +306,34 @@ func _input(event : InputEvent) -> void: 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(sprite, mouse_pos, sprite.get_pixelv(mouse_pos), current_color) if horizontal_mirror: var pos := Vector2(mirror_x, mouse_pos.y) - flood_fill(pos, layers[current_layer_index][0].get_pixelv(pos), current_color) + flood_fill(sprite, pos, sprite.get_pixelv(pos), current_color) if vertical_mirror: var pos := Vector2(mouse_pos.x, mirror_y) - flood_fill(pos, layers[current_layer_index][0].get_pixelv(pos), current_color) + flood_fill(sprite, pos, sprite.get_pixelv(pos), current_color) if horizontal_mirror && vertical_mirror: var pos := Vector2(mirror_x, mirror_y) - flood_fill(pos, layers[current_layer_index][0].get_pixelv(pos), current_color) + flood_fill(sprite, pos, sprite.get_pixelv(pos), current_color) else: # Paint all pixels of the same color - var pixel_color : Color = layers[current_layer_index][0].get_pixelv(mouse_pos) + var pixel_color : Color = sprite.get_pixelv(mouse_pos) for xx in range(west_limit, east_limit): for yy in range(north_limit, south_limit): - var c : Color = layers[current_layer_index][0].get_pixel(xx, yy) + var c : Color = sprite.get_pixel(xx, yy) if c == pixel_color: - layers[current_layer_index][0].set_pixel(xx, yy, current_color) + sprite.set_pixel(xx, yy, current_color) sprite_changed_this_frame = true "LightenDarken": if can_handle: - var pixel_color : Color = layers[current_layer_index][0].get_pixelv(mouse_pos) + var pixel_color : Color = sprite.get_pixelv(mouse_pos) var color_changed : Color if ld == 0: # Lighten color_changed = pixel_color.lightened(ld_amount) else: # Darken color_changed = pixel_color.darkened(ld_amount) - pencil_and_eraser(mouse_pos, color_changed, current_mouse_button, current_action) + pencil_and_eraser(sprite, mouse_pos, color_changed, current_mouse_button, current_action) "RectSelect": # Check SelectionRectangle.gd for more code on Rectangle Selection if Global.can_draw && Global.has_focus: @@ -363,7 +360,7 @@ func _input(event : InputEvent) -> void: Global.selection_rectangle.polygon[3] = Vector2(start_pos.x, end_pos.y) "ColorPicker": if can_handle: - var pixel_color : Color = layers[current_layer_index][0].get_pixelv(mouse_pos) + var pixel_color : Color = sprite.get_pixelv(mouse_pos) if color_picker_for == 0: # Pick for the left color Global.left_color_picker.color = pixel_color Global.update_left_custom_brush() @@ -422,7 +419,7 @@ func _input(event : InputEvent) -> void: previous_mouse_pos.x = clamp(previous_mouse_pos.x, location.x, location.x + size.x) previous_mouse_pos.y = clamp(previous_mouse_pos.y, location.y, location.y + size.y) if sprite_changed_this_frame: - update_texture(current_layer_index, (Input.is_action_just_released("left_mouse") || Input.is_action_just_released("right_mouse"))) + update_texture(Global.current_layer, (Input.is_action_just_released("left_mouse") || Input.is_action_just_released("right_mouse"))) func camera_zoom() -> void: # Set camera zoom based on the sprite size @@ -454,7 +451,7 @@ func handle_undo(action : String) -> void: var layer_index := -1 if Global.animation_timer.is_stopped(): # if we're not animating, store only the current canvas canvases = [self] - layer_index = current_layer_index + layer_index = Global.current_layer else: # If we're animating, store all canvases canvases = Global.canvases Global.undos += 1 @@ -496,27 +493,29 @@ func handle_redo(action : String) -> void: func update_texture(layer_index : int, update_frame_tex := true) -> void: layers[layer_index][1].create_from_image(layers[layer_index][0], 0) - var layer_container := get_layer_container(layer_index) - if layer_container: - layer_container.get_child(1).get_child(0).texture = layers[layer_index][1] - - if update_frame_tex: - # This code is used to update the texture in the animation timeline frame button - # but blend_rect causes major performance issues on large images - var whole_image := Image.new() - whole_image.create(size.x, size.y, false, Image.FORMAT_RGBA8) - for layer in layers: - whole_image.blend_rect(layer[0], Rect2(position, size), Vector2.ZERO) - layer[0].lock() - var whole_image_texture := ImageTexture.new() - whole_image_texture.create_from_image(whole_image, 0) - frame_texture_rect.texture = whole_image_texture +# var layer_container := get_layer_container(layer_index) +# if layer_container: +# layer_container.get_child(1).get_child(0).texture = layers[layer_index][1] + var frame_texture_rect : TextureRect + frame_texture_rect = Global.find_node_by_name(Global.layers[layer_index][2].get_child(frame),"FrameTexture") + frame_texture_rect.texture = layers[layer_index][1] +# if update_frame_tex: +# # This code is used to update the texture in the animation timeline frame button +# # but blend_rect causes major performance issues on large images +# var whole_image := Image.new() +# whole_image.create(size.x, size.y, false, Image.FORMAT_RGBA8) +# for layer in layers: +# whole_image.blend_rect(layer[0], Rect2(position, size), Vector2.ZERO) +# layer[0].lock() +# var whole_image_texture := ImageTexture.new() +# whole_image_texture.create_from_image(whole_image, 0) +# frame_texture_rect.texture = whole_image_texture func frame_changed(value : int) -> void: frame = value - if frame_button: - frame_button.get_node("FrameButton").frame = frame - frame_button.get_node("FrameID").text = str(frame + 1) +# if frame_button: +# frame_button.get_node("FrameButton").frame = frame +# frame_button.get_node("FrameID").text = str(frame + 1) func get_layer_container(layer_index : int) -> LayerContainer: for container in Global.vbox_layer_container.get_children(): @@ -525,7 +524,8 @@ func get_layer_container(layer_index : int) -> LayerContainer: return null func generate_layer_panels() -> void: - for child in Global.vbox_layer_container.get_children(): + return + for child in Global.layers_container.get_children(): if child is LayerContainer: child.queue_free() @@ -539,32 +539,31 @@ func generate_layer_panels() -> void: for i in range(layers.size() -1, -1, -1): var layer_container = load("res://Prefabs/LayerContainer.tscn").instance() - if !layers[i][2]: - layers[i][2] = tr("Layer") + " %s" % i +# if !layers[i][2]: +# layers[i][2] = tr("Layer") + " %s" % i layer_container.i = i - layer_container.get_child(1).get_child(0).texture = layers[i][1] - layer_container.get_child(1).get_child(1).text = layers[i][2] - layer_container.get_child(1).get_child(2).text = layers[i][2] - Global.vbox_layer_container.add_child(layer_container) + layer_container.get_child(0).get_child(1).text = layers[i][2] + layer_container.get_child(0).get_child(2).text = layers[i][2] + Global.layer_and_frame_container.add_child(layer_container) -func pencil_and_eraser(mouse_pos : Vector2, color : Color, current_mouse_button : String, current_action := "None") -> void: +func pencil_and_eraser(sprite : Image, mouse_pos : Vector2, color : Color, current_mouse_button : String, current_action := "None") -> void: if made_line: return if is_making_line: - fill_gaps(line_2d.points[1], previous_mouse_pos_for_lines, color, current_mouse_button, current_action) - draw_brush(line_2d.points[1], color, current_mouse_button, current_action) + fill_gaps(sprite, line_2d.points[1], previous_mouse_pos_for_lines, color, current_mouse_button, current_action) + draw_brush(sprite, line_2d.points[1], color, current_mouse_button, current_action) made_line = true else: if point_in_rectangle(mouse_pos, location, location + size): mouse_inside_canvas = true # Draw - draw_brush(mouse_pos, color, current_mouse_button, current_action) - fill_gaps(mouse_pos, previous_mouse_pos, color, current_mouse_button, current_action) #Fill the gaps + draw_brush(sprite, mouse_pos, color, current_mouse_button, current_action) + fill_gaps(sprite, mouse_pos, previous_mouse_pos, color, current_mouse_button, current_action) # Fill the gaps # If mouse is not inside bounds but it used to be, fill the gaps elif point_in_rectangle(previous_mouse_pos, location, location + size): - fill_gaps(mouse_pos, previous_mouse_pos, color, current_mouse_button, current_action) + fill_gaps(sprite, mouse_pos, previous_mouse_pos, color, current_mouse_button, current_action) -func draw_brush(pos : Vector2, color : Color, current_mouse_button : String, current_action := "None") -> void: +func draw_brush(sprite : Image, pos : Vector2, color : Color, current_mouse_button : String, current_action := "None") -> void: if Global.can_draw && Global.has_focus: var brush_size := 1 var brush_type = Global.Brush_Types.PIXEL @@ -635,7 +634,7 @@ func draw_brush(pos : Vector2, color : Color, current_mouse_button : String, cur if point_in_rectangle(Vector2(cur_pos_x, cur_pos_y), Vector2(west_limit - 1, north_limit - 1), Vector2(east_limit, south_limit)): var pos_floored := Vector2(cur_pos_x, cur_pos_y).floor() # Don't draw the same pixel over and over and don't re-lighten/darken it - var current_pixel_color : Color = layers[current_layer_index][0].get_pixel(cur_pos_x, cur_pos_y) + var current_pixel_color : Color = layers[Global.current_layer][0].get_pixel(cur_pos_x, cur_pos_y) var _c := color if current_action == "Pencil" && color.a < 1: _c = blend_colors(color, current_pixel_color) @@ -655,14 +654,14 @@ func draw_brush(pos : Vector2, color : Color, current_mouse_button : String, cur mouse_press_pressure_values.append(pen_pressure) else: mouse_press_pressure_values[saved_pixel_index] = pen_pressure - layers[current_layer_index][0].set_pixel(cur_pos_x, cur_pos_y, _c) + layers[Global.current_layer][0].set_pixel(cur_pos_x, cur_pos_y, _c) sprite_changed_this_frame = true # Handle mirroring var mirror_x := east_limit + west_limit - cur_pos_x - 1 var mirror_y := south_limit + north_limit - cur_pos_y - 1 if horizontal_mirror: - current_pixel_color = layers[current_layer_index][0].get_pixel(mirror_x, cur_pos_y) + current_pixel_color = layers[Global.current_layer][0].get_pixel(mirror_x, cur_pos_y) if current_pixel_color != _c: # don't draw the same pixel over and over if current_action == "LightenDarken": if ld == 0: # Lighten @@ -672,10 +671,24 @@ func draw_brush(pos : Vector2, color : Color, current_mouse_button : String, cur mouse_press_pixels.append(pos_floored) mouse_press_pressure_values.append(pen_pressure) - layers[current_layer_index][0].set_pixel(mirror_x, cur_pos_y, _c) + layers[Global.current_layer][0].set_pixel(mirror_x, cur_pos_y, _c) sprite_changed_this_frame = true - if vertical_mirror: - current_pixel_color = layers[current_layer_index][0].get_pixel(cur_pos_x, mirror_y) + + if vertical_mirror: + current_pixel_color = layers[Global.current_layer][0].get_pixel(cur_pos_x, mirror_y) + if current_pixel_color != _c: # don't draw the same pixel over and over + if current_action == "LightenDarken": + if ld == 0: # Lighten + _c = current_pixel_color.lightened(ld_amount) + else: + _c = current_pixel_color.darkened(ld_amount) + mouse_press_pixels.append(pos_floored) + mouse_press_pressure_values.append(pen_pressure) + layers[Global.current_layer][0].set_pixel(cur_pos_x, mirror_y, _c) + sprite_changed_this_frame = true + + if horizontal_mirror && vertical_mirror: + current_pixel_color = layers[Global.current_layer][0].get_pixel(mirror_x, mirror_y) if current_pixel_color != _c: # don't draw the same pixel over and over if current_action == "LightenDarken": if ld == 0: # Lighten @@ -685,34 +698,21 @@ func draw_brush(pos : Vector2, color : Color, current_mouse_button : String, cur mouse_press_pixels.append(pos_floored) mouse_press_pressure_values.append(pen_pressure) - layers[current_layer_index][0].set_pixel(cur_pos_x, mirror_y, _c) - sprite_changed_this_frame = true - if horizontal_mirror && vertical_mirror: - current_pixel_color = layers[current_layer_index][0].get_pixel(mirror_x, mirror_y) - if current_pixel_color != _c: # don't draw the same pixel over and over - if current_action == "LightenDarken": - if ld == 0: # Lighten - _c = current_pixel_color.lightened(ld_amount) - else: - _c = current_pixel_color.darkened(ld_amount) - - mouse_press_pixels.append(pos_floored) - mouse_press_pressure_values.append(pen_pressure) - layers[current_layer_index][0].set_pixel(mirror_x, mirror_y, _c) + sprite.set_pixel(mirror_x, mirror_y, _c) sprite_changed_this_frame = true - elif brush_type == Global.Brush_Types.CIRCLE || brush_type == Global.Brush_Types.FILLED_CIRCLE: - plot_circle(layers[current_layer_index][0], pos.x, pos.y, brush_size, color, brush_type == Global.Brush_Types.FILLED_CIRCLE) + elif brush_type == Global.BRUSH_TYPES.CIRCLE || brush_type == Global.Brush_Types.FILLED_CIRCLE: + plot_circle(sprite, pos.x, pos.y, brush_size, color, brush_type == Global.Brush_Types.FILLED_CIRCLE) # Handle mirroring var mirror_x := east_limit + west_limit - pos.x var mirror_y := south_limit + north_limit - pos.y if horizontal_mirror: - plot_circle(layers[current_layer_index][0], mirror_x, pos.y, brush_size, color, brush_type == Global.Brush_Types.FILLED_CIRCLE) + plot_circle(sprite, mirror_x, pos.y, brush_size, color, brush_type == Global.Brush_Types.FILLED_CIRCLE) if vertical_mirror: - plot_circle(layers[current_layer_index][0], pos.x, mirror_y, brush_size, color, brush_type == Global.Brush_Types.FILLED_CIRCLE) + plot_circle(sprite, pos.x, mirror_y, brush_size, color, brush_type == Global.Brush_Types.FILLED_CIRCLE) if horizontal_mirror && vertical_mirror: - plot_circle(layers[current_layer_index][0], mirror_x, mirror_y, brush_size, color, brush_type == Global.Brush_Types.FILLED_CIRCLE) + plot_circle(sprite, mirror_x, mirror_y, brush_size, color, brush_type == Global.Brush_Types.FILLED_CIRCLE) sprite_changed_this_frame = true @@ -755,13 +755,13 @@ func draw_brush(pos : Vector2, color : Color, current_mouse_button : String, cur mirror_y -= 1 # Use custom blend function cause of godot's issue #31124 if color.a > 0: # If it's the pencil - blend_rect(layers[current_layer_index][0], custom_brush_image, src_rect, dst) + blend_rect(sprite, custom_brush_image, src_rect, dst) if horizontal_mirror: - blend_rect(layers[current_layer_index][0], custom_brush_image, src_rect, Vector2(mirror_x, dst.y)) + blend_rect(sprite, custom_brush_image, src_rect, Vector2(mirror_x, dst.y)) if vertical_mirror: - blend_rect(layers[current_layer_index][0], custom_brush_image, src_rect, Vector2(dst.x, mirror_y)) + blend_rect(sprite, custom_brush_image, src_rect, Vector2(dst.x, mirror_y)) if horizontal_mirror && vertical_mirror: - blend_rect(layers[current_layer_index][0], custom_brush_image, src_rect, Vector2(mirror_x, mirror_y)) + blend_rect(sprite, custom_brush_image, src_rect, Vector2(mirror_x, mirror_y)) else: # if it's transparent - if it's the eraser var custom_brush := Image.new() @@ -770,15 +770,15 @@ func draw_brush(pos : Vector2, color : Color, current_mouse_button : String, cur custom_brush.resize(custom_brush_size.x * brush_size, custom_brush_size.y * brush_size, Image.INTERPOLATE_NEAREST) var custom_brush_blended = Global.blend_image_with_color(custom_brush, color, 1) - layers[current_layer_index][0].blit_rect_mask(custom_brush_blended, custom_brush, src_rect, dst) + sprite.blit_rect_mask(custom_brush_blended, custom_brush, src_rect, dst) if horizontal_mirror: - layers[current_layer_index][0].blit_rect_mask(custom_brush_blended, custom_brush, src_rect, Vector2(mirror_x, dst.y)) + sprite.blit_rect_mask(custom_brush_blended, custom_brush, src_rect, Vector2(mirror_x, dst.y)) if vertical_mirror: - layers[current_layer_index][0].blit_rect_mask(custom_brush_blended, custom_brush, src_rect, Vector2(dst.x, mirror_y)) + sprite.blit_rect_mask(custom_brush_blended, custom_brush, src_rect, Vector2(dst.x, mirror_y)) if horizontal_mirror && vertical_mirror: - layers[current_layer_index][0].blit_rect_mask(custom_brush_blended, custom_brush, src_rect, Vector2(mirror_x, mirror_y)) + sprite.blit_rect_mask(custom_brush_blended, custom_brush, src_rect, Vector2(mirror_x, mirror_y)) - layers[current_layer_index][0].lock() + sprite.lock() sprite_changed_this_frame = true previous_mouse_pos_for_lines = pos.floor() + Vector2(0.5, 0.5) @@ -789,7 +789,7 @@ func draw_brush(pos : Vector2, color : Color, current_mouse_button : String, cur # Bresenham's Algorithm # Thanks to https://godotengine.org/qa/35276/tile-based-line-drawing-algorithm-efficiency -func fill_gaps(mouse_pos : Vector2, prev_mouse_pos : Vector2, color : Color, current_mouse_button : String, current_action := "None") -> void: +func fill_gaps(sprite : Image, mouse_pos : Vector2, prev_mouse_pos : Vector2, color : Color, current_mouse_button : String, current_action := "None") -> void: var previous_mouse_pos_floored = prev_mouse_pos.floor() var mouse_pos_floored = mouse_pos.floor() mouse_pos_floored.x = clamp(mouse_pos_floored.x, location.x - 1, location.x + size.x) @@ -803,7 +803,7 @@ func fill_gaps(mouse_pos : Vector2, prev_mouse_pos : Vector2, color : Color, cur var x = previous_mouse_pos_floored.x var y = previous_mouse_pos_floored.y while !(x == mouse_pos_floored.x && y == mouse_pos_floored.y): - draw_brush(Vector2(x, y), color, current_mouse_button, current_action) + draw_brush(sprite, Vector2(x, y), color, current_mouse_button, current_action) e2 = err << 1 if e2 >= dy: err += dy @@ -813,9 +813,9 @@ func fill_gaps(mouse_pos : Vector2, prev_mouse_pos : Vector2, color : Color, cur y += sy # Thanks to https://en.wikipedia.org/wiki/Flood_fill -func flood_fill(pos : Vector2, target_color : Color, replace_color : Color) -> void: +func flood_fill(sprite : Image, pos : Vector2, target_color : Color, replace_color : Color) -> void: pos = pos.floor() - var pixel = layers[current_layer_index][0].get_pixelv(pos) + var pixel = sprite.get_pixelv(pos) if target_color == replace_color: return elif pixel != target_color: @@ -832,20 +832,20 @@ func flood_fill(pos : Vector2, target_color : Color, replace_color : Color) -> v break var west : Vector2 = n var east : Vector2 = n - while west.x >= west_limit && layers[current_layer_index][0].get_pixelv(west) == target_color: + while west.x >= west_limit && sprite.get_pixelv(west) == target_color: west += Vector2.LEFT - while east.x < east_limit && layers[current_layer_index][0].get_pixelv(east) == target_color: + while east.x < east_limit && sprite.get_pixelv(east) == target_color: east += Vector2.RIGHT for px in range(west.x + 1, east.x): var p := Vector2(px, n.y) # Draw - layers[current_layer_index][0].set_pixelv(p, replace_color) - replace_color = layers[current_layer_index][0].get_pixelv(p) + sprite.set_pixelv(p, replace_color) + replace_color = sprite.get_pixelv(p) var north := p + Vector2.UP var south := p + Vector2.DOWN - if north.y >= north_limit && layers[current_layer_index][0].get_pixelv(north) == target_color: + if north.y >= north_limit && sprite.get_pixelv(north) == target_color: q.append(north) - if south.y < south_limit && layers[current_layer_index][0].get_pixelv(south) == target_color: + if south.y < south_limit && sprite.get_pixelv(south) == target_color: q.append(south) sprite_changed_this_frame = true diff --git a/Scripts/Dialogs/PreferencesDialog.gd b/Scripts/Dialogs/PreferencesDialog.gd index b854f8cbb..3e1eaead2 100644 --- a/Scripts/Dialogs/PreferencesDialog.gd +++ b/Scripts/Dialogs/PreferencesDialog.gd @@ -254,8 +254,8 @@ func change_theme(ID : int) -> void: var disabled_file_name = button.texture_disabled.resource_path.get_file() button.texture_disabled = load("res://Assets/Graphics/%s Themes/%s/%s" % [Global.theme_type, button_category, disabled_file_name]) - # Make sure the frame text gets updated - Global.current_frame = Global.current_frame + # Make sure the frame text gets updated + Global.current_frame = Global.current_frame func _on_GridWidthValue_value_changed(value : float) -> void: Global.grid_width = value diff --git a/Scripts/FrameButton.gd b/Scripts/FrameButton.gd index 97cb28088..c2a5c0293 100644 --- a/Scripts/FrameButton.gd +++ b/Scripts/FrameButton.gd @@ -1,12 +1,15 @@ extends Button var frame := 0 +var layer := 0 onready var popup_menu := $PopupMenu func _on_FrameButton_pressed() -> void: if Input.is_action_just_released("left_mouse"): Global.current_frame = frame + Global.current_layer = layer + print(str(frame), str(layer)) elif Input.is_action_just_released("right_mouse"): if Global.canvases.size() == 1: popup_menu.set_item_disabled(0, true) @@ -30,7 +33,7 @@ func _on_PopupMenu_id_pressed(ID : int) -> void: 0: #Remove Frame remove_frame() - 1: #Clone Layer + 1: # Clone Layer var canvas : Canvas = Global.canvases[frame] var new_canvas : Canvas = load("res://Prefabs/Canvas.tscn").instance() new_canvas.size = Global.canvas.size @@ -58,7 +61,7 @@ func _on_PopupMenu_id_pressed(ID : int) -> void: Global.undo_redo.add_do_property(Global, "hidden_canvases", Global.hidden_canvases) Global.undo_redo.add_do_property(Global, "canvas", new_canvas) Global.undo_redo.add_do_property(Global, "current_frame", new_canvases.size() - 1) - for child in Global.frame_container.get_children(): + for child in Global.frame_containers.get_children(): var frame_button = child.get_node("FrameButton") Global.undo_redo.add_do_property(frame_button, "pressed", false) Global.undo_redo.add_undo_property(frame_button, "pressed", frame_button.pressed) diff --git a/Scripts/Global.gd b/Scripts/Global.gd index 84078e295..e13f17cd7 100644 --- a/Scripts/Global.gd +++ b/Scripts/Global.gd @@ -13,7 +13,9 @@ var undos := 0 # The number of times we added undo properties var saved := true # Checks if the user has saved # Canvas related stuff +var layers := [] var current_frame := 0 setget frame_changed +var current_layer := 0 # warning-ignore:unused_class_variable var can_draw := false # warning-ignore:unused_class_variable @@ -223,14 +225,14 @@ var right_mirror_container : Container var animation_timeline : Panel var animation_timer : Timer +var frame_ids : HBoxContainer var current_frame_label : Label var loop_animation_button : BaseButton var play_forward : BaseButton var play_backwards : BaseButton var timeline_seconds : Control -var frame_container : HBoxContainer +var layer_and_frame_container : GridContainer -var vbox_layer_container : VBoxContainer var remove_layer_button : BaseButton var move_up_layer_button : BaseButton var move_down_layer_button : BaseButton @@ -340,24 +342,23 @@ func _ready() -> void: animation_timeline = find_node_by_name(root, "AnimationTimeline") + layer_and_frame_container = find_node_by_name(animation_timeline, "LayersAndFrames") animation_timer = find_node_by_name(animation_timeline, "AnimationTimer") + frame_ids = find_node_by_name(animation_timeline, "FrameIDs") current_frame_label = find_node_by_name(animation_timeline, "CurrentFrame") loop_animation_button = find_node_by_name(animation_timeline, "LoopAnim") play_forward = find_node_by_name(animation_timeline, "PlayForward") play_backwards = find_node_by_name(animation_timeline, "PlayBackwards") - timeline_seconds = find_node_by_name(animation_timeline, "TimelineSeconds") - frame_container = find_node_by_name(animation_timeline, "FrameContainer") - var layer_stuff_container = find_node_by_name(root, "LayerVBoxContainer") - var layer_buttons = find_node_by_name(layer_stuff_container, "LayerButtons") - remove_layer_button = find_node_by_name(layer_buttons, "RemoveLayer") - move_up_layer_button = find_node_by_name(layer_buttons, "MoveUpLayer") - move_down_layer_button = find_node_by_name(layer_buttons, "MovwDownLayer") - merge_down_layer_button = find_node_by_name(layer_buttons, "MergeDownLayer") + #var layer_stuff_container = find_node_by_name(animation_timeline, "LayerVBoxContainer") - layer_opacity_slider = find_node_by_name(layer_stuff_container, "OpacitySlider") - layer_opacity_spinbox = find_node_by_name(layer_stuff_container, "OpacitySpinBox") - vbox_layer_container = find_node_by_name(layer_stuff_container, "VBoxLayerContainer") + remove_layer_button = find_node_by_name(animation_timeline, "RemoveLayer") + move_up_layer_button = find_node_by_name(animation_timeline, "MoveUpLayer") + move_down_layer_button = find_node_by_name(animation_timeline, "MovwDownLayer") + merge_down_layer_button = find_node_by_name(animation_timeline, "MergeDownLayer") + + layer_opacity_slider = find_node_by_name(animation_timeline, "OpacitySlider") + layer_opacity_spinbox = find_node_by_name(animation_timeline, "OpacitySpinBox") add_palette_button = find_node_by_name(root, "AddPalette") edit_palette_button = find_node_by_name(root, "EditPalette") @@ -370,6 +371,10 @@ func _ready() -> void: error_dialog = find_node_by_name(root, "ErrorDialog") + # Store [layer name, frame container] + layers.append([tr("Layer") + " 0", HBoxContainer.new()]) + layer_and_frame_container.add_child(layers[0][1]) + # Thanks to https://godotengine.org/qa/17524/how-to-find-an-instanced-scene-by-its-name func find_node_by_name(root, node_name) -> Node: if root.get_name() == node_name: @@ -412,7 +417,7 @@ func undo(_canvases : Array, layer_index : int = -1) -> void: if action_name == "Add Frame": canvas_parent.remove_child(_canvases[0]) - frame_container.remove_child(_canvases[0].frame_button) + layer_and_frame_container.remove_child(_canvases[0].frame_button) # This actually means that canvases.size is one, but it hasn't been updated yet if canvases.size() == 2: # Stop animating play_forward.pressed = false @@ -421,10 +426,10 @@ func undo(_canvases : Array, layer_index : int = -1) -> void: elif action_name == "Remove Frame": canvas_parent.add_child(_canvases[0]) canvas_parent.move_child(_canvases[0], _canvases[0].frame) - frame_container.add_child(_canvases[0].frame_button) - frame_container.move_child(_canvases[0].frame_button, _canvases[0].frame) + layer_and_frame_container.add_child(_canvases[0].frame_button) + layer_and_frame_container.move_child(_canvases[0].frame_button, _canvases[0].frame) elif action_name == "Change Frame Order": - frame_container.move_child(_canvases[0].frame_button, _canvases[0].frame) + layer_and_frame_container.move_child(_canvases[0].frame_button, _canvases[0].frame) canvas_parent.move_child(_canvases[0], _canvases[0].frame) canvas.update() @@ -448,26 +453,49 @@ func redo(_canvases : Array, layer_index : int = -1) -> void: if action_name == "Scale": c.camera_zoom() - if "Layer" in action_name: - var current_layer_index : int = _canvases[0].current_layer_index - _canvases[0].generate_layer_panels() - if action_name == "Change Layer Order": - _canvases[0].current_layer_index = current_layer_index - _canvases[0].get_layer_container(current_layer_index).changed_selection() + if action_name == "Add Layer": + var layer_container = load("res://Prefabs/LayerContainer.tscn").instance() + _canvases[0].layers[current_layer][2] = tr("Layer") + " %s" % current_layer + layer_container.i = current_layer + layer_container.get_child(0).get_child(1).text = _canvases[0].layers[current_layer][2] + layer_container.get_child(0).get_child(2).text = _canvases[0].layers[current_layer][2] + layer_and_frame_container.add_child(layer_container) + layer_and_frame_container.move_child(layer_container, 0) + + layer_and_frame_container.add_child(layers[current_layer][1]) + layer_and_frame_container.move_child(layers[current_layer][1], 1) + for i in range(canvases.size()): + var frame_button = load("res://Prefabs/FrameButton.tscn").instance() + frame_button.frame = i + frame_button.layer = current_layer + frame_button.pressed = true + + layers[current_layer][1].add_child(frame_button) + + +# if action_name == "Change Layer Order": +# var current_layer_index : int = _canvases[0].current_layer_index +# _canvases[0].current_layer_index = current_layer_index +# _canvases[0].get_layer_container(current_layer_index).changed_selection() if action_name == "Add Frame": canvas_parent.add_child(_canvases[0]) - if !Global.frame_container.is_a_parent_of(_canvases[0].frame_button): - Global.frame_container.add_child(_canvases[0].frame_button) + var label := Label.new() + label.rect_min_size.x = 36 + label.align = Label.ALIGN_CENTER + label.text = str(canvases.size() + 1) + frame_ids.add_child(label) + if !layer_and_frame_container.is_a_parent_of(_canvases[0].frame_button): + layer_and_frame_container.add_child(_canvases[0].frame_button) elif action_name == "Remove Frame": canvas_parent.remove_child(_canvases[0]) - frame_container.remove_child(_canvases[0].frame_button) + layer_and_frame_container.remove_child(_canvases[0].frame_button) if canvases.size() == 1: # Stop animating play_forward.pressed = false play_backwards.pressed = false animation_timer.stop() elif action_name == "Change Frame Order": - frame_container.move_child(_canvases[0].frame_button, _canvases[0].frame) + layer_and_frame_container.move_child(_canvases[0].frame_button, _canvases[0].frame) canvas_parent.move_child(_canvases[0], _canvases[0].frame) canvas.update() @@ -491,18 +519,17 @@ func frame_changed(value : int) -> void: c.line_2d.set_point_position(1, c.line_2d.points[0]) canvas = canvases[current_frame] canvas.visible = true - canvas.generate_layer_panels() + #canvas.generate_layer_panels() # Make all frame buttons unpressed for c in canvases: var text_color := Color.white if theme_type == "Gold" || theme_type == "Light": text_color = Color.black - c.frame_button.get_node("FrameButton").pressed = false - c.frame_button.get_node("FrameID").add_color_override("font_color", text_color) + c.frame_button.pressed = false + #c.frame_button.get_node("FrameID").add_color_override("font_color", text_color) # Make only the current frame button pressed - canvas.frame_button.get_node("FrameButton").pressed = true - canvas.frame_button.get_node("FrameID").add_color_override("font_color", Color("#3c5d75")) - + canvas.frame_button.pressed = true + #canvas.frame_button.get_node("FrameID").add_color_override("font_color", Color("#3c5d75")) func create_brush_button(brush_img : Image, brush_type := Brush_Types.CUSTOM, hint_tooltip := "") -> void: var brush_container diff --git a/Scripts/LayerContainer.gd b/Scripts/LayerContainer.gd index 1a7f65ac5..8a2b4eef2 100644 --- a/Scripts/LayerContainer.gd +++ b/Scripts/LayerContainer.gd @@ -1,16 +1,16 @@ class_name LayerContainer extends Button -var i +var i := 0 # warning-ignore:unused_class_variable var currently_selected := false -onready var visibility_button := $VisibilityButton +onready var visibility_button := $HBoxContainer/VisibilityButton onready var label := $HBoxContainer/Label onready var line_edit := $HBoxContainer/LineEdit func _ready() -> void: - changed_selection() + #changed_selection() if Global.canvas.layers[i][3]: visibility_button.texture_normal = load("res://Assets/Graphics/%s Themes/Layers/Layer_Visible.png" % Global.theme_type) visibility_button.texture_hover = load("res://Assets/Graphics/%s Themes/Layers/Layer_Visible_Hover.png" % Global.theme_type) @@ -27,8 +27,8 @@ func _input(event : InputEvent) -> void: func _on_LayerContainer_pressed() -> void: var initially_pressed := pressed var label_initially_visible : bool = label.visible - Global.canvas.current_layer_index = i - changed_selection() +# Global.canvas.current_layer_index = i +# changed_selection() if !initially_pressed: if label_initially_visible: label.visible = false @@ -44,14 +44,15 @@ func changed_selection() -> void: var parent := get_parent() for child in parent.get_children(): if child is Button: + #print(child.name) child.label.visible = true child.line_edit.visible = false child.line_edit.editable = false if Global.canvas.current_layer_index == child.i: # The selected layer child.currently_selected = true child.pressed = true - Global.layer_opacity_slider.value = Global.canvas.layers[child.i][4] * 100 - Global.layer_opacity_spinbox.value = Global.canvas.layers[child.i][4] * 100 + Global.layer_opacity_slider.value = Global.canvas.layers[child.i][3] * 100 + Global.layer_opacity_spinbox.value = Global.canvas.layers[child.i][3] * 100 if Global.canvas.current_layer_index < Global.canvas.layers.size() - 1: Global.move_up_layer_button.disabled = false @@ -86,5 +87,5 @@ func _on_VisibilityButton_pressed() -> void: Global.canvas.update() func _on_LineEdit_text_changed(new_text : String) -> void: - Global.canvas.layers[i][2] = new_text + Global.layers[i][0] = new_text label.text = new_text diff --git a/Scripts/Main.gd b/Scripts/Main.gd index f86b319c3..4a61baf0d 100644 --- a/Scripts/Main.gd +++ b/Scripts/Main.gd @@ -406,9 +406,10 @@ func _on_OpenSprite_file_selected(path : String) -> void: Global.canvas = canvas var width := file.get_16() var height := file.get_16() + print(width, height) var layer_line := file.get_line() - while layer_line == "-": #Load layers + while layer_line == "-": # Load layers var buffer := file.get_buffer(width * height * 4) var layer_name := file.get_line() var layer_transparency := 1.0 @@ -507,7 +508,7 @@ func _on_SaveSprite_file_selected(path : String) -> void: file.store_float(layer[4]) # Layer transparency file.store_line("END_LAYERS") - for child in canvas.get_children(): #Store guides + for child in canvas.get_children(): # Store guides if child is Guide: file.store_line("|") file.store_8(child.type) @@ -554,7 +555,7 @@ func clear_canvases() -> void: for child in Global.vbox_layer_container.get_children(): if child is PanelContainer: child.queue_free() - for child in Global.frame_container.get_children(): + for child in Global.frame_containers.get_children(): child.queue_free() for child in Global.canvas_parent.get_children(): if child is Canvas: @@ -687,86 +688,6 @@ func _on_RightBrushSizeEdit_value_changed(value) -> void: Global.right_brush_size = new_size update_right_custom_brush() -func add_layer(is_new := true) -> void: - var new_layer := Image.new() - var layer_name = null - if is_new: - new_layer.create(Global.canvas.size.x, Global.canvas.size.y, false, Image.FORMAT_RGBA8) - else: # clone layer - new_layer.copy_from(Global.canvas.layers[Global.canvas.current_layer_index][0]) - layer_name = Global.canvas.layers[Global.canvas.current_layer_index][2] + " (" + tr("copy") + ")" - new_layer.lock() - var new_layer_tex := ImageTexture.new() - new_layer_tex.create_from_image(new_layer, 0) - - var new_layers: Array = Global.canvas.layers.duplicate() - # Store [Image, ImageTexture, Layer Name, Visibity boolean, Opacity] - new_layers.append([new_layer, new_layer_tex, layer_name, true, 1]) - Global.undos += 1 - Global.undo_redo.create_action("Add Layer") - Global.undo_redo.add_do_property(Global.canvas, "layers", new_layers) - Global.undo_redo.add_undo_property(Global.canvas, "layers", Global.canvas.layers) - - Global.undo_redo.add_undo_method(Global, "undo", [Global.canvas]) - Global.undo_redo.add_do_method(Global, "redo", [Global.canvas]) - Global.undo_redo.commit_action() - -func _on_RemoveLayerButton_pressed() -> void: - var new_layers: Array = Global.canvas.layers.duplicate() - new_layers.remove(Global.canvas.current_layer_index) - Global.undos += 1 - Global.undo_redo.create_action("Remove Layer") - Global.undo_redo.add_do_property(Global.canvas, "layers", new_layers) - Global.undo_redo.add_undo_property(Global.canvas, "layers", Global.canvas.layers) - - Global.undo_redo.add_undo_method(Global, "undo", [Global.canvas]) - Global.undo_redo.add_do_method(Global, "redo", [Global.canvas]) - Global.undo_redo.commit_action() - -func change_layer_order(rate : int) -> void: - var change = Global.canvas.current_layer_index + rate - - var new_layers: Array = Global.canvas.layers.duplicate() - var temp = new_layers[Global.canvas.current_layer_index] - new_layers[Global.canvas.current_layer_index] = new_layers[change] - new_layers[change] = temp - Global.undo_redo.create_action("Change Layer Order") - Global.undo_redo.add_do_property(Global.canvas, "layers", new_layers) - Global.undo_redo.add_do_property(Global.canvas, "current_layer_index", change) - Global.undo_redo.add_undo_property(Global.canvas, "layers", Global.canvas.layers) - Global.undo_redo.add_undo_property(Global.canvas, "current_layer_index", Global.canvas.current_layer_index) - - Global.undo_redo.add_undo_method(Global, "undo", [Global.canvas]) - Global.undo_redo.add_do_method(Global, "redo", [Global.canvas]) - Global.undo_redo.commit_action() - -func _on_MergeLayer_pressed() -> void: - var new_layers: Array = Global.canvas.layers.duplicate() - new_layers.remove(Global.canvas.current_layer_index) - var selected_layer = Global.canvas.layers[Global.canvas.current_layer_index][0] - if Global.canvas.layers[Global.canvas.current_layer_index][4] < 1: # If we have layer transparency - for xx in selected_layer.get_size().x: - for yy in selected_layer.get_size().y: - var pixel_color : Color = selected_layer.get_pixel(xx, yy) - var alpha : float = pixel_color.a * Global.canvas.layers[Global.canvas.current_layer_index][4] - selected_layer.set_pixel(xx, yy, Color(pixel_color.r, pixel_color.g, pixel_color.b, alpha)) - - var new_layer := Image.new() - new_layer.copy_from(Global.canvas.layers[Global.canvas.current_layer_index - 1][0]) - new_layer.lock() - - Global.canvas.blend_rect(new_layer, selected_layer, Rect2(Global.canvas.position, Global.canvas.size), Vector2.ZERO) - - Global.undos += 1 - Global.undo_redo.create_action("Merge Layer") - Global.undo_redo.add_do_property(Global.canvas, "layers", new_layers) - Global.undo_redo.add_do_property(Global.canvas.layers[Global.canvas.current_layer_index - 1][0], "data", new_layer.data) - Global.undo_redo.add_undo_property(Global.canvas, "layers", Global.canvas.layers) - Global.undo_redo.add_undo_property(Global.canvas.layers[Global.canvas.current_layer_index - 1][0], "data", Global.canvas.layers[Global.canvas.current_layer_index - 1][0].data) - - Global.undo_redo.add_undo_method(Global, "undo", [Global.canvas]) - Global.undo_redo.add_do_method(Global, "redo", [Global.canvas]) - Global.undo_redo.commit_action() func _on_ColorSwitch_pressed() -> void: var temp: Color = Global.left_color_picker.color From 7d7eccb03f2ad1654e2fe49cf5530e33d9b8a2e7 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Sun, 19 Jan 2020 00:56:30 +0200 Subject: [PATCH 02/32] Fixed issues with scrolling No longer using a GridContainer for the layer and frames. --- Prefabs/AnimationTimeline.tscn | 133 +++++++++++++++++---------------- Scripts/Global.gd | 32 ++++---- 2 files changed, 84 insertions(+), 81 deletions(-) diff --git a/Prefabs/AnimationTimeline.tscn b/Prefabs/AnimationTimeline.tscn index 07f6b3f3a..44724c746 100644 --- a/Prefabs/AnimationTimeline.tscn +++ b/Prefabs/AnimationTimeline.tscn @@ -103,30 +103,26 @@ margin_right = 543.0 margin_bottom = 196.0 size_flags_horizontal = 3 -[node name="FrameLayerButtonContainer" type="HBoxContainer" parent="AnimationContainer/TimelineContainer"] +[node name="LayerButtons" type="HBoxContainer" parent="AnimationContainer/TimelineContainer"] margin_right = 543.0 -margin_bottom = 36.0 +margin_bottom = 32.0 -[node name="LayerButtons" type="HBoxContainer" parent="AnimationContainer/TimelineContainer/FrameLayerButtonContainer"] -margin_right = 326.0 -margin_bottom = 36.0 - -[node name="AddLayer" type="TextureButton" parent="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons" groups=[ +[node name="AddLayer" type="TextureButton" parent="AnimationContainer/TimelineContainer/LayerButtons" groups=[ "UIButtons", ]] margin_right = 32.0 -margin_bottom = 36.0 +margin_bottom = 32.0 hint_tooltip = "LAYERNEW_HT" mouse_default_cursor_shape = 2 texture_normal = ExtResource( 2 ) texture_hover = ExtResource( 3 ) -[node name="RemoveLayer" type="TextureButton" parent="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons" groups=[ +[node name="RemoveLayer" type="TextureButton" parent="AnimationContainer/TimelineContainer/LayerButtons" groups=[ "UIButtons", ]] margin_left = 36.0 margin_right = 68.0 -margin_bottom = 36.0 +margin_bottom = 32.0 hint_tooltip = "LAYERREMOVE_HT" mouse_default_cursor_shape = 8 disabled = true @@ -134,12 +130,12 @@ texture_normal = ExtResource( 4 ) texture_hover = ExtResource( 5 ) texture_disabled = ExtResource( 6 ) -[node name="MoveUpLayer" type="TextureButton" parent="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons" groups=[ +[node name="MoveUpLayer" type="TextureButton" parent="AnimationContainer/TimelineContainer/LayerButtons" groups=[ "UIButtons", ]] margin_left = 72.0 margin_right = 104.0 -margin_bottom = 36.0 +margin_bottom = 32.0 hint_tooltip = "LAYERUP_HT" mouse_default_cursor_shape = 8 disabled = true @@ -147,12 +143,12 @@ texture_normal = ExtResource( 7 ) texture_hover = ExtResource( 8 ) texture_disabled = ExtResource( 9 ) -[node name="MovwDownLayer" type="TextureButton" parent="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons" groups=[ +[node name="MovwDownLayer" type="TextureButton" parent="AnimationContainer/TimelineContainer/LayerButtons" groups=[ "UIButtons", ]] margin_left = 108.0 margin_right = 140.0 -margin_bottom = 36.0 +margin_bottom = 32.0 hint_tooltip = "LAYERDOWN_HT" mouse_default_cursor_shape = 8 disabled = true @@ -160,23 +156,23 @@ texture_normal = ExtResource( 10 ) texture_hover = ExtResource( 11 ) texture_disabled = ExtResource( 12 ) -[node name="CloneLayer" type="TextureButton" parent="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons" groups=[ +[node name="CloneLayer" type="TextureButton" parent="AnimationContainer/TimelineContainer/LayerButtons" groups=[ "UIButtons", ]] margin_left = 144.0 margin_right = 176.0 -margin_bottom = 36.0 +margin_bottom = 32.0 hint_tooltip = "LAYERCLONE_HT" mouse_default_cursor_shape = 2 texture_normal = ExtResource( 13 ) texture_hover = ExtResource( 14 ) -[node name="MergeDownLayer" type="TextureButton" parent="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons" groups=[ +[node name="MergeDownLayer" type="TextureButton" parent="AnimationContainer/TimelineContainer/LayerButtons" groups=[ "UIButtons", ]] margin_left = 180.0 margin_right = 212.0 -margin_bottom = 36.0 +margin_bottom = 32.0 hint_tooltip = "LAYERMERGE_HT" mouse_default_cursor_shape = 8 disabled = true @@ -184,39 +180,30 @@ texture_normal = ExtResource( 15 ) texture_hover = ExtResource( 16 ) texture_disabled = ExtResource( 17 ) -[node name="TagsAndFrameIDs" type="VBoxContainer" parent="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons"] +[node name="AnimationTags" type="VBoxContainer" parent="AnimationContainer/TimelineContainer/LayerButtons"] margin_left = 216.0 margin_right = 326.0 -margin_bottom = 36.0 +margin_bottom = 32.0 -[node name="AnimationTags" type="VBoxContainer" parent="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons/TagsAndFrameIDs"] -editor/display_folded = true -margin_right = 110.0 -margin_bottom = 36.0 -size_flags_vertical = 0 - -[node name="Line2D" type="Line2D" parent="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons/TagsAndFrameIDs/AnimationTags"] +[node name="Line2D" type="Line2D" parent="AnimationContainer/TimelineContainer/LayerButtons/AnimationTags"] points = PoolVector2Array( 0, 32, 0, 0, 110, 0, 110, 32 ) width = 1.0 -[node name="Label" type="Label" parent="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons/TagsAndFrameIDs/AnimationTags"] +[node name="Label" type="Label" parent="AnimationContainer/TimelineContainer/LayerButtons/AnimationTags"] margin_right = 110.0 margin_bottom = 32.0 rect_min_size = Vector2( 110, 32 ) -size_flags_vertical = 1 +size_flags_horizontal = 0 +size_flags_vertical = 0 text = "Animation Tags" align = 1 valign = 1 -[node name="FramesContainer" type="HBoxContainer" parent="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons/TagsAndFrameIDs/AnimationTags"] -margin_top = 36.0 -margin_right = 110.0 -margin_bottom = 36.0 - [node name="OpacityContainer" type="HBoxContainer" parent="AnimationContainer/TimelineContainer"] -margin_top = 40.0 +editor/display_folded = true +margin_top = 36.0 margin_right = 543.0 -margin_bottom = 64.0 +margin_bottom = 60.0 custom_constants/separation = 2 [node name="OpacityLabel" type="Label" parent="AnimationContainer/TimelineContainer/OpacityContainer"] @@ -246,36 +233,50 @@ size_flags_vertical = 4 value = 100.0 align = 1 -[node name="FrameIDs" type="HBoxContainer" parent="AnimationContainer/TimelineContainer/OpacityContainer"] -margin_left = 245.0 -margin_right = 281.0 -margin_bottom = 24.0 +[node name="TimelineScroll" type="ScrollContainer" parent="AnimationContainer/TimelineContainer"] +margin_top = 64.0 +margin_right = 543.0 +margin_bottom = 160.0 +size_flags_vertical = 3 -[node name="Label" type="Label" parent="AnimationContainer/TimelineContainer/OpacityContainer/FrameIDs"] -margin_top = 5.0 +[node name="LayersAndFrames" type="HBoxContainer" parent="AnimationContainer/TimelineContainer/TimelineScroll"] +margin_right = 252.0 +margin_bottom = 96.0 +size_flags_vertical = 3 + +[node name="LayersContainer" type="VBoxContainer" parent="AnimationContainer/TimelineContainer/TimelineScroll/LayersAndFrames"] +margin_right = 212.0 +margin_bottom = 96.0 + +[node name="LayerLabel" type="Label" parent="AnimationContainer/TimelineContainer/TimelineScroll/LayersAndFrames/LayersContainer"] +margin_right = 212.0 +margin_bottom = 16.0 +rect_min_size = Vector2( 0, 16 ) +text = "Layers" +align = 1 +valign = 1 + +[node name="LayerContainer" parent="AnimationContainer/TimelineContainer/TimelineScroll/LayersAndFrames/LayersContainer" instance=ExtResource( 18 )] +margin_top = 20.0 +margin_right = 212.0 +margin_bottom = 56.0 + +[node name="FramesContainer" type="VBoxContainer" parent="AnimationContainer/TimelineContainer/TimelineScroll/LayersAndFrames"] +margin_left = 216.0 +margin_right = 252.0 +margin_bottom = 96.0 + +[node name="FrameIDs" type="HBoxContainer" parent="AnimationContainer/TimelineContainer/TimelineScroll/LayersAndFrames/FramesContainer"] margin_right = 36.0 -margin_bottom = 19.0 +margin_bottom = 14.0 + +[node name="Label" type="Label" parent="AnimationContainer/TimelineContainer/TimelineScroll/LayersAndFrames/FramesContainer/FrameIDs"] +margin_right = 36.0 +margin_bottom = 14.0 rect_min_size = Vector2( 36, 0 ) text = "1" align = 1 -[node name="TimelineScroll" type="ScrollContainer" parent="AnimationContainer/TimelineContainer"] -margin_top = 68.0 -margin_right = 543.0 -margin_bottom = 160.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 - -[node name="LayersAndFrames" type="GridContainer" parent="AnimationContainer/TimelineContainer/TimelineScroll"] -margin_right = 212.0 -margin_bottom = 36.0 -custom_constants/vseparation = 4 -custom_constants/hseparation = 4 -columns = 2 - -[node name="LayerContainer" parent="AnimationContainer/TimelineContainer/TimelineScroll/LayersAndFrames" instance=ExtResource( 18 )] -margin_right = 212.0 - [node name="HSeparator" type="HSeparator" parent="AnimationContainer/TimelineContainer"] margin_top = 164.0 margin_right = 543.0 @@ -476,12 +477,12 @@ margin_right = 689.0 margin_bottom = 196.0 [node name="AnimationTimer" type="Timer" parent="."] -[connection signal="pressed" from="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons/AddLayer" to="." method="add_layer" binds= [ true ]] -[connection signal="pressed" from="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons/RemoveLayer" to="." method="_on_RemoveLayer_pressed"] -[connection signal="pressed" from="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons/MoveUpLayer" to="." method="change_layer_order" binds= [ 1 ]] -[connection signal="pressed" from="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons/MovwDownLayer" to="." method="change_layer_order" binds= [ -1 ]] -[connection signal="pressed" from="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons/CloneLayer" to="." method="add_layer" binds= [ false ]] -[connection signal="pressed" from="AnimationContainer/TimelineContainer/FrameLayerButtonContainer/LayerButtons/MergeDownLayer" to="." method="_on_MergeDownLayer_pressed"] +[connection signal="pressed" from="AnimationContainer/TimelineContainer/LayerButtons/AddLayer" to="." method="add_layer" binds= [ true ]] +[connection signal="pressed" from="AnimationContainer/TimelineContainer/LayerButtons/RemoveLayer" to="." method="_on_RemoveLayer_pressed"] +[connection signal="pressed" from="AnimationContainer/TimelineContainer/LayerButtons/MoveUpLayer" to="." method="change_layer_order" binds= [ 1 ]] +[connection signal="pressed" from="AnimationContainer/TimelineContainer/LayerButtons/MovwDownLayer" to="." method="change_layer_order" binds= [ -1 ]] +[connection signal="pressed" from="AnimationContainer/TimelineContainer/LayerButtons/CloneLayer" to="." method="add_layer" binds= [ false ]] +[connection signal="pressed" from="AnimationContainer/TimelineContainer/LayerButtons/MergeDownLayer" to="." method="_on_MergeDownLayer_pressed"] [connection signal="value_changed" from="AnimationContainer/TimelineContainer/OpacityContainer/OpacitySlider" to="." method="_on_OpacitySlider_value_changed"] [connection signal="value_changed" from="AnimationContainer/TimelineContainer/OpacityContainer/OpacitySpinBox" to="." method="_on_OpacitySlider_value_changed"] [connection signal="pressed" from="AnimationContainer/TimelineContainer/AnimationButtons/AddFrame" to="." method="add_frame"] diff --git a/Scripts/Global.gd b/Scripts/Global.gd index e13f17cd7..3e3d3561e 100644 --- a/Scripts/Global.gd +++ b/Scripts/Global.gd @@ -231,7 +231,8 @@ var loop_animation_button : BaseButton var play_forward : BaseButton var play_backwards : BaseButton var timeline_seconds : Control -var layer_and_frame_container : GridContainer +var layers_container : VBoxContainer +var frames_container : VBoxContainer var remove_layer_button : BaseButton var move_up_layer_button : BaseButton @@ -342,7 +343,8 @@ func _ready() -> void: animation_timeline = find_node_by_name(root, "AnimationTimeline") - layer_and_frame_container = find_node_by_name(animation_timeline, "LayersAndFrames") + layers_container = find_node_by_name(animation_timeline, "LayersContainer") + frames_container = find_node_by_name(animation_timeline, "FramesContainer") animation_timer = find_node_by_name(animation_timeline, "AnimationTimer") frame_ids = find_node_by_name(animation_timeline, "FrameIDs") current_frame_label = find_node_by_name(animation_timeline, "CurrentFrame") @@ -373,7 +375,7 @@ func _ready() -> void: # Store [layer name, frame container] layers.append([tr("Layer") + " 0", HBoxContainer.new()]) - layer_and_frame_container.add_child(layers[0][1]) + frames_container.add_child(layers[0][1]) # Thanks to https://godotengine.org/qa/17524/how-to-find-an-instanced-scene-by-its-name func find_node_by_name(root, node_name) -> Node: @@ -417,7 +419,7 @@ func undo(_canvases : Array, layer_index : int = -1) -> void: if action_name == "Add Frame": canvas_parent.remove_child(_canvases[0]) - layer_and_frame_container.remove_child(_canvases[0].frame_button) + frames_container.remove_child(_canvases[0].frame_button) # This actually means that canvases.size is one, but it hasn't been updated yet if canvases.size() == 2: # Stop animating play_forward.pressed = false @@ -426,10 +428,10 @@ func undo(_canvases : Array, layer_index : int = -1) -> void: elif action_name == "Remove Frame": canvas_parent.add_child(_canvases[0]) canvas_parent.move_child(_canvases[0], _canvases[0].frame) - layer_and_frame_container.add_child(_canvases[0].frame_button) - layer_and_frame_container.move_child(_canvases[0].frame_button, _canvases[0].frame) + frames_container.add_child(_canvases[0].frame_button) + frames_container.move_child(_canvases[0].frame_button, _canvases[0].frame) elif action_name == "Change Frame Order": - layer_and_frame_container.move_child(_canvases[0].frame_button, _canvases[0].frame) + frames_container.move_child(_canvases[0].frame_button, _canvases[0].frame) canvas_parent.move_child(_canvases[0], _canvases[0].frame) canvas.update() @@ -459,11 +461,11 @@ func redo(_canvases : Array, layer_index : int = -1) -> void: layer_container.i = current_layer layer_container.get_child(0).get_child(1).text = _canvases[0].layers[current_layer][2] layer_container.get_child(0).get_child(2).text = _canvases[0].layers[current_layer][2] - layer_and_frame_container.add_child(layer_container) - layer_and_frame_container.move_child(layer_container, 0) + layers_container.add_child(layer_container) + layers_container.move_child(layer_container, 1) - layer_and_frame_container.add_child(layers[current_layer][1]) - layer_and_frame_container.move_child(layers[current_layer][1], 1) + frames_container.add_child(layers[current_layer][1]) + frames_container.move_child(layers[current_layer][1], 2) for i in range(canvases.size()): var frame_button = load("res://Prefabs/FrameButton.tscn").instance() frame_button.frame = i @@ -485,17 +487,17 @@ func redo(_canvases : Array, layer_index : int = -1) -> void: label.align = Label.ALIGN_CENTER label.text = str(canvases.size() + 1) frame_ids.add_child(label) - if !layer_and_frame_container.is_a_parent_of(_canvases[0].frame_button): - layer_and_frame_container.add_child(_canvases[0].frame_button) + if !frames_container.is_a_parent_of(_canvases[0].frame_button): + frames_container.add_child(_canvases[0].frame_button) elif action_name == "Remove Frame": canvas_parent.remove_child(_canvases[0]) - layer_and_frame_container.remove_child(_canvases[0].frame_button) + frames_container.remove_child(_canvases[0].frame_button) if canvases.size() == 1: # Stop animating play_forward.pressed = false play_backwards.pressed = false animation_timer.stop() elif action_name == "Change Frame Order": - layer_and_frame_container.move_child(_canvases[0].frame_button, _canvases[0].frame) + frames_container.move_child(_canvases[0].frame_button, _canvases[0].frame) canvas_parent.move_child(_canvases[0], _canvases[0].frame) canvas.update() From 3df9853ddaa37b3070be5b3a3839e7d05808cdc3 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Sun, 19 Jan 2020 01:14:35 +0200 Subject: [PATCH 03/32] Update the button textures accordingly Every button will have a texture based on its frame AND its layer. Which means, if the button is on layer 2 and frame 1, its texture will be the contents of frame 1's layer 2 contents. --- Scripts/Global.gd | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Scripts/Global.gd b/Scripts/Global.gd index 3e3d3561e..00d967e9a 100644 --- a/Scripts/Global.gd +++ b/Scripts/Global.gd @@ -465,7 +465,7 @@ func redo(_canvases : Array, layer_index : int = -1) -> void: layers_container.move_child(layer_container, 1) frames_container.add_child(layers[current_layer][1]) - frames_container.move_child(layers[current_layer][1], 2) + frames_container.move_child(layers[current_layer][1], 1) for i in range(canvases.size()): var frame_button = load("res://Prefabs/FrameButton.tscn").instance() frame_button.frame = i @@ -487,8 +487,8 @@ func redo(_canvases : Array, layer_index : int = -1) -> void: label.align = Label.ALIGN_CENTER label.text = str(canvases.size() + 1) frame_ids.add_child(label) - if !frames_container.is_a_parent_of(_canvases[0].frame_button): - frames_container.add_child(_canvases[0].frame_button) + #if !frames_container.is_a_parent_of(_canvases[0].frame_button): + # frames_container.add_child(_canvases[0].frame_button) elif action_name == "Remove Frame": canvas_parent.remove_child(_canvases[0]) frames_container.remove_child(_canvases[0].frame_button) @@ -527,10 +527,10 @@ func frame_changed(value : int) -> void: var text_color := Color.white if theme_type == "Gold" || theme_type == "Light": text_color = Color.black - c.frame_button.pressed = false + #c.frame_button.pressed = false #c.frame_button.get_node("FrameID").add_color_override("font_color", text_color) # Make only the current frame button pressed - canvas.frame_button.pressed = true + #canvas.frame_button.pressed = true #canvas.frame_button.get_node("FrameID").add_color_override("font_color", Color("#3c5d75")) func create_brush_button(brush_img : Image, brush_type := Brush_Types.CUSTOM, hint_tooltip := "") -> void: From a2893e1c1cd4cbd5cc3f14234c4633d40c2922cd Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Sun, 19 Jan 2020 20:03:32 +0200 Subject: [PATCH 04/32] Store layer visibility on Global.layers instead This way, toggling visibility in a layers works for all frames in that layer. --- Prefabs/AnimationTimeline.tscn | 1 + Scripts/AnimationTimeline.gd | 14 +++++++------- Scripts/Dialogs/ImportSprites.gd | 4 ++-- Scripts/FrameButton.gd | 4 ++-- Scripts/Global.gd | 18 +++++++++--------- Scripts/LayerContainer.gd | 8 ++++---- Scripts/Main.gd | 4 +++- 7 files changed, 28 insertions(+), 25 deletions(-) diff --git a/Prefabs/AnimationTimeline.tscn b/Prefabs/AnimationTimeline.tscn index 44724c746..e401a853d 100644 --- a/Prefabs/AnimationTimeline.tscn +++ b/Prefabs/AnimationTimeline.tscn @@ -188,6 +188,7 @@ margin_bottom = 32.0 [node name="Line2D" type="Line2D" parent="AnimationContainer/TimelineContainer/LayerButtons/AnimationTags"] points = PoolVector2Array( 0, 32, 0, 0, 110, 0, 110, 32 ) width = 1.0 +texture_mode = 1313163520 [node name="Label" type="Label" parent="AnimationContainer/TimelineContainer/LayerButtons/AnimationTags"] margin_right = 110.0 diff --git a/Scripts/AnimationTimeline.gd b/Scripts/AnimationTimeline.gd index eaa8a3be4..56131079a 100644 --- a/Scripts/AnimationTimeline.gd +++ b/Scripts/AnimationTimeline.gd @@ -24,7 +24,7 @@ func add_frame() -> void: Global.undo_redo.add_do_property(Global, "canvas", new_canvas) Global.undo_redo.add_do_property(Global, "current_frame", new_canvases.size() - 1) for i in range(Global.layers.size()): - for child in Global.layers[i][1].get_children(): + for child in Global.layers[i][2].get_children(): Global.undo_redo.add_do_property(child, "pressed", false) Global.undo_redo.add_undo_property(child, "pressed", child.pressed) for c in Global.canvases: @@ -149,15 +149,15 @@ func add_layer(is_new := true) -> void: new_layer.create(Global.canvas.size.x, Global.canvas.size.y, false, Image.FORMAT_RGBA8) else: # clone layer new_layer.copy_from(Global.canvas.layers[Global.current_layer][0]) - layer_name = Global.canvas.layers[Global.current_layer][2] + " (" + tr("copy") + ")" + layer_name = Global.layers[Global.current_layer][1] + " (" + tr("copy") + ")" new_layer.lock() var new_layer_tex := ImageTexture.new() new_layer_tex.create_from_image(new_layer, 0) var new_layers : Array = Global.layers.duplicate() - # Store [layer name, frame container] - new_layers.append([layer_name, HBoxContainer.new()]) + # Store [Layer name, Layer visibility boolean, Frame container] + new_layers.append([layer_name, true, HBoxContainer.new()]) Global.undos += 1 Global.undo_redo.create_action("Add Layer") @@ -166,8 +166,8 @@ func add_layer(is_new := true) -> void: for c in Global.canvases: var new_canvas_layers : Array = c.layers.duplicate() - # Store [Image, ImageTexture, Visibity boolean, Opacity] - new_canvas_layers.append([new_layer, new_layer_tex, true, 1]) + # Store [Image, ImageTexture, Opacity] + new_canvas_layers.append([new_layer, new_layer_tex, 1]) Global.undo_redo.add_do_property(c, "layers", new_canvas_layers) Global.undo_redo.add_undo_property(c, "layers", c.layers) @@ -236,7 +236,7 @@ func _on_MergeDownLayer_pressed() -> void: Global.undo_redo.commit_action() func _on_OpacitySlider_value_changed(value) -> void: - Global.canvas.layers[Global.current_layer][3] = value / 100 + Global.canvas.layers[Global.current_layer][2] = value / 100 Global.layer_opacity_slider.value = value Global.layer_opacity_spinbox.value = value Global.canvas.update() diff --git a/Scripts/Dialogs/ImportSprites.gd b/Scripts/Dialogs/ImportSprites.gd index 62cdeab5e..c0f2e4822 100644 --- a/Scripts/Dialogs/ImportSprites.gd +++ b/Scripts/Dialogs/ImportSprites.gd @@ -55,8 +55,8 @@ func _on_ImportSprites_files_selected(paths : PoolStringArray) -> void: image.lock() var tex := ImageTexture.new() tex.create_from_image(image, 0) - # Store [Image, ImageTexture, Layer Name, Visibity boolean, Opacity] - canvas.layers.append([image, tex, "Layer 0", true, 1]) + # Store [Image, ImageTexture, Opacity] + canvas.layers.append([image, tex, 1]) canvas.frame = i Global.canvases.append(canvas) Global.canvas_parent.add_child(canvas) diff --git a/Scripts/FrameButton.gd b/Scripts/FrameButton.gd index c2a5c0293..2e344bee7 100644 --- a/Scripts/FrameButton.gd +++ b/Scripts/FrameButton.gd @@ -44,13 +44,13 @@ func _on_PopupMenu_id_pressed(ID : int) -> void: var new_hidden_canvases := Global.hidden_canvases.duplicate() new_hidden_canvases.append(new_canvas) - for layer in canvas.layers: #Copy every layer + for layer in canvas.layers: # Copy every layer var sprite := Image.new() sprite.copy_from(layer[0]) sprite.lock() var tex := ImageTexture.new() tex.create_from_image(sprite, 0) - new_canvas.layers.append([sprite, tex, layer[2], layer[3], layer[4]]) + new_canvas.layers.append([sprite, tex, layer[2]]) Global.undos += 1 Global.undo_redo.create_action("Add Frame") diff --git a/Scripts/Global.gd b/Scripts/Global.gd index 00d967e9a..a52a6af72 100644 --- a/Scripts/Global.gd +++ b/Scripts/Global.gd @@ -373,9 +373,9 @@ func _ready() -> void: error_dialog = find_node_by_name(root, "ErrorDialog") - # Store [layer name, frame container] - layers.append([tr("Layer") + " 0", HBoxContainer.new()]) - frames_container.add_child(layers[0][1]) + # Store [Layer name, Layer visibility boolean, Frame container] + layers.append([tr("Layer") + " 0", true, HBoxContainer.new()]) + frames_container.add_child(layers[0][2]) # Thanks to https://godotengine.org/qa/17524/how-to-find-an-instanced-scene-by-its-name func find_node_by_name(root, node_name) -> Node: @@ -457,22 +457,22 @@ func redo(_canvases : Array, layer_index : int = -1) -> void: c.camera_zoom() if action_name == "Add Layer": var layer_container = load("res://Prefabs/LayerContainer.tscn").instance() - _canvases[0].layers[current_layer][2] = tr("Layer") + " %s" % current_layer + layers[current_layer][0] = tr("Layer") + " %s" % current_layer layer_container.i = current_layer - layer_container.get_child(0).get_child(1).text = _canvases[0].layers[current_layer][2] - layer_container.get_child(0).get_child(2).text = _canvases[0].layers[current_layer][2] + layer_container.get_child(0).get_child(1).text = layers[current_layer][0] + layer_container.get_child(0).get_child(2).text = layers[current_layer][0] layers_container.add_child(layer_container) layers_container.move_child(layer_container, 1) - frames_container.add_child(layers[current_layer][1]) - frames_container.move_child(layers[current_layer][1], 1) + frames_container.add_child(layers[current_layer][2]) + frames_container.move_child(layers[current_layer][2], 1) for i in range(canvases.size()): var frame_button = load("res://Prefabs/FrameButton.tscn").instance() frame_button.frame = i frame_button.layer = current_layer frame_button.pressed = true - layers[current_layer][1].add_child(frame_button) + layers[current_layer][2].add_child(frame_button) # if action_name == "Change Layer Order": diff --git a/Scripts/LayerContainer.gd b/Scripts/LayerContainer.gd index 8a2b4eef2..79c77bb3d 100644 --- a/Scripts/LayerContainer.gd +++ b/Scripts/LayerContainer.gd @@ -11,7 +11,7 @@ onready var line_edit := $HBoxContainer/LineEdit func _ready() -> void: #changed_selection() - if Global.canvas.layers[i][3]: + if Global.layers[i][1]: visibility_button.texture_normal = load("res://Assets/Graphics/%s Themes/Layers/Layer_Visible.png" % Global.theme_type) visibility_button.texture_hover = load("res://Assets/Graphics/%s Themes/Layers/Layer_Visible_Hover.png" % Global.theme_type) else: @@ -76,12 +76,12 @@ func changed_selection() -> void: child.pressed = false func _on_VisibilityButton_pressed() -> void: - if Global.canvas.layers[i][3]: - Global.canvas.layers[i][3] = false + if Global.layers[i][1]: + Global.layers[i][1] = false visibility_button.texture_normal = load("res://Assets/Graphics/%s Themes/Layers/Layer_Invisible.png" % Global.theme_type) visibility_button.texture_hover = load("res://Assets/Graphics/%s Themes/Layers/Layer_Invisible_Hover.png" % Global.theme_type) else: - Global.canvas.layers[i][3] = true + Global.layers[i][1] = true visibility_button.texture_normal = load("res://Assets/Graphics/%s Themes/Layers/Layer_Visible.png" % Global.theme_type) visibility_button.texture_hover = load("res://Assets/Graphics/%s Themes/Layers/Layer_Visible_Hover.png" % Global.theme_type) Global.canvas.update() diff --git a/Scripts/Main.gd b/Scripts/Main.gd index 4a61baf0d..f76fc7a1a 100644 --- a/Scripts/Main.gd +++ b/Scripts/Main.gd @@ -163,7 +163,9 @@ func _ready() -> void: Global.window_title = "(" + tr("untitled") + ") - Pixelorama" - Global.canvas.layers[0][2] = tr("Layer") + " 0" + Global.layers[0][0] = tr("Layer") + " 0" + Global.layers_container.get_child(1).label.text = Global.layers[0][0] + Global.layers_container.get_child(1).line_edit.text = Global.layers[0][0] Global.canvas.generate_layer_panels() Import.import_brushes("Brushes") From 6e713988d342c771ca301d1197a87668d96c5755 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Tue, 18 Feb 2020 03:59:01 +0200 Subject: [PATCH 05/32] Fix Canvas.gd problems --- Scripts/Canvas.gd | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Scripts/Canvas.gd b/Scripts/Canvas.gd index 2263899f5..e06d53980 100644 --- a/Scripts/Canvas.gd +++ b/Scripts/Canvas.gd @@ -130,12 +130,12 @@ func _draw() -> void: if point_in_rectangle(mouse_pos, location, location + size): mouse_pos = mouse_pos.floor() if Global.left_square_indicator_visible && Global.can_draw: - if Global.current_left_brush_type == Global.BRUSH_TYPES.PIXEL || Global.current_left_tool == "LightenDarken": + if Global.current_left_brush_type == Global.Brush_Types.PIXEL || Global.current_left_tool == "LightenDarken": if Global.current_left_tool == "Pencil" || Global.current_left_tool == "Eraser" || Global.current_left_tool == "LightenDarken": var start_pos_x = mouse_pos.x - (Global.left_brush_size >> 1) var start_pos_y = mouse_pos.y - (Global.left_brush_size >> 1) draw_rect(Rect2(start_pos_x, start_pos_y, Global.left_brush_size, Global.left_brush_size), Color.blue, false) - elif Global.current_left_brush_type == Global.BRUSH_TYPES.CIRCLE || Global.current_left_brush_type == Global.BRUSH_TYPES.FILLED_CIRCLE: + elif Global.current_left_brush_type == Global.Brush_Types.CIRCLE || Global.current_left_brush_type == Global.Brush_Types.FILLED_CIRCLE: if Global.current_left_tool == "Pencil" || Global.current_left_tool == "Eraser": draw_set_transform(mouse_pos, rotation, scale) for rect in Global.left_circle_points: @@ -148,12 +148,12 @@ func _draw() -> void: draw_texture(Global.custom_left_brush_texture, dst) if Global.right_square_indicator_visible && Global.can_draw: - if Global.current_right_brush_type == Global.BRUSH_TYPES.PIXEL || Global.current_right_tool == "LightenDarken": + if Global.current_right_brush_type == Global.Brush_Types.PIXEL || Global.current_right_tool == "LightenDarken": if Global.current_right_tool == "Pencil" || Global.current_right_tool == "Eraser" || Global.current_right_tool == "LightenDarken": var start_pos_x = mouse_pos.x - (Global.right_brush_size >> 1) var start_pos_y = mouse_pos.y - (Global.right_brush_size >> 1) draw_rect(Rect2(start_pos_x, start_pos_y, Global.right_brush_size, Global.right_brush_size), Color.red, false) - elif Global.current_right_brush_type == Global.BRUSH_TYPES.CIRCLE || Global.current_right_brush_type == Global.BRUSH_TYPES.FILLED_CIRCLE: + elif Global.current_right_brush_type == Global.Brush_Types.CIRCLE || Global.current_right_brush_type == Global.Brush_Types.FILLED_CIRCLE: if Global.current_right_tool == "Pencil" || Global.current_right_tool == "Eraser": draw_set_transform(mouse_pos, rotation, scale) for rect in Global.right_circle_points: @@ -634,7 +634,7 @@ func draw_brush(sprite : Image, pos : Vector2, color : Color, current_mouse_butt if point_in_rectangle(Vector2(cur_pos_x, cur_pos_y), Vector2(west_limit - 1, north_limit - 1), Vector2(east_limit, south_limit)): var pos_floored := Vector2(cur_pos_x, cur_pos_y).floor() # Don't draw the same pixel over and over and don't re-lighten/darken it - var current_pixel_color : Color = layers[Global.current_layer][0].get_pixel(cur_pos_x, cur_pos_y) + var current_pixel_color : Color = sprite.get_pixel(cur_pos_x, cur_pos_y) var _c := color if current_action == "Pencil" && color.a < 1: _c = blend_colors(color, current_pixel_color) @@ -654,14 +654,14 @@ func draw_brush(sprite : Image, pos : Vector2, color : Color, current_mouse_butt mouse_press_pressure_values.append(pen_pressure) else: mouse_press_pressure_values[saved_pixel_index] = pen_pressure - layers[Global.current_layer][0].set_pixel(cur_pos_x, cur_pos_y, _c) + sprite.set_pixel(cur_pos_x, cur_pos_y, _c) sprite_changed_this_frame = true # Handle mirroring var mirror_x := east_limit + west_limit - cur_pos_x - 1 var mirror_y := south_limit + north_limit - cur_pos_y - 1 if horizontal_mirror: - current_pixel_color = layers[Global.current_layer][0].get_pixel(mirror_x, cur_pos_y) + current_pixel_color = sprite.get_pixel(mirror_x, cur_pos_y) if current_pixel_color != _c: # don't draw the same pixel over and over if current_action == "LightenDarken": if ld == 0: # Lighten @@ -671,11 +671,11 @@ func draw_brush(sprite : Image, pos : Vector2, color : Color, current_mouse_butt mouse_press_pixels.append(pos_floored) mouse_press_pressure_values.append(pen_pressure) - layers[Global.current_layer][0].set_pixel(mirror_x, cur_pos_y, _c) + sprite.set_pixel(mirror_x, cur_pos_y, _c) sprite_changed_this_frame = true - - if vertical_mirror: - current_pixel_color = layers[Global.current_layer][0].get_pixel(cur_pos_x, mirror_y) + + if vertical_mirror: + current_pixel_color = sprite.get_pixel(cur_pos_x, mirror_y) if current_pixel_color != _c: # don't draw the same pixel over and over if current_action == "LightenDarken": if ld == 0: # Lighten @@ -684,11 +684,11 @@ func draw_brush(sprite : Image, pos : Vector2, color : Color, current_mouse_butt _c = current_pixel_color.darkened(ld_amount) mouse_press_pixels.append(pos_floored) mouse_press_pressure_values.append(pen_pressure) - layers[Global.current_layer][0].set_pixel(cur_pos_x, mirror_y, _c) + sprite.set_pixel(cur_pos_x, mirror_y, _c) sprite_changed_this_frame = true - - if horizontal_mirror && vertical_mirror: - current_pixel_color = layers[Global.current_layer][0].get_pixel(mirror_x, mirror_y) + + if horizontal_mirror && vertical_mirror: + current_pixel_color = sprite.get_pixel(mirror_x, mirror_y) if current_pixel_color != _c: # don't draw the same pixel over and over if current_action == "LightenDarken": if ld == 0: # Lighten @@ -701,7 +701,7 @@ func draw_brush(sprite : Image, pos : Vector2, color : Color, current_mouse_butt sprite.set_pixel(mirror_x, mirror_y, _c) sprite_changed_this_frame = true - elif brush_type == Global.BRUSH_TYPES.CIRCLE || brush_type == Global.Brush_Types.FILLED_CIRCLE: + elif brush_type == Global.Brush_Types.CIRCLE || brush_type == Global.Brush_Types.FILLED_CIRCLE: plot_circle(sprite, pos.x, pos.y, brush_size, color, brush_type == Global.Brush_Types.FILLED_CIRCLE) # Handle mirroring From 29959a410a5e4c613a59025a07505ab25f8ae4c3 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Tue, 18 Feb 2020 04:04:10 +0200 Subject: [PATCH 06/32] Implement rotation dialog and #155 to Main.tscn --- Main.tscn | 60 ++++++++++++++++--------------------------------------- 1 file changed, 17 insertions(+), 43 deletions(-) diff --git a/Main.tscn b/Main.tscn index f494edd68..917890372 100644 --- a/Main.tscn +++ b/Main.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=48 format=2] +[gd_scene load_steps=49 format=2] [ext_resource path="res://Themes & Styles/Dark Theme/Dark Theme.tres" type="Theme" id=1] [ext_resource path="res://Scripts/Main.gd" type="Script" id=2] @@ -37,6 +37,7 @@ [ext_resource path="res://Prefabs/EditPalettePopup.tscn" type="PackedScene" id=35] [ext_resource path="res://Prefabs/NewPaletteDialog.tscn" type="PackedScene" id=36] [ext_resource path="res://Prefabs/PaletteImportFileDialog.tscn" type="PackedScene" id=37] +[ext_resource path="res://Prefabs/Dialogs/RotateImage.tscn" type="PackedScene" id=38] [sub_resource type="InputEventKey" id=1] scancode = 88 @@ -44,7 +45,7 @@ scancode = 88 [sub_resource type="ShortCut" id=2] shortcut = SubResource( 1 ) -[sub_resource type="Image" id=3] +[sub_resource type="Image" id=11] data = { "data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), "format": "RGBA8", @@ -54,10 +55,10 @@ data = { } [sub_resource type="ImageTexture" id=4] -image = SubResource( 3 ) +image = SubResource( 11 ) size = Vector2( 32, 32 ) -[sub_resource type="Image" id=5] +[sub_resource type="Image" id=12] data = { "data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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-82,10 +83,10 @@ data = { [sub_resource type="ImageTexture" id=8] flags = 3 flags = 3 -image = SubResource( 7 ) +image = SubResource( 13 ) size = Vector2( 9, 9 ) -[sub_resource type="Image" id=9] +[sub_resource type="Image" id=14] data = { "data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), "format": "RGBA8", @@ -97,7 +98,7 @@ data = { [sub_resource type="ImageTexture" id=10] flags = 3 flags = 3 -image = SubResource( 9 ) +image = SubResource( 14 ) size = Vector2( 9, 9 ) [node name="Control" type="Control"] @@ -116,14 +117,12 @@ anchor_bottom = 1.0 custom_constants/separation = 0 [node name="TopMenuContainer" type="Panel" parent="MenuAndUI"] -editor/display_folded = true margin_right = 1152.0 margin_bottom = 28.0 rect_min_size = Vector2( 0, 28 ) custom_styles/panel = ExtResource( 3 ) [node name="MenuItems" type="HBoxContainer" parent="MenuAndUI/TopMenuContainer"] -editor/display_folded = true margin_left = 2.0 margin_top = 4.0 margin_right = 1010.0 @@ -168,7 +167,6 @@ text = "Help" switch_on_hover = true [node name="HBoxContainer" type="HBoxContainer" parent="MenuAndUI/TopMenuContainer"] -editor/display_folded = true anchor_left = 0.5 anchor_right = 0.5 anchor_bottom = 1.0 @@ -201,7 +199,6 @@ size_flags_vertical = 3 custom_constants/separation = 0 [node name="ToolPanel" type="Panel" parent="MenuAndUI/UI"] -editor/display_folded = true margin_right = 224.0 margin_bottom = 620.0 rect_min_size = Vector2( 224, 0 ) @@ -219,18 +216,15 @@ custom_constants/autohide = 0 custom_constants/separation = 32 [node name="MenusAndTools" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools"] -editor/display_folded = true margin_right = 208.0 margin_bottom = 127.0 custom_constants/separation = 17 [node name="UtilityTools" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools"] -editor/display_folded = true margin_right = 208.0 margin_bottom = 55.0 [node name="VBoxContainer" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools/UtilityTools"] -editor/display_folded = true margin_right = 208.0 margin_bottom = 19.0 custom_constants/separation = 0 @@ -246,7 +240,6 @@ margin_right = 208.0 margin_bottom = 19.0 [node name="SelectionToolsContainer2" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools/UtilityTools"] -editor/display_folded = true margin_top = 23.0 margin_right = 208.0 margin_bottom = 55.0 @@ -278,7 +271,6 @@ margin_right = 208.0 margin_bottom = 127.0 [node name="VBoxContainer" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools/DrawTools"] -editor/display_folded = true margin_right = 208.0 margin_bottom = 19.0 custom_constants/separation = 0 @@ -294,7 +286,6 @@ margin_right = 208.0 margin_bottom = 19.0 [node name="PaintToolsContainer" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/MenusAndTools/DrawTools"] -editor/display_folded = true margin_top = 23.0 margin_right = 208.0 margin_bottom = 55.0 @@ -350,7 +341,6 @@ size_flags_vertical = 3 custom_constants/separation = 8 [node name="ColorButtonsVertical" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions"] -editor/display_folded = true margin_right = 208.0 margin_bottom = 51.0 custom_constants/separation = 2 @@ -424,7 +414,6 @@ margin_right = 208.0 margin_bottom = 63.0 [node name="ScrollContainer" type="ScrollContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions"] -editor/display_folded = true margin_top = 71.0 margin_right = 208.0 margin_bottom = 453.0 @@ -437,7 +426,6 @@ margin_bottom = 352.0 size_flags_horizontal = 3 [node name="LeftToolOptions" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions"] -editor/display_folded = true margin_right = 208.0 margin_bottom = 170.0 @@ -467,7 +455,6 @@ pressed = true text = "Show tool icon" [node name="LeftBrushType" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/LeftToolOptions"] -editor/display_folded = true margin_top = 59.0 margin_right = 208.0 margin_bottom = 91.0 @@ -496,7 +483,6 @@ margin_bottom = 23.0 text = "Brush: Pixel" [node name="LeftBrushSize" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/LeftToolOptions"] -editor/display_folded = true margin_top = 95.0 margin_right = 208.0 margin_bottom = 131.0 @@ -533,7 +519,6 @@ align = 1 suffix = "px" [node name="LeftColorInterpolation" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/LeftToolOptions"] -editor/display_folded = true visible = false margin_top = 115.0 margin_right = 208.0 @@ -543,6 +528,7 @@ margin_bottom = 151.0 margin_right = 208.0 margin_bottom = 15.0 hint_tooltip = "COLORFROM_HT" +mouse_filter = 1 text = "Brush color from" [node name="HBoxContainer" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/LeftToolOptions/LeftColorInterpolation"] @@ -568,7 +554,6 @@ value = 100.0 align = 1 [node name="LeftFillArea" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/LeftToolOptions"] -editor/display_folded = true visible = false margin_top = 155.0 margin_right = 208.0 @@ -590,7 +575,6 @@ items = [ "Area of the same color", null, false, 0, null, "All pixels of the sam selected = 0 [node name="LeftLDOptions" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/LeftToolOptions"] -editor/display_folded = true visible = false margin_top = 115.0 margin_right = 208.0 @@ -635,7 +619,6 @@ value = 10.0 align = 1 [node name="LeftColorPickerOptions" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/LeftToolOptions"] -editor/display_folded = true visible = false margin_top = 115.0 margin_right = 208.0 @@ -657,7 +640,6 @@ items = [ "Left Color", null, false, 0, null, "Right Color", null, false, 1, nul selected = 0 [node name="LeftMirroring" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/LeftToolOptions"] -editor/display_folded = true margin_top = 135.0 margin_right = 208.0 margin_bottom = 170.0 @@ -693,7 +675,6 @@ margin_right = 208.0 margin_bottom = 178.0 [node name="RightToolOptions" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions"] -editor/display_folded = true margin_top = 182.0 margin_right = 208.0 margin_bottom = 352.0 @@ -723,7 +704,6 @@ pressed = true text = "Show tool icon" [node name="RightBrushType" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/RightToolOptions"] -editor/display_folded = true margin_top = 59.0 margin_right = 208.0 margin_bottom = 91.0 @@ -752,7 +732,6 @@ margin_bottom = 23.0 text = "Brush: Pixel" [node name="RightBrushSize" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/RightToolOptions"] -editor/display_folded = true margin_top = 95.0 margin_right = 208.0 margin_bottom = 131.0 @@ -789,7 +768,6 @@ align = 1 suffix = "px" [node name="RightColorInterpolation" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/RightToolOptions"] -editor/display_folded = true visible = false margin_top = 115.0 margin_right = 208.0 @@ -799,6 +777,7 @@ margin_bottom = 151.0 margin_right = 208.0 margin_bottom = 15.0 hint_tooltip = "COLORFROM_HT" +mouse_filter = 1 text = "Brush color from" [node name="HBoxContainer" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/RightToolOptions/RightColorInterpolation"] @@ -826,7 +805,6 @@ value = 100.0 align = 1 [node name="RightFillArea" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/RightToolOptions"] -editor/display_folded = true visible = false margin_top = 96.0 margin_right = 208.0 @@ -847,7 +825,6 @@ items = [ "Area of the same color", null, false, 0, null, "All pixels of the sam selected = 0 [node name="RightLDOptions" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/RightToolOptions"] -editor/display_folded = true visible = false margin_top = 115.0 margin_right = 208.0 @@ -892,7 +869,6 @@ value = 10.0 align = 1 [node name="RightColorPickerOptions" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/RightToolOptions"] -editor/display_folded = true visible = false margin_top = 115.0 margin_right = 208.0 @@ -914,7 +890,6 @@ items = [ "Left Color", null, false, 0, null, "Right Color", null, false, 1, nul selected = 1 [node name="RightMirroring" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ScrollContainer/ToolOptions/RightToolOptions"] -editor/display_folded = true margin_top = 135.0 margin_right = 208.0 margin_bottom = 170.0 @@ -952,7 +927,6 @@ size_flags_horizontal = 3 custom_constants/separation = 0 [node name="HViewportContainer" type="HBoxContainer" parent="MenuAndUI/UI/CanvasAndTimeline"] -editor/display_folded = true margin_right = 704.0 margin_bottom = 420.0 size_flags_horizontal = 3 @@ -979,7 +953,6 @@ enabled_focus_mode = 0 script = ExtResource( 14 ) [node name="HSplitContainer" type="HSplitContainer" parent="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers"] -editor/display_folded = true margin_top = 16.0 margin_right = 704.0 margin_bottom = 420.0 @@ -1010,7 +983,6 @@ enabled_focus_mode = 0 script = ExtResource( 15 ) [node name="ViewportContainer" type="ViewportContainer" parent="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HSplitContainer/ViewportandVerticalRuler"] -editor/display_folded = true margin_left = 16.0 margin_right = 692.0 margin_bottom = 404.0 @@ -1073,7 +1045,6 @@ anchor_bottom = 1.0 margin_top = 16.0 [node name="CanvasPreview" type="ViewportContainer" parent="MenuAndUI/UI/RightPanel/PreviewAndPalettes"] -editor/display_folded = true margin_right = 224.0 margin_bottom = 164.0 rect_min_size = Vector2( 0, 164 ) @@ -1183,7 +1154,6 @@ columns = 5 script = ExtResource( 25 ) [node name="BrushesPopup" type="Popup" parent="."] -editor/display_folded = true margin_right = 226.0 margin_bottom = 144.0 rect_min_size = Vector2( 0, 144 ) @@ -1206,6 +1176,8 @@ size_flags_horizontal = 3 scroll_horizontal_enabled = false [node name="FileBrushContainer" type="GridContainer" parent="BrushesPopup/TabContainer/File"] +margin_right = 96.0 +margin_bottom = 32.0 columns = 6 [node name="PixelBrushButton" parent="BrushesPopup/TabContainer/File/FileBrushContainer" instance=ExtResource( 26 )] @@ -1285,6 +1257,8 @@ current_path = "C:/Users/Overloaded/Dropbox/Orama Founding Members/εταιρι [node name="PreferencesDialog" parent="." instance=ExtResource( 32 )] +[node name="RotateImage" parent="." instance=ExtResource( 38 )] + [node name="OutlineDialog" parent="." instance=ExtResource( 33 )] visible = false @@ -1393,4 +1367,4 @@ visible = false [editable path="BrushesPopup/TabContainer/File/FileBrushContainer/CircleBrushButton"] -[editable path="BrushesPopup/TabContainer/File/FileBrushContainer/FilledCircleBrushButton"] \ No newline at end of file +[editable path="BrushesPopup/TabContainer/File/FileBrushContainer/FilledCircleBrushButton"] From 37621477c88837fec2d7b43c1cce1993429a579c Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Thu, 20 Feb 2020 01:35:12 +0200 Subject: [PATCH 07/32] Hide invisible layers in onion skinning --- Scripts/Canvas.gd | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Scripts/Canvas.gd b/Scripts/Canvas.gd index e06d53980..82ef540a0 100644 --- a/Scripts/Canvas.gd +++ b/Scripts/Canvas.gd @@ -85,9 +85,12 @@ func _draw() -> void: color = Color.white for i in range(1, Global.onion_skinning_past_rate + 1): if Global.current_frame >= i: + var layer_i := 0 for layer in Global.canvases[Global.current_frame - i].layers: - color.a = 0.6/i - draw_texture(layer[1], location, color) + if Global.layers[layer_i][1]: # If it's visible + color.a = 0.6 / i + draw_texture(layer[1], location, color) + layer_i += 1 # Future if Global.onion_skinning_future_rate > 0: @@ -98,9 +101,12 @@ func _draw() -> void: color = Color.white for i in range(1, Global.onion_skinning_future_rate + 1): if Global.current_frame < Global.canvases.size() - i: + var layer_i := 0 for layer in Global.canvases[Global.current_frame + i].layers: - color.a = 0.6/i - draw_texture(layer[1], location, color) + if Global.layers[layer_i][1]: # If it's visible + color.a = 0.6 / i + draw_texture(layer[1], location, color) + layer_i += 1 # Draw current frame layers for i in range(layers.size()): From bb6e2cbf16e722bada0ebb28fda706c239520308 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Thu, 20 Feb 2020 02:14:15 +0200 Subject: [PATCH 08/32] Layer images are now unique to each frame --- Scripts/AnimationTimeline.gd | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Scripts/AnimationTimeline.gd b/Scripts/AnimationTimeline.gd index 56131079a..ab541c9d0 100644 --- a/Scripts/AnimationTimeline.gd +++ b/Scripts/AnimationTimeline.gd @@ -143,16 +143,9 @@ func _on_BlueRedMode_toggled(button_pressed) -> void: # Layer buttons func add_layer(is_new := true) -> void: - var new_layer := Image.new() var layer_name = null - if is_new: - new_layer.create(Global.canvas.size.x, Global.canvas.size.y, false, Image.FORMAT_RGBA8) - else: # clone layer - new_layer.copy_from(Global.canvas.layers[Global.current_layer][0]) + if !is_new: # clone layer layer_name = Global.layers[Global.current_layer][1] + " (" + tr("copy") + ")" - new_layer.lock() - var new_layer_tex := ImageTexture.new() - new_layer_tex.create_from_image(new_layer, 0) var new_layers : Array = Global.layers.duplicate() @@ -165,6 +158,16 @@ func add_layer(is_new := true) -> void: Global.undo_redo.add_do_property(Global, "layers", new_layers) for c in Global.canvases: + var new_layer := Image.new() + if is_new: + new_layer.create(c.size.x, c.size.y, false, Image.FORMAT_RGBA8) + else: # clone layer + new_layer.copy_from(c.layers[Global.current_layer][0]) + + new_layer.lock() + var new_layer_tex := ImageTexture.new() + new_layer_tex.create_from_image(new_layer, 0) + var new_canvas_layers : Array = c.layers.duplicate() # Store [Image, ImageTexture, Opacity] new_canvas_layers.append([new_layer, new_layer_tex, 1]) From 2bfae6875534a57d14bc7203d1ed1064379a2c94 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Sat, 22 Feb 2020 17:00:39 +0200 Subject: [PATCH 09/32] Implemented Remove Layer - Doesn't work properly yet --- Scripts/AnimationTimeline.gd | 18 +++++++++++++----- Scripts/FrameButton.gd | 2 +- Scripts/Global.gd | 10 ++++++++++ 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/Scripts/AnimationTimeline.gd b/Scripts/AnimationTimeline.gd index ab541c9d0..5124c1c15 100644 --- a/Scripts/AnimationTimeline.gd +++ b/Scripts/AnimationTimeline.gd @@ -182,15 +182,23 @@ func add_layer(is_new := true) -> void: Global.undo_redo.commit_action() func _on_RemoveLayer_pressed() -> void: - var new_layers : Array = Global.canvas.layers.duplicate() - new_layers.remove(Global.canvas.current_layer_index) + var new_layers : Array = Global.layers.duplicate() + new_layers.remove(Global.current_layer) Global.undos += 1 Global.undo_redo.create_action("Remove Layer") - Global.undo_redo.add_do_property(Global.canvas, "layers", new_layers) - Global.undo_redo.add_undo_property(Global.canvas, "layers", Global.canvas.layers) + Global.undo_redo.add_do_method(Global, "redo", [Global.canvas], Global.current_layer) + Global.undo_redo.add_do_property(Global, "current_layer", Global.current_layer - 1) + Global.undo_redo.add_do_property(Global, "layers", new_layers) + for c in Global.canvases: + var new_canvas_layers : Array = c.layers.duplicate() + new_canvas_layers.remove(Global.current_layer) + Global.undo_redo.add_do_property(c, "layers", new_canvas_layers) + Global.undo_redo.add_undo_property(c, "layers", c.layers) + + Global.undo_redo.add_undo_property(Global, "current_layer", Global.current_layer) + Global.undo_redo.add_undo_property(Global, "layers", Global.canvas.layers) Global.undo_redo.add_undo_method(Global, "undo", [Global.canvas]) - Global.undo_redo.add_do_method(Global, "redo", [Global.canvas]) Global.undo_redo.commit_action() func change_layer_order(rate : int) -> void: diff --git a/Scripts/FrameButton.gd b/Scripts/FrameButton.gd index 2e344bee7..afed896a4 100644 --- a/Scripts/FrameButton.gd +++ b/Scripts/FrameButton.gd @@ -30,7 +30,7 @@ func _on_FrameButton_pressed() -> void: func _on_PopupMenu_id_pressed(ID : int) -> void: match ID: - 0: #Remove Frame + 0: # Remove Frame remove_frame() 1: # Clone Layer diff --git a/Scripts/Global.gd b/Scripts/Global.gd index a52a6af72..31831ef9d 100644 --- a/Scripts/Global.gd +++ b/Scripts/Global.gd @@ -474,6 +474,16 @@ func redo(_canvases : Array, layer_index : int = -1) -> void: layers[current_layer][2].add_child(frame_button) + remove_layer_button.disabled = false + remove_layer_button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND + + if action_name == "Remove Layer": + var layer_container_child_index = (layers_container.get_child_count() - 1) - layer_index + layers_container.remove_child(layers_container.get_child(layer_container_child_index)) + frames_container.remove_child(layers[layer_index][2]) + if layers.size() == 2: # Actually 1, but it hasn't been updated yet + remove_layer_button.disabled = true + remove_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN # if action_name == "Change Layer Order": # var current_layer_index : int = _canvases[0].current_layer_index From 60aed9efbab82feb3aae3fb3c76d827861694f48 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Fri, 28 Feb 2020 03:27:22 +0200 Subject: [PATCH 10/32] Use setter method for layers to update the UI Instead of updating it in undo and redo methods --- Main.tscn | 2 - Prefabs/AnimationTimeline.tscn | 22 ++++--- Scripts/AnimationTimeline.gd | 4 +- Scripts/FrameButton.gd | 4 ++ Scripts/Global.gd | 110 ++++++++++++++++++++++----------- Scripts/Main.gd | 5 +- 6 files changed, 96 insertions(+), 51 deletions(-) diff --git a/Main.tscn b/Main.tscn index 917890372..e47b58c84 100644 --- a/Main.tscn +++ b/Main.tscn @@ -1360,8 +1360,6 @@ visible = false [connection signal="confirmed" from="QuitAndSaveDialog" to="." method="_on_QuitDialog_confirmed"] [connection signal="custom_action" from="QuitAndSaveDialog" to="." method="_on_QuitAndSaveDialog_custom_action"] [connection signal="popup_hide" from="QuitAndSaveDialog" to="." method="_can_draw_true"] -[connection signal="confirmed" from="NewPaletteDialog" to="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/PaletteVBoxContainer/ScrollPalette/CenterPalette/PaletteContainer" method="on_new_palette_confirmed"] -[connection signal="file_selected" from="PaletteImportFileDialog" to="MenuAndUI/UI/LayerPanel/LayersAndMisc/VSplitContainer/PaletteVBoxContainer/ScrollPalette/CenterPalette/PaletteContainer" method="on_palette_import_file_selected"] [connection signal="confirmed" from="NewPaletteDialog" to="MenuAndUI/UI/RightPanel/PreviewAndPalettes/PaletteVBoxContainer/ScrollPalette/CenterPalette/PaletteContainer" method="on_new_palette_confirmed"] [connection signal="file_selected" from="PaletteImportFileDialog" to="MenuAndUI/UI/RightPanel/PreviewAndPalettes/PaletteVBoxContainer/ScrollPalette/CenterPalette/PaletteContainer" method="on_palette_import_file_selected"] diff --git a/Prefabs/AnimationTimeline.tscn b/Prefabs/AnimationTimeline.tscn index e401a853d..d50eebab1 100644 --- a/Prefabs/AnimationTimeline.tscn +++ b/Prefabs/AnimationTimeline.tscn @@ -201,7 +201,6 @@ align = 1 valign = 1 [node name="OpacityContainer" type="HBoxContainer" parent="AnimationContainer/TimelineContainer"] -editor/display_folded = true margin_top = 36.0 margin_right = 543.0 margin_bottom = 60.0 @@ -245,11 +244,11 @@ margin_right = 252.0 margin_bottom = 96.0 size_flags_vertical = 3 -[node name="LayersContainer" type="VBoxContainer" parent="AnimationContainer/TimelineContainer/TimelineScroll/LayersAndFrames"] +[node name="VBoxContainer" type="VBoxContainer" parent="AnimationContainer/TimelineContainer/TimelineScroll/LayersAndFrames"] margin_right = 212.0 margin_bottom = 96.0 -[node name="LayerLabel" type="Label" parent="AnimationContainer/TimelineContainer/TimelineScroll/LayersAndFrames/LayersContainer"] +[node name="LayerLabel" type="Label" parent="AnimationContainer/TimelineContainer/TimelineScroll/LayersAndFrames/VBoxContainer"] margin_right = 212.0 margin_bottom = 16.0 rect_min_size = Vector2( 0, 16 ) @@ -257,27 +256,35 @@ text = "Layers" align = 1 valign = 1 -[node name="LayerContainer" parent="AnimationContainer/TimelineContainer/TimelineScroll/LayersAndFrames/LayersContainer" instance=ExtResource( 18 )] +[node name="LayersContainer" type="VBoxContainer" parent="AnimationContainer/TimelineContainer/TimelineScroll/LayersAndFrames/VBoxContainer"] margin_top = 20.0 margin_right = 212.0 margin_bottom = 56.0 -[node name="FramesContainer" type="VBoxContainer" parent="AnimationContainer/TimelineContainer/TimelineScroll/LayersAndFrames"] +[node name="LayerContainer" parent="AnimationContainer/TimelineContainer/TimelineScroll/LayersAndFrames/VBoxContainer/LayersContainer" instance=ExtResource( 18 )] +margin_right = 212.0 + +[node name="VBoxContainer2" type="VBoxContainer" parent="AnimationContainer/TimelineContainer/TimelineScroll/LayersAndFrames"] margin_left = 216.0 margin_right = 252.0 margin_bottom = 96.0 -[node name="FrameIDs" type="HBoxContainer" parent="AnimationContainer/TimelineContainer/TimelineScroll/LayersAndFrames/FramesContainer"] +[node name="FrameIDs" type="HBoxContainer" parent="AnimationContainer/TimelineContainer/TimelineScroll/LayersAndFrames/VBoxContainer2"] margin_right = 36.0 margin_bottom = 14.0 -[node name="Label" type="Label" parent="AnimationContainer/TimelineContainer/TimelineScroll/LayersAndFrames/FramesContainer/FrameIDs"] +[node name="Label" type="Label" parent="AnimationContainer/TimelineContainer/TimelineScroll/LayersAndFrames/VBoxContainer2/FrameIDs"] margin_right = 36.0 margin_bottom = 14.0 rect_min_size = Vector2( 36, 0 ) text = "1" align = 1 +[node name="FramesContainer" type="VBoxContainer" parent="AnimationContainer/TimelineContainer/TimelineScroll/LayersAndFrames/VBoxContainer2"] +margin_top = 18.0 +margin_right = 36.0 +margin_bottom = 18.0 + [node name="HSeparator" type="HSeparator" parent="AnimationContainer/TimelineContainer"] margin_top = 164.0 margin_right = 543.0 @@ -309,7 +316,6 @@ texture_normal = ExtResource( 19 ) texture_hover = ExtResource( 20 ) [node name="PlaybackButtons" type="HBoxContainer" parent="AnimationContainer/TimelineContainer/AnimationButtons"] -editor/display_folded = true margin_left = 223.0 margin_right = 363.0 margin_bottom = 24.0 diff --git a/Scripts/AnimationTimeline.gd b/Scripts/AnimationTimeline.gd index 5124c1c15..fcacb1c2e 100644 --- a/Scripts/AnimationTimeline.gd +++ b/Scripts/AnimationTimeline.gd @@ -186,7 +186,6 @@ func _on_RemoveLayer_pressed() -> void: new_layers.remove(Global.current_layer) Global.undos += 1 Global.undo_redo.create_action("Remove Layer") - Global.undo_redo.add_do_method(Global, "redo", [Global.canvas], Global.current_layer) Global.undo_redo.add_do_property(Global, "current_layer", Global.current_layer - 1) Global.undo_redo.add_do_property(Global, "layers", new_layers) @@ -197,7 +196,8 @@ func _on_RemoveLayer_pressed() -> void: Global.undo_redo.add_undo_property(c, "layers", c.layers) Global.undo_redo.add_undo_property(Global, "current_layer", Global.current_layer) - Global.undo_redo.add_undo_property(Global, "layers", Global.canvas.layers) + Global.undo_redo.add_undo_property(Global, "layers", Global.layers) + Global.undo_redo.add_do_method(Global, "redo", [Global.canvas]) Global.undo_redo.add_undo_method(Global, "undo", [Global.canvas]) Global.undo_redo.commit_action() diff --git a/Scripts/FrameButton.gd b/Scripts/FrameButton.gd index afed896a4..154bf4ae0 100644 --- a/Scripts/FrameButton.gd +++ b/Scripts/FrameButton.gd @@ -5,11 +5,15 @@ var layer := 0 onready var popup_menu := $PopupMenu +func _ready() -> void: + hint_tooltip = "Frame: %s, Layer: %s" % [frame, layer] + func _on_FrameButton_pressed() -> void: if Input.is_action_just_released("left_mouse"): Global.current_frame = frame Global.current_layer = layer print(str(frame), str(layer)) + print("Current layer: %s" % Global.current_layer) elif Input.is_action_just_released("right_mouse"): if Global.canvases.size() == 1: popup_menu.set_item_disabled(0, true) diff --git a/Scripts/Global.gd b/Scripts/Global.gd index 31831ef9d..795c09082 100644 --- a/Scripts/Global.gd +++ b/Scripts/Global.gd @@ -13,7 +13,7 @@ var undos := 0 # The number of times we added undo properties var saved := true # Checks if the user has saved # Canvas related stuff -var layers := [] +var layers := [] setget layers_changed var current_frame := 0 setget frame_changed var current_layer := 0 # warning-ignore:unused_class_variable @@ -410,12 +410,12 @@ func undo(_canvases : Array, layer_index : int = -1) -> void: if action_name == "Scale": c.camera_zoom() - if "Layer" in action_name: - var current_layer_index : int = _canvases[0].current_layer_index - _canvases[0].generate_layer_panels() - if action_name == "Change Layer Order": - _canvases[0].current_layer_index = current_layer_index - _canvases[0].get_layer_container(current_layer_index).changed_selection() +# if "Layer" in action_name: +# var current_layer_index : int = _canvases[0].current_layer_index +# _canvases[0].generate_layer_panels() +# if action_name == "Change Layer Order": +# _canvases[0].current_layer_index = current_layer_index +# _canvases[0].get_layer_container(current_layer_index).changed_selection() if action_name == "Add Frame": canvas_parent.remove_child(_canvases[0]) @@ -455,35 +455,36 @@ func redo(_canvases : Array, layer_index : int = -1) -> void: if action_name == "Scale": c.camera_zoom() - if action_name == "Add Layer": - var layer_container = load("res://Prefabs/LayerContainer.tscn").instance() - layers[current_layer][0] = tr("Layer") + " %s" % current_layer - layer_container.i = current_layer - layer_container.get_child(0).get_child(1).text = layers[current_layer][0] - layer_container.get_child(0).get_child(2).text = layers[current_layer][0] - layers_container.add_child(layer_container) - layers_container.move_child(layer_container, 1) - - frames_container.add_child(layers[current_layer][2]) - frames_container.move_child(layers[current_layer][2], 1) - for i in range(canvases.size()): - var frame_button = load("res://Prefabs/FrameButton.tscn").instance() - frame_button.frame = i - frame_button.layer = current_layer - frame_button.pressed = true - - layers[current_layer][2].add_child(frame_button) - - remove_layer_button.disabled = false - remove_layer_button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND - - if action_name == "Remove Layer": - var layer_container_child_index = (layers_container.get_child_count() - 1) - layer_index - layers_container.remove_child(layers_container.get_child(layer_container_child_index)) - frames_container.remove_child(layers[layer_index][2]) - if layers.size() == 2: # Actually 1, but it hasn't been updated yet - remove_layer_button.disabled = true - remove_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN +# if action_name == "Add Layer": +# var layer_container = load("res://Prefabs/LayerContainer.tscn").instance() +# layers[current_layer][0] = tr("Layer") + " %s" % current_layer +# layer_container.i = current_layer +# layer_container.get_child(0).get_child(1).text = layers[current_layer][0] +# layer_container.get_child(0).get_child(2).text = layers[current_layer][0] +# layers_container.add_child(layer_container) +# layers_container.move_child(layer_container, 0) +# +# frames_container.add_child(layers[current_layer][2]) +# frames_container.move_child(layers[current_layer][2], 0) +# for i in range(canvases.size()): +# var frame_button = load("res://Prefabs/FrameButton.tscn").instance() +# frame_button.frame = i +# frame_button.layer = current_layer +# frame_button.pressed = true +# +# layers[current_layer][2].add_child(frame_button) +# +# remove_layer_button.disabled = false +# remove_layer_button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND +# +# if action_name == "Remove Layer": +# var layer_container_child_index = (layers_container.get_child_count() - 1) - layer_index +# layers_container.remove_child(layers_container.get_child(layer_container_child_index)) +# print(layer_index, layers[layer_index][2]) +# frames_container.remove_child(layers[layer_index][2]) +# if layers.size() == 2: # Actually 1, but it hasn't been updated yet +# remove_layer_button.disabled = true +# remove_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN # if action_name == "Change Layer Order": # var current_layer_index : int = _canvases[0].current_layer_index @@ -521,6 +522,43 @@ func title_changed(value : String) -> void: window_title = value OS.set_window_title(value) +func layers_changed(value : Array) -> void: + layers = value + print(layers) + print(str(layers_container.get_child_count()) + " " + str(frames_container.get_child_count())) + + for container in layers_container.get_children(): + container.queue_free() + + for container in frames_container.get_children(): + for button in container.get_children(): + button.queue_free() + frames_container.remove_child(container) + + for i in range(layers.size() - 1, -1, -1): + var layer_container = load("res://Prefabs/LayerContainer.tscn").instance() + layers[i][0] = tr("Layer") + " %s" % i + layer_container.i = i + layer_container.get_child(0).get_child(1).text = layers[i][0] + layer_container.get_child(0).get_child(2).text = layers[i][0] + layers_container.add_child(layer_container) + + frames_container.add_child(layers[i][2]) + for j in range(canvases.size()): + var frame_button = load("res://Prefabs/FrameButton.tscn").instance() + frame_button.frame = j + frame_button.layer = i + frame_button.pressed = true + + layers[i][2].add_child(frame_button) + + if layers.size() == 1: + remove_layer_button.disabled = true + remove_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN + else: + remove_layer_button.disabled = false + remove_layer_button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND + func frame_changed(value : int) -> void: current_frame = value current_frame_label.text = tr("Current frame:") + " %s/%s" % [str(current_frame + 1), canvases.size()] diff --git a/Scripts/Main.gd b/Scripts/Main.gd index f76fc7a1a..4b7d3017c 100644 --- a/Scripts/Main.gd +++ b/Scripts/Main.gd @@ -164,9 +164,8 @@ func _ready() -> void: Global.window_title = "(" + tr("untitled") + ") - Pixelorama" Global.layers[0][0] = tr("Layer") + " 0" - Global.layers_container.get_child(1).label.text = Global.layers[0][0] - Global.layers_container.get_child(1).line_edit.text = Global.layers[0][0] - Global.canvas.generate_layer_panels() + Global.layers_container.get_child(0).label.text = Global.layers[0][0] + Global.layers_container.get_child(0).line_edit.text = Global.layers[0][0] Import.import_brushes("Brushes") From 0945a558d26e20b4ddf85b72f61fb16b02beb019 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Sat, 29 Feb 2020 01:23:45 +0200 Subject: [PATCH 11/32] Fix layer name change Name change is now saved only if the user presses Enter --- Prefabs/LayerContainer.tscn | 1 - Scripts/Global.gd | 4 +++- Scripts/LayerContainer.gd | 7 +++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Prefabs/LayerContainer.tscn b/Prefabs/LayerContainer.tscn index cc11393b2..b9a5d530b 100644 --- a/Prefabs/LayerContainer.tscn +++ b/Prefabs/LayerContainer.tscn @@ -58,4 +58,3 @@ caret_blink = true caret_blink_speed = 0.5 [connection signal="pressed" from="." to="." method="_on_LayerContainer_pressed"] [connection signal="pressed" from="HBoxContainer/VisibilityButton" to="." method="_on_VisibilityButton_pressed"] -[connection signal="text_changed" from="HBoxContainer/LineEdit" to="." method="_on_LineEdit_text_changed"] diff --git a/Scripts/Global.gd b/Scripts/Global.gd index 795c09082..829598390 100644 --- a/Scripts/Global.gd +++ b/Scripts/Global.gd @@ -537,8 +537,10 @@ func layers_changed(value : Array) -> void: for i in range(layers.size() - 1, -1, -1): var layer_container = load("res://Prefabs/LayerContainer.tscn").instance() - layers[i][0] = tr("Layer") + " %s" % i layer_container.i = i + if !layers[i][0]: + layers[i][0] = tr("Layer") + " %s" % i + layer_container.get_child(0).get_child(1).text = layers[i][0] layer_container.get_child(0).get_child(2).text = layers[i][0] layers_container.add_child(layer_container) diff --git a/Scripts/LayerContainer.gd b/Scripts/LayerContainer.gd index 79c77bb3d..d1e5cf197 100644 --- a/Scripts/LayerContainer.gd +++ b/Scripts/LayerContainer.gd @@ -23,6 +23,9 @@ func _input(event : InputEvent) -> void: label.visible = true line_edit.visible = false line_edit.editable = false + var new_text : String = line_edit.text + label.text = new_text + Global.layers[i][0] = new_text func _on_LayerContainer_pressed() -> void: var initially_pressed := pressed @@ -85,7 +88,3 @@ func _on_VisibilityButton_pressed() -> void: visibility_button.texture_normal = load("res://Assets/Graphics/%s Themes/Layers/Layer_Visible.png" % Global.theme_type) visibility_button.texture_hover = load("res://Assets/Graphics/%s Themes/Layers/Layer_Visible_Hover.png" % Global.theme_type) Global.canvas.update() - -func _on_LineEdit_text_changed(new_text : String) -> void: - Global.layers[i][0] = new_text - label.text = new_text From 6557d3aeac7c5259a856b658db669e39f2eb5f2d Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Sat, 29 Feb 2020 01:31:16 +0200 Subject: [PATCH 12/32] Clone layer is now functional --- Scripts/AnimationTimeline.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/AnimationTimeline.gd b/Scripts/AnimationTimeline.gd index fcacb1c2e..caa0f80a6 100644 --- a/Scripts/AnimationTimeline.gd +++ b/Scripts/AnimationTimeline.gd @@ -145,7 +145,7 @@ func _on_BlueRedMode_toggled(button_pressed) -> void: func add_layer(is_new := true) -> void: var layer_name = null if !is_new: # clone layer - layer_name = Global.layers[Global.current_layer][1] + " (" + tr("copy") + ")" + layer_name = Global.layers[Global.current_layer][0] + " (" + tr("copy") + ")" var new_layers : Array = Global.layers.duplicate() From 53d062619e3b7fff2c3bca6f54434599181edc81 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Sat, 29 Feb 2020 01:55:01 +0200 Subject: [PATCH 13/32] Rectangle Selection works per layer again --- Scripts/SelectionRectangle.gd | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Scripts/SelectionRectangle.gd b/Scripts/SelectionRectangle.gd index 69656d7f8..6a922109f 100644 --- a/Scripts/SelectionRectangle.gd +++ b/Scripts/SelectionRectangle.gd @@ -23,7 +23,7 @@ func _process(delta : float) -> void: var mouse_pos_floored := mouse_pos.floor() var start_pos := polygon[0] var end_pos := polygon[2] - var current_layer_index: int = Global.canvas.current_layer_index + var current_layer_index : int = Global.current_layer var layer : Image = Global.canvas.layers[current_layer_index][0] if end_pos == start_pos: @@ -59,7 +59,7 @@ func _process(delta : float) -> void: layer.set_pixelv(curr_px, Color(0, 0, 0, 0)) else: # If part of selection is outside canvas orig_colors.append(Color(0, 0, 0, 0)) - Global.canvas.update_texture(Global.canvas.current_layer_index) + Global.canvas.update_texture(current_layer_index) tex.create_from_image(img, 0) update() @@ -90,7 +90,7 @@ func _process(delta : float) -> void: var px = polygon[0] + Global.selected_pixels[i] - Global.selected_pixels[0] if point_in_rectangle(px, Global.canvas.location - Vector2.ONE, Global.canvas.size): layer.set_pixelv(px, orig_colors[i]) - Global.canvas.update_texture(Global.canvas.current_layer_index) + Global.canvas.update_texture(current_layer_index) img.fill(Color(0, 0, 0, 0)) tex.create_from_image(img, 0) update() @@ -136,8 +136,6 @@ func _process(delta : float) -> void: layer.set_pixel(xx, yy, Color(0, 0, 0, 0)) Global.canvas.handle_redo("Draw") - - func _draw() -> void: if img.get_size() == polygon[2] - polygon[0]: draw_texture(tex, polygon[0], Color(1, 1, 1, 0.5)) From 18356d440893095b16041827a857e7b5393a7af9 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Sat, 29 Feb 2020 02:12:03 +0200 Subject: [PATCH 14/32] UndoRedo and Image effects work per layer Basically just replaced Global.canvas.current_layer_index with Global.current_layer --- Scripts/Canvas.gd | 12 ++++++------ Scripts/Dialogs/OutlineDialog.gd | 2 +- Scripts/Main.gd | 20 ++++++++++---------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Scripts/Canvas.gd b/Scripts/Canvas.gd index 82ef540a0..1dd79d455 100644 --- a/Scripts/Canvas.gd +++ b/Scripts/Canvas.gd @@ -465,10 +465,10 @@ func handle_undo(action : String) -> void: for c in canvases: # I'm not sure why I have to unlock it, but... # ...if I don't, it doesn't work properly - c.layers[c.current_layer_index][0].unlock() - var data = c.layers[c.current_layer_index][0].data - c.layers[c.current_layer_index][0].lock() - Global.undo_redo.add_undo_property(c.layers[c.current_layer_index][0], "data", data) + c.layers[Global.current_layer][0].unlock() + var data = c.layers[Global.current_layer][0].data + c.layers[Global.current_layer][0].lock() + Global.undo_redo.add_undo_property(c.layers[Global.current_layer][0], "data", data) if action == "Rectangle Select": var selected_pixels = Global.selected_pixels.duplicate() Global.undo_redo.add_undo_property(Global.selection_rectangle, "polygon", Global.selection_rectangle.polygon) @@ -486,11 +486,11 @@ func handle_redo(action : String) -> void: var layer_index := -1 if Global.animation_timer.is_stopped(): canvases = [self] - layer_index = current_layer_index + layer_index = Global.current_layer else: canvases = Global.canvases for c in canvases: - Global.undo_redo.add_do_property(c.layers[c.current_layer_index][0], "data", c.layers[c.current_layer_index][0].data) + Global.undo_redo.add_do_property(c.layers[Global.current_layer][0], "data", c.layers[Global.current_layer][0].data) if action == "Rectangle Select": Global.undo_redo.add_do_property(Global.selection_rectangle, "polygon", Global.selection_rectangle.polygon) Global.undo_redo.add_do_property(Global, "selected_pixels", Global.selected_pixels) diff --git a/Scripts/Dialogs/OutlineDialog.gd b/Scripts/Dialogs/OutlineDialog.gd index e2b5def35..1711b2789 100644 --- a/Scripts/Dialogs/OutlineDialog.gd +++ b/Scripts/Dialogs/OutlineDialog.gd @@ -9,7 +9,7 @@ func _on_OutlineDialog_confirmed() -> void: var diagonal : bool = $OptionsContainer/DiagonalCheckBox.pressed var inside_image : bool = $OptionsContainer/InsideImageCheckBox.pressed - var image : Image = Global.canvas.layers[Global.canvas.current_layer_index][0] + var image : Image = Global.canvas.layers[Global.current_layer][0] if image.is_invisible(): return var new_image := Image.new() diff --git a/Scripts/Main.gd b/Scripts/Main.gd index 4b7d3017c..2e860bd7a 100644 --- a/Scripts/Main.gd +++ b/Scripts/Main.gd @@ -332,23 +332,23 @@ func image_menu_id_pressed(id : int) -> void: 2: # Flip Horizontal var canvas : Canvas = Global.canvas canvas.handle_undo("Draw") - canvas.layers[canvas.current_layer_index][0].unlock() - canvas.layers[canvas.current_layer_index][0].flip_x() - canvas.layers[canvas.current_layer_index][0].lock() + canvas.layers[Global.current_layer][0].unlock() + canvas.layers[Global.current_layer][0].flip_x() + canvas.layers[Global.current_layer][0].lock() canvas.handle_redo("Draw") 3: # Flip Vertical var canvas : Canvas = Global.canvas canvas.handle_undo("Draw") - canvas.layers[canvas.current_layer_index][0].unlock() - canvas.layers[canvas.current_layer_index][0].flip_y() - canvas.layers[canvas.current_layer_index][0].lock() + canvas.layers[Global.current_layer][0].unlock() + canvas.layers[Global.current_layer][0].flip_y() + canvas.layers[Global.current_layer][0].lock() canvas.handle_redo("Draw") 4: # Rotate - var image : Image = Global.canvas.layers[Global.canvas.current_layer_index][0] + var image : Image = Global.canvas.layers[Global.current_layer][0] $RotateImage.set_sprite(image) $RotateImage.popup_centered() 5: # Invert Colors - var image : Image = Global.canvas.layers[Global.canvas.current_layer_index][0] + var image : Image = Global.canvas.layers[Global.current_layer][0] Global.canvas.handle_undo("Draw") for xx in image.get_size().x: for yy in image.get_size().y: @@ -358,7 +358,7 @@ func image_menu_id_pressed(id : int) -> void: image.set_pixel(xx, yy, px_color) Global.canvas.handle_redo("Draw") 6: # Desaturation - var image : Image = Global.canvas.layers[Global.canvas.current_layer_index][0] + var image : Image = Global.canvas.layers[Global.current_layer][0] Global.canvas.handle_undo("Draw") for xx in image.get_size().x: for yy in image.get_size().y: @@ -775,7 +775,7 @@ func _on_RightVerticalMirroring_toggled(button_pressed) -> void: Global.right_vertical_mirror = button_pressed func _on_OpacitySlider_value_changed(value) -> void: - Global.canvas.layers[Global.canvas.current_layer_index][4] = value / 100 + Global.canvas.layers[Global.current_layer][4] = value / 100 Global.layer_opacity_slider.value = value Global.layer_opacity_spinbox.value = value Global.canvas.update() From 4e31c1ed4b70fd938d104ba7e33f911f3a406d1f Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Sun, 1 Mar 2020 00:57:47 +0200 Subject: [PATCH 15/32] Changing layer order works again Started using a setter method for Global.current_layer --- Scripts/AnimationTimeline.gd | 44 ++++++++++++++---------- Scripts/Canvas.gd | 2 +- Scripts/Global.gd | 66 +++++++++++++----------------------- Scripts/LayerContainer.gd | 1 - 4 files changed, 50 insertions(+), 63 deletions(-) diff --git a/Scripts/AnimationTimeline.gd b/Scripts/AnimationTimeline.gd index caa0f80a6..cf3a8ba02 100644 --- a/Scripts/AnimationTimeline.gd +++ b/Scripts/AnimationTimeline.gd @@ -154,8 +154,6 @@ func add_layer(is_new := true) -> void: Global.undos += 1 Global.undo_redo.create_action("Add Layer") - Global.undo_redo.add_do_property(Global, "current_layer", Global.current_layer + 1) - Global.undo_redo.add_do_property(Global, "layers", new_layers) for c in Global.canvases: var new_layer := Image.new() @@ -174,6 +172,8 @@ func add_layer(is_new := true) -> void: Global.undo_redo.add_do_property(c, "layers", new_canvas_layers) Global.undo_redo.add_undo_property(c, "layers", c.layers) + Global.undo_redo.add_do_property(Global, "current_layer", Global.current_layer + 1) + Global.undo_redo.add_do_property(Global, "layers", new_layers) Global.undo_redo.add_undo_property(Global, "current_layer", Global.current_layer) Global.undo_redo.add_undo_property(Global, "layers", Global.layers) @@ -187,7 +187,6 @@ func _on_RemoveLayer_pressed() -> void: Global.undos += 1 Global.undo_redo.create_action("Remove Layer") Global.undo_redo.add_do_property(Global, "current_layer", Global.current_layer - 1) - Global.undo_redo.add_do_property(Global, "layers", new_layers) for c in Global.canvases: var new_canvas_layers : Array = c.layers.duplicate() @@ -195,6 +194,7 @@ func _on_RemoveLayer_pressed() -> void: Global.undo_redo.add_do_property(c, "layers", new_canvas_layers) Global.undo_redo.add_undo_property(c, "layers", c.layers) + Global.undo_redo.add_do_property(Global, "layers", new_layers) Global.undo_redo.add_undo_property(Global, "current_layer", Global.current_layer) Global.undo_redo.add_undo_property(Global, "layers", Global.layers) Global.undo_redo.add_do_method(Global, "redo", [Global.canvas]) @@ -202,17 +202,25 @@ func _on_RemoveLayer_pressed() -> void: Global.undo_redo.commit_action() func change_layer_order(rate : int) -> void: - var change = Global.canvas.current_layer_index + rate + var change = Global.current_layer + rate - var new_layers : Array = Global.canvas.layers.duplicate() - var temp = new_layers[Global.canvas.current_layer_index] - new_layers[Global.canvas.current_layer_index] = new_layers[change] + var new_layers : Array = Global.layers.duplicate() + var temp = new_layers[Global.current_layer] + new_layers[Global.current_layer] = new_layers[change] new_layers[change] = temp Global.undo_redo.create_action("Change Layer Order") - Global.undo_redo.add_do_property(Global.canvas, "layers", new_layers) - Global.undo_redo.add_do_property(Global.canvas, "current_layer_index", change) - Global.undo_redo.add_undo_property(Global.canvas, "layers", Global.canvas.layers) - Global.undo_redo.add_undo_property(Global.canvas, "current_layer_index", Global.canvas.current_layer_index) + for c in Global.canvases: + var new_layers_canvas : Array = c.layers.duplicate() + var temp_canvas = new_layers_canvas[Global.current_layer] + new_layers_canvas[Global.current_layer] = new_layers_canvas[change] + new_layers_canvas[change] = temp_canvas + Global.undo_redo.add_do_property(c, "layers", new_layers_canvas) + Global.undo_redo.add_undo_property(c, "layers", c.layers) + + Global.undo_redo.add_do_property(Global, "current_layer", change) + Global.undo_redo.add_do_property(Global, "layers", new_layers) + Global.undo_redo.add_undo_property(Global, "layers", Global.layers) + Global.undo_redo.add_undo_property(Global, "current_layer", Global.current_layer) Global.undo_redo.add_undo_method(Global, "undo", [Global.canvas]) Global.undo_redo.add_do_method(Global, "redo", [Global.canvas]) @@ -220,17 +228,17 @@ func change_layer_order(rate : int) -> void: func _on_MergeDownLayer_pressed() -> void: var new_layers : Array = Global.canvas.layers.duplicate() - new_layers.remove(Global.canvas.current_layer_index) - var selected_layer = Global.canvas.layers[Global.canvas.current_layer_index][0] - if Global.canvas.layers[Global.canvas.current_layer_index][4] < 1: # If we have layer transparency + new_layers.remove(Global.current_layer) + var selected_layer = Global.canvas.layers[Global.current_layer][0] + if Global.canvas.layers[Global.current_layer][2] < 1: # If we have layer transparency for xx in selected_layer.get_size().x: for yy in selected_layer.get_size().y: var pixel_color : Color = selected_layer.get_pixel(xx, yy) - var alpha : float = pixel_color.a * Global.canvas.layers[Global.canvas.current_layer_index][4] + var alpha : float = pixel_color.a * Global.canvas.layers[Global.current_layer][4] selected_layer.set_pixel(xx, yy, Color(pixel_color.r, pixel_color.g, pixel_color.b, alpha)) var new_layer := Image.new() - new_layer.copy_from(Global.canvas.layers[Global.canvas.current_layer_index - 1][0]) + new_layer.copy_from(Global.canvas.layers[Global.current_layer - 1][0]) new_layer.lock() Global.canvas.blend_rect(new_layer, selected_layer, Rect2(Global.canvas.position, Global.canvas.size), Vector2.ZERO) @@ -238,9 +246,9 @@ func _on_MergeDownLayer_pressed() -> void: Global.undos += 1 Global.undo_redo.create_action("Merge Layer") Global.undo_redo.add_do_property(Global.canvas, "layers", new_layers) - Global.undo_redo.add_do_property(Global.canvas.layers[Global.canvas.current_layer_index - 1][0], "data", new_layer.data) + Global.undo_redo.add_do_property(Global.canvas.layers[Global.current_layer - 1][0], "data", new_layer.data) Global.undo_redo.add_undo_property(Global.canvas, "layers", Global.canvas.layers) - Global.undo_redo.add_undo_property(Global.canvas.layers[Global.canvas.current_layer_index - 1][0], "data", Global.canvas.layers[Global.canvas.current_layer_index - 1][0].data) + Global.undo_redo.add_undo_property(Global.canvas.layers[Global.current_layer - 1][0], "data", Global.canvas.layers[Global.current_layer - 1][0].data) Global.undo_redo.add_undo_method(Global, "undo", [Global.canvas]) Global.undo_redo.add_do_method(Global, "redo", [Global.canvas]) diff --git a/Scripts/Canvas.gd b/Scripts/Canvas.gd index 1dd79d455..f8c2c797f 100644 --- a/Scripts/Canvas.gd +++ b/Scripts/Canvas.gd @@ -51,7 +51,7 @@ func _ready() -> void: var tex := ImageTexture.new() tex.create_from_image(sprite, 0) - # Store [Image, ImageTexture, Layer Name, Opacity] + # Store [Image, ImageTexture, Opacity] layers.append([sprite, tex, 1]) var frame_button = load("res://Prefabs/FrameButton.tscn").instance() diff --git a/Scripts/Global.gd b/Scripts/Global.gd index 829598390..ec92a695d 100644 --- a/Scripts/Global.gd +++ b/Scripts/Global.gd @@ -15,7 +15,7 @@ var saved := true # Checks if the user has saved # Canvas related stuff var layers := [] setget layers_changed var current_frame := 0 setget frame_changed -var current_layer := 0 +var current_layer := 0 setget layer_changed # warning-ignore:unused_class_variable var can_draw := false # warning-ignore:unused_class_variable @@ -410,13 +410,6 @@ func undo(_canvases : Array, layer_index : int = -1) -> void: if action_name == "Scale": c.camera_zoom() -# if "Layer" in action_name: -# var current_layer_index : int = _canvases[0].current_layer_index -# _canvases[0].generate_layer_panels() -# if action_name == "Change Layer Order": -# _canvases[0].current_layer_index = current_layer_index -# _canvases[0].get_layer_container(current_layer_index).changed_selection() - if action_name == "Add Frame": canvas_parent.remove_child(_canvases[0]) frames_container.remove_child(_canvases[0].frame_button) @@ -455,41 +448,6 @@ func redo(_canvases : Array, layer_index : int = -1) -> void: if action_name == "Scale": c.camera_zoom() -# if action_name == "Add Layer": -# var layer_container = load("res://Prefabs/LayerContainer.tscn").instance() -# layers[current_layer][0] = tr("Layer") + " %s" % current_layer -# layer_container.i = current_layer -# layer_container.get_child(0).get_child(1).text = layers[current_layer][0] -# layer_container.get_child(0).get_child(2).text = layers[current_layer][0] -# layers_container.add_child(layer_container) -# layers_container.move_child(layer_container, 0) -# -# frames_container.add_child(layers[current_layer][2]) -# frames_container.move_child(layers[current_layer][2], 0) -# for i in range(canvases.size()): -# var frame_button = load("res://Prefabs/FrameButton.tscn").instance() -# frame_button.frame = i -# frame_button.layer = current_layer -# frame_button.pressed = true -# -# layers[current_layer][2].add_child(frame_button) -# -# remove_layer_button.disabled = false -# remove_layer_button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND -# -# if action_name == "Remove Layer": -# var layer_container_child_index = (layers_container.get_child_count() - 1) - layer_index -# layers_container.remove_child(layers_container.get_child(layer_container_child_index)) -# print(layer_index, layers[layer_index][2]) -# frames_container.remove_child(layers[layer_index][2]) -# if layers.size() == 2: # Actually 1, but it hasn't been updated yet -# remove_layer_button.disabled = true -# remove_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN - -# if action_name == "Change Layer Order": -# var current_layer_index : int = _canvases[0].current_layer_index -# _canvases[0].current_layer_index = current_layer_index -# _canvases[0].get_layer_container(current_layer_index).changed_selection() if action_name == "Add Frame": canvas_parent.add_child(_canvases[0]) @@ -551,6 +509,7 @@ func layers_changed(value : Array) -> void: frame_button.frame = j frame_button.layer = i frame_button.pressed = true + frame_button.get_child(0).texture = Global.canvases[j].layers[i][1] layers[i][2].add_child(frame_button) @@ -583,6 +542,27 @@ func frame_changed(value : int) -> void: #canvas.frame_button.pressed = true #canvas.frame_button.get_node("FrameID").add_color_override("font_color", Color("#3c5d75")) +func layer_changed(value : int) -> void: + current_layer = value + layer_opacity_slider.value = canvas.layers[current_layer][2] * 100 + layer_opacity_spinbox.value = canvas.layers[current_layer][2] * 100 + if current_layer < layers.size() - 1: + move_up_layer_button.disabled = false + move_up_layer_button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND + else: + move_up_layer_button.disabled = true + move_up_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN + + if current_layer > 0: + move_down_layer_button.disabled = false + move_down_layer_button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND + merge_down_layer_button.disabled = false + merge_down_layer_button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND + else: + move_down_layer_button.disabled = true + move_down_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN + merge_down_layer_button.disabled = true + func create_brush_button(brush_img : Image, brush_type := Brush_Types.CUSTOM, hint_tooltip := "") -> void: var brush_container var brush_button = load("res://Prefabs/BrushButton.tscn").instance() diff --git a/Scripts/LayerContainer.gd b/Scripts/LayerContainer.gd index d1e5cf197..b78cab5cd 100644 --- a/Scripts/LayerContainer.gd +++ b/Scripts/LayerContainer.gd @@ -47,7 +47,6 @@ func changed_selection() -> void: var parent := get_parent() for child in parent.get_children(): if child is Button: - #print(child.name) child.label.visible = true child.line_edit.visible = false child.line_edit.editable = false From 24e9eda6446523f4d9a5353e22e27bf0cf84443b Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Sun, 1 Mar 2020 00:58:50 +0200 Subject: [PATCH 16/32] Fixed crash where the cursor was failing to load The issue still exists though, but instead of crashing, the cursor just doesn't change. Probably a Godot bug? --- Scripts/Canvas.gd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Scripts/Canvas.gd b/Scripts/Canvas.gd index f8c2c797f..c507ee109 100644 --- a/Scripts/Canvas.gd +++ b/Scripts/Canvas.gd @@ -251,7 +251,8 @@ func _input(event : InputEvent) -> void: Global.cursor_position_label.text = "[%s×%s] %s, %s" % [size.x, size.y, mouse_pos_floored.x, mouse_pos_floored.y] if !cursor_inside_canvas: cursor_inside_canvas = true - Input.set_custom_mouse_cursor(Global.cursor_image, 0, Vector2(15, 15)) + if Global.cursor_image.get_data().get_size() != Vector2.ZERO: + Input.set_custom_mouse_cursor(Global.cursor_image, 0, Vector2(15, 15)) if Global.show_left_tool_icon: Global.left_cursor.visible = true if Global.show_right_tool_icon: From adcacaa8cb8433e460e2de3d4e6e8a9576613da4 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Sun, 1 Mar 2020 01:43:48 +0200 Subject: [PATCH 17/32] Merging layers works This should be all of the layer functionality restored. Frame functionality will soon follow. --- Scripts/AnimationTimeline.gd | 44 +++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/Scripts/AnimationTimeline.gd b/Scripts/AnimationTimeline.gd index cf3a8ba02..eaf7fa2ea 100644 --- a/Scripts/AnimationTimeline.gd +++ b/Scripts/AnimationTimeline.gd @@ -227,28 +227,36 @@ func change_layer_order(rate : int) -> void: Global.undo_redo.commit_action() func _on_MergeDownLayer_pressed() -> void: - var new_layers : Array = Global.canvas.layers.duplicate() + var new_layers : Array = Global.layers.duplicate() new_layers.remove(Global.current_layer) - var selected_layer = Global.canvas.layers[Global.current_layer][0] - if Global.canvas.layers[Global.current_layer][2] < 1: # If we have layer transparency - for xx in selected_layer.get_size().x: - for yy in selected_layer.get_size().y: - var pixel_color : Color = selected_layer.get_pixel(xx, yy) - var alpha : float = pixel_color.a * Global.canvas.layers[Global.current_layer][4] - selected_layer.set_pixel(xx, yy, Color(pixel_color.r, pixel_color.g, pixel_color.b, alpha)) - - var new_layer := Image.new() - new_layer.copy_from(Global.canvas.layers[Global.current_layer - 1][0]) - new_layer.lock() - - Global.canvas.blend_rect(new_layer, selected_layer, Rect2(Global.canvas.position, Global.canvas.size), Vector2.ZERO) Global.undos += 1 Global.undo_redo.create_action("Merge Layer") - Global.undo_redo.add_do_property(Global.canvas, "layers", new_layers) - Global.undo_redo.add_do_property(Global.canvas.layers[Global.current_layer - 1][0], "data", new_layer.data) - Global.undo_redo.add_undo_property(Global.canvas, "layers", Global.canvas.layers) - Global.undo_redo.add_undo_property(Global.canvas.layers[Global.current_layer - 1][0], "data", Global.canvas.layers[Global.current_layer - 1][0].data) + for c in Global.canvases: + var new_layers_canvas : Array = c.layers.duplicate() + new_layers_canvas.remove(Global.current_layer) + var selected_layer = c.layers[Global.current_layer][0] + if c.layers[Global.current_layer][2] < 1: # If we have layer transparency + for xx in selected_layer.get_size().x: + for yy in selected_layer.get_size().y: + var pixel_color : Color = selected_layer.get_pixel(xx, yy) + var alpha : float = pixel_color.a * c.layers[Global.current_layer][4] + selected_layer.set_pixel(xx, yy, Color(pixel_color.r, pixel_color.g, pixel_color.b, alpha)) + + var new_layer := Image.new() + new_layer.copy_from(c.layers[Global.current_layer - 1][0]) + new_layer.lock() + c.blend_rect(new_layer, selected_layer, Rect2(c.position, c.size), Vector2.ZERO) + + Global.undo_redo.add_do_property(c, "layers", new_layers_canvas) + Global.undo_redo.add_do_property(c.layers[Global.current_layer - 1][0], "data", new_layer.data) + Global.undo_redo.add_undo_property(c, "layers", c.layers) + Global.undo_redo.add_undo_property(c.layers[Global.current_layer - 1][0], "data", c.layers[Global.current_layer - 1][0].data) + + Global.undo_redo.add_do_property(Global, "current_layer", Global.current_layer - 1) + Global.undo_redo.add_do_property(Global, "layers", new_layers) + Global.undo_redo.add_undo_property(Global, "layers", Global.layers) + Global.undo_redo.add_undo_property(Global, "current_layer", Global.current_layer) Global.undo_redo.add_undo_method(Global, "undo", [Global.canvas]) Global.undo_redo.add_do_method(Global, "redo", [Global.canvas]) From 98e6b0f56bbba1e2f60510ab13b08fba28964de2 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Tue, 3 Mar 2020 01:46:14 +0200 Subject: [PATCH 18/32] Fix move up/down and merge layers not de-activating when there's only one layer left --- Scripts/Global.gd | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Scripts/Global.gd b/Scripts/Global.gd index ec92a695d..b39ce9397 100644 --- a/Scripts/Global.gd +++ b/Scripts/Global.gd @@ -516,6 +516,12 @@ func layers_changed(value : Array) -> void: if layers.size() == 1: remove_layer_button.disabled = true remove_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN + move_up_layer_button.disabled = true + move_up_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN + move_down_layer_button.disabled = true + move_down_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN + merge_down_layer_button.disabled = true + merge_down_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN else: remove_layer_button.disabled = false remove_layer_button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND @@ -562,6 +568,7 @@ func layer_changed(value : int) -> void: move_down_layer_button.disabled = true move_down_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN merge_down_layer_button.disabled = true + merge_down_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN func create_brush_button(brush_img : Image, brush_type := Brush_Types.CUSTOM, hint_tooltip := "") -> void: var brush_container From 120e47d0f924b091eda8ca8433eda43d5d19fc9c Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Tue, 3 Mar 2020 02:50:39 +0200 Subject: [PATCH 19/32] Add/remove/move frames should now work With Undo/Redo. Cloning frames doesn't work yet, will fix shortly. --- Scripts/Canvas.gd | 9 --------- Scripts/Global.gd | 44 ++++++++++++++++++++++++++++++-------------- 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/Scripts/Canvas.gd b/Scripts/Canvas.gd index c507ee109..5c6e3c897 100644 --- a/Scripts/Canvas.gd +++ b/Scripts/Canvas.gd @@ -31,7 +31,6 @@ var pen_pressure := 1.0 # For tablet pressure sensitivity func _ready() -> void: var fill_layers := layers.empty() for i in range(Global.layers.size()): - print(i) if fill_layers: # The sprite itself var sprite := Image.new() @@ -54,14 +53,6 @@ func _ready() -> void: # Store [Image, ImageTexture, Opacity] layers.append([sprite, tex, 1]) - var frame_button = load("res://Prefabs/FrameButton.tscn").instance() - frame_button.frame = frame - frame_button.layer = i - frame_button.pressed = true - #frame_button.get_node("FrameID").text = str(frame + 1) - #frame_button.get_node("FrameID").add_color_override("font_color", Color("#3c5d75")) - Global.layers[i][2].add_child(frame_button) - # Only handle camera zoom settings & offset on the first frame if Global.canvases[0] == self: camera_zoom() diff --git a/Scripts/Global.gd b/Scripts/Global.gd index b39ce9397..14ca889be 100644 --- a/Scripts/Global.gd +++ b/Scripts/Global.gd @@ -13,6 +13,7 @@ var undos := 0 # The number of times we added undo properties var saved := true # Checks if the user has saved # Canvas related stuff +var canvases := [] setget canvases_changed var layers := [] setget layers_changed var current_frame := 0 setget frame_changed var current_layer := 0 setget layer_changed @@ -20,7 +21,6 @@ var current_layer := 0 setget layer_changed var can_draw := false # warning-ignore:unused_class_variable var has_focus := false -var canvases := [] # warning-ignore:unused_class_variable var hidden_canvases := [] var pressure_sensitivity_mode = Pressure_Sensitivity.NONE @@ -412,7 +412,6 @@ func undo(_canvases : Array, layer_index : int = -1) -> void: if action_name == "Add Frame": canvas_parent.remove_child(_canvases[0]) - frames_container.remove_child(_canvases[0].frame_button) # This actually means that canvases.size is one, but it hasn't been updated yet if canvases.size() == 2: # Stop animating play_forward.pressed = false @@ -421,10 +420,7 @@ func undo(_canvases : Array, layer_index : int = -1) -> void: elif action_name == "Remove Frame": canvas_parent.add_child(_canvases[0]) canvas_parent.move_child(_canvases[0], _canvases[0].frame) - frames_container.add_child(_canvases[0].frame_button) - frames_container.move_child(_canvases[0].frame_button, _canvases[0].frame) elif action_name == "Change Frame Order": - frames_container.move_child(_canvases[0].frame_button, _canvases[0].frame) canvas_parent.move_child(_canvases[0], _canvases[0].frame) canvas.update() @@ -451,22 +447,15 @@ func redo(_canvases : Array, layer_index : int = -1) -> void: if action_name == "Add Frame": canvas_parent.add_child(_canvases[0]) - var label := Label.new() - label.rect_min_size.x = 36 - label.align = Label.ALIGN_CENTER - label.text = str(canvases.size() + 1) - frame_ids.add_child(label) #if !frames_container.is_a_parent_of(_canvases[0].frame_button): # frames_container.add_child(_canvases[0].frame_button) elif action_name == "Remove Frame": canvas_parent.remove_child(_canvases[0]) - frames_container.remove_child(_canvases[0].frame_button) if canvases.size() == 1: # Stop animating play_forward.pressed = false play_backwards.pressed = false animation_timer.stop() elif action_name == "Change Frame Order": - frames_container.move_child(_canvases[0].frame_button, _canvases[0].frame) canvas_parent.move_child(_canvases[0], _canvases[0].frame) canvas.update() @@ -480,10 +469,37 @@ func title_changed(value : String) -> void: window_title = value OS.set_window_title(value) +func canvases_changed(value : Array) -> void: + canvases = value + for container in frames_container.get_children(): + for button in container.get_children(): + button.queue_free() + frames_container.remove_child(container) + + for frame_id in frame_ids.get_children(): + frame_id.queue_free() + + for i in range(layers.size() - 1, -1, -1): + frames_container.add_child(layers[i][2]) + + for j in range(canvases.size()): + var label := Label.new() + label.rect_min_size.x = 36 + label.align = Label.ALIGN_CENTER + label.text = str(j + 1) + frame_ids.add_child(label) + + for i in range(layers.size() - 1, -1, -1): + var frame_button = load("res://Prefabs/FrameButton.tscn").instance() + frame_button.frame = j + frame_button.layer = i + frame_button.pressed = true + frame_button.get_child(0).texture = Global.canvases[j].layers[i][1] + + layers[i][2].add_child(frame_button) + func layers_changed(value : Array) -> void: layers = value - print(layers) - print(str(layers_container.get_child_count()) + " " + str(frames_container.get_child_count())) for container in layers_container.get_children(): container.queue_free() From 24818bfaea3de8639615fab73eab4c08d6691bf6 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Tue, 3 Mar 2020 03:05:48 +0200 Subject: [PATCH 20/32] Cloning frames works --- Scripts/Canvas.gd | 2 +- Scripts/FrameButton.gd | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Scripts/Canvas.gd b/Scripts/Canvas.gd index 5c6e3c897..e7d082d4a 100644 --- a/Scripts/Canvas.gd +++ b/Scripts/Canvas.gd @@ -30,7 +30,7 @@ var pen_pressure := 1.0 # For tablet pressure sensitivity # Called when the node enters the scene tree for the first time. func _ready() -> void: var fill_layers := layers.empty() - for i in range(Global.layers.size()): + for l in Global.layers: if fill_layers: # The sprite itself var sprite := Image.new() diff --git a/Scripts/FrameButton.gd b/Scripts/FrameButton.gd index 154bf4ae0..fbc5d4c81 100644 --- a/Scripts/FrameButton.gd +++ b/Scripts/FrameButton.gd @@ -37,7 +37,7 @@ func _on_PopupMenu_id_pressed(ID : int) -> void: 0: # Remove Frame remove_frame() - 1: # Clone Layer + 1: # Clone Frame var canvas : Canvas = Global.canvases[frame] var new_canvas : Canvas = load("res://Prefabs/Canvas.tscn").instance() new_canvas.size = Global.canvas.size @@ -65,10 +65,10 @@ func _on_PopupMenu_id_pressed(ID : int) -> void: Global.undo_redo.add_do_property(Global, "hidden_canvases", Global.hidden_canvases) Global.undo_redo.add_do_property(Global, "canvas", new_canvas) Global.undo_redo.add_do_property(Global, "current_frame", new_canvases.size() - 1) - for child in Global.frame_containers.get_children(): - var frame_button = child.get_node("FrameButton") - Global.undo_redo.add_do_property(frame_button, "pressed", false) - Global.undo_redo.add_undo_property(frame_button, "pressed", frame_button.pressed) + for i in range(Global.layers.size()): + for child in Global.layers[i][2].get_children(): + Global.undo_redo.add_do_property(child, "pressed", false) + Global.undo_redo.add_undo_property(child, "pressed", child.pressed) for c in Global.canvases: Global.undo_redo.add_do_property(c, "visible", false) Global.undo_redo.add_undo_property(c, "visible", c.visible) @@ -79,9 +79,9 @@ func _on_PopupMenu_id_pressed(ID : int) -> void: Global.undo_redo.add_undo_property(Global, "current_frame", Global.current_frame) Global.undo_redo.commit_action() - 2: #Move Left + 2: # Move Left change_frame_order(-1) - 3: #Move Right + 3: # Move Right change_frame_order(1) func remove_frame() -> void: From 87629fdf2fadaa6c6b24866afe26948638c6a206 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Thu, 5 Mar 2020 01:13:59 +0200 Subject: [PATCH 21/32] The selected layer's buttons are now pressed The unselected layers's buttons are pressed = false --- Scripts/Global.gd | 11 ++++++++ Scripts/LayerContainer.gd | 57 +++++++-------------------------------- 2 files changed, 21 insertions(+), 47 deletions(-) diff --git a/Scripts/Global.gd b/Scripts/Global.gd index 14ca889be..a31ec3f55 100644 --- a/Scripts/Global.gd +++ b/Scripts/Global.gd @@ -529,6 +529,9 @@ func layers_changed(value : Array) -> void: layers[i][2].add_child(frame_button) + var layer_button = layers_container.get_child(layers_container.get_child_count() - 1 - current_layer) + layer_button.pressed = true + if layers.size() == 1: remove_layer_button.disabled = true remove_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN @@ -568,6 +571,14 @@ func layer_changed(value : int) -> void: current_layer = value layer_opacity_slider.value = canvas.layers[current_layer][2] * 100 layer_opacity_spinbox.value = canvas.layers[current_layer][2] * 100 + + for container in layers_container.get_children(): + container.pressed = false + + if current_layer < layers_container.get_child_count(): + var layer_button = layers_container.get_child(layers_container.get_child_count() - 1 - current_layer) + layer_button.pressed = true + if current_layer < layers.size() - 1: move_up_layer_button.disabled = false move_up_layer_button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND diff --git a/Scripts/LayerContainer.gd b/Scripts/LayerContainer.gd index b78cab5cd..e518f7f96 100644 --- a/Scripts/LayerContainer.gd +++ b/Scripts/LayerContainer.gd @@ -10,7 +10,6 @@ onready var label := $HBoxContainer/Label onready var line_edit := $HBoxContainer/LineEdit func _ready() -> void: - #changed_selection() if Global.layers[i][1]: visibility_button.texture_normal = load("res://Assets/Graphics/%s Themes/Layers/Layer_Visible.png" % Global.theme_type) visibility_button.texture_hover = load("res://Assets/Graphics/%s Themes/Layers/Layer_Visible_Hover.png" % Global.theme_type) @@ -28,54 +27,18 @@ func _input(event : InputEvent) -> void: Global.layers[i][0] = new_text func _on_LayerContainer_pressed() -> void: - var initially_pressed := pressed + pressed = !pressed var label_initially_visible : bool = label.visible -# Global.canvas.current_layer_index = i -# changed_selection() - if !initially_pressed: - if label_initially_visible: - label.visible = false - line_edit.visible = true - line_edit.editable = true - line_edit.grab_focus() - else: - label.visible = true - line_edit.visible = false - line_edit.editable = false -func changed_selection() -> void: - var parent := get_parent() - for child in parent.get_children(): - if child is Button: - child.label.visible = true - child.line_edit.visible = false - child.line_edit.editable = false - if Global.canvas.current_layer_index == child.i: # The selected layer - child.currently_selected = true - child.pressed = true - Global.layer_opacity_slider.value = Global.canvas.layers[child.i][3] * 100 - Global.layer_opacity_spinbox.value = Global.canvas.layers[child.i][3] * 100 - - if Global.canvas.current_layer_index < Global.canvas.layers.size() - 1: - Global.move_up_layer_button.disabled = false - Global.move_up_layer_button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND - else: - Global.move_up_layer_button.disabled = true - Global.move_up_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN - - if Global.canvas.current_layer_index > 0: - Global.move_down_layer_button.disabled = false - Global.move_down_layer_button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND - Global.merge_down_layer_button.disabled = false - Global.merge_down_layer_button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND - else: - Global.move_down_layer_button.disabled = true - Global.move_down_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN - Global.merge_down_layer_button.disabled = true - Global.merge_down_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN - else: - child.currently_selected = false - child.pressed = false + if label_initially_visible: + label.visible = false + line_edit.visible = true + line_edit.editable = true + line_edit.grab_focus() + else: + label.visible = true + line_edit.visible = false + line_edit.editable = false func _on_VisibilityButton_pressed() -> void: if Global.layers[i][1]: From 2a5dfa7ea28c2b529c4cb138d6c8a9df8bb2e47e Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Thu, 5 Mar 2020 01:53:48 +0200 Subject: [PATCH 22/32] The selected cel (?) is now pressed, based on current layer and frame All the other buttons are pressed = false. Also removed some legacy code. --- Scripts/AnimationTimeline.gd | 5 +---- Scripts/Canvas.gd | 42 +++--------------------------------- Scripts/FrameButton.gd | 2 -- Scripts/Global.gd | 33 +++++++++++++++++----------- 4 files changed, 25 insertions(+), 57 deletions(-) diff --git a/Scripts/AnimationTimeline.gd b/Scripts/AnimationTimeline.gd index eaf7fa2ea..cf7337e00 100644 --- a/Scripts/AnimationTimeline.gd +++ b/Scripts/AnimationTimeline.gd @@ -23,10 +23,7 @@ func add_frame() -> void: Global.undo_redo.add_do_property(Global, "hidden_canvases", Global.hidden_canvases) Global.undo_redo.add_do_property(Global, "canvas", new_canvas) Global.undo_redo.add_do_property(Global, "current_frame", new_canvases.size() - 1) - for i in range(Global.layers.size()): - for child in Global.layers[i][2].get_children(): - Global.undo_redo.add_do_property(child, "pressed", false) - Global.undo_redo.add_undo_property(child, "pressed", child.pressed) + for c in Global.canvases: Global.undo_redo.add_do_property(c, "visible", false) Global.undo_redo.add_undo_property(c, "visible", c.visible) diff --git a/Scripts/Canvas.gd b/Scripts/Canvas.gd index e7d082d4a..180d9e8dd 100644 --- a/Scripts/Canvas.gd +++ b/Scripts/Canvas.gd @@ -417,7 +417,7 @@ func _input(event : InputEvent) -> void: previous_mouse_pos.x = clamp(previous_mouse_pos.x, location.x, location.x + size.x) previous_mouse_pos.y = clamp(previous_mouse_pos.y, location.y, location.y + size.y) if sprite_changed_this_frame: - update_texture(Global.current_layer, (Input.is_action_just_released("left_mouse") || Input.is_action_just_released("right_mouse"))) + update_texture(Global.current_layer) func camera_zoom() -> void: # Set camera zoom based on the sprite size @@ -489,25 +489,12 @@ func handle_redo(action : String) -> void: Global.undo_redo.add_do_method(Global, "redo", canvases, layer_index) Global.undo_redo.commit_action() -func update_texture(layer_index : int, update_frame_tex := true) -> void: +func update_texture(layer_index : int) -> void: layers[layer_index][1].create_from_image(layers[layer_index][0], 0) -# var layer_container := get_layer_container(layer_index) -# if layer_container: -# layer_container.get_child(1).get_child(0).texture = layers[layer_index][1] + var frame_texture_rect : TextureRect frame_texture_rect = Global.find_node_by_name(Global.layers[layer_index][2].get_child(frame),"FrameTexture") frame_texture_rect.texture = layers[layer_index][1] -# if update_frame_tex: -# # This code is used to update the texture in the animation timeline frame button -# # but blend_rect causes major performance issues on large images -# var whole_image := Image.new() -# whole_image.create(size.x, size.y, false, Image.FORMAT_RGBA8) -# for layer in layers: -# whole_image.blend_rect(layer[0], Rect2(position, size), Vector2.ZERO) -# layer[0].lock() -# var whole_image_texture := ImageTexture.new() -# whole_image_texture.create_from_image(whole_image, 0) -# frame_texture_rect.texture = whole_image_texture func frame_changed(value : int) -> void: frame = value @@ -521,29 +508,6 @@ func get_layer_container(layer_index : int) -> LayerContainer: return container return null -func generate_layer_panels() -> void: - return - for child in Global.layers_container.get_children(): - if child is LayerContainer: - child.queue_free() - - current_layer_index = layers.size() - 1 - if layers.size() == 1: - Global.remove_layer_button.disabled = true - Global.remove_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN - else: - Global.remove_layer_button.disabled = false - Global.remove_layer_button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND - - for i in range(layers.size() -1, -1, -1): - var layer_container = load("res://Prefabs/LayerContainer.tscn").instance() -# if !layers[i][2]: -# layers[i][2] = tr("Layer") + " %s" % i - layer_container.i = i - layer_container.get_child(0).get_child(1).text = layers[i][2] - layer_container.get_child(0).get_child(2).text = layers[i][2] - Global.layer_and_frame_container.add_child(layer_container) - func pencil_and_eraser(sprite : Image, mouse_pos : Vector2, color : Color, current_mouse_button : String, current_action := "None") -> void: if made_line: return diff --git a/Scripts/FrameButton.gd b/Scripts/FrameButton.gd index fbc5d4c81..3dbfa87fc 100644 --- a/Scripts/FrameButton.gd +++ b/Scripts/FrameButton.gd @@ -12,8 +12,6 @@ func _on_FrameButton_pressed() -> void: if Input.is_action_just_released("left_mouse"): Global.current_frame = frame Global.current_layer = layer - print(str(frame), str(layer)) - print("Current layer: %s" % Global.current_layer) elif Input.is_action_just_released("right_mouse"): if Global.canvases.size() == 1: popup_menu.set_item_disabled(0, true) diff --git a/Scripts/Global.gd b/Scripts/Global.gd index a31ec3f55..0ef82b5d5 100644 --- a/Scripts/Global.gd +++ b/Scripts/Global.gd @@ -473,10 +473,12 @@ func canvases_changed(value : Array) -> void: canvases = value for container in frames_container.get_children(): for button in container.get_children(): + container.remove_child(button) button.queue_free() frames_container.remove_child(container) for frame_id in frame_ids.get_children(): + frame_ids.remove_child(frame_id) frame_id.queue_free() for i in range(layers.size() - 1, -1, -1): @@ -506,6 +508,7 @@ func layers_changed(value : Array) -> void: for container in frames_container.get_children(): for button in container.get_children(): + container.remove_child(button) button.queue_free() frames_container.remove_child(container) @@ -524,13 +527,13 @@ func layers_changed(value : Array) -> void: var frame_button = load("res://Prefabs/FrameButton.tscn").instance() frame_button.frame = j frame_button.layer = i - frame_button.pressed = true frame_button.get_child(0).texture = Global.canvases[j].layers[i][1] layers[i][2].add_child(frame_button) var layer_button = layers_container.get_child(layers_container.get_child_count() - 1 - current_layer) layer_button.pressed = true + self.current_frame = current_frame # Call frame_changed to update UI if layers.size() == 1: remove_layer_button.disabled = true @@ -549,23 +552,26 @@ func frame_changed(value : int) -> void: current_frame = value current_frame_label.text = tr("Current frame:") + " %s/%s" % [str(current_frame + 1), canvases.size()] - for c in canvases: + var i := 0 + for c in canvases: # De-select all the other canvases/frames c.visible = false c.is_making_line = false c.line_2d.set_point_position(1, c.line_2d.points[0]) - canvas = canvases[current_frame] - canvas.visible = true - #canvas.generate_layer_panels() - # Make all frame buttons unpressed - for c in canvases: var text_color := Color.white if theme_type == "Gold" || theme_type == "Light": text_color = Color.black - #c.frame_button.pressed = false - #c.frame_button.get_node("FrameID").add_color_override("font_color", text_color) - # Make only the current frame button pressed - #canvas.frame_button.pressed = true - #canvas.frame_button.get_node("FrameID").add_color_override("font_color", Color("#3c5d75")) + frame_ids.get_child(i).add_color_override("font_color", text_color) + for layer in layers: + if i < layer[2].get_child_count(): + layer[2].get_child(i).pressed = false + i += 1 + + # Select the new canvas/frame + canvas = canvases[current_frame] + canvas.visible = true + frame_ids.get_child(current_frame).add_color_override("font_color", Color("#3c5d75")) + if current_frame < layers[current_layer][2].get_child_count(): + layers[current_layer][2].get_child(current_frame).pressed = true func layer_changed(value : int) -> void: current_layer = value @@ -597,6 +603,9 @@ func layer_changed(value : int) -> void: merge_down_layer_button.disabled = true merge_down_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN + yield(get_tree().create_timer(0.01), "timeout") + self.current_frame = current_frame # Call frame_changed to update UI + func create_brush_button(brush_img : Image, brush_type := Brush_Types.CUSTOM, hint_tooltip := "") -> void: var brush_container var brush_button = load("res://Prefabs/BrushButton.tscn").instance() From 9812a34b8b8211436ffc823f08840e1c238824c8 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Fri, 6 Mar 2020 20:56:25 +0200 Subject: [PATCH 23/32] Fixed exporting PNGs --- Prefabs/AnimationTimeline.tscn | 4 ++++ Scripts/Dialogs/ExportSprites.gd | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Prefabs/AnimationTimeline.tscn b/Prefabs/AnimationTimeline.tscn index d50eebab1..83ac13a49 100644 --- a/Prefabs/AnimationTimeline.tscn +++ b/Prefabs/AnimationTimeline.tscn @@ -86,6 +86,9 @@ margin_bottom = 620.0 rect_min_size = Vector2( 0, 200 ) size_flags_horizontal = 3 script = ExtResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} [node name="VSeparator" type="VSeparator" parent="."] anchor_bottom = 1.0 @@ -181,6 +184,7 @@ texture_hover = ExtResource( 16 ) texture_disabled = ExtResource( 17 ) [node name="AnimationTags" type="VBoxContainer" parent="AnimationContainer/TimelineContainer/LayerButtons"] +visible = false margin_left = 216.0 margin_right = 326.0 margin_bottom = 32.0 diff --git a/Scripts/Dialogs/ExportSprites.gd b/Scripts/Dialogs/ExportSprites.gd index 279461c43..b7040ad15 100644 --- a/Scripts/Dialogs/ExportSprites.gd +++ b/Scripts/Dialogs/ExportSprites.gd @@ -77,7 +77,7 @@ func save_sprite(canvas : Canvas, path : String) -> void: for layer in canvas.layers: var img : Image = layer[0] img.lock() - if layer[4] < 1: # If we have layer transparency + if layer[2] < 1: # If we have layer transparency for xx in img.get_size().x: for yy in img.get_size().y: var pixel_color := img.get_pixel(xx, yy) @@ -132,7 +132,7 @@ func save_spritesheet() -> void: for layer in canvas.layers: var img : Image = layer[0] img.lock() - if layer[4] < 1: # If we have layer transparency + if layer[2] < 1: # If we have layer transparency for xx in img.get_size().x: for yy in img.get_size().y: var pixel_color := img.get_pixel(xx, yy) From 4969978f4669d453ff5a80b91b610de18a3df9fb Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Fri, 6 Mar 2020 22:44:48 +0200 Subject: [PATCH 24/32] Fix issue with frame moving and current_frame not changing This bug actually originates from before the timeline remake and can be found in v0.6.2 and potentially earlier versions. --- Scripts/FrameButton.gd | 4 ++++ Scripts/Global.gd | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Scripts/FrameButton.gd b/Scripts/FrameButton.gd index 3dbfa87fc..b417c526f 100644 --- a/Scripts/FrameButton.gd +++ b/Scripts/FrameButton.gd @@ -126,6 +126,10 @@ func change_frame_order(rate : int) -> void: Global.undo_redo.add_do_property(Global.canvases[frame], "frame", change) Global.undo_redo.add_do_property(Global.canvases[change], "frame", frame) + if Global.current_frame == frame: + Global.undo_redo.add_do_property(Global, "current_frame", change) + Global.undo_redo.add_undo_property(Global, "current_frame", Global.current_frame) + Global.undo_redo.add_undo_property(Global, "canvases", Global.canvases) Global.undo_redo.add_undo_property(Global.canvases[frame], "frame", frame) Global.undo_redo.add_undo_property(Global.canvases[change], "frame", change) diff --git a/Scripts/Global.gd b/Scripts/Global.gd index 0ef82b5d5..2c5d1f1cf 100644 --- a/Scripts/Global.gd +++ b/Scripts/Global.gd @@ -495,7 +495,6 @@ func canvases_changed(value : Array) -> void: var frame_button = load("res://Prefabs/FrameButton.tscn").instance() frame_button.frame = j frame_button.layer = i - frame_button.pressed = true frame_button.get_child(0).texture = Global.canvases[j].layers[i][1] layers[i][2].add_child(frame_button) From 2f072593896b3ca39391a413d033061a6fbd10c4 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Fri, 6 Mar 2020 23:11:21 +0200 Subject: [PATCH 25/32] Importing PNGs should now work --- Scripts/Dialogs/ImportSprites.gd | 14 ++++++++++++++ Scripts/Main.gd | 5 ----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Scripts/Dialogs/ImportSprites.gd b/Scripts/Dialogs/ImportSprites.gd index c0f2e4822..99802090a 100644 --- a/Scripts/Dialogs/ImportSprites.gd +++ b/Scripts/Dialogs/ImportSprites.gd @@ -57,6 +57,19 @@ func _on_ImportSprites_files_selected(paths : PoolStringArray) -> void: tex.create_from_image(image, 0) # Store [Image, ImageTexture, Opacity] canvas.layers.append([image, tex, 1]) + + for _i in range(1, Global.layers.size()): + var empty_sprite := Image.new() + empty_sprite.create(canvas.size.x, canvas.size.y, false, Image.FORMAT_RGBA8) + empty_sprite.fill(Color(0, 0, 0, 0)) + empty_sprite.lock() + + var empty_tex := ImageTexture.new() + empty_tex.create_from_image(empty_sprite, 0) + + # Store [Image, ImageTexture, Opacity] + canvas.layers.append([empty_sprite, empty_tex, 1]) + canvas.frame = i Global.canvases.append(canvas) Global.canvas_parent.add_child(canvas) @@ -107,6 +120,7 @@ func _on_ImportSprites_files_selected(paths : PoolStringArray) -> void: Global.canvases[Global.canvases.size() - 1].camera_zoom() + Global.canvases = Global.canvases # Just to call Global.canvases_changed Global.current_frame = i - 1 Global.canvas = Global.canvases[Global.canvases.size() - 1] Global.canvas.visible = true diff --git a/Scripts/Main.gd b/Scripts/Main.gd index 2e860bd7a..f65a292a8 100644 --- a/Scripts/Main.gd +++ b/Scripts/Main.gd @@ -553,11 +553,6 @@ func _on_SaveSprite_file_selected(path : String) -> void: _on_QuitDialog_confirmed() func clear_canvases() -> void: - for child in Global.vbox_layer_container.get_children(): - if child is PanelContainer: - child.queue_free() - for child in Global.frame_containers.get_children(): - child.queue_free() for child in Global.canvas_parent.get_children(): if child is Canvas: child.queue_free() From baa8cfbf6317f32203c23748d0664025581fb051 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Fri, 6 Mar 2020 23:24:21 +0200 Subject: [PATCH 26/32] Importing spritesheets now works --- Scripts/Dialogs/ImportSprites.gd | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Scripts/Dialogs/ImportSprites.gd b/Scripts/Dialogs/ImportSprites.gd index 99802090a..8696ad382 100644 --- a/Scripts/Dialogs/ImportSprites.gd +++ b/Scripts/Dialogs/ImportSprites.gd @@ -109,8 +109,20 @@ func _on_ImportSprites_files_selected(paths : PoolStringArray) -> void: cropped_image.lock() var tex := ImageTexture.new() tex.create_from_image(cropped_image, 0) - # Store [Image, ImageTexture, Layer Name, Visibity boolean, Opacity] - canvas.layers.append([cropped_image, tex, tr("Layer") + " 0", true, 1]) + # Store [Image, ImageTexture, Opacity] + canvas.layers.append([cropped_image, tex, 1]) + for _i in range(1, Global.layers.size()): + var empty_sprite := Image.new() + empty_sprite.create(canvas.size.x, canvas.size.y, false, Image.FORMAT_RGBA8) + empty_sprite.fill(Color(0, 0, 0, 0)) + empty_sprite.lock() + + var empty_tex := ImageTexture.new() + empty_tex.create_from_image(empty_sprite, 0) + + # Store [Image, ImageTexture, Opacity] + canvas.layers.append([empty_sprite, empty_tex, 1]) + canvas.frame = i Global.canvases.append(canvas) Global.canvas_parent.add_child(canvas) From 0619d0e1ad17d9322d908200704815e82d956105 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Sat, 7 Mar 2020 02:58:52 +0200 Subject: [PATCH 27/32] Opening and saving .pxo file should now work This should be all of the functionality restored. This commit makes the branch stable, in theory. --- Scripts/Global.gd | 1 - Scripts/Main.gd | 60 ++++++++++++++++++++++++++++++----------------- project.godot | 2 +- 3 files changed, 40 insertions(+), 23 deletions(-) diff --git a/Scripts/Global.gd b/Scripts/Global.gd index 2c5d1f1cf..7e629517a 100644 --- a/Scripts/Global.gd +++ b/Scripts/Global.gd @@ -375,7 +375,6 @@ func _ready() -> void: # Store [Layer name, Layer visibility boolean, Frame container] layers.append([tr("Layer") + " 0", true, HBoxContainer.new()]) - frames_container.add_child(layers[0][2]) # Thanks to https://godotengine.org/qa/17524/how-to-find-an-instanced-scene-by-its-name func find_node_by_name(root, node_name) -> Node: diff --git a/Scripts/Main.gd b/Scripts/Main.gd index f65a292a8..b079798c4 100644 --- a/Scripts/Main.gd +++ b/Scripts/Main.gd @@ -399,7 +399,18 @@ func _on_OpenSprite_file_selected(path : String) -> void: var version_number = float(version.substr(1, 3)) # Example, "0.6" if current_version_number < 0.5: OS.alert("File is from an older version of Pixelorama, as such it might not work properly") + var frame := 0 + Global.layers.clear() + if (version_number - 0.01) > 0.6: + var global_layer_line := file.get_line() + while global_layer_line == ".": + var layer_name := file.get_line() + var layer_visibility := file.get_8() + # Store [Layer name, Layer visibility boolean, Frame container] + Global.layers.append([layer_name, layer_visibility, HBoxContainer.new()]) + global_layer_line = file.get_line() + var frame_line := file.get_line() clear_canvases() while frame_line == "--": # Load frames @@ -407,12 +418,14 @@ func _on_OpenSprite_file_selected(path : String) -> void: Global.canvas = canvas var width := file.get_16() var height := file.get_16() - print(width, height) var layer_line := file.get_line() while layer_line == "-": # Load layers var buffer := file.get_buffer(width * height * 4) - var layer_name := file.get_line() + if version_number < (0.7 - 0.01): + var layer_name_old_version = file.get_line() + if frame == 0: + Global.layers.append([layer_name_old_version, true, HBoxContainer.new()]) var layer_transparency := 1.0 if version_number > 0.5: layer_transparency = file.get_float() @@ -421,7 +434,7 @@ func _on_OpenSprite_file_selected(path : String) -> void: image.lock() var tex := ImageTexture.new() tex.create_from_image(image, 0) - canvas.layers.append([image, tex, layer_name, true, layer_transparency]) + canvas.layers.append([image, tex, layer_transparency]) layer_line = file.get_line() var guide_line := file.get_line() # "guideline" no pun intended @@ -446,7 +459,9 @@ func _on_OpenSprite_file_selected(path : String) -> void: frame_line = file.get_line() frame += 1 + Global.canvases = Global.canvases # Just to call Global.canvases_changed Global.current_frame = frame - 1 + Global.layers = Global.layers # Just to call Global.layers_changed # Load tool options Global.left_color_picker.color = file.get_var() Global.right_color_picker.color = file.get_var() @@ -454,12 +469,13 @@ func _on_OpenSprite_file_selected(path : String) -> void: Global.left_brush_size_edit.value = Global.left_brush_size Global.right_brush_size = file.get_8() Global.right_brush_size_edit.value = Global.right_brush_size - var left_palette = file.get_var() - var right_palette = file.get_var() - for color in left_palette: - Global.left_color_picker.get_picker().add_preset(color) - for color in right_palette: - Global.right_color_picker.get_picker().add_preset(color) + if version_number < (0.7 - 0.01): + var left_palette = file.get_var() + var right_palette = file.get_var() + for color in left_palette: + Global.left_color_picker.get_picker().add_preset(color) + for color in right_palette: + Global.right_color_picker.get_picker().add_preset(color) # Load custom brushes Global.custom_brushes.resize(Global.brushes_from_files) @@ -498,15 +514,21 @@ func _on_SaveSprite_file_selected(path : String) -> void: var err := file.open(path, File.WRITE) if err == OK: file.store_line(ProjectSettings.get_setting("application/config/Version")) + + for layer in Global.layers: # Store Global layers + file.store_line(".") + file.store_line(layer[0]) # Layer name + file.store_8(layer[1]) # Layer visibility + file.store_line("END_GLOBAL_LAYERS") + for canvas in Global.canvases: # Store frames file.store_line("--") file.store_16(canvas.size.x) file.store_16(canvas.size.y) - for layer in canvas.layers: # Store layers + for layer in canvas.layers: # Store canvas layers file.store_line("-") file.store_buffer(layer[0].get_data()) - file.store_line(layer[2]) # Layer name - file.store_float(layer[4]) # Layer transparency + file.store_float(layer[2]) # Layer transparency file.store_line("END_LAYERS") for child in canvas.get_children(): # Store guides @@ -523,19 +545,15 @@ func _on_SaveSprite_file_selected(path : String) -> void: file.store_line("END_FRAMES") # Save tool options - var left_color: Color = Global.left_color_picker.color - var right_color: Color = Global.right_color_picker.color - var left_brush_size: int = Global.left_brush_size - var right_brush_size: int = Global.right_brush_size - var left_palette: PoolColorArray = Global.left_color_picker.get_picker().get_presets() - var right_palette: PoolColorArray = Global.right_color_picker.get_picker().get_presets() + var left_color : Color = Global.left_color_picker.color + var right_color : Color = Global.right_color_picker.color + var left_brush_size : int = Global.left_brush_size + var right_brush_size : int = Global.right_brush_size file.store_var(left_color) file.store_var(right_color) file.store_8(left_brush_size) file.store_8(right_brush_size) - file.store_var(left_palette) - file.store_var(right_palette) - #Save custom brushes + # Save custom brushes for i in range(Global.brushes_from_files, Global.custom_brushes.size()): var brush = Global.custom_brushes[i] file.store_line("/") diff --git a/project.godot b/project.godot index e540c559b..ec399819f 100644 --- a/project.godot +++ b/project.godot @@ -53,7 +53,7 @@ boot_splash/bg_color=Color( 0.145098, 0.145098, 0.164706, 1 ) config/icon="res://icon.png" config/macos_native_icon="res://icon.icns" config/windows_native_icon="res://icon.ico" -config/Version="v0.6.2" +config/Version="v0.7" [autoload] From 321ac978f18bd96e6743728112a5af84bf2d122a Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Sun, 8 Mar 2020 21:25:09 +0200 Subject: [PATCH 28/32] Fixed crash when removing the first layer Global.current_layer was being set to -1 --- Scripts/AnimationTimeline.gd | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Scripts/AnimationTimeline.gd b/Scripts/AnimationTimeline.gd index cf7337e00..54774a338 100644 --- a/Scripts/AnimationTimeline.gd +++ b/Scripts/AnimationTimeline.gd @@ -183,7 +183,10 @@ func _on_RemoveLayer_pressed() -> void: new_layers.remove(Global.current_layer) Global.undos += 1 Global.undo_redo.create_action("Remove Layer") - Global.undo_redo.add_do_property(Global, "current_layer", Global.current_layer - 1) + if Global.current_layer > 0: + Global.undo_redo.add_do_property(Global, "current_layer", Global.current_layer - 1) + else: + Global.undo_redo.add_do_property(Global, "current_layer", Global.current_layer) for c in Global.canvases: var new_canvas_layers : Array = c.layers.duplicate() From 3b68698be3c9bcee8803a025cbf83eec93633eb7 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Sun, 8 Mar 2020 21:41:01 +0200 Subject: [PATCH 29/32] Removed legacy FrameContainer.tscn --- Prefabs/FrameButton.tscn | 3 +++ Prefabs/FrameContainer.tscn | 18 ------------------ 2 files changed, 3 insertions(+), 18 deletions(-) delete mode 100644 Prefabs/FrameContainer.tscn diff --git a/Prefabs/FrameButton.tscn b/Prefabs/FrameButton.tscn index c1555f298..68225065c 100644 --- a/Prefabs/FrameButton.tscn +++ b/Prefabs/FrameButton.tscn @@ -13,6 +13,9 @@ size_flags_vertical = 0 toggle_mode = true button_mask = 7 script = ExtResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} [node name="FrameTexture" type="TextureRect" parent="."] margin_left = 2.0 diff --git a/Prefabs/FrameContainer.tscn b/Prefabs/FrameContainer.tscn deleted file mode 100644 index 01387acad..000000000 --- a/Prefabs/FrameContainer.tscn +++ /dev/null @@ -1,18 +0,0 @@ -[gd_scene load_steps=2 format=2] - -[ext_resource path="res://Prefabs/FrameButton.tscn" type="PackedScene" id=1] - -[node name="FrameContainer" type="VBoxContainer"] -margin_right = 32.0 -margin_bottom = 50.0 - -[node name="FrameID" type="Label" parent="."] -margin_right = 36.0 -margin_bottom = 17.0 -rect_min_size = Vector2( 0, 17 ) -text = "0" -align = 1 - -[node name="FrameButton" parent="." instance=ExtResource( 1 )] -margin_top = 21.0 -margin_bottom = 57.0 From b9b0d3e1b3c632415504da53e608b7ed60bc2d6a Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Sun, 8 Mar 2020 21:57:22 +0200 Subject: [PATCH 30/32] Small UI improvement - The visibility icon will remain in a fixed place no matter how long the layer name is. --- Prefabs/LayerContainer.tscn | 54 ++++++++++++++++++++++++------------- Scripts/Global.gd | 4 +-- Scripts/LayerContainer.gd | 11 +++++--- 3 files changed, 45 insertions(+), 24 deletions(-) diff --git a/Prefabs/LayerContainer.tscn b/Prefabs/LayerContainer.tscn index b9a5d530b..439554a80 100644 --- a/Prefabs/LayerContainer.tscn +++ b/Prefabs/LayerContainer.tscn @@ -8,27 +8,32 @@ margin_right = 210.0 margin_bottom = 36.0 rect_min_size = Vector2( 212, 36 ) +size_flags_horizontal = 0 toggle_mode = true script = ExtResource( 1 ) __meta__ = { -"_edit_horizontal_guides_": [ ] +"_edit_horizontal_guides_": [ ], +"_edit_use_anchors_": false } [node name="HBoxContainer" type="HBoxContainer" parent="."] -anchor_top = 0.5 anchor_right = 1.0 -anchor_bottom = 0.5 -margin_top = -16.0 -margin_bottom = 16.0 -mouse_default_cursor_shape = 2 -alignment = 1 +anchor_bottom = 1.0 +size_flags_horizontal = 0 +__meta__ = { +"_edit_use_anchors_": false +} -[node name="VisibilityButton" type="TextureButton" parent="HBoxContainer" groups=[ +[node name="LayerButtons" type="HBoxContainer" parent="HBoxContainer"] +margin_right = 32.0 +margin_bottom = 36.0 + +[node name="VisibilityButton" type="TextureButton" parent="HBoxContainer/LayerButtons" groups=[ "UIButtons", ]] -margin_left = 65.0 -margin_right = 97.0 -margin_bottom = 32.0 +margin_top = 2.0 +margin_right = 32.0 +margin_bottom = 34.0 hint_tooltip = "LAYERVISIBILITY_HT" mouse_default_cursor_shape = 2 size_flags_horizontal = 0 @@ -36,15 +41,28 @@ size_flags_vertical = 4 texture_normal = ExtResource( 2 ) texture_hover = ExtResource( 3 ) -[node name="Label" type="Label" parent="HBoxContainer"] -margin_left = 101.0 -margin_top = 9.0 -margin_right = 147.0 -margin_bottom = 23.0 +[node name="LayerName" type="HBoxContainer" parent="HBoxContainer"] +margin_left = 36.0 +margin_right = 212.0 +margin_bottom = 36.0 +rect_min_size = Vector2( 176, 0 ) +mouse_default_cursor_shape = 2 +size_flags_horizontal = 0 +alignment = 1 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Label" type="Label" parent="HBoxContainer/LayerName"] +margin_top = 11.0 +margin_right = 176.0 +margin_bottom = 25.0 +size_flags_horizontal = 3 text = "Layer 0" align = 1 +clip_text = true -[node name="LineEdit" type="LineEdit" parent="HBoxContainer"] +[node name="LineEdit" type="LineEdit" parent="HBoxContainer/LayerName"] visible = false margin_left = 86.0 margin_top = 5.0 @@ -57,4 +75,4 @@ editable = false caret_blink = true caret_blink_speed = 0.5 [connection signal="pressed" from="." to="." method="_on_LayerContainer_pressed"] -[connection signal="pressed" from="HBoxContainer/VisibilityButton" to="." method="_on_VisibilityButton_pressed"] +[connection signal="pressed" from="HBoxContainer/LayerButtons/VisibilityButton" to="." method="_on_VisibilityButton_pressed"] diff --git a/Scripts/Global.gd b/Scripts/Global.gd index 7e629517a..41f1edf06 100644 --- a/Scripts/Global.gd +++ b/Scripts/Global.gd @@ -516,9 +516,9 @@ func layers_changed(value : Array) -> void: if !layers[i][0]: layers[i][0] = tr("Layer") + " %s" % i - layer_container.get_child(0).get_child(1).text = layers[i][0] - layer_container.get_child(0).get_child(2).text = layers[i][0] layers_container.add_child(layer_container) + layer_container.label.text = layers[i][0] + layer_container.line_edit.text = layers[i][0] frames_container.add_child(layers[i][2]) for j in range(canvases.size()): diff --git a/Scripts/LayerContainer.gd b/Scripts/LayerContainer.gd index e518f7f96..9d9bef92a 100644 --- a/Scripts/LayerContainer.gd +++ b/Scripts/LayerContainer.gd @@ -4,12 +4,15 @@ extends Button var i := 0 # warning-ignore:unused_class_variable var currently_selected := false - -onready var visibility_button := $HBoxContainer/VisibilityButton -onready var label := $HBoxContainer/Label -onready var line_edit := $HBoxContainer/LineEdit +var visibility_button : BaseButton +var label : Label +var line_edit : LineEdit func _ready() -> void: + visibility_button = Global.find_node_by_name(self, "VisibilityButton") + label = Global.find_node_by_name(self, "Label") + line_edit = Global.find_node_by_name(self, "LineEdit") + if Global.layers[i][1]: visibility_button.texture_normal = load("res://Assets/Graphics/%s Themes/Layers/Layer_Visible.png" % Global.theme_type) visibility_button.texture_hover = load("res://Assets/Graphics/%s Themes/Layers/Layer_Visible_Hover.png" % Global.theme_type) From a9c57d27e53b61c6ef8fd569bbd817eb1936dc74 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Sun, 8 Mar 2020 22:03:31 +0200 Subject: [PATCH 31/32] Removed frame_changed method from Canvas.gd --- Scripts/Canvas.gd | 7 +------ Scripts/LayerContainer.gd | 2 -- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/Scripts/Canvas.gd b/Scripts/Canvas.gd index 180d9e8dd..28a850eee 100644 --- a/Scripts/Canvas.gd +++ b/Scripts/Canvas.gd @@ -6,7 +6,7 @@ var current_layer_index := 0 var location := Vector2.ZERO var size := Vector2(64, 64) var fill_color := Color(0, 0, 0, 0) -var frame := 0 setget frame_changed +var frame := 0 var current_pixel := Vector2.ZERO # pretty much same as mouse_pos, but can be accessed externally var previous_mouse_pos := Vector2.ZERO var previous_mouse_pos_for_lines := Vector2.ZERO @@ -496,11 +496,6 @@ func update_texture(layer_index : int) -> void: frame_texture_rect = Global.find_node_by_name(Global.layers[layer_index][2].get_child(frame),"FrameTexture") frame_texture_rect.texture = layers[layer_index][1] -func frame_changed(value : int) -> void: - frame = value -# if frame_button: -# frame_button.get_node("FrameButton").frame = frame -# frame_button.get_node("FrameID").text = str(frame + 1) func get_layer_container(layer_index : int) -> LayerContainer: for container in Global.vbox_layer_container.get_children(): diff --git a/Scripts/LayerContainer.gd b/Scripts/LayerContainer.gd index 9d9bef92a..d03e24af5 100644 --- a/Scripts/LayerContainer.gd +++ b/Scripts/LayerContainer.gd @@ -2,8 +2,6 @@ class_name LayerContainer extends Button var i := 0 -# warning-ignore:unused_class_variable -var currently_selected := false var visibility_button : BaseButton var label : Label var line_edit : LineEdit From 6b73c59a8f20a8dc0a0516eb641f78f540e86006 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Sun, 8 Mar 2020 22:12:18 +0200 Subject: [PATCH 32/32] Removed some commented code --- Scripts/Global.gd | 2 -- 1 file changed, 2 deletions(-) diff --git a/Scripts/Global.gd b/Scripts/Global.gd index 41f1edf06..5b02db826 100644 --- a/Scripts/Global.gd +++ b/Scripts/Global.gd @@ -446,8 +446,6 @@ func redo(_canvases : Array, layer_index : int = -1) -> void: if action_name == "Add Frame": canvas_parent.add_child(_canvases[0]) - #if !frames_container.is_a_parent_of(_canvases[0].frame_button): - # frames_container.add_child(_canvases[0].frame_button) elif action_name == "Remove Frame": canvas_parent.remove_child(_canvases[0]) if canvases.size() == 1: # Stop animating