mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 15:34:43 -04:00
Store layer visibility on Global.layers instead
This way, toggling visibility in a layers works for all frames in that layer.
This commit is contained in:
parent
3df9853dda
commit
a2893e1c1c
7 changed files with 28 additions and 25 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue