From 719d29526f42da78bf82abf12482d27c5ec6ebba Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Wed, 11 Dec 2019 01:00:26 +0200 Subject: [PATCH] Updated custom tool cursors & changed rectangle selection tool - Also fixed a small translation bug with the menu items, for real this time - Fixed a bug with the brush color not being updated when using the custom color picker tool - The pixel indicators only appear for Pencil, Eraser and LightenDarken tools - Small UI margin changes. --- Assets/Graphics/Tools/Bucket_Cursor.png | Bin 311 -> 759 bytes Assets/Graphics/Tools/ColorPicker_Cursor.png | Bin 253 -> 736 bytes Assets/Graphics/Tools/Eraser_Cursor.png | Bin 251 -> 713 bytes .../Graphics/Tools/LightenDarken_Cursor.png | Bin 289 -> 724 bytes Assets/Graphics/Tools/Pencil_Cursor.png | Bin 259 -> 742 bytes Assets/Graphics/Tools/RectSelect_Cursor.png | Bin 132 -> 635 bytes Main.tscn | 80 ++++++++++-------- Scripts/Canvas.gd | 16 ++-- Scripts/Main.gd | 48 +++++------ Scripts/SelectionRectangle.gd | 5 ++ 10 files changed, 84 insertions(+), 65 deletions(-) diff --git a/Assets/Graphics/Tools/Bucket_Cursor.png b/Assets/Graphics/Tools/Bucket_Cursor.png index df02839996aac4ab876e1c9eee244958cab5c7ca..eb2bbc4f7d51ca6bdec2260c306b0b944175261f 100644 GIT binary patch literal 759 zcmVEX>4Tx04R}tkv&MmKpe$iQ$;Nm5j#k6$WWauh>AE$6^me@v=v%)FuC*#nlvOS zE{=k0!NHHks)LKOt`4q(Aou~|;_9U6A|?JWDYS_3;J6>}?mh0_0Yam~RI_UWP&La) z#baVNw<`9$B8UJ6(TA|aOg)ia%)oPe-NVP%yC~1{KKJM7SMnwUd?N82(+!JwgLr1s z(mC%FhgeBch|h_~4Z0xlBiCh@-#8Z?7I5bWxZDATpLEHP9LY~pC=`JAGy0|+Fmww9*4*A&`#607GSt=b4RCM> zj1?(+-Q(T8oxS~grq$mMK)rI4xdiSg00006VoOIv0RI600RN!9r;`8x010qNS#tmY zE+YT{E+YYWr9XB6000McNliru;|vNCCeSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{007TPL_t(I%dOST4TK;N1>m>S4i{RXB11wyw8DjY*ozQU z1|RH_m`DuY@FOz-*UI_O?ZcokMgV|wjvWJ8nZ+5P`~zNEJ`1-k*a;{bD77V`p*d&d zoVRh&&|eQzc2MsN54gwc z^(-L-6-_Atzylqvu3r28-j@)<105~@4IL$vDbAu=rW)ca=qv?Z@Ky9Jw>EqgWs>&g pZ(&iof>fME=`yohp4hfjP`}`2q|Zlci{bzP002ovPDHLkV1nhlNWcI9 literal 311 zcmV-70m%M|P)X1^@s6FWx?20002~Nkl&j(9iRc(1K&N%baoj~P^P~4xqzlbpvxxWJ4PS;9WEX>4Tx04R}tkv&MmKpe$iQ$;Nm5j#k6$WWauh>AE$6^me@v=v%)FuC*#nlvOS zE{=k0!NHHks)LKOt`4q(Aou~|;_9U6A|?JWDYS_3;J6>}?mh0_0Yam~RI_UWP&La) z#baVNw<`9$B8UJ6(TA|aOg)ia%)oPe-NVP%yC~1{KKJM7SMnwUd?N82(+!JwgLr1s z(mC%FhgeBch|h_~4Z0xlBiCh@-#8Z?7I5bWxZDATpLEHP9LY~pC=`JAGy0|+Fmww9*4*A&`#607GSt=b4RCM> zj1?(+-Q(T8oxS~grq$mMK)rI4xdiSg00006VoOIv0RI3b04mlRF)jcA010qNS#tmY zE+YT{E+YYWr9XB6000McNliru;|vNCAUPvy6eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{006j2L_t(I%dON=4uBvC08nTh$g6lCe%!ndSMf&llTIrY zG`_5{7ZHK5A5xw1byx*sjO7Lq6>}Aq8muGZ_$ON9hw_!h`t(y<9TB~HI*LPEffmd? zp22u0nsCchhz7Nen=mtY?_n}xrXNI@xm-N)FHrOG8WaG4nL*og)S`8CD#uyHQ}j74 znu=BE$7aJ3+@K+ZCNZUCT3R_#oO9hIE1HvkN2j}D6&=DmXcyi^OOH2}Q#US&WL}F_ SL^1dP0000pfUWFSuiwP4%ffjK7N+Wr%t&I{kCdPQ?Yi1?@pxxjy%uLII z7Ch%z6^vr)AXl5`JE|U->_7v~g_z%g7CtS|N~YITL{9HL^;WaIHwi@K2dyPF*eodF z7Kuvm1lLN2YdV5ILCbVI(7;D&9@+tK3QBkg;qok{WZJyjVdq@4ax45M*bN7iAG=w& zO0WVS3RdBl^ya^k<4rgKPz~QY7X0C-58ykZx5o4VT}5j<>{}!U00000NkvXXu0mjf D^6h0N diff --git a/Assets/Graphics/Tools/Eraser_Cursor.png b/Assets/Graphics/Tools/Eraser_Cursor.png index f6abcc245720692bde0408fafb9cf052cf29ac5a..527629e5fc560d66622bb487834f0ca9c615247d 100644 GIT binary patch literal 713 zcmV;)0yh1LP)EX>4Tx04R}tkv&MmKpe$iQ$;Nm5j#k6$WWauh>AE$6^me@v=v%)FuC*#nlvOS zE{=k0!NHHks)LKOt`4q(Aou~|;_9U6A|?JWDYS_3;J6>}?mh0_0Yam~RI_UWP&La) z#baVNw<`9$B8UJ6(TA|aOg)ia%)oPe-NVP%yC~1{KKJM7SMnwUd?N82(+!JwgLr1s z(mC%FhgeBch|h_~4Z0xlBiCh@-#8Z?7I5bWxZDATpLEHP9LY~pC=`JAGy0|+Fmww9*4*A&`#607GSt=b4RCM> zj1?(+-Q(T8oxS~grq$mMK)rI4xdiSg00006VoOIv0RI600RN!9r;`8x010qNS#tmY zE+YT{E+YYWr9XB6000McNliru;|vNCD++&3t$+Xk02y>eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{005y$L_t(I%eB=(4#Xe`1yJY>xsOZl^H1Y>?50kvm1==u zWiY-N^+zUq)o#q=BwJAcR7xQtqLk9ZVlUci#5n?;;T(mII7gyAeng|Kj(?!5Gd7{C zGj^fcj@{@C4nfDus{lwu+-TpZ0Desop`5cBZOt3Hi@%|-?-)Q^{25&aWQOmcJITA@ vyQq43v$|djTOzIEUr{w6UQ~^A#J_j~TCRGCc#NrK00000NkvXXu0mjfL;W%J literal 251 zcmeAS@N?(olHy`uVBq!ia0vp^QXtI11|(N{`J4k%hdf;zLp(ayUJ2xL5#(uoc>m3X zI-6VlS0m2PRTp;NscY+hsY8FMV1b9`)6CZr$rHYH91UJ_jmyC+)9O3dqzTgmt=q~v zT4WuiQjVON!1~fqxTI;ziiOfHymytfPB2&2D(kbD$yO?PpO9w!;on5~BY?NgZDC-cbc6N|p(_A_wy>td!ptH75_lyOCn-vxS y#ncz?m(ACI!hb1Y`3aV{8>C%YRNja&{$M&gVUa|#cwQyYHw>PxelF{r5}E+?LS3W) diff --git a/Assets/Graphics/Tools/LightenDarken_Cursor.png b/Assets/Graphics/Tools/LightenDarken_Cursor.png index 219b9fbdee5617024c0f34b56749085065188ecb..b6c073b34997229888d386da7882c6b455629e80 100644 GIT binary patch literal 724 zcmV;_0xSKAP)EX>4Tx04R}tkv&MmKpe$iQ$;Nm5j#k6$WWauh>AE$6^me@v=v%)FuC*#nlvOS zE{=k0!NHHks)LKOt`4q(Aou~|;_9U6A|?JWDYS_3;J6>}?mh0_0Yam~RI_UWP&La) z#baVNw<`9$B8UJ6(TA|aOg)ia%)oPe-NVP%yC~1{KKJM7SMnwUd?N82(+!JwgLr1s z(mC%FhgeBch|h_~4Z0xlBiCh@-#8Z?7I5bWxZDATpLEHP9LY~pC=`JAGy0|+Fmww9*4*A&`#607GSt=b4RCM> zj1?(+-Q(T8oxS~grq$mMK)rI4xdiSg00006VoOIv0RI600RN!9r;`8x010qNS#tmY zE+YT{E+YYWr9XB6000McNliru;|vNE8W}ktmtFt>02y>eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{0068>L_t(I%e|Dr5yK!11Wy_Ipanj3$CK{(&;pf^PbNb^ zmL)s*e#p$~21`eyKw7X0I>TSsB>Jb@(e*aR&M;E9 zz#RZW2;V|$4FKT1zYOjpaF(?JX`nI2pR)viWZXoz7T4qEIjw_I3fn-+3YFtowN`P_ z+^)^to)xC&_&kG{GmoU3%C*KVcVWp2W(w%eU+tC&;PeIoxj4OsNUMSX0000m?HSwP|WhlC}#ha2J!J%VQBj(0oG|L^KzGzPcPvl|MiDBzUT=Vc_?k`>ITZU&T`^w{$q`Y5Fp05oItE;v5K_SEX>4Tx04R}tkv&MmKpe$iQ$;Nm5j#k6$WWauh>AE$6^me@v=v%)FuC*#nlvOS zE{=k0!NHHks)LKOt`4q(Aou~|;_9U6A|?JWDYS_3;J6>}?mh0_0Yam~RI_UWP&La) z#baVNw<`9$B8UJ6(TA|aOg)ia%)oPe-NVP%yC~1{KKJM7SMnwUd?N82(+!JwgLr1s z(mC%FhgeBch|h_~4Z0xlBiCh@-#8Z?7I5bWxZDATpLEHP9LY~pC=`JAGy0|+Fmww9*4*A&`#607GSt=b4RCM> zj1?(+-Q(T8oxS~grq$mMK)rI4xdiSg00006VoOIv0RI600RN!9r;`8x010qNS#tmY zE+YT{E+YYWr9XB6000McNliru;|vNE94^<#mDd0O02y>eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{006#8L_t(I%dOSD4TUfaM$sGApzFxXPn_3Ei` YADw`FuuO>=@Bjb+07*qoM6N<$f)}ku@c;k- literal 259 zcmV+e0sQ`nP)HS!2* zLAs$1oDg^dK>$(m_0GQ{w#JNi*g@yrpy#ZTzrFTs0`I`U$002ov JPDHLkV1gErYRLcq diff --git a/Assets/Graphics/Tools/RectSelect_Cursor.png b/Assets/Graphics/Tools/RectSelect_Cursor.png index d7d2a1ee274dfcf3864b686202cb573fca5d10ce..ebb3fcce9f6a76a728d4120946ef0275a034d2cb 100644 GIT binary patch literal 635 zcmV->0)+jEP)EX>4Tx04R}tkv&MmKpe$iQ$;Nm5j#k6$WWauh>AE$6^me@v=v%)FuC*#nlvOS zE{=k0!NHHks)LKOt`4q(Aou~|;_9U6A|?JWDYS_3;J6>}?mh0_0Yam~RI_UWP&La) z#baVNw<`9$B8UJ6(TA|aOg)ia%)oPe-NVP%yC~1{KKJM7SMnwUd?N82(+!JwgLr1s z(mC%FhgeBch|h_~4Z0xlBiCh@-#8Z?7I5bWxZDATpLEHP9LY~pC=`JAGy0|+Fmww9*4*A&`#607GSt=b4RCM> zj1?(+-Q(T8oxS~grq$mMK)rI4xdiSg00006VoOIv0RI600RN!9r;`8x010qNS#tmY zE+YT{E+YYWr9XB6000McNliru;|vNEFbAweW)%Pc02y>eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{002`-L_t(I%k9-M3IHGoh2h`sf0uVeTXHFyG-&XF;3V=5 zYJl?~13(gzsO$k;lCRCv6|-!ku%v(=6jg~?gGXtKrf7<$_=+NX=ue8O*L0&O%LK2T Vh5dI32fF|O002ovPDHLkV1jQx3#kAA literal 132 zcmeAS@N?(olHy`uVBq!ia0vp^QXtI11|(N{`J4k%-kvUwAs(H{G5hQO*0Zs(wH-L% z;0C1GB<8>ToC#L`a diff --git a/Main.tscn b/Main.tscn index 9159c7470..754fa2021 100644 --- a/Main.tscn +++ b/Main.tscn @@ -214,7 +214,6 @@ rect_min_size = Vector2( 224, 0 ) size_flags_vertical = 3 [node name="Tools" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel"] -editor/display_folded = true anchor_right = 1.0 anchor_bottom = 1.0 margin_left = 8.0 @@ -336,16 +335,19 @@ button_mask = 3 texture_normal = ExtResource( 8 ) [node name="ColorAndToolOptions" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools"] +editor/display_folded = true margin_top = 159.0 margin_right = 208.0 margin_bottom = 612.0 size_flags_vertical = 3 custom_constants/separation = 8 +alignment = 1 [node name="ColorPickersCenter" type="CenterContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions"] editor/display_folded = true +margin_top = 35.0 margin_right = 208.0 -margin_bottom = 32.0 +margin_bottom = 67.0 [node name="ColorPickersHorizontal" type="HBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ColorPickersCenter"] margin_left = 27.0 @@ -401,17 +403,15 @@ flat = true color = Color( 1, 1, 1, 1 ) [node name="HSeparator" type="HSeparator" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions"] -margin_top = 40.0 +margin_top = 75.0 margin_right = 208.0 -margin_bottom = 44.0 +margin_bottom = 79.0 [node name="LeftToolOptions" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions"] editor/display_folded = true -margin_top = 52.0 +margin_top = 87.0 margin_right = 208.0 margin_bottom = 242.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 [node name="LeftLabel" type="Label" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/LeftToolOptions"] margin_right = 208.0 @@ -595,9 +595,7 @@ margin_bottom = 254.0 editor/display_folded = true margin_top = 262.0 margin_right = 208.0 -margin_bottom = 453.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 +margin_bottom = 417.0 [node name="RightLabel" type="Label" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/RightToolOptions"] margin_right = 208.0 @@ -787,6 +785,7 @@ size_flags_horizontal = 3 size_flags_vertical = 3 [node name="ViewportAndRulers" type="VBoxContainer" parent="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer"] +editor/display_folded = true margin_right = 704.0 margin_bottom = 478.0 size_flags_horizontal = 3 @@ -849,8 +848,11 @@ zoom = Vector2( 0.15, 0.15 ) script = ExtResource( 16 ) [node name="SelectionRectangle" type="Polygon2D" parent="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/ViewportandVerticalRuler/ViewportContainer/Viewport"] +visible = false z_index = 1 color = Color( 0.0823529, 0.694118, 0.623529, 0.592157 ) +invert_enable = true +invert_border = 0.5 polygon = PoolVector2Array( 0, 0, 0, 0, 0, 0, 0, 0 ) script = ExtResource( 17 ) @@ -1118,7 +1120,6 @@ rect_min_size = Vector2( 224, 0 ) anchor_right = 1.0 anchor_bottom = 1.0 margin_top = 16.0 -custom_constants/separation = 3 [node name="CanvasPreview" type="ViewportContainer" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc"] editor/display_folded = true @@ -1140,38 +1141,45 @@ zoom = Vector2( 0.15, 0.15 ) script = ExtResource( 16 ) [node name="LayerLabel" type="Label" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc"] -margin_top = 167.0 +margin_top = 168.0 margin_right = 224.0 -margin_bottom = 182.0 +margin_bottom = 183.0 size_flags_horizontal = 3 size_flags_vertical = 0 text = "Layers" align = 1 [node name="HSeparator" type="HSeparator" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc"] -margin_top = 185.0 +margin_top = 187.0 margin_right = 224.0 -margin_bottom = 189.0 +margin_bottom = 191.0 -[node name="CenterLayerButtons" type="CenterContainer" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc"] +[node name="LayerVBoxContainer" type="VBoxContainer" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc"] editor/display_folded = true -margin_top = 192.0 +margin_top = 195.0 margin_right = 224.0 -margin_bottom = 224.0 +margin_bottom = 604.0 +size_flags_vertical = 3 +custom_constants/separation = 6 -[node name="LayerButtons" type="HBoxContainer" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/CenterLayerButtons"] +[node name="CenterLayerButtons" type="CenterContainer" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/LayerVBoxContainer"] +editor/display_folded = true +margin_right = 224.0 +margin_bottom = 32.0 + +[node name="LayerButtons" type="HBoxContainer" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/LayerVBoxContainer/CenterLayerButtons"] margin_left = 6.0 margin_right = 218.0 margin_bottom = 32.0 -[node name="AddLayerButton" type="TextureButton" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/CenterLayerButtons/LayerButtons"] +[node name="AddLayerButton" type="TextureButton" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/LayerVBoxContainer/CenterLayerButtons/LayerButtons"] margin_right = 32.0 margin_bottom = 32.0 hint_tooltip = "LAYERNEW_HT" mouse_default_cursor_shape = 2 texture_normal = ExtResource( 29 ) -[node name="RemoveLayerButton" type="TextureButton" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/CenterLayerButtons/LayerButtons"] +[node name="RemoveLayerButton" type="TextureButton" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/LayerVBoxContainer/CenterLayerButtons/LayerButtons"] margin_left = 36.0 margin_right = 68.0 margin_bottom = 32.0 @@ -1181,7 +1189,7 @@ disabled = true texture_normal = ExtResource( 30 ) texture_disabled = ExtResource( 31 ) -[node name="MoveUpLayer" type="TextureButton" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/CenterLayerButtons/LayerButtons"] +[node name="MoveUpLayer" type="TextureButton" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/LayerVBoxContainer/CenterLayerButtons/LayerButtons"] margin_left = 72.0 margin_right = 104.0 margin_bottom = 32.0 @@ -1191,7 +1199,7 @@ disabled = true texture_normal = ExtResource( 32 ) texture_disabled = ExtResource( 33 ) -[node name="MoveDownLayer" type="TextureButton" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/CenterLayerButtons/LayerButtons"] +[node name="MoveDownLayer" type="TextureButton" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/LayerVBoxContainer/CenterLayerButtons/LayerButtons"] margin_left = 108.0 margin_right = 140.0 margin_bottom = 32.0 @@ -1201,7 +1209,7 @@ disabled = true texture_normal = ExtResource( 34 ) texture_disabled = ExtResource( 35 ) -[node name="CloneLayer" type="TextureButton" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/CenterLayerButtons/LayerButtons"] +[node name="CloneLayer" type="TextureButton" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/LayerVBoxContainer/CenterLayerButtons/LayerButtons"] margin_left = 144.0 margin_right = 176.0 margin_bottom = 32.0 @@ -1209,7 +1217,7 @@ hint_tooltip = "LAYERCLONE_HT" mouse_default_cursor_shape = 2 texture_normal = ExtResource( 36 ) -[node name="MergeDownLayer" type="TextureButton" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/CenterLayerButtons/LayerButtons"] +[node name="MergeDownLayer" type="TextureButton" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/LayerVBoxContainer/CenterLayerButtons/LayerButtons"] margin_left = 180.0 margin_right = 212.0 margin_bottom = 32.0 @@ -1219,14 +1227,14 @@ disabled = true texture_normal = ExtResource( 37 ) texture_disabled = ExtResource( 38 ) -[node name="ScrollLayers" type="ScrollContainer" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc"] -margin_top = 227.0 +[node name="ScrollLayers" type="ScrollContainer" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/LayerVBoxContainer"] +margin_top = 38.0 margin_right = 224.0 -margin_bottom = 604.0 +margin_bottom = 409.0 size_flags_horizontal = 3 size_flags_vertical = 3 -[node name="VBoxLayerContainer" type="VBoxContainer" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/ScrollLayers"] +[node name="VBoxLayerContainer" type="VBoxContainer" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/LayerVBoxContainer/ScrollLayers"] margin_right = 224.0 size_flags_horizontal = 3 @@ -1706,8 +1714,10 @@ dialog_text = "QUIT_LABEL" [node name="AnimationTimer" type="Timer" parent="."] [node name="LeftCursor" type="Sprite" parent="."] +visible = false [node name="RightCursor" type="Sprite" parent="."] +visible = false [connection signal="color_changed" from="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ColorPickersCenter/ColorPickersHorizontal/LeftColorPickerButton" to="." method="_on_LeftColorPickerButton_color_changed"] [connection signal="popup_closed" from="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ColorPickersCenter/ColorPickersHorizontal/LeftColorPickerButton" to="." method="_can_draw_true"] [connection signal="pressed" from="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ColorPickersCenter/ColorPickersHorizontal/LeftColorPickerButton" to="." method="_can_draw_false"] @@ -1752,12 +1762,12 @@ dialog_text = "QUIT_LABEL" [connection signal="value_changed" from="MenuAndUI/UI/CanvasAndTimeline/AnimationTimeline/AnimationContainer/OnionSkinningButtons/PastOnionSkinning" to="." method="_on_PastOnionSkinning_value_changed"] [connection signal="value_changed" from="MenuAndUI/UI/CanvasAndTimeline/AnimationTimeline/AnimationContainer/OnionSkinningButtons/FutureOnionSkinning" to="." method="_on_FutureOnionSkinning_value_changed"] [connection signal="toggled" from="MenuAndUI/UI/CanvasAndTimeline/AnimationTimeline/AnimationContainer/OnionSkinningButtons/BlueRedMode" to="." method="_on_BlueRedMode_toggled"] -[connection signal="pressed" from="MenuAndUI/UI/LayerPanel/LayersAndMisc/CenterLayerButtons/LayerButtons/AddLayerButton" to="." method="add_layer"] -[connection signal="pressed" from="MenuAndUI/UI/LayerPanel/LayersAndMisc/CenterLayerButtons/LayerButtons/RemoveLayerButton" to="." method="_on_RemoveLayerButton_pressed"] -[connection signal="pressed" from="MenuAndUI/UI/LayerPanel/LayersAndMisc/CenterLayerButtons/LayerButtons/MoveUpLayer" to="." method="change_layer_order" binds= [ 1 ]] -[connection signal="pressed" from="MenuAndUI/UI/LayerPanel/LayersAndMisc/CenterLayerButtons/LayerButtons/MoveDownLayer" to="." method="change_layer_order" binds= [ -1 ]] -[connection signal="pressed" from="MenuAndUI/UI/LayerPanel/LayersAndMisc/CenterLayerButtons/LayerButtons/CloneLayer" to="." method="add_layer" binds= [ false ]] -[connection signal="pressed" from="MenuAndUI/UI/LayerPanel/LayersAndMisc/CenterLayerButtons/LayerButtons/MergeDownLayer" to="." method="_on_MergeLayer_pressed"] +[connection signal="pressed" from="MenuAndUI/UI/LayerPanel/LayersAndMisc/LayerVBoxContainer/CenterLayerButtons/LayerButtons/AddLayerButton" to="." method="add_layer"] +[connection signal="pressed" from="MenuAndUI/UI/LayerPanel/LayersAndMisc/LayerVBoxContainer/CenterLayerButtons/LayerButtons/RemoveLayerButton" to="." method="_on_RemoveLayerButton_pressed"] +[connection signal="pressed" from="MenuAndUI/UI/LayerPanel/LayersAndMisc/LayerVBoxContainer/CenterLayerButtons/LayerButtons/MoveUpLayer" to="." method="change_layer_order" binds= [ 1 ]] +[connection signal="pressed" from="MenuAndUI/UI/LayerPanel/LayersAndMisc/LayerVBoxContainer/CenterLayerButtons/LayerButtons/MoveDownLayer" to="." method="change_layer_order" binds= [ -1 ]] +[connection signal="pressed" from="MenuAndUI/UI/LayerPanel/LayersAndMisc/LayerVBoxContainer/CenterLayerButtons/LayerButtons/CloneLayer" to="." method="add_layer" binds= [ false ]] +[connection signal="pressed" from="MenuAndUI/UI/LayerPanel/LayersAndMisc/LayerVBoxContainer/CenterLayerButtons/LayerButtons/MergeDownLayer" to="." method="_on_MergeLayer_pressed"] [connection signal="toggled" from="SplitScreenButton" to="." method="_on_SplitScreenButton_toggled"] [connection signal="confirmed" from="CreateNewImage" to="." method="_on_CreateNewImage_confirmed"] [connection signal="popup_hide" from="CreateNewImage" to="." method="_can_draw_true"] diff --git a/Scripts/Canvas.gd b/Scripts/Canvas.gd index a7f332eca..3156449ed 100644 --- a/Scripts/Canvas.gd +++ b/Scripts/Canvas.gd @@ -241,8 +241,10 @@ func _process(delta : float) -> void: var pixel_color : Color = layers[current_layer_index][0].get_pixelv(mouse_pos) if current_mouse_button == "left_mouse": Global.left_color_picker.color = pixel_color + Global.update_left_custom_brush() elif current_mouse_button == "right_mouse": Global.right_color_picker.color = pixel_color + Global.update_right_custom_brush() if !is_making_line: previous_mouse_pos = mouse_pos @@ -408,9 +410,10 @@ func _draw() -> void: mouse_pos = mouse_pos.floor() if Global.left_square_indicator_visible and Global.can_draw: if Global.current_left_brush_type == Global.BRUSH_TYPES.PIXEL: - 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) + 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) else: if Global.current_left_tool == "Pencil" || Global.current_left_tool == "Eraser": var custom_brush_size = Global.custom_left_brush_image.get_size() - Vector2.ONE @@ -419,9 +422,10 @@ func _draw() -> void: if Global.right_square_indicator_visible and Global.can_draw: if Global.current_right_brush_type == Global.BRUSH_TYPES.PIXEL: - 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) + if Global.current_right_tool == "Pencil" || Global.current_right_tool == "Eraser" || Global.current_left_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) else: if Global.current_right_tool == "Pencil" || Global.current_right_tool == "Eraser": var custom_brush_size = Global.custom_right_brush_image.get_size() - Vector2.ONE diff --git a/Scripts/Main.gd b/Scripts/Main.gd index c5bfe91da..3fea8a73e 100644 --- a/Scripts/Main.gd +++ b/Scripts/Main.gd @@ -24,7 +24,7 @@ func _ready() -> void: # This property is only available in 3.2alpha or later, so use `set()` to fail gracefully if it doesn't exist. OS.set("min_window_size", Vector2(1152, 648)) - #Make sure locales are always sorted, in the same order + # Make sure locales are always sorted, in the same order loaded_locales = TranslationServer.get_loaded_locales() loaded_locales.sort() @@ -44,33 +44,33 @@ func _ready() -> void: OS.window_size = config_cache.get_value("window", "size") var file_menu_items := { - tr("New...") : KEY_MASK_CTRL + KEY_N, - tr("Open...") : KEY_MASK_CTRL + KEY_O, - tr("Save...") : KEY_MASK_CTRL + KEY_S, - tr("Save as...") : KEY_MASK_SHIFT + KEY_MASK_CTRL + KEY_S, - tr("Import PNG...") : KEY_MASK_CTRL + KEY_I, - tr("Export PNG...") : KEY_MASK_CTRL + KEY_E, - tr("Export PNG as...") : KEY_MASK_SHIFT + KEY_MASK_CTRL + KEY_E, - tr("Quit") : KEY_MASK_CTRL + KEY_Q + "New..." : KEY_MASK_CTRL + KEY_N, + "Open..." : KEY_MASK_CTRL + KEY_O, + "Save..." : KEY_MASK_CTRL + KEY_S, + "Save as..." : KEY_MASK_SHIFT + KEY_MASK_CTRL + KEY_S, + "Import PNG..." : KEY_MASK_CTRL + KEY_I, + "Export PNG..." : KEY_MASK_CTRL + KEY_E, + "Export PNG as..." : KEY_MASK_SHIFT + KEY_MASK_CTRL + KEY_E, + "Quit" : KEY_MASK_CTRL + KEY_Q } var edit_menu_items := { - tr("Undo") : KEY_MASK_CTRL + KEY_Z, - tr("Redo") : KEY_MASK_SHIFT + KEY_MASK_CTRL + KEY_Z, - tr("Scale Image") : 0, - tr("Crop Image") : 0, - tr("Clear Selection") : 0, - tr("Flip Horizontal") : KEY_MASK_SHIFT + KEY_H, - tr("Flip Vertical") : KEY_MASK_SHIFT + KEY_V, - tr("Preferences") : 0 + "Undo" : KEY_MASK_CTRL + KEY_Z, + "Redo" : KEY_MASK_SHIFT + KEY_MASK_CTRL + KEY_Z, + "Scale Image" : 0, + "Crop Image" : 0, + "Clear Selection" : 0, + "Flip Horizontal" : KEY_MASK_SHIFT + KEY_H, + "Flip Vertical" : KEY_MASK_SHIFT + KEY_V, + "Preferences" : 0 } var view_menu_items := { - tr("Tile Mode") : KEY_MASK_CTRL + KEY_T, - tr("Show Grid") : KEY_MASK_CTRL + KEY_G, - tr("Show Rulers") : KEY_MASK_CTRL + KEY_R, - tr("Show Guides") : KEY_MASK_CTRL + KEY_Y + "Tile Mode" : KEY_MASK_CTRL + KEY_T, + "Show Grid" : KEY_MASK_CTRL + KEY_G, + "Show Rulers" : KEY_MASK_CTRL + KEY_R, + "Show Guides" : KEY_MASK_CTRL + KEY_Y } var help_menu_items := { - tr("About Pixelorama") : 0 + "About Pixelorama" : 0 } # Load language @@ -164,9 +164,9 @@ func _ready() -> void: Global.brushes_from_files = Global.custom_brushes.size() func _input(event : InputEvent) -> void: - Global.left_cursor.position = get_global_mouse_position() + Vector2(-20, 20) + Global.left_cursor.position = get_global_mouse_position() + Vector2(-32, 32) Global.left_cursor.texture = Global.left_cursor_tool_texture - Global.right_cursor.position = get_global_mouse_position() + Vector2(20, 20) + Global.right_cursor.position = get_global_mouse_position() + Vector2(32, 32) Global.right_cursor.texture = Global.right_cursor_tool_texture if event.is_action_pressed("toggle_fullscreen"): OS.window_fullscreen = !OS.window_fullscreen diff --git a/Scripts/SelectionRectangle.gd b/Scripts/SelectionRectangle.gd index 6cb152562..1abd573e1 100644 --- a/Scripts/SelectionRectangle.gd +++ b/Scripts/SelectionRectangle.gd @@ -26,6 +26,11 @@ func _process(delta : float) -> void: var current_layer_index := Global.canvas.current_layer_index var layer : Image = Global.canvas.layers[current_layer_index][0] + if end_pos == start_pos: + Global.selection_rectangle.visible = false + else: + Global.selection_rectangle.visible = true + if point_in_rectangle(mouse_pos, polygon[0], polygon[2]) && Global.selected_pixels.size() > 0 && (Global.current_left_tool == "RectSelect" || Global.current_right_tool == "RectSelect"): get_parent().get_parent().mouse_default_cursor_shape = Input.CURSOR_MOVE Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)