feat(ui): 'Lager til' viser kun bygninger der kan tage flowets lagervarer (paller -> palleskure der tager varen); valgt palleskur bruges til palleture (v1.19.2.0)
This commit is contained in:
@@ -119,10 +119,12 @@ function SmartPickupFrame:fillBuildingRows(adEnv, run, role)
|
||||
local count = 0
|
||||
-- kandidater -> valgte først, så med markør; uden markør kun med "Vis alle bygninger"
|
||||
local candidates = {}
|
||||
-- "Lager til": kun bygninger der kan tage flowets lagervarer (æg-paller -> palleskure der tager æg)
|
||||
local storeGoods = role == "store" and ADRunsController.getStoreGoods(adEnv, run) or nil
|
||||
for _, building in ipairs(ADBuildings.list(adEnv, g_currentMission:getFarmId())) do
|
||||
-- "Lager til": siloer og gårdens fabrikker (fx BGA) — markøren er bygningens aflæsningsmarkør
|
||||
local isStoreKind = building.kind == "silo" or building.kind == "factory" or building.kind == "objectStorage"
|
||||
local fits = (role == "load" and building.canBeSource) or (role == "unload" and building.canBeTarget)
|
||||
or (role == "store" and (building.kind == "silo" or building.kind == "factory"))
|
||||
or (role == "store" and isStoreKind and (chosen[building.id] or ADRunsController.canStoreAt(adEnv, building, storeGoods)))
|
||||
if fits then
|
||||
local markers = ADBuildings.getMarkers ~= nil and ADBuildings.getMarkers(building, role == "store" and "unload" or role) or {}
|
||||
table.insert(candidates, {id = building.id, name = building.name, hasMarker = markers[1] ~= nil, building = building})
|
||||
|
||||
Reference in New Issue
Block a user