fix(oversigt): kædeflows uden traktor foldet sammen, 'mangler traktor/vogn' som status (v1.61.12.0)
This commit is contained in:
@@ -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*.
|
||||||
|
|||||||
@@ -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 = {}, {}
|
||||||
|
|||||||
@@ -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,15 +105,29 @@ 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")})
|
||||||
|
local function addBoardRow(run)
|
||||||
|
local cells = self:addCellRow(self.flowPrefab, self:flowCells(adEnv, run))
|
||||||
|
if cells[1] ~= nil and cells[1].parent ~= nil then
|
||||||
|
local runId = run.id
|
||||||
|
self:makeRowClickable(cells[1].parent, function(frame) frame:openFlow(runId) end)
|
||||||
|
end
|
||||||
|
table.insert(self.overviewRows, {runId = run.id, cells = cells})
|
||||||
|
end
|
||||||
for _, group in ipairs(ADFlowView.boardGroups(ADRunsController.store.runs)) do
|
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"))
|
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 runs, idle = group.runs, {}
|
||||||
local cells = self:addCellRow(self.flowPrefab, self:flowCells(adEnv, run))
|
-- kædeflows uden traktor foldes sammen som i Flows-listen (in-game 30/9)
|
||||||
if cells[1] ~= nil and cells[1].parent ~= nil then
|
if group.chain then runs, idle = ADFlowView.splitIdle(group.runs) end
|
||||||
local runId = run.id
|
for _, run in ipairs(runs) do addBoardRow(run) end
|
||||||
self:makeRowClickable(cells[1].parent, function(frame) frame:openFlow(runId) 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
|
||||||
table.insert(self.overviewRows, {runId = run.id, cells = cells})
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if #ADRunsController.store.runs == 0 then
|
if #ADRunsController.store.runs == 0 then
|
||||||
|
|||||||
@@ -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 %%"/>
|
||||||
|
|||||||
@@ -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,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>
|
||||||
|
|||||||
Reference in New Issue
Block a user