Debug boss button texture
This commit is contained in:
@@ -3,6 +3,8 @@ extends LessonButton
|
||||
|
||||
@export var icon_texture: Texture2D:
|
||||
set = _set_icon_texture
|
||||
@export var completed_icon_texture: Texture2D:
|
||||
set = _set_completed_icon_texture
|
||||
|
||||
@onready var icon: TextureRect = %Icon
|
||||
|
||||
@@ -11,10 +13,28 @@ func _ready() -> void:
|
||||
super()
|
||||
if label:
|
||||
label.hide()
|
||||
_set_icon_texture(icon_texture)
|
||||
_refresh_icon()
|
||||
|
||||
|
||||
func _set_icon_texture(value: Texture2D) -> void:
|
||||
icon_texture = value
|
||||
if icon:
|
||||
icon.texture = value
|
||||
_refresh_icon()
|
||||
|
||||
|
||||
func _set_completed_icon_texture(value: Texture2D) -> void:
|
||||
completed_icon_texture = value
|
||||
_refresh_icon()
|
||||
|
||||
|
||||
func _set_completed(value: bool) -> void:
|
||||
super(value)
|
||||
_refresh_icon()
|
||||
|
||||
|
||||
func _refresh_icon() -> void:
|
||||
if not icon:
|
||||
return
|
||||
if completed and completed_icon_texture:
|
||||
icon.texture = completed_icon_texture
|
||||
else:
|
||||
icon.texture = icon_texture
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
[ext_resource type="Script" uid="uid://bbjhs5nta7xxj" path="res://sources/gardens/boss_button.gd" id="5_3d6pj"]
|
||||
[ext_resource type="PackedScene" uid="uid://cn2rw06pltyiu" path="res://sources/utils/fx/right.tscn" id="7_rtwam"]
|
||||
[ext_resource type="Texture2D" uid="uid://cfnjk06m367r3" path="res://assets/minigames/boss/boss_icon.png" id="8_oy4mt"]
|
||||
[ext_resource type="Texture2D" uid="uid://bc3e0qths2cvt" path="res://assets/minigames/boss/boss_icon_full.png" id="9_full"]
|
||||
[ext_resource type="Texture2D" uid="uid://cxjy5f7oyl8mq" path="res://assets/gardens/buttons/lesson_circle.png" id="lesson_circle"]
|
||||
|
||||
[node name="BossButton" type="TextureButton" unique_id=1297494779]
|
||||
@@ -21,6 +22,7 @@ texture_focused = ExtResource("lesson_circle")
|
||||
stretch_mode = 0
|
||||
script = ExtResource("5_3d6pj")
|
||||
icon_texture = ExtResource("8_oy4mt")
|
||||
completed_icon_texture = ExtResource("9_full")
|
||||
|
||||
[node name="RightFX" parent="." unique_id=1100015067 instance=ExtResource("7_rtwam")]
|
||||
unique_name_in_owner = true
|
||||
|
||||
Reference in New Issue
Block a user