23 lines
446 B
GDScript
23 lines
446 B
GDScript
@tool
|
|
extends Control
|
|
|
|
@export var locked: bool = true
|
|
@export var image: Texture:
|
|
set(value):
|
|
image = value
|
|
if is_inside_tree() and has_node("%Texture"):
|
|
$%Texture.texture = image
|
|
|
|
|
|
|
|
func _ready():
|
|
if image != null and has_node("%Texture"):
|
|
$%Texture.texture = image
|
|
if has_node("%TextureRect") and has_node("%HooverTween"):
|
|
if locked:
|
|
$%TextureRect.show()
|
|
$%HooverTween.queue_free()
|
|
else:
|
|
$%TextureRect.hide()
|
|
|