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

fix(Feed): 修复costShow.count计算错误,使用countOf方法替代

原计算方式使用了multipiler方法可能导致显示数量错误,现统一使用countOf方法确保显示数量准确
This commit is contained in:
2025-09-30 17:38:00 +08:00
parent 072d6f81fe
commit 4c4af7c8c7
+3 -3
View File
@@ -104,9 +104,9 @@ func rebuildInfo():
i.queue_free()
for i in range(min(costs.size(), costCounts.size())):
var cost = costs[i]
var count = costCounts[i]
var count = countOf(i)
var costShow: ItemShow = ComponentManager.getUIComponent("ItemShow").instantiate()
costShow.enough = is_instance_valid(UIState.player) and UIState.player.inventory[cost] >= countOf(i)
costShow.enough = is_instance_valid(UIState.player) and UIState.player.inventory[cost] >= count
costShow.type = cost
costShow.count = int(count * multipiler())
costShow.count = count
costsBox.add_child(costShow)