feat(kæde): læs i køretøjer tæller som lager, ingen skift under høst, varelinje åbner flow (v1.61.8.0)
This commit is contained in:
@@ -42,6 +42,27 @@ function SmartPickupFrame:onChainAction(action)
|
||||
self:requestRebuild()
|
||||
end
|
||||
|
||||
-- Klik på en varelinje: åbn flowet der kører varen til modtageren (kædens eget flow til bygningen, ellers et flow
|
||||
-- der dækker varen) i Flows-fanens redigeringsvindue; uden flow en besked.
|
||||
function SmartPickupFrame:openChainFlow(consumer, fillType)
|
||||
local runs = ADChain.runsView(ADRunsController.store.runs)
|
||||
local runId = ADChainActions.chainRunFor(runs, consumer)
|
||||
if runId == nil then
|
||||
for _, run in ipairs(runs) do
|
||||
if runId == nil and ADChainActions.isCovered({consumer = consumer, fillType = fillType}, {run}) then runId = run.id end
|
||||
end
|
||||
end
|
||||
if runId == nil then
|
||||
self.statusOverride = self.i18n:getText("spu_chain_noFlow")
|
||||
self.statusOverrideTicks = SmartPickupFrame.STATUS_OVERRIDE_TICKS
|
||||
self:requestRebuild()
|
||||
return
|
||||
end
|
||||
self.selectedRunId = runId
|
||||
self:switchTab(SmartPickupFrame.TAB_FLOWS)
|
||||
self:openEditPanel("flow", runId)
|
||||
end
|
||||
|
||||
-- Klik på rodens linje uden for knappen: fold ud/sammen (huskes kun mens spillet kører).
|
||||
function SmartPickupFrame:toggleChainRoot(rootKey)
|
||||
self.chainExpanded = self.chainExpanded or {}
|
||||
@@ -76,7 +97,9 @@ function SmartPickupFrame:addChainRow(entry)
|
||||
cells[4]:setTextColor(unpackFn(color))
|
||||
end
|
||||
local actions, toggle = entry.actions or {}, entry.toggle
|
||||
if next(actions) ~= nil or toggle ~= nil then
|
||||
if next(actions) == nil and toggle == nil and entry.openConsumer ~= nil then
|
||||
self:makeRowClickable(row, function(frame) frame:openChainFlow(entry.openConsumer, entry.openFillType) end)
|
||||
elseif next(actions) ~= nil or toggle ~= nil then
|
||||
self:makeRowClickable(row, function(frame)
|
||||
local action = actions[clickedCell(frame, cells) or 0]
|
||||
if action ~= nil then
|
||||
|
||||
Reference in New Issue
Block a user