From 7a008cfc3f119484dcae45403bf60d5ca2273269 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Mon, 9 Mar 2020 03:26:13 +0200 Subject: [PATCH] Implemented locking/unlocking layers When a layer is locked, no changes can be made to it. --- Assets/Graphics/Dark Themes/Layers/Lock.png | Bin 0 -> 735 bytes .../Dark Themes/Layers/Lock.png.import | 34 ++++++++++++++++++ .../Dark Themes/Layers/Lock_Hover.png | Bin 0 -> 5809 bytes .../Dark Themes/Layers/Lock_Hover.png.import | 34 ++++++++++++++++++ Assets/Graphics/Dark Themes/Layers/Unlock.png | Bin 0 -> 718 bytes .../Dark Themes/Layers/Unlock.png.import | 34 ++++++++++++++++++ .../Dark Themes/Layers/Unlock_Hover.png | Bin 0 -> 718 bytes .../Layers/Unlock_Hover.png.import | 34 ++++++++++++++++++ Assets/Graphics/Gold Themes/Layers/Lock.png | Bin 0 -> 6163 bytes .../Gold Themes/Layers/Lock.png.import | 34 ++++++++++++++++++ .../Gold Themes/Layers/Lock_Hover.png | Bin 0 -> 6160 bytes .../Gold Themes/Layers/Lock_Hover.png.import | 34 ++++++++++++++++++ Assets/Graphics/Gold Themes/Layers/Unlock.png | Bin 0 -> 724 bytes .../Gold Themes/Layers/Unlock.png.import | 34 ++++++++++++++++++ .../Gold Themes/Layers/Unlock_Hover.png | Bin 0 -> 724 bytes .../Layers/Unlock_Hover.png.import | 34 ++++++++++++++++++ Assets/Graphics/Light Themes/Layers/Lock.png | Bin 0 -> 5827 bytes .../Light Themes/Layers/Lock.png.import | 34 ++++++++++++++++++ .../Light Themes/Layers/Lock_Hover.png | Bin 0 -> 5822 bytes .../Light Themes/Layers/Lock_Hover.png.import | 34 ++++++++++++++++++ .../Graphics/Light Themes/Layers/Unlock.png | Bin 0 -> 718 bytes .../Light Themes/Layers/Unlock.png.import | 34 ++++++++++++++++++ .../Light Themes/Layers/Unlock_Hover.png | Bin 0 -> 716 bytes .../Layers/Unlock_Hover.png.import | 34 ++++++++++++++++++ Prefabs/LayerContainer.tscn | 27 +++++++++++--- Scripts/AnimationTimeline.gd | 6 ++-- Scripts/Canvas.gd | 4 +-- Scripts/Global.gd | 20 +++++------ Scripts/LayerContainer.gd | 19 ++++++++++ Scripts/Main.gd | 6 ++-- Scripts/SelectionRectangle.gd | 2 ++ 31 files changed, 470 insertions(+), 22 deletions(-) create mode 100644 Assets/Graphics/Dark Themes/Layers/Lock.png create mode 100644 Assets/Graphics/Dark Themes/Layers/Lock.png.import create mode 100644 Assets/Graphics/Dark Themes/Layers/Lock_Hover.png create mode 100644 Assets/Graphics/Dark Themes/Layers/Lock_Hover.png.import create mode 100644 Assets/Graphics/Dark Themes/Layers/Unlock.png create mode 100644 Assets/Graphics/Dark Themes/Layers/Unlock.png.import create mode 100644 Assets/Graphics/Dark Themes/Layers/Unlock_Hover.png create mode 100644 Assets/Graphics/Dark Themes/Layers/Unlock_Hover.png.import create mode 100644 Assets/Graphics/Gold Themes/Layers/Lock.png create mode 100644 Assets/Graphics/Gold Themes/Layers/Lock.png.import create mode 100644 Assets/Graphics/Gold Themes/Layers/Lock_Hover.png create mode 100644 Assets/Graphics/Gold Themes/Layers/Lock_Hover.png.import create mode 100644 Assets/Graphics/Gold Themes/Layers/Unlock.png create mode 100644 Assets/Graphics/Gold Themes/Layers/Unlock.png.import create mode 100644 Assets/Graphics/Gold Themes/Layers/Unlock_Hover.png create mode 100644 Assets/Graphics/Gold Themes/Layers/Unlock_Hover.png.import create mode 100644 Assets/Graphics/Light Themes/Layers/Lock.png create mode 100644 Assets/Graphics/Light Themes/Layers/Lock.png.import create mode 100644 Assets/Graphics/Light Themes/Layers/Lock_Hover.png create mode 100644 Assets/Graphics/Light Themes/Layers/Lock_Hover.png.import create mode 100644 Assets/Graphics/Light Themes/Layers/Unlock.png create mode 100644 Assets/Graphics/Light Themes/Layers/Unlock.png.import create mode 100644 Assets/Graphics/Light Themes/Layers/Unlock_Hover.png create mode 100644 Assets/Graphics/Light Themes/Layers/Unlock_Hover.png.import diff --git a/Assets/Graphics/Dark Themes/Layers/Lock.png b/Assets/Graphics/Dark Themes/Layers/Lock.png new file mode 100644 index 0000000000000000000000000000000000000000..0681a44f1f008b438754ab62fdf389bc2e291144 GIT binary patch literal 735 zcmV<50wDc~P)EX>4Tx04R}tkv&MmKpe$iQ>8^Jf_5myAwzYtAS&W0RV;#q(pG5I!Q|2}XktiG zTpR`0f`cE6RRU7TlmpZjz4D@Bt5K9P8q>4rtTPCUJ7 z>74h8!>l4H#OK6g23?T&k?XR{Z=A~x3p_JyjdyW16NwdztIF{K1pwM zwAc|aunk;XcQknqxZD9EPr77Cj^w8)luE$+8GTa$7`g@eR^8s(`#607a@5t*4RCM> zjFu^T&Ews{?%w`A)9&vFPlIxqEmPRl00006VoOIv0A&Ec0RI#`I*$MV010qNS#tmY zE+YT{E+YYWr9XB6000McNlirueSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{006g1L_t(o!|hkm4MQOa1mZ-D;-HSgO6@NpZ4iZ8oAUP* zx$|*gKrq&Oe?Xy)F;IWwr-0uP!4u$`1i@j$mD@A(%XJY66KEO0c0WR-t%6$+z0b_k zB&JfJgL{D^z5oD}32uG7luZ#>5m>~Rc0`vUT*|&t^vv-_bY~~bv{o%bPY+ZL?!~%W zgd(z3qA3J4@D7Q4Q(&LpYyUv2DzD$yKskZk`rdBEStPs||H|BqJk)*ZHs`k;s%O{jc5y_A_9sVipx|2BF;GWc+T`cb54?a?|t{X_ucyLeO0Rj z-X0caW6e+~lm*Yz%@_Gc>%OMO$S)il`y7Qbd=cv(to8*oXr)RamPjGAIz|bhA+1D= zLTPUu44RYvm}dI+!ARIB(Mdi2pcR}*f1fLAC_eSelH#M*kSJ*)H=&N-{@c>&?-FNj z-E_eGQO>JzxN)+LNvq^No9<^(r*}R}FHU+ej+JFTXj447C+AI`;%fQIExR`V(~jL) zFuwBGsIGR`kaccB%krED*)$nSqv&4MX=&CC9amzwFK3s(7DSd{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}>F7em(e$<6la%HODYxgRABpmG z=|t6J&a!Qbyaq`pPbXAYK9kt;Bq`%jw}jG{1-P*PgVc` literal 0 HcmV?d00001 diff --git a/Assets/Graphics/Gold Themes/Layers/Lock.png.import b/Assets/Graphics/Gold Themes/Layers/Lock.png.import new file mode 100644 index 000000000..79446bc78 --- /dev/null +++ b/Assets/Graphics/Gold Themes/Layers/Lock.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Lock.png-416bf727369200d7502932659c7deec1.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Graphics/Gold Themes/Layers/Lock.png" +dest_files=[ "res://.import/Lock.png-416bf727369200d7502932659c7deec1.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/Assets/Graphics/Gold Themes/Layers/Lock_Hover.png b/Assets/Graphics/Gold Themes/Layers/Lock_Hover.png new file mode 100644 index 0000000000000000000000000000000000000000..e948e5923652d76b1ef34874051c9c9c0eb429a2 GIT binary patch literal 6160 zcmeHKX;>5I77ik-LPb$PK|)X#C1kQe5)%bNSS*3CN(GcjG9iI%CKD16tVPsZnWlX zJ^#CJ^_J$CaoyMApPk9EwVTpeWpEeU{N&mt`(CKmcI~N{2`|;jJ^gnL2T!MItf&E7 zA3S+3=8ZMsLEVmn7x?MTq9x9EE#bG)Uv`cyJ~B&@%;-PcVOO_$OH9b!b+_XhCS2UM zSC7xpyIq;SIOT2si|=3Fi+W==V7KSuw?EyGRkmgM++f_C$}zP{|Jj*pz&KvB@8~7! zgG0~k>RvruliOO<*LK~S-Sl9k>XK1`ZB=NQYf`2PN=-_iDEFT-HiL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iauAWiY6V&^GNlC8Y2GghWeO+^0WsOAOjkM!pwnC_ z3@SjOvEG9sAhia~Ta1-TAyH|@6^WSRgK~ms{>T(y3`ABbV~h)E)Eu4~0ufj(gkd?C zfJKGJOpVomcN@ra&Ky__V)bAILlUf128zWCj3FC`Zsbpa|AQ$k7S<{MH=g&z4zHF%`K44XA}A#v?#=>|YYcg31^OZIlC5@^)VKk%UDL9t0RPDUnVGr9=kc zDkX{-Qh+F8vLH4S0GSLL^FwwGEJbvn8uE-m%LqMZw1|x7jGs1;XU-qub+HhZL=+mD z$#f#cRY;?77_J-&h0uT6csDZE8sF~L4Qn0&0i3~lxM9tOBft_aEMBFO%OLfKI=#)C z|AHH2Kait;Wj+|zZ_R^M323#(B0)OkC*6Mp*v~LWCWe$6_*0<|hV;ua=mtS!?w><% zCiJ2szq{!MvIHxnzwvJ%`~F4`DD@X7pQY~?xxUEtSqgj>_)B(uk?XS*_$=_3?E1gS zW%d4D8B(IpeLD0_I7ByQH~JQBA@cY2#zD9eT;FInjscw+s`8tw!Qn`gu#bs;zlRo` z9D)b}_(NJvEk{ytrrr1Mqf=uMeiXuk71-MnZs2JhuahCMcLB?Mg@8 z+hJA;mTj$H_fuuO)Mixd*b=RW*S@1E^KCDX2{n@sgzjFwEO}B94!32fGO2J&fL)Yb zRQWco_co^mSBpY=u66q$F;lPQM-aV&MhLARSDc%ldaY3SgR>c<%O-tUSoE&urG2w< zT#h%_%>t4eUo|N!=1wkj=)2N3Gp%NG%ga&e-^`tIXUW!TbPG5EKhXP_S9Hq102|S< Ag#Z8m literal 0 HcmV?d00001 diff --git a/Assets/Graphics/Light Themes/Layers/Lock.png.import b/Assets/Graphics/Light Themes/Layers/Lock.png.import new file mode 100644 index 000000000..7f0309ccb --- /dev/null +++ b/Assets/Graphics/Light Themes/Layers/Lock.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Lock.png-dc7e2c18836835a8b8a96271217c9efd.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Graphics/Light Themes/Layers/Lock.png" +dest_files=[ "res://.import/Lock.png-dc7e2c18836835a8b8a96271217c9efd.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/Assets/Graphics/Light Themes/Layers/Lock_Hover.png b/Assets/Graphics/Light Themes/Layers/Lock_Hover.png new file mode 100644 index 0000000000000000000000000000000000000000..c1db4f768e84185e91c67a0e427232efe9690194 GIT binary patch literal 5822 zcmeHKcT^Mk77kKHP{4u|b&P8PO)n(bgdQPElOn8TA(>1_ByE#{1P}{Yv0z0+U03X~ z@D$jERa8*K1ysZWNQt`eR92C-;3BBJnSdJK^SRG+-u`FKNhWiD-~H~LJKw#(nYAH7 ze%6+bmKY4in&Q&?@r_{-K+u^H^Hd)bM$%rqWwLBAj@8VCR7{?iwc}KArE7-Wm|zQU?*1KXa{Sk&Mje~|4SCkx zUx&Cl&ClOm@`UyKIa8awAMHZcjk2Sxuq5YatlVWXGLU9@a+voyPgnCX<3(-6 z$fzB&W;odvJ1^ zQ9_WbXF9Di&G~?X6b!sWir6g`IIpVQ@?GVm*Q2Z^Z-VlCUYX>s+1I|l@CvglHOzkD z)5<@sp1JodId&)})f(SplN!2a;?X&|L8r|kHe~1criC?d+rb-S!CA!YADI03b1SwL z2)D`-Zr$HR^Q%4zEKbMe_t>RpMul!)vugJR_UmOG{HhN9+1!IMIl``P)Xd+S%{9Gd*Pu{o*vQfX%P$r$SRqd8qC z*mJi7n2+iIN)_RDd+Yk-!?ic+I?kQdHLbd50*p`> z=bB}wDARu4x1Um~2&t>OT4mjp_qeaIuFm1xpuIz?SJL-PosjbL#hI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0f`cE6RRU7TlmpZjz4D@Bt5K9P8q>4rtTPCUJ7 z>74h8!>l4H#OK6g23?T&k?XR{Z=A~x3p_JyjdyW16NwdztIF{K1pwM zwAc|aunk;XcQknqxZD9EPr77Cj^w8)luE$+8GTa$7`g@eR^8s(`#607a@5t*4RCM> zjFu^T&Ews{?%w`A)9&vFPlIxqEmPRl00006VoOIv0A&Ec0RI#`I*$MV010qNS#tmY zE+YT{E+YYWr9XB6000McNlirueSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{005*(L_t(o!|j*B4Zt7>Ma8(0dohfAF;jbMh-t+HkebLz zFaF0DG(hTth_2)qwN~JJSS9=g0ukaIBB$U0%j{cg&l(Ze0dV0yBoOl}n9bY_;LUap zF>=S$fj;wDC(3He-D}_gYzF{Q|G-oiNIh)PDcM_GI&1GDM8vp void: var new_layers : Array = Global.layers.duplicate() - # Store [Layer name, Layer visibility boolean, Frame container] - new_layers.append([layer_name, true, HBoxContainer.new()]) + # Store [Layer name, Layer visibility boolean, Layer lock boolean, Frame container] + new_layers.append([layer_name, true, false, HBoxContainer.new()]) Global.undos += 1 Global.undo_redo.create_action("Add Layer") @@ -156,7 +156,7 @@ func add_layer(is_new := true) -> void: var new_layer := Image.new() if is_new: new_layer.create(c.size.x, c.size.y, false, Image.FORMAT_RGBA8) - else: # clone layer + else: # Clone layer new_layer.copy_from(c.layers[Global.current_layer][0]) new_layer.lock() diff --git a/Scripts/Canvas.gd b/Scripts/Canvas.gd index 5bfa2958e..0b88081dc 100644 --- a/Scripts/Canvas.gd +++ b/Scripts/Canvas.gd @@ -180,7 +180,7 @@ func _input(event : InputEvent) -> void: can_undo = true current_pixel = get_local_mouse_position() + location - if Global.current_frame != frame: + if Global.current_frame != frame || Global.layers[Global.current_layer][2]: previous_mouse_pos = current_pixel 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) @@ -493,7 +493,7 @@ func update_texture(layer_index : int) -> void: layers[layer_index][1].create_from_image(layers[layer_index][0], 0) 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 = Global.find_node_by_name(Global.layers[layer_index][3].get_child(frame),"FrameTexture") frame_texture_rect.texture = layers[layer_index][1] func pencil_and_eraser(sprite : Image, mouse_pos : Vector2, color : Color, current_mouse_button : String, current_action := "None") -> void: diff --git a/Scripts/Global.gd b/Scripts/Global.gd index 49f5235dd..5a2558110 100644 --- a/Scripts/Global.gd +++ b/Scripts/Global.gd @@ -371,8 +371,8 @@ func _ready() -> void: error_dialog = find_node_by_name(root, "ErrorDialog") - # Store [Layer name, Layer visibility boolean, Frame container] - layers.append([tr("Layer") + " 0", true, HBoxContainer.new()]) + # Store [Layer name, Layer visibility boolean, Layer lock boolean, Frame container] + layers.append([tr("Layer") + " 0", true, false, HBoxContainer.new()]) # 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: @@ -477,7 +477,7 @@ func canvases_changed(value : Array) -> void: frame_id.queue_free() for i in range(layers.size() - 1, -1, -1): - frames_container.add_child(layers[i][2]) + frames_container.add_child(layers[i][3]) for j in range(canvases.size()): var label := Label.new() @@ -492,7 +492,7 @@ func canvases_changed(value : Array) -> void: frame_button.layer = i frame_button.get_child(0).texture = Global.canvases[j].layers[i][1] - layers[i][2].add_child(frame_button) + layers[i][3].add_child(frame_button) func layers_changed(value : Array) -> void: layers = value @@ -516,14 +516,14 @@ func layers_changed(value : Array) -> void: layer_container.label.text = layers[i][0] layer_container.line_edit.text = layers[i][0] - frames_container.add_child(layers[i][2]) + frames_container.add_child(layers[i][3]) 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.get_child(0).texture = Global.canvases[j].layers[i][1] - layers[i][2].add_child(frame_button) + layers[i][3].add_child(frame_button) var layer_button = layers_container.get_child(layers_container.get_child_count() - 1 - current_layer) layer_button.pressed = true @@ -556,16 +556,16 @@ func frame_changed(value : int) -> void: text_color = Color.black 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 + if i < layer[3].get_child_count(): + layer[3].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 + if current_frame < layers[current_layer][3].get_child_count(): + layers[current_layer][3].get_child(current_frame).pressed = true func layer_changed(value : int) -> void: current_layer = value diff --git a/Scripts/LayerContainer.gd b/Scripts/LayerContainer.gd index d03e24af5..ec2b8fd47 100644 --- a/Scripts/LayerContainer.gd +++ b/Scripts/LayerContainer.gd @@ -3,11 +3,13 @@ extends Button var i := 0 var visibility_button : BaseButton +var lock_button : BaseButton var label : Label var line_edit : LineEdit func _ready() -> void: visibility_button = Global.find_node_by_name(self, "VisibilityButton") + lock_button = Global.find_node_by_name(self, "LockButton") label = Global.find_node_by_name(self, "Label") line_edit = Global.find_node_by_name(self, "LineEdit") @@ -18,6 +20,13 @@ func _ready() -> void: 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) + if Global.layers[i][2]: + lock_button.texture_normal = load("res://Assets/Graphics/%s Themes/Layers/Lock.png" % Global.theme_type) + lock_button.texture_hover = load("res://Assets/Graphics/%s Themes/Layers/Lock_Hover.png" % Global.theme_type) + else: + lock_button.texture_normal = load("res://Assets/Graphics/%s Themes/Layers/Unlock.png" % Global.theme_type) + lock_button.texture_hover = load("res://Assets/Graphics/%s Themes/Layers/Unlock_Hover.png" % Global.theme_type) + func _input(event : InputEvent) -> void: if event.is_action_released("ui_accept") && line_edit.visible && event.scancode != KEY_SPACE: label.visible = true @@ -51,3 +60,13 @@ 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_LockButton_pressed() -> void: + if Global.layers[i][2]: + Global.layers[i][2] = false + lock_button.texture_normal = load("res://Assets/Graphics/%s Themes/Layers/Unlock.png" % Global.theme_type) + lock_button.texture_hover = load("res://Assets/Graphics/%s Themes/Layers/Unlock_Hover.png" % Global.theme_type) + else: + Global.layers[i][2] = true + lock_button.texture_normal = load("res://Assets/Graphics/%s Themes/Layers/Lock.png" % Global.theme_type) + lock_button.texture_hover = load("res://Assets/Graphics/%s Themes/Layers/Lock_Hover.png" % Global.theme_type) diff --git a/Scripts/Main.gd b/Scripts/Main.gd index 7c9de8f9f..9a5eb4536 100644 --- a/Scripts/Main.gd +++ b/Scripts/Main.gd @@ -407,8 +407,9 @@ func _on_OpenSprite_file_selected(path : String) -> void: 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()]) + var layer_lock := file.get_8() + # Store [Layer name, Layer visibility boolean, Layer lock boolean, Frame container] + Global.layers.append([layer_name, layer_visibility, layer_lock, HBoxContainer.new()]) global_layer_line = file.get_line() var frame_line := file.get_line() @@ -519,6 +520,7 @@ func _on_SaveSprite_file_selected(path : String) -> void: file.store_line(".") file.store_line(layer[0]) # Layer name file.store_8(layer[1]) # Layer visibility + file.store_8(layer[2]) # Layer lock file.store_line("END_GLOBAL_LAYERS") for canvas in Global.canvases: # Store frames diff --git a/Scripts/SelectionRectangle.gd b/Scripts/SelectionRectangle.gd index 42d40f772..ddf1e4b50 100644 --- a/Scripts/SelectionRectangle.gd +++ b/Scripts/SelectionRectangle.gd @@ -19,6 +19,8 @@ func _ready() -> void: # warning-ignore:unused_argument func _process(delta : float) -> void: + if Global.layers[Global.current_layer][2]: + return var mouse_pos: Vector2 = get_local_mouse_position() - Global.canvas.location var mouse_pos_floored := mouse_pos.floor() var start_pos := polygon[0]