20 lines
488 B
GDScript
20 lines
488 B
GDScript
extends TextureRect
|
|
signal click
|
|
|
|
var discount:float=0
|
|
# Called when the node enters the scene tree for the first time.
|
|
var data:Dictionary
|
|
func set_item(item_data:Dictionary):
|
|
data=item_data
|
|
%face.texture=Database.get_texture(data["texture"])
|
|
%price.text="价格:"+str(int(data["price"]*discount))
|
|
if data.has("num"):
|
|
%num.show()
|
|
%num.text=str(data["num"])
|
|
else:
|
|
%num.hide()
|
|
|
|
func _on_trade_card_btn_spec_pressed() -> void:
|
|
click.emit()
|
|
pass # Replace with function body.
|