mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 16:04:43 -04:00
Layer buttons change depending on theme
2 theme types, dark and light. 2 types of graphics for the layer buttons for each theme type.
This commit is contained in:
parent
c159eda437
commit
f08d6c8708
87 changed files with 253 additions and 223 deletions
|
@ -5,11 +5,13 @@ var i
|
|||
# warning-ignore:unused_class_variable
|
||||
var currently_selected := false
|
||||
|
||||
onready var visibility_button := $VisibilityButton
|
||||
onready var visibility_button := $Layer_Visible
|
||||
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()
|
||||
|
||||
func _input(event : InputEvent):
|
||||
|
@ -69,12 +71,14 @@ func changed_selection() -> void:
|
|||
func _on_VisibilityButton_pressed() -> void:
|
||||
if Global.canvas.layers[i][3]:
|
||||
Global.canvas.layers[i][3] = false
|
||||
visibility_button.texture_normal = preload("res://Assets/Graphics/Layers/Dark Themes/Layer_Invisible.png")
|
||||
visibility_button.texture_hover = preload("res://Assets/Graphics/Layers/Dark Themes/Layer_Invisible_Hover.png")
|
||||
visibility_button.name = "Layer_Invisible"
|
||||
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
|
||||
visibility_button.texture_normal = preload("res://Assets/Graphics/Layers/Dark Themes/Layer_Visible.png")
|
||||
visibility_button.texture_hover = preload("res://Assets/Graphics/Layers/Dark Themes/Layer_Visible_Hover.png")
|
||||
visibility_button.name = "Layer_Visible"
|
||||
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)
|
||||
|
||||
func _on_LineEdit_text_changed(new_text : String) -> void:
|
||||
Global.canvas.layers[i][2] = new_text
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue