1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-03-12 22:35:18 +00:00

Can't delete and apply effects to locked layers

By effects I mean the selections of the Image menu
This commit is contained in:
OverloadedOrama 2020-03-10 01:42:50 +02:00
parent e71f76d8ee
commit 550da1e961
2 changed files with 15 additions and 2 deletions

View file

@ -529,16 +529,18 @@ func layers_changed(value : Array) -> void:
layer_button.pressed = true
self.current_frame = current_frame # Call frame_changed to update UI
if layers.size() == 1:
if layers[current_layer][2]:
remove_layer_button.disabled = true
remove_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN
if layers.size() == 1:
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:
elif !layers[current_layer][2]:
remove_layer_button.disabled = false
remove_layer_button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND
@ -597,6 +599,15 @@ func layer_changed(value : int) -> void:
merge_down_layer_button.disabled = true
merge_down_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN
if current_layer < layers.size():
if layers[current_layer][2]:
remove_layer_button.disabled = true
remove_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN
else:
if layers.size() > 1:
remove_layer_button.disabled = false
remove_layer_button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND
yield(get_tree().create_timer(0.01), "timeout")
self.current_frame = current_frame # Call frame_changed to update UI

View file

@ -292,6 +292,8 @@ func view_menu_id_pressed(id : int) -> void:
Global.canvas.update()
func image_menu_id_pressed(id : int) -> void:
if Global.layers[Global.current_layer][2]: # No changes if the layer is locked
return
match id:
0: # Scale Image
$ScaleImage.popup_centered()