1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

Layers stay invisible when adding/removing/moving a new layer

This commit is contained in:
OverloadedOrama 2019-12-27 20:24:44 +02:00
parent 42e3aec561
commit 86761c92ec
2 changed files with 8 additions and 4 deletions

View file

@ -517,7 +517,6 @@ func generate_layer_panels() -> void:
layer_container.get_child(1).get_child(0).texture = layers[i][1]
layer_container.get_child(1).get_child(1).text = layers[i][2]
layer_container.get_child(1).get_child(2).text = layers[i][2]
layers[i][3] = true # Set visible
Global.vbox_layer_container.add_child(layer_container)
func pencil_and_eraser(mouse_pos : Vector2, color : Color, current_mouse_button : String, current_action := "None") -> void:

View file

@ -10,11 +10,15 @@ onready var label := $HBoxContainer/Label
onready var line_edit := $HBoxContainer/LineEdit
func _ready() -> 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)
changed_selection()
if Global.canvas.layers[i][3]:
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:
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)
func _input(event : InputEvent):
func _input(event : InputEvent) -> void:
if event.is_action_released("ui_accept") && line_edit.visible && event.scancode != KEY_SPACE:
label.visible = true
line_edit.visible = false
@ -79,6 +83,7 @@ func _on_VisibilityButton_pressed() -> void:
Global.canvas.layers[i][3] = 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()
func _on_LineEdit_text_changed(new_text : String) -> void:
Global.canvas.layers[i][2] = new_text