challenge-editor/scene/basic_mes_skin_card.gd
2024-09-27 17:51:20 +08:00

32 lines
566 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=Global.get_texture(data["skin_card_face"])
func _on_btn_pressed() -> void:
click.emit(self,index)
pass # Replace with function body.