feat: Alt automatisk dækker gårdens forbrug først, spreder resten på top-3, hele årets såtid, [Gård]-markering — 1.62.282

This commit is contained in:
2026-10-17 02:21:31 +02:00
parent cbe417d0a9
commit 550f332593
7 changed files with 133 additions and 36 deletions
+11 -4
View File
@@ -110,7 +110,7 @@ function SmartPickupFrame:fieldCells(row)
local crop = ADFieldView.cropText(info, function(key) return self.i18n:getText(key) end)
return {
name, crop, self:fieldPlanText(field, info),
self.i18n:getText(field.plan.mode == "auto" and "spu_field_mode_auto" or "spu_field_mode_manual"),
self.i18n:getText(ADFieldView.modeKey(field.plan)),
self:fieldStatusText(field, info, true) .. ((ADFieldJobs.state.paused and not ADFieldJobs.isFieldResumed(info.id)
and ADFieldModel.isWorking(field)) and (" " .. self.i18n:getText("spu_field_pausedSuffix")) or ""),
ADFlowView.joinCounted(names, ", ", "-"),
@@ -395,9 +395,16 @@ end
function SmartPickupFrame:onAutoAllResult(yes)
self:safe(function(frame)
if not yes then return end
local result = ADAutoCrop.applyAll(g_currentMission:getFarmId())
local fruit = result.fruit ~= nil and frame:fruitTitle(result.fruit) or "-"
frame.statusOverride = string.format(frame.i18n:getText("spu_field_autoAllDone"), result.enabled, result.targeted, fruit)
local result = ADAutoCrop.applyAll(g_currentMission:getFarmId(), frame.getAdEnv())
if result.scanning then
frame.statusOverride = frame.i18n:getText("spu_field_autoAllScanning")
frame.statusOverrideTicks = SmartPickupFrame.STATUS_OVERRIDE_TICKS
return
end
local titles = {}
for _, name in ipairs(result.fruits or {}) do table.insert(titles, frame:fruitTitle(name)) end
frame.statusOverride = string.format(frame.i18n:getText("spu_field_autoAllDone"), result.enabled, result.chain, result.targeted,
#titles > 0 and table.concat(titles, ", ") or "-")
frame.statusOverrideTicks = SmartPickupFrame.STATUS_OVERRIDE_TICKS
frame:requestRebuild()
end)