fix(marksilo): review — flerværdi-valg som MultiTextOption, lagerreservation på tværs af runder, vagt kun før start, rutetjek + straks-fejl pauses, rotation fra på lånte vogne, kræver parkering, flow-siloer udelades, slettede vogne og små rester håndteres
This commit is contained in:
@@ -21,14 +21,24 @@ local function indexOf(list, value)
|
||||
return 1
|
||||
end
|
||||
|
||||
-- Valg med flere værdier: productPrefab (MultiTextOption). ingredientPrefab er en BinaryOption med kun to sider.
|
||||
function SmartPickupFrame:addFieldSiloChoiceRow(kind, title, texts, state)
|
||||
local element = self:addRow(self.productPrefab, {kind = kind})
|
||||
local option = element:getDescendantByName("option")
|
||||
option:setTexts(texts)
|
||||
option:setState(state, false)
|
||||
element:getDescendantByName("title"):setText(title)
|
||||
local tooltip = option:getDescendantByName("ignore")
|
||||
if tooltip ~= nil then tooltip:setText("") end
|
||||
return option
|
||||
end
|
||||
|
||||
function SmartPickupFrame:fillFieldSiloRows(adEnv)
|
||||
local i18n, cfg = self.i18n, ADFieldSilos.config
|
||||
local onOff = {i18n:getText("ui_no"), i18n:getText("ui_yes")}
|
||||
self:addToggleRow("fsEnabled", i18n:getText("spu_fs_enabled"), onOff, cfg.enabled)
|
||||
local maxOption = self:addToggleRow("fsMaxVehicles", i18n:getText("spu_fs_maxVehicles"), numberTexts(1, ADFieldSiloConfig.MAX_VEHICLES), false)
|
||||
maxOption:setState(cfg.maxVehicles, false)
|
||||
local minOption = self:addToggleRow("fsMinLiters", i18n:getText("spu_fs_minLiters"), literTexts(), false)
|
||||
minOption:setState(indexOf(ADFieldSiloConfig.MIN_LITERS_CHOICES, cfg.minLiters), false)
|
||||
self:addFieldSiloChoiceRow("fsMaxVehicles", i18n:getText("spu_fs_maxVehicles"), numberTexts(1, ADFieldSiloConfig.MAX_VEHICLES), cfg.maxVehicles)
|
||||
self:addFieldSiloChoiceRow("fsMinLiters", i18n:getText("spu_fs_minLiters"), literTexts(), indexOf(ADFieldSiloConfig.MIN_LITERS_CHOICES, cfg.minLiters))
|
||||
|
||||
local plan = ADFieldSilos.lastPlan
|
||||
local waiting = 0
|
||||
|
||||
@@ -119,6 +119,9 @@ function SmartPickupFrame:onClickProduct(state, element)
|
||||
if clicked ~= nil and clicked.kind == "storageBuilding" then
|
||||
return self:safe(function(frame) frame:onClickStorageBuilding(state) end)
|
||||
end
|
||||
if clicked ~= nil and SmartPickupFrame.FIELDSILO_ROW_KINDS ~= nil and SmartPickupFrame.FIELDSILO_ROW_KINDS[clicked.kind] then
|
||||
return self:onClickFieldSiloRow(state, clicked)
|
||||
end
|
||||
if clicked ~= nil and SmartPickupFrame.FIELD_ROW_KINDS ~= nil and SmartPickupFrame.FIELD_ROW_KINDS[clicked.kind] then
|
||||
return self:onClickFieldRow(state, clicked)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user