feat: maskiner uden parkering — spilleren kører dem til og fra marken, pop-up eller statusvindue (1.62.201)
This commit is contained in:
@@ -285,6 +285,8 @@ function ADStatusHud.stuckEntries()
|
||||
local owned = not isGone(vehicle) and (farmId == nil or (vehicle.getOwnerFarmId ~= nil and vehicle:getOwnerFarmId() == farmId))
|
||||
local held = owned and ((ADUnloadWait ~= nil and ADUnloadWait.getWaitFor ~= nil and ADUnloadWait.getWaitFor(vehicle) ~= nil)
|
||||
or (ADOutbound ~= nil and ADOutbound.getHoldFor ~= nil and ADOutbound.getHoldFor(vehicle) ~= nil))
|
||||
-- en maskine der venter på at blive hentet efter spillerkørsel står allerede som "kør væk" (pickupEntries)
|
||||
held = held or (owned and ADPlayerTransport ~= nil and ADPlayerTransport.isPickup(vehicle))
|
||||
if owned and not held then
|
||||
table.insert(entries, {text = string.format(textOf("spu_status_stuck"), tostring(ADRuns.vehicleLabel(vehicle)),
|
||||
math.floor(still.ms / 60000)), level = "error", target = vehicle})
|
||||
@@ -293,6 +295,17 @@ function ADStatusHud.stuckEntries()
|
||||
return entries
|
||||
end
|
||||
|
||||
-- Maskiner uden parkering der er færdige på en mark: "kør X væk fra F38" (gul) til de har forladt marken.
|
||||
function ADStatusHud.pickupEntries()
|
||||
local entries = {}
|
||||
if ADPlayerTransport == nil then return entries end
|
||||
for _, pickup in ipairs(ADPlayerTransport.pickupEntries()) do
|
||||
table.insert(entries, {text = string.format(textOf("spu_status_pickup"), tostring(pickup.label), tostring(pickup.fieldId)),
|
||||
level = "waiting", target = pickup.vehicle})
|
||||
end
|
||||
return entries
|
||||
end
|
||||
|
||||
function ADStatusHud.snapshot(adEnv)
|
||||
local proxy = frameProxy()
|
||||
local snapshot = {missing = {}, flows = {}, fields = {}, chains = {}, warnings = {}}
|
||||
@@ -304,6 +317,7 @@ function ADStatusHud.snapshot(adEnv)
|
||||
local chainResult = guarded("chains", ADStatusHud.chainEntries, proxy) or {}
|
||||
snapshot.chains = chainResult.chains or {}
|
||||
for _, entry in ipairs(chainResult.dependencies or {}) do table.insert(snapshot.warnings, entry) end
|
||||
for _, entry in ipairs(guarded("pickups", ADStatusHud.pickupEntries) or {}) do table.insert(snapshot.warnings, entry) end
|
||||
for _, entry in ipairs(guarded("stuck", ADStatusHud.stuckEntries) or {}) do table.insert(snapshot.warnings, entry) end
|
||||
for _, entry in ipairs(chainResult.suggestions or {}) do table.insert(snapshot.warnings, entry) end
|
||||
return snapshot
|
||||
|
||||
Reference in New Issue
Block a user