feat(lagre): faner pr. bygningstype (Fabrikker/Siloer/Stalde/Palleskure), kolonner tilpasset rækkebredden, statistik tæller kun kørende produktioner × tidsjustering (v1.16.0.0)

This commit is contained in:
2026-09-24 02:19:30 +02:00
parent a11c8e46df
commit 3227453392
12 changed files with 144 additions and 57 deletions
+9 -3
View File
@@ -10,8 +10,14 @@ SmartPickupFrame.REFRESH_INTERVAL_MS = 1000
SmartPickupFrame.STATUS_OVERRIDE_TICKS = 6
SmartPickupFrame.LOG_PREFIX = "ADSmartPickup: "
SmartPickupFrame.STATE_OFF, SmartPickupFrame.STATE_ON = 1, 2
SmartPickupFrame.TAB_FLOWS, SmartPickupFrame.TAB_STORAGE = 1, 2
SmartPickupFrame.TAB_NAMES = {"spu_tab_flows", "spu_tab_storage"}
SmartPickupFrame.TAB_FLOWS = 1
-- Lagerfaner: én pr. bygningstype (indeks -> kind i ADSources.getFarmInventory)
SmartPickupFrame.TAB_NAMES = {"spu_tab_flows", "spu_tab_factories", "spu_tab_silos", "spu_tab_barns", "spu_tab_sheds"}
SmartPickupFrame.TAB_KINDS = {[2] = "factory", [3] = "silo", [4] = "husbandry", [5] = "objectStorage"}
function SmartPickupFrame.getTabKind(tab)
return SmartPickupFrame.TAB_KINDS[tab]
end
SmartPickupFrame.POLICIES = {"off", "store", "sell", "sellElseStore"}
-- Afvisningsgrunde der handler om VOGNEN (ikke run'ets opsætning): traktoren kan ikke vælges.
SmartPickupFrame.VEHICLE_BLOCKING_REASONS = {noTrailer = true, cannotCarry = true, needsAutoload = true}
@@ -349,7 +355,7 @@ function SmartPickupFrame:rebuild()
self:clearRows()
local run = self:getRun()
self:setStaticRowsVisible(self.currentTab, run)
if self.currentTab == SmartPickupFrame.TAB_STORAGE then
if SmartPickupFrame.getTabKind(self.currentTab) ~= nil then
if adEnv ~= nil then
self:fillStorageRows(adEnv)
end