challenge-editor/scene/basic_mes_skin_card.gd
2024-10-04 18:08:33 +08:00

32 lines
568 B
GDScript

extends TextureRect
class_name BasicMesSkinCard
signal click(skin:BasicMesSkinCard,ind:int)
var data:Dictionary
var index:int=0
var state:int=-2:
set(val):
if val!=state:
state=val
match val:
-1:
%lock.show()
%btn.disabled=true
0:
%lock.hide()
%btn.disabled=false
1:
%lock.hide()
%btn.disabled=true
pass
func set_data(_data:Dictionary):
data=_data
%skin_head.texture=Database.get_texture(data["skin_card_face"])
func _on_btn_pressed() -> void:
click.emit(self,index)
pass # Replace with function body.