mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-31 07:29:49 +00:00
Make layers uneditable when they're invisible
This commit is contained in:
parent
d70c6a22c4
commit
ea606a072a
|
@ -17,3 +17,7 @@ func _init(_name := tr("Layer") + " 0", _visible := true, _locked := false, _fra
|
|||
frame_container = _frame_container
|
||||
new_cels_linked = _new_cels_linked
|
||||
linked_cels = _linked_cels
|
||||
|
||||
|
||||
func can_layer_get_drawn() -> bool:
|
||||
return visible && !locked
|
||||
|
|
|
@ -95,7 +95,7 @@ func update_pattern() -> void:
|
|||
|
||||
func draw_start(position : Vector2) -> void:
|
||||
Global.canvas.selection.move_content_confirm()
|
||||
if Global.current_project.layers[Global.current_project.current_layer].locked or !Global.current_project.tile_mode_rects[Global.TileMode.NONE].has_point(position):
|
||||
if !Global.current_project.layers[Global.current_project.current_layer].can_layer_get_drawn() or !Global.current_project.tile_mode_rects[Global.TileMode.NONE].has_point(position):
|
||||
return
|
||||
if Global.current_project.has_selection and not Global.current_project.can_pixel_get_drawn(position):
|
||||
return
|
||||
|
|
|
@ -177,7 +177,7 @@ func commit_undo(action : String) -> void:
|
|||
|
||||
|
||||
func draw_tool(position : Vector2) -> void:
|
||||
if Global.current_project.layers[Global.current_project.current_layer].locked:
|
||||
if !Global.current_project.layers[Global.current_project.current_layer].can_layer_get_drawn():
|
||||
return
|
||||
var strength := _strength
|
||||
if Global.pressure_sensitivity_mode == Global.PressureSensitivity.ALPHA:
|
||||
|
|
|
@ -437,7 +437,7 @@ func toggle_fullscreen() -> void:
|
|||
|
||||
|
||||
func image_menu_id_pressed(id : int) -> void:
|
||||
if Global.current_project.layers[Global.current_project.current_layer].locked: # No changes if the layer is locked
|
||||
if !Global.current_project.layers[Global.current_project.current_layer].can_layer_get_drawn(): # No changes if the layer is locked or invisible
|
||||
return
|
||||
var image : Image = Global.current_project.frames[Global.current_project.current_frame].cels[Global.current_project.current_layer].image
|
||||
match id:
|
||||
|
|
Loading…
Reference in a new issue