feat: vare uden køber som gården selv bruger vises som 'bruges selv'

This commit is contained in:
2026-10-20 08:28:38 +02:00
parent 8c89e159d5
commit 08226e1f5d
7 changed files with 13 additions and 3 deletions
+7
View File
@@ -275,6 +275,13 @@ function ADStorageStats.groupStats(group, farm, rate, quote)
return stat
end
-- Tekst-nøgle når varen ingen køber har: gården forbruger den selv (fx yngel til fiskedammene) = "bruges selv",
-- ellers "ingen køber" (in-game 20/10: Young Trout stod som "no buyer" og lignede en fejl)
function ADStorageStats.noValueKey(stat)
if (stat ~= nil and stat.consumption or 0) > 0 then return "spu_stat_ownUse" end
return "spu_stat_noSell"
end
-- Rangering: rød tom > rød fuld > gul tom > gul fuld > sælg nu (største beløb først).
-- Kortest tid til tom / mest fyldt vinder inden for samme trin.
local function attentionEntries(stat)
@@ -97,7 +97,7 @@ function SmartPickupFrame:statCells(stat)
here = string.format(i18n:getText("spu_stat_pallets"), stat.count, stat.slots)
end
if stat.percent ~= nil then here = here .. string.format(" %d %%", stat.percent) end
local now, top = i18n:getText("spu_stat_noSell"), ""
local now, top = i18n:getText(ADStorageStats.noValueKey(stat)), ""
if stat.valueNow ~= nil then
now, top = SmartPickupFrame.formatMoney(stat.valueNow), SmartPickupFrame.formatMoney(stat.valueTop)
end
@@ -236,7 +236,7 @@ end
function SmartPickupFrame:itemCells(stat)
local marker = self:isItemExpanded(stat.fillType) and "– " or "+ "
local value = stat.valueNow ~= nil and SmartPickupFrame.formatMoney(stat.valueNow) or self.i18n:getText("spu_stat_noSell")
local value = stat.valueNow ~= nil and SmartPickupFrame.formatMoney(stat.valueNow) or self.i18n:getText(ADStorageStats.noValueKey(stat))
return {marker .. stat.title, self:itemAmountText(stat), value, self:itemRateText(stat)}
end
+1
View File
@@ -433,6 +433,7 @@
<text name="spu_stat_now" text="nu %s"/>
<text name="spu_stat_top" text="ved toppris %s"/>
<text name="spu_stat_noSell" text="ingen køber"/>
<text name="spu_stat_ownUse" text="bruges selv"/>
<text name="spu_stat_days" text="%.1f døgn"/>
<text name="spu_stat_noUse" text="forbruges ikke"/>
<text name="spu_stat_farm" text="gården %s = %s"/>
+1
View File
@@ -433,6 +433,7 @@
<text name="spu_stat_now" text="now %s"/>
<text name="spu_stat_top" text="at top price %s"/>
<text name="spu_stat_noSell" text="no buyer"/>
<text name="spu_stat_ownUse" text="own use"/>
<text name="spu_stat_days" text="%.1f days"/>
<text name="spu_stat_noUse" text="not consumed"/>
<text name="spu_stat_farm" text="farm %s = %s"/>
+1 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<modDesc descVersion="107">
<author>masterdraco</author>
<version>1.62.393.0</version>
<version>1.62.394.0</version>
<title>
<en>AD Smart Pickup</en>
</title>