fix(lagre): 'rækker til' regnes på nettoforbrug (+ 'stiger'), bredere beholdningskolonne, kort tooltip (v1.16.1.0)

This commit is contained in:
2026-09-24 02:48:54 +02:00
parent 3227453392
commit ac9dfe0d62
9 changed files with 34 additions and 18 deletions
+4 -2
View File
@@ -1,6 +1,6 @@
-- AD Storage Stats
-- Rene beregninger (ingen spil-API) til fanen Lagre: pr. vare i en bygning fyldning, værdi nu og
-- ved årets toppris, gårdens samlede beholdning og hvor mange døgn den rækker ved gårdens forbrug.
-- ved årets toppris, gårdens samlede beholdning og hvor mange døgn den rækker ved gårdens nettoforbrug.
ADStorageStats = {}
@@ -22,7 +22,9 @@ function ADStorageStats.itemStats(item, farmTotal, rate, quote)
consumption = consumption,
production = production,
net = production - consumption,
days = consumption > 0 and (farmTotal or level) / consumption or nil,
-- døgn til tom ved gårdens NETTO-forbrug; produktion ≥ forbrug = beholdningen stiger
days = consumption > production and (farmTotal or level) / (consumption - production) or nil,
rising = consumption > 0 and production >= consumption,
}
end
+7 -7
View File
@@ -74,13 +74,13 @@
</Bitmap>
<!-- Lagre: statistik-tabel (vare · i bygningen · værdi nu · ved toppris · gården · rækker til · forbrug/prod.) -->
<Bitmap profile="fs25_multiTextOptionContainer" id="statPrefab">
<Text profile="spuCellBold" name="c1" position="20px 0px" size="145px 40px"/>
<Text profile="spuCell" name="c2" position="165px 0px" size="135px 40px"/>
<Text profile="spuCell" name="c3" position="300px 0px" size="200px 40px"/>
<Text profile="spuCell" name="c4" position="400px 0px" size="100px 40px"/>
<Text profile="spuCell" name="c5" position="500px 0px" size="70px 40px"/>
<Text profile="spuCell" name="c6" position="570px 0px" size="85px 40px"/>
<Text profile="spuCell" name="c7" position="655px 0px" size="155px 40px"/>
<Text profile="spuCellBold" name="c1" position="20px 0px" size="140px 40px"/>
<Text profile="spuCell" name="c2" position="160px 0px" size="145px 40px"/>
<Text profile="spuCell" name="c3" position="305px 0px" size="200px 40px"/>
<Text profile="spuCell" name="c4" position="405px 0px" size="100px 40px"/>
<Text profile="spuCell" name="c5" position="505px 0px" size="65px 40px"/>
<Text profile="spuCell" name="c6" position="570px 0px" size="80px 40px"/>
<Text profile="spuCell" name="c7" position="650px 0px" size="160px 40px"/>
</Bitmap>
<!-- Lagre: gårdens beholdning som gitter (bygning · 2 varer pr. række). Rækken er ~815 px bred. -->
<Bitmap profile="fs25_multiTextOptionContainer" id="gridPrefab">
@@ -98,7 +98,12 @@ function SmartPickupFrame:statCells(stat)
if stat.valueNow ~= nil then
now, top = SmartPickupFrame.formatMoney(stat.valueNow), SmartPickupFrame.formatMoney(stat.valueTop)
end
local days = stat.days ~= nil and string.format(i18n:getText("spu_stat_days"), stat.days) or "-"
local days = "-"
if stat.days ~= nil then
days = string.format(i18n:getText("spu_stat_days"), stat.days)
elseif stat.rising then
days = i18n:getText("spu_stat_rising")
end
return {self:fillTypeTitle(stat.fillType), here, now, top, fc(stat.farmTotal), days, ADStorageStats.rateText(stat.consumption, stat.production, fc)}
end
+2 -1
View File
@@ -134,6 +134,7 @@
<text name="spu_stat_use" text="forbrug %s/døgn"/>
<text name="spu_stat_prod" text="prod. %s/døgn"/>
<text name="spu_stat_total" text="Bygningen i alt"/>
<text name="spu_stat_rising" text="stiger"/>
<text name="spu_tab_factories" text="Fabrikker"/>
<text name="spu_tab_silos" text="Siloer"/>
<text name="spu_tab_barns" text="Stalde"/>
@@ -149,6 +150,6 @@
<text name="spu_col_farm" text="Gården"/>
<text name="spu_col_lasts" text="Rækker til"/>
<text name="spu_col_rate" text="Forbrug/prod. døgn"/>
<text name="spu_storage_select_tooltip" text="Vælg en bygning for at se værdi, gårdens samlede beholdning og forbrug og produktion pr. døgn for hver vare."/>
<text name="spu_storage_select_tooltip" text="Vælg bygningen tabellen viser."/>
</texts>
</l10n>
+2 -1
View File
@@ -134,6 +134,7 @@
<text name="spu_stat_use" text="use %s/day"/>
<text name="spu_stat_prod" text="prod. %s/day"/>
<text name="spu_stat_total" text="Building total"/>
<text name="spu_stat_rising" text="rising"/>
<text name="spu_tab_factories" text="Factories"/>
<text name="spu_tab_silos" text="Silos"/>
<text name="spu_tab_barns" text="Barns"/>
@@ -149,6 +150,6 @@
<text name="spu_col_farm" text="Farm"/>
<text name="spu_col_lasts" text="Lasts"/>
<text name="spu_col_rate" text="Use/prod. per day"/>
<text name="spu_storage_select_tooltip" text="Pick a building to see value, the farm total and daily use and production for each item."/>
<text name="spu_storage_select_tooltip" text="Choose the building shown in the table."/>
</texts>
</l10n>
+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.16.0.0</version>
<version>1.16.1.0</version>
<title>
<en>AD Smart Pickup</en>
</title>