feat(marksilo): marknummer foran silonavnet; statuslinje fortæller hvorfor ingen tømmevogn lånes (uden parkering/optaget/spiller i/ikke i flåden) (v1.38.7.0)
This commit is contained in:
@@ -138,7 +138,8 @@ function ADFieldSilos.collectBuildings(adEnv)
|
||||
local x, z = position(building.placeable ~= nil and building.placeable.rootNode or nil)
|
||||
if not seen[building.id] and not ADFieldSiloConfig.hasStore(ADFieldSilos.config, building.id) and not nearStore(stores, x, z) then
|
||||
seen[building.id] = true
|
||||
table.insert(silos, {id = building.id, name = building.name, markerId = firstMarker(building, "load"),
|
||||
-- marknummeret først: navnet skæres af i fanen, og mange siloer hedder ens ("Farma 500 …")
|
||||
table.insert(silos, {id = building.id, name = string.format("F%s %s", tostring(info.id), tostring(building.name)), markerId = firstMarker(building, "load"),
|
||||
x = x, z = z, stock = siloStock(building.placeable)})
|
||||
end
|
||||
end
|
||||
@@ -168,15 +169,25 @@ end
|
||||
|
||||
function ADFieldSilos.collectVehicles(adEnv)
|
||||
local vehicles, byId = {}, {}
|
||||
-- hvorfor tømmevogne ikke kan lånes (til fanens statuslinje)
|
||||
local why = {notEnabled = 0, busy = 0, controlled = 0, noPark = 0}
|
||||
for _, rig in ipairs(ADFieldWork.getRigs(adEnv)) do
|
||||
-- uden AD-parkeringspunkt bliver vognen holdende på lagerets markør og spærrer for de næste
|
||||
local canPark = ADFieldWork.parkMarkerId == nil or ADFieldWork.parkMarkerId(adEnv, rig.vehicle) ~= nil
|
||||
if rig.role == "unloader" then
|
||||
if not rig.enabled then why.notEnabled = why.notEnabled + 1
|
||||
elseif rig.controlled then why.controlled = why.controlled + 1
|
||||
elseif rig.busy then why.busy = why.busy + 1
|
||||
elseif not canPark then why.noPark = why.noPark + 1 end
|
||||
end
|
||||
if rig.role == "unloader" and rig.enabled and not rig.busy and not rig.controlled and canPark then
|
||||
local capacity, carries, cargo = trailerInfo(adEnv, rig.vehicle)
|
||||
table.insert(vehicles, {id = rig.id, x = rig.x, z = rig.z, capacity = capacity, carries = carries, cargo = cargo})
|
||||
byId[rig.id] = rig.vehicle
|
||||
end
|
||||
end
|
||||
why.eligible = #vehicles
|
||||
ADFieldSilos.lastVehicleReasons = why
|
||||
return vehicles, byId
|
||||
end
|
||||
|
||||
|
||||
@@ -45,6 +45,10 @@ function SmartPickupFrame:fillFieldSiloRows(adEnv)
|
||||
for _, entry in ipairs(plan ~= nil and plan.status or {}) do if entry.state == "ok" then waiting = waiting + 1 end end
|
||||
self:addTextRow(string.format(i18n:getText("spu_fs_status"), ADFieldSilos.loanCount(), cfg.maxVehicles, waiting))
|
||||
if #cfg.storeIds == 0 then self:addTextRow(i18n:getText("spu_fs_noStores")) end
|
||||
local why = ADFieldSilos.lastVehicleReasons
|
||||
if waiting > 0 and ADFieldSilos.loanCount() < cfg.maxVehicles and why ~= nil and why.eligible == 0 then
|
||||
self:addTextRow(string.format(i18n:getText("spu_fs_noVehicle"), why.noPark, why.busy, why.controlled, why.notEnabled))
|
||||
end
|
||||
|
||||
self:addTextRow(i18n:getText("spu_fs_silosTitle"))
|
||||
if plan == nil or #plan.status == 0 then
|
||||
|
||||
@@ -476,6 +476,7 @@
|
||||
<text name="spu_fs_status" text="%d/%d vogne ude · %d siloer venter"/>
|
||||
<text name="spu_fs_noStores" text="Vælg mindst ét gårdlager nedenfor — ellers køres intet hjem"/>
|
||||
<text name="spu_fs_silosTitle" text="Marksiloer med varer"/>
|
||||
<text name="spu_fs_noVehicle" text="Ingen ledig tømmevogn: %d uden AD-parkeringspunkt, %d optaget, %d med spiller i, %d ikke i flåden (vogne i flows lånes ikke)"/>
|
||||
<text name="spu_fs_nothing" text="Ingen marksiloer har varer over mindste mængde"/>
|
||||
<text name="spu_fs_col_silo" text="Silo"/>
|
||||
<text name="spu_fs_col_liters" text="Liter"/>
|
||||
|
||||
@@ -476,6 +476,7 @@
|
||||
<text name="spu_fs_status" text="%d/%d vehicles out · %d silos waiting"/>
|
||||
<text name="spu_fs_noStores" text="Select at least one farm storage below — otherwise nothing is brought home"/>
|
||||
<text name="spu_fs_silosTitle" text="Field silos with products"/>
|
||||
<text name="spu_fs_noVehicle" text="No free unloading trailer: %d without AD park destination, %d busy, %d with a player in it, %d not in the fleet (flow vehicles are never borrowed)"/>
|
||||
<text name="spu_fs_nothing" text="No field silo has products above the minimum amount"/>
|
||||
<text name="spu_fs_col_silo" text="Silo"/>
|
||||
<text name="spu_fs_col_liters" text="Liters"/>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<modDesc descVersion="107">
|
||||
<author>masterdraco</author>
|
||||
<version>1.38.6.0</version>
|
||||
<version>1.38.7.0</version>
|
||||
<title>
|
||||
<en>AD Smart Pickup</en>
|
||||
</title>
|
||||
|
||||
Reference in New Issue
Block a user