fix: klippede tekster i Oversigt/Marker/Fabrikker/Siloer/Stalde — kort status i oversigten, fuld dvale-grund i Flows-listen (oversat), kortere opmærksomhedslinjer — 1.62.307

This commit is contained in:
2026-10-17 10:32:09 +02:00
parent 079b790028
commit 4db27f7b12
8 changed files with 51 additions and 32 deletions
+3 -2
View File
@@ -298,14 +298,15 @@ local function freeTractors(adEnv, taken)
return result
end
-- Oversigtens tekst for et sovende flow (nil når der ikke har været et vågn-tjek endnu).
-- Seneste vågn-tjeks grund for et sovende flow: planlæggerens tekst, false = ingen tur uden nærmere grund (GUI'et
-- oversætter selv efter flowtype), nil = intet vågn-tjek endnu.
function ADFlowSleep.getSleepReason(runId)
return sleepReason[runId]
end
local function noteNoWork(run, why, now)
local text = ADFlowSleep.sleepReasonText(why, run.kind)
sleepReason[run.id] = text
sleepReason[run.id] = (why ~= nil and why ~= "") and why or false
if run.kind == "outbound" and why ~= nil and ADOutbound ~= nil and ADOutbound.setRunReasons ~= nil then
pcall(ADOutbound.setRunReasons, run.id, {why})
end
@@ -91,7 +91,7 @@ end
function SmartPickupFrame:fieldPlanText(field, info)
if field.contract then return self.i18n:getText("spu_field_plan_contract") end
if field.plan.targetFruit ~= nil and field.plan.targetFruit ~= "" then
return "-> " .. self:fruitTitle(field.plan.targetFruit)
return "→" .. self:fruitTitle(field.plan.targetFruit) -- kort pil: "→Sugar Beet" passer i kolonnen (17/10)
end
local text = self.i18n:getText(ADFieldView.planKey(field.plan, info.kind))
if field.plan.rake and info.kind == "mowable" then text = text .. " + " .. self.i18n:getText("spu_field_plan_rake") end
@@ -293,7 +293,7 @@ function SmartPickupFrame:refreshFlowListRows(adEnv)
entry.cells[1]:setText(ADFlowView.listName(run))
entry.cells[2]:setText(tostring(cells[2]))
entry.cells[3]:setText(tostring(cells[5]))
entry.cells[4]:setText(tostring(cells[6]))
entry.cells[4]:setText(tostring(cells[7] or cells[6]))
entry.cells[5]:setText(self.i18n:getText(canStop and "spu_flowList_stop" or "spu_flowList_start"))
if entry.dot ~= nil and entry.dot.setImageColor ~= nil then entry.dot:setImageColor(nil, unpackFn(color)) end
if entry.cells[4].setTextColor ~= nil then entry.cells[4]:setTextColor(unpackFn(color)) end
@@ -349,7 +349,7 @@ function SmartPickupFrame:fillFlowSummary(adEnv, run)
end)
end
local cells = self:flowCells(adEnv, run)
self:addTextRow(" " .. string.format(i18n:getText("spu_field_statusFull"), tostring(cells[6])))
self:addTextRow(" " .. string.format(i18n:getText("spu_field_statusFull"), tostring(cells[7] or cells[6])))
self:addLinkRow(" " .. i18n:getText("spu_guide_flow_open"), function(frame)
frame.selectedRunId = runId
frame:onClickFlowSetup()
@@ -371,7 +371,8 @@ SmartPickupFrame.EDIT_PANEL_KINDS.flow = {
end,
status = function(frame, adEnv, id)
local run = ADRuns.getRun(ADRunsController.store, id)
return {text = tostring(frame:flowCells(adEnv, run)[6]), level = frame:flowLevel(adEnv, run)}
local cells = frame:flowCells(adEnv, run)
return {text = tostring(cells[7] or cells[6]), level = frame:flowLevel(adEnv, run)}
end,
startStopText = function(frame, adEnv, id)
local run = ADRuns.getRun(ADRunsController.store, id)
+13 -3
View File
@@ -66,12 +66,22 @@ function SmartPickupFrame:flowCells(adEnv, run)
end
-- kædeflow uden traktor: sig hvorfor det står stille i stedet for flowets regel
if ADFlowView.isIdleChain(run) then status = i18n:getText("spu_flow_chainIdle") end
-- [6] kort status til oversigtens smalle celle (132 px), [7] lang status med grund til Flows-listen (244 px)
local longStatus = status
if run.sleeping then
local why = ADFlowSleep ~= nil and ADFlowSleep.getSleepReason ~= nil and ADFlowSleep.getSleepReason(run.id) or nil
status = why ~= nil and string.format(i18n:getText("spu_flow_sleepingWhy"), ADFlowSleep.shortReason(why)) or i18n:getText("spu_flow_sleeping")
-- (ikke "a and b or nil": det sluger false, som betyder "ingen tur uden nærmere grund" — review 17/10)
local why = nil
if ADFlowSleep ~= nil and ADFlowSleep.getSleepReason ~= nil then why = ADFlowSleep.getSleepReason(run.id) end
status = i18n:getText("spu_flow_sleeping")
if why == false then
why = i18n:getText(run.kind == "outbound" and "spu_sleep_noTripOut" or "spu_sleep_noTripSupply")
elseif why ~= nil then
why = ADFlowSleep.shortReason(why)
end
longStatus = why ~= nil and string.format(i18n:getText("spu_flow_sleepingWhy"), why) or i18n:getText("spu_flow_sleepingLong")
end
local name = (run.id == self.selectedRunId and "> " or "") .. ADFlowView.listName(run)
return {name, products, from, to, string.format("%d/%d", row.running, row.total), status}
return {name, products, from, to, string.format("%d/%d", row.running, row.total), status, longStatus}
end
-- Hele rækken klikbar med musen (Bitmap-rækker har ingen onClick). Klikket gemmes kun som
+14 -11
View File
@@ -77,7 +77,7 @@
<text name="spu_field_stage_done" text="Færdig"/>
<text name="spu_field_reason_noRig" text="ingen %s med flueben i markflåden"/>
<text name="spu_field_reasonShort_noRig" text="ingen maskine"/>
<text name="spu_field_reasonShort_allBusy" text="venter på maskine"/>
<text name="spu_field_reasonShort_allBusy" text="ingen maskine fri"/>
<text name="spu_field_reasonShort_tooWide" text="for bred"/>
<text name="spu_field_reasonShort_widthUnknown" text="bredde ukendt"/>
<text name="spu_field_reasonShort_tooNarrow" text="for smal"/>
@@ -346,7 +346,7 @@
<text name="spu_reason_needsAutoload" text="pallevarer kræver Universal Autoload på vognen"/>
<text name="spu_product_row" text="%s — %s l — %s"/>
<text name="spu_price_pct" text="%d %% af top (%s)"/>
<text name="spu_price_none" text="intet salgssted"/>
<text name="spu_price_none" text="ingen køber"/>
<text name="spu_outbound_waiting" text="venter: %s"/>
<text name="spu_outbound_warning" text="!! %s"/>
<text name="spu_activity_holding" text="holder ved %s (%s)"/>
@@ -370,13 +370,16 @@
<text name="spu_flow_noVehicle" text="(ingen traktor)"/>
<text name="spu_flow_ruleSellAlways" text="sælg altid"/>
<text name="spu_flow_chainIdle" text="mangler traktor/vogn"/>
<text name="spu_flow_sleeping" text="Sover — vågner når der er arbejde (traktor og vogn er ledige imens)"/>
<text name="spu_flow_sleeping" text="Sover"/>
<text name="spu_flow_sleepingWhy" text="Sover — %s" />
<text name="spu_flow_sleepingLong" text="Sover — vågner når der er arbejde (traktor og vogn er ledige imens)"/>
<text name="spu_sleep_noTripOut" text="intet at køre ud med"/>
<text name="spu_sleep_noTripSupply" text="intet at hente til målene"/>
<text name="spu_flow_ruleSell" text="pris >= %d %%"/>
<text name="spu_flow_ruleStore" text="lager > %d %%"/>
<text name="spu_flow_ruleOut" text="pris >= %d %%, lager > %d %%"/>
<text name="spu_flow_round" text="runde"/>
<text name="spu_flow_ruleIn" text="efter behov — laveste først"/>
<text name="spu_flow_ruleIn" text="efter behov"/>
<text name="spu_flow_ruleInLoops" text="efter behov, %d ture"/>
<text name="spu_markerAt" text="%s %d m"/>
<text name="spu_noMarker" text="INGEN MARKØR inden for 40 m — sæt en AD-markør ved triggeren"/>
@@ -386,7 +389,7 @@
<text name="spu_storage_select" text="Vis bygning"/>
<text name="spu_stat_now" text="nu %s"/>
<text name="spu_stat_top" text="ved toppris %s"/>
<text name="spu_stat_noSell" text="intet salgssted"/>
<text name="spu_stat_noSell" text="ingen køber"/>
<text name="spu_stat_days" text="%.1f døgn"/>
<text name="spu_stat_noUse" text="forbruges ikke"/>
<text name="spu_stat_farm" text="gården %s = %s"/>
@@ -620,14 +623,14 @@
<text name="spu_kpi_full" text="Næsten fuldt"/>
<text name="spu_attention" text="— Kræver handling —"/>
<text name="spu_attention_none" text="Intet kræver handling lige nu"/>
<text name="spu_attention_hintFlow" text=" → klik: opret flow"/>
<text name="spu_attention_hintOpen" text=" → klik: åbn flow '%s'"/>
<text name="spu_attention_hintFlow" text=" → opret flow"/>
<text name="spu_attention_hintOpen" text=" → åbn flow '%s'"/>
<text name="spu_attention_hintProduce" text=" → producér/køb"/>
<text name="spu_attention_produce" text="Et flow hjælper ikke — gården har kun %2$s %1$s i alt. Producér eller køb mere."/>
<text name="spu_attention_flowName" text="%s til %s"/>
<text name="spu_attention_hintSellFlow" text=" → klik: opret salgsflow"/>
<text name="spu_attention_hintSellFlow" text=" → opret salgsflow"/>
<text name="spu_attention_sellFlowName" text="Sælg %s"/>
<text name="spu_alert_empty" text="%s løber tør om %s — gården har %s, bruger %s/døgn"/>
<text name="spu_alert_empty" text="%s løber tør om %s — lager %s, bruger %s/døgn"/>
<text name="spu_alert_fullIn" text="%s er %d %% fuld — fuld om %s"/>
<text name="spu_alert_full" text="%s er %d %% fuld"/>
<text name="spu_alert_sell" text="Sælg %s nu: prisen er %d %% af årets top — %s"/>
@@ -688,7 +691,7 @@
<text name="spu_chain_switches" text="Automatiske skift siden indlæsning: %d"/>
<text name="spu_chain_scanning" text="Marker scannes endnu – kæden skifter ingen marker før alle er set"/>
<text name="spu_attention_chainSuggests" text="Kæde: %d forslag"/>
<text name="spu_attention_hintChain" text=" → klik: se Kæder"/>
<text name="spu_attention_hintChain" text=" → se Kæder"/>
<text name="spu_chain_problem_buy" text="Ingen af dine fabrikker laver %s — byg en eller køb"/>
<text name="spu_chain_problem_barn" text="Dine stalde leverer ikke nok %s — køb resten eller flere dyr"/>
<text name="spu_chain_problem_bottleneck" text="%s kan kun lave %s af %s/md"/>
@@ -719,6 +722,6 @@
<text name="spu_dep_warnNoDays" text="Advarsel: du slukkede %s (%s) — %s bruger det."/>
<text name="spu_attention_depOff" text="Slukket men nødvendig: %s"/>
<text name="spu_attention_depOffMore" text="Slukket men nødvendig: %s +%d"/>
<text name="spu_attention_hintFactories" text=" → klik: se Fabrikker"/>
<text name="spu_attention_hintFactories" text=" → se Fabrikker"/>
</texts>
</l10n>
+14 -11
View File
@@ -77,7 +77,7 @@
<text name="spu_field_stage_done" text="Done"/>
<text name="spu_field_reason_noRig" text="no %s ticked in the field fleet"/>
<text name="spu_field_reasonShort_noRig" text="no machine"/>
<text name="spu_field_reasonShort_allBusy" text="waiting for machine"/>
<text name="spu_field_reasonShort_allBusy" text="no machine free"/>
<text name="spu_field_reasonShort_tooWide" text="too wide"/>
<text name="spu_field_reasonShort_widthUnknown" text="width unknown"/>
<text name="spu_field_reasonShort_tooNarrow" text="too narrow"/>
@@ -346,7 +346,7 @@
<text name="spu_reason_needsAutoload" text="pallet goods need Universal Autoload on the trailer"/>
<text name="spu_product_row" text="%s — %s l — %s"/>
<text name="spu_price_pct" text="%d %% of top (%s)"/>
<text name="spu_price_none" text="no selling point"/>
<text name="spu_price_none" text="no buyer"/>
<text name="spu_outbound_waiting" text="waiting: %s"/>
<text name="spu_outbound_warning" text="!! %s"/>
<text name="spu_activity_holding" text="holding at %s (%s)"/>
@@ -370,13 +370,16 @@
<text name="spu_flow_noVehicle" text="(no tractor)"/>
<text name="spu_flow_ruleSellAlways" text="always sell"/>
<text name="spu_flow_chainIdle" text="needs a tractor/trailer"/>
<text name="spu_flow_sleeping" text="Sleeping — wakes when there is work (tractor and wagon are free meanwhile)"/>
<text name="spu_flow_sleeping" text="Sleeping"/>
<text name="spu_flow_sleepingWhy" text="Sleeping — %s" />
<text name="spu_flow_sleepingLong" text="Sleeping — wakes when there is work (tractor and wagon are free meanwhile)"/>
<text name="spu_sleep_noTripOut" text="nothing to take out"/>
<text name="spu_sleep_noTripSupply" text="nothing to fetch for the targets"/>
<text name="spu_flow_ruleSell" text="price >= %d %%"/>
<text name="spu_flow_ruleStore" text="storage > %d %%"/>
<text name="spu_flow_ruleOut" text="price >= %d %%, storage > %d %%"/>
<text name="spu_flow_round" text="round"/>
<text name="spu_flow_ruleIn" text="by need — lowest first"/>
<text name="spu_flow_ruleIn" text="by need"/>
<text name="spu_flow_ruleInLoops" text="by need, %d trips"/>
<text name="spu_markerAt" text="%s %d m"/>
<text name="spu_noMarker" text="NO MARKER within 40 m — place an AD marker at the trigger"/>
@@ -386,7 +389,7 @@
<text name="spu_storage_select" text="Show building"/>
<text name="spu_stat_now" text="now %s"/>
<text name="spu_stat_top" text="at top price %s"/>
<text name="spu_stat_noSell" text="no selling point"/>
<text name="spu_stat_noSell" text="no buyer"/>
<text name="spu_stat_days" text="%.1f days"/>
<text name="spu_stat_noUse" text="not consumed"/>
<text name="spu_stat_farm" text="farm %s = %s"/>
@@ -620,14 +623,14 @@
<text name="spu_kpi_full" text="Almost full"/>
<text name="spu_attention" text="— Needs attention —"/>
<text name="spu_attention_none" text="Nothing needs attention right now"/>
<text name="spu_attention_hintFlow" text=" → click: create flow"/>
<text name="spu_attention_hintOpen" text=" → click: open flow '%s'"/>
<text name="spu_attention_hintFlow" text=" → create flow"/>
<text name="spu_attention_hintOpen" text=" → open flow '%s'"/>
<text name="spu_attention_hintProduce" text=" → produce/buy"/>
<text name="spu_attention_produce" text="A flow won't help — the farm only has %2$s %1$s in total. Produce or buy more."/>
<text name="spu_attention_flowName" text="%s to %s"/>
<text name="spu_attention_hintSellFlow" text=" → click: create sell flow"/>
<text name="spu_attention_hintSellFlow" text=" → create sell flow"/>
<text name="spu_attention_sellFlowName" text="Sell %s"/>
<text name="spu_alert_empty" text="%s runs out in %s — farm has %s, uses %s/day"/>
<text name="spu_alert_empty" text="%s runs out in %s — stock %s, uses %s/day"/>
<text name="spu_alert_fullIn" text="%s is %d %% full — full in %s"/>
<text name="spu_alert_full" text="%s is %d %% full"/>
<text name="spu_alert_sell" text="Sell %s now: price is %d %% of the yearly top — %s"/>
@@ -688,7 +691,7 @@
<text name="spu_chain_switches" text="Automatic switches since load: %d"/>
<text name="spu_chain_scanning" text="Fields still being scanned – no field changes until all are seen"/>
<text name="spu_attention_chainSuggests" text="Chain: %d suggestions"/>
<text name="spu_attention_hintChain" text=" → click: see Chains"/>
<text name="spu_attention_hintChain" text=" → see Chains"/>
<text name="spu_chain_problem_buy" text="None of your factories makes %s — build one or buy it"/>
<text name="spu_chain_problem_barn" text="Barns make too little %s — buy the rest or more animals"/>
<text name="spu_chain_problem_bottleneck" text="%s can only make %s of %s/mo"/>
@@ -719,6 +722,6 @@
<text name="spu_dep_warnNoDays" text="Warning: you switched off %s (%s) — %s uses it."/>
<text name="spu_attention_depOff" text="Switched off but needed: %s"/>
<text name="spu_attention_depOffMore" text="Switched off but needed: %s +%d"/>
<text name="spu_attention_hintFactories" text=" → click: see Factories"/>
<text name="spu_attention_hintFactories" text=" → see Factories"/>
</texts>
</l10n>
+1 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<modDesc descVersion="107">
<author>masterdraco</author>
<version>1.62.306.0</version>
<version>1.62.307.0</version>
<title>
<en>AD Smart Pickup</en>
</title>