otherworldly_simulation/scene/trader_board/trader_board.gd
2024-11-01 23:23:07 +08:00

29 lines
722 B
GDScript

extends Control
#绑定到的角色
var bind_character:Unit
#卡片场景
const TRADE_ITEM_CARD = preload("res://scene/trader_board/trade_item_card.tscn")
#缓存的物品数据
var item_array_cache:Array[BagItem]
#打开界面并绑定到特定角色
func open(item_array:Array[BagItem],bind:Unit=null):
for i in %trade_card_add_pos.get_children():
i.queue_free()
item_array_cache=item_array
for i in item_array:
var new_card=TRADE_ITEM_CARD.instantiate()
%trade_card_add_pos.add_child(new_card)
new_card.set_item(i)
show()
#func _ready() -> void:
#open([Database.get_item("item_test_01"),Database.get_item("item_test_02")])
func _on_exit_pressed() -> void:
hide()
pass # Replace with function body.