fix(oversigt): kædeflows uden traktor foldet sammen, 'mangler traktor/vogn' som status (v1.61.12.0)

This commit is contained in:
2026-09-30 21:30:45 +02:00
parent 6b533e62eb
commit 991252848f
6 changed files with 32 additions and 8 deletions
+1
View File
@@ -8,6 +8,7 @@ står i [docs/BRUGERMANUAL.md](docs/BRUGERMANUAL.md) (dansk) og [docs/USER_MANUA
## 1.61 — Produktionskæder ## 1.61 — Produktionskæder
- **1.61.12** Oversigt-tavlen folder også kædeflows uden traktor sammen og viser navnene uden "Kæde: "; et kædeflow uden traktor har status *mangler traktor/vogn* (tavle og Flows-liste).
- **1.61.11** Markørvalg ved bygninger: når to markører står inden for 20 m af hinanden, afgør navnet — pålæsning foretrækker *Pickup/Hent/Læs/Load*, aflæsning *Unload/Drop/Aflæs*. Før vandt den nærmeste (Sell Egg kørte til "Chicken Storage Unload" i stedet for "Egg Storage Pickup"). - **1.61.11** Markørvalg ved bygninger: når to markører står inden for 20 m af hinanden, afgør navnet — pålæsning foretrækker *Pickup/Hent/Læs/Load*, aflæsning *Unload/Drop/Aflæs*. Før vandt den nærmeste (Sell Egg kørte til "Chicken Storage Unload" i stedet for "Egg Storage Pickup").
- **1.61.10** Markflådens puljeliste viser korte maskinnavne (uden " Unrealistic" og parenteser som "(+ Custom Crops)"), så lange linjer ikke ombrydes med traktorens nummer alene på næste linje. - **1.61.10** Markflådens puljeliste viser korte maskinnavne (uden " Unrealistic" og parenteser som "(+ Custom Crops)"), så lange linjer ikke ombrydes med traktorens nummer alene på næste linje.
- **1.61.9** *Sælg fra* i udkørselsflows har valget **Altid (uanset pris)** øverst: flowet sælger, så snart der er noget at køre med, uden at vente på en god pris. Resumé og status viser *sælg altid*. - **1.61.9** *Sælg fra* i udkørselsflows har valget **Altid (uanset pris)** øverst: flowet sælger, så snart der er noget at køre med, uden at vente på en god pris. Resumé og status viser *sælg altid*.
+5
View File
@@ -83,6 +83,11 @@ function ADFlowView.shortVehicleName(name)
return short return short
end end
-- Kædeflow uden traktor (venter på en ledig traktor/vogn).
function ADFlowView.isIdleChain(run)
return run.chain ~= nil and run.chain ~= "" and #(run.vehicleIds or {}) == 0
end
-- Kædeflows uden traktor foldes sammen i listen (de venter på en ledig traktor/vogn). -> active, idle -- Kædeflows uden traktor foldes sammen i listen (de venter på en ledig traktor/vogn). -> active, idle
function ADFlowView.splitIdle(runs) function ADFlowView.splitIdle(runs)
local active, idle = {}, {} local active, idle = {}, {}
+20 -4
View File
@@ -64,7 +64,9 @@ function SmartPickupFrame:flowCells(adEnv, run)
elseif row.reason ~= nil then elseif row.reason ~= nil then
status = row.reason status = row.reason
end end
local name = (run.id == self.selectedRunId and "> " or "") .. tostring(run.name) -- kædeflow uden traktor: sig hvorfor det står stille i stedet for flowets regel
if ADFlowView.isIdleChain(run) then status = i18n:getText("spu_flow_chainIdle") end
local name = (run.id == self.selectedRunId and "> " or "") .. ADFlowView.listName(run)
return {name, products, from, to, string.format("%d/%d", row.running, row.total), status} return {name, products, from, to, string.format("%d/%d", row.running, row.total), status}
end end
@@ -103,9 +105,7 @@ function SmartPickupFrame:fillOverviewRows(adEnv)
local i18n = self.i18n local i18n = self.i18n
self:addTextRow(i18n:getText("spu_overview_hint")) self:addTextRow(i18n:getText("spu_overview_hint"))
self:addCellRow(self.flowPrefab, {i18n:getText("spu_col_flow"), i18n:getText("spu_col_goods"), i18n:getText("spu_col_from"), i18n:getText("spu_col_to"), i18n:getText("spu_col_tractors"), i18n:getText("spu_col_status")}) self:addCellRow(self.flowPrefab, {i18n:getText("spu_col_flow"), i18n:getText("spu_col_goods"), i18n:getText("spu_col_from"), i18n:getText("spu_col_to"), i18n:getText("spu_col_tractors"), i18n:getText("spu_col_status")})
for _, group in ipairs(ADFlowView.boardGroups(ADRunsController.store.runs)) do local function addBoardRow(run)
self:addTextRow(i18n:getText(group.chain and "spu_board_chain" or group.kind == "outbound" and "spu_board_outbound" or "spu_board_supply"))
for _, run in ipairs(group.runs) do
local cells = self:addCellRow(self.flowPrefab, self:flowCells(adEnv, run)) local cells = self:addCellRow(self.flowPrefab, self:flowCells(adEnv, run))
if cells[1] ~= nil and cells[1].parent ~= nil then if cells[1] ~= nil and cells[1].parent ~= nil then
local runId = run.id local runId = run.id
@@ -113,6 +113,22 @@ function SmartPickupFrame:fillOverviewRows(adEnv)
end end
table.insert(self.overviewRows, {runId = run.id, cells = cells}) table.insert(self.overviewRows, {runId = run.id, cells = cells})
end end
for _, group in ipairs(ADFlowView.boardGroups(ADRunsController.store.runs)) do
self:addTextRow(i18n:getText(group.chain and "spu_board_chain" or group.kind == "outbound" and "spu_board_outbound" or "spu_board_supply"))
local runs, idle = group.runs, {}
-- kædeflows uden traktor foldes sammen som i Flows-listen (in-game 30/9)
if group.chain then runs, idle = ADFlowView.splitIdle(group.runs) end
for _, run in ipairs(runs) do addBoardRow(run) end
if #idle > 0 then
local key = self.showIdleChainFlows and "spu_board_chainIdleHide" or "spu_board_chainIdleShow"
self:addLinkRow(" " .. string.format(i18n:getText(key), #idle), function(frame)
frame.showIdleChainFlows = not frame.showIdleChainFlows
frame:requestRebuild()
end)
if self.showIdleChainFlows then
for _, run in ipairs(idle) do addBoardRow(run) end
end
end
end end
if #ADRunsController.store.runs == 0 then if #ADRunsController.store.runs == 0 then
self:addTextRow(i18n:getText("spu_noRuns")) self:addTextRow(i18n:getText("spu_noRuns"))
+1
View File
@@ -352,6 +352,7 @@
<text name="spu_flow_noTarget" text="(intet mål)"/> <text name="spu_flow_noTarget" text="(intet mål)"/>
<text name="spu_flow_noVehicle" text="(ingen traktor)"/> <text name="spu_flow_noVehicle" text="(ingen traktor)"/>
<text name="spu_flow_ruleSellAlways" text="sælg altid"/> <text name="spu_flow_ruleSellAlways" text="sælg altid"/>
<text name="spu_flow_chainIdle" text="mangler traktor/vogn"/>
<text name="spu_flow_ruleSell" text="pris >= %d %%"/> <text name="spu_flow_ruleSell" text="pris >= %d %%"/>
<text name="spu_flow_ruleStore" text="lager > %d %%"/> <text name="spu_flow_ruleStore" text="lager > %d %%"/>
<text name="spu_flow_ruleOut" text="pris >= %d %%, lager > %d %%"/> <text name="spu_flow_ruleOut" text="pris >= %d %%, lager > %d %%"/>
+1
View File
@@ -352,6 +352,7 @@
<text name="spu_flow_noTarget" text="(no target)"/> <text name="spu_flow_noTarget" text="(no target)"/>
<text name="spu_flow_noVehicle" text="(no tractor)"/> <text name="spu_flow_noVehicle" text="(no tractor)"/>
<text name="spu_flow_ruleSellAlways" text="always sell"/> <text name="spu_flow_ruleSellAlways" text="always sell"/>
<text name="spu_flow_chainIdle" text="needs a tractor/trailer"/>
<text name="spu_flow_ruleSell" text="price >= %d %%"/> <text name="spu_flow_ruleSell" text="price >= %d %%"/>
<text name="spu_flow_ruleStore" text="storage > %d %%"/> <text name="spu_flow_ruleStore" text="storage > %d %%"/>
<text name="spu_flow_ruleOut" text="price >= %d %%, storage > %d %%"/> <text name="spu_flow_ruleOut" text="price >= %d %%, storage > %d %%"/>
+1 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?> <?xml version="1.0" encoding="utf-8" standalone="no"?>
<modDesc descVersion="107"> <modDesc descVersion="107">
<author>masterdraco</author> <author>masterdraco</author>
<version>1.61.11.0</version> <version>1.61.12.0</version>
<title> <title>
<en>AD Smart Pickup</en> <en>AD Smart Pickup</en>
</title> </title>