feat: skift flowets vogn i guiden — tøm, sæt af og hent ny ved start (v1.62.44)

This commit is contained in:
2026-10-06 15:40:27 +02:00
parent a58fb77eb7
commit 3b33060238
5 changed files with 88 additions and 12 deletions
@@ -176,8 +176,17 @@ function SmartPickupFrame:flowVehicleContext(adEnv, preview, wagons)
local solo = validation.reason == "noTrailer" and ADPool.canPull(ADPool.ownRole(vehicle))
if solo and hasWagons then text = string.format(self.i18n:getText("spu_guide_flow_soloText"), tostring(label)) end
local blocked = SmartPickupFrame.VEHICLE_BLOCKING_REASONS[validation.reason] == true and not (solo and hasWagons)
-- vognen der hænger på nu (kan byttes til en ledig i vognvalget)
local own = nil
local rear = ADHitch.rearImplementsOf(vehicle)[1]
if rear ~= nil and rear.object ~= nil then
local okCap, _, capacity = pcall(ADPool.cargoOf, rear.object)
if okCap and (capacity or 0) > 0 then
own = {id = ADRunsController.getVehicleId(rear.object), label = tostring(ADRuns.vehicleLabel(rear.object))}
end
end
return {id = ADRunsController.getVehicleId(vehicle), text = text, label = label, otherRunId = other ~= nil and other.id or nil,
otherRunName = other ~= nil and other.name or nil, blocked = blocked, solo = solo}
otherRunName = other ~= nil and other.name or nil, blocked = blocked, solo = solo, ownWagon = own}
end)
if ok and entry.id ~= nil then
table.insert(result, entry)