1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-27 22:41:56 +08:00

feat: 添加掉落物功能,更新饲料和物品显示,重构相关UI组件

This commit is contained in:
2025-08-26 20:46:02 +08:00
parent 417ca71de3
commit 51fc904a6a
20 changed files with 424 additions and 16 deletions
+8
View File
@@ -13,7 +13,14 @@ class_name Feed
@onready var nameLabel: RichTextLabel = $"%name"
@onready var fieldsBox: VBoxContainer = $"%fields"
@onready var costsBox: GridContainer = $"%costs"
@onready var selectButton: Button = $"%selectBtn"
func _ready():
selectButton.pressed.connect(
func():
apply(UIState.player)
queue_free()
)
func _process(_delta):
avatarRect.texture = avatarTexture
nameLabel.text = "[b]" + displayName + "[/b]"
@@ -39,6 +46,7 @@ func _process(_delta):
costShow.type = cost
costShow.count = count
costsBox.add_child(costShow)
func apply(entity: EntityBase):
var allHave = true
for i in range(min(costs.size(), costCounts.size())):