feat(kæde): ét flow pr. bygning, slutprodukter sælges straks (Sælg/Behold), tomme kædeflows foldes sammen; såmaskine ikke gødningsspreder (v1.61.4.0)
This commit is contained in:
@@ -27,6 +27,8 @@ function SmartPickupFrame:onChainAction(action)
|
||||
ok = ADChain.approve(action.fieldId)
|
||||
elseif action.kind == "dismiss" then
|
||||
ok = ADChain.dismiss(action.fieldId)
|
||||
elseif action.kind == "finalMode" then
|
||||
ADChain.setFinalKeep(action.rootKey, action.keep)
|
||||
elseif action.kind == "pause" or action.kind == "resume" then
|
||||
ADChain.setPaused(action.rootKey, action.kind == "pause")
|
||||
end
|
||||
|
||||
@@ -232,10 +232,8 @@ function SmartPickupFrame:fillFlowTabRows(adEnv)
|
||||
return
|
||||
end
|
||||
self:addTextRow(i18n:getText("spu_flowList_hint"))
|
||||
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"))
|
||||
for _, run in ipairs(group.runs) do
|
||||
local row = self:addRow(self.flowListPrefab, {kind = "flowList"})
|
||||
local function addFlowRow(run)
|
||||
local row = self:addRow(self.flowListPrefab, {kind = "flowList"})
|
||||
local entry = {runId = run.id, row = row, dot = row:getDescendantByName("dot"),
|
||||
cells = {row:getDescendantByName("c1"), row:getDescendantByName("c2"), row:getDescendantByName("c3"),
|
||||
row:getDescendantByName("c4"), row:getDescendantByName("c5")}}
|
||||
@@ -252,6 +250,22 @@ function SmartPickupFrame:fillFlowTabRows(adEnv)
|
||||
end
|
||||
end)
|
||||
table.insert(self.flowListRows, entry)
|
||||
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 (venter på en ledig traktor/vogn) foldes sammen (in-game 30/9)
|
||||
if group.chain then runs, idle = ADFlowView.splitIdle(group.runs) end
|
||||
for _, run in ipairs(runs) do addFlowRow(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 addFlowRow(run) end
|
||||
end
|
||||
end
|
||||
end
|
||||
self:refreshFlowListRows(adEnv)
|
||||
|
||||
Reference in New Issue
Block a user