32 lines
566 B
GDScript3
32 lines
566 B
GDScript3
|
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.
|