fix(kæde): højst 3 beskeder og samlede poster i Kræver handling
notifyProblems sender højst 3 beskeder pr. tick og samler resten i én
("+N manglende led — se fanen Kæder"). Alle kædeproblemer står i én rød post
("Kæder: N manglende led", scoret under rød fuld; klik folder kæderne ud) og
slukkede nødvendige fabrikker i højst én post ("Slukket men nødvendig: X +k").
This commit is contained in:
@@ -106,10 +106,10 @@ end
|
||||
function SmartPickupFrame:onAttentionClick(entry)
|
||||
self:safe(function(frame)
|
||||
if entry ~= nil and (entry.kind == "chainSuggest" or entry.kind == "chainProblem") then
|
||||
-- manglende led: kæden foldes ud, så problemteksten står under den røde linje
|
||||
if entry.kind == "chainProblem" and entry.rootKey ~= nil then
|
||||
-- manglende led: kæderne med problemer foldes ud, så problemteksten står under den røde linje
|
||||
if entry.kind == "chainProblem" then
|
||||
frame.chainExpanded = frame.chainExpanded or {}
|
||||
frame.chainExpanded[entry.rootKey] = true
|
||||
for _, rootKey in ipairs(entry.rootKeys or {}) do frame.chainExpanded[rootKey] = true end
|
||||
end
|
||||
frame:switchTab(SmartPickupFrame.TAB_CHAINS)
|
||||
return
|
||||
|
||||
@@ -202,14 +202,13 @@ function SmartPickupFrame:alertText(entry)
|
||||
return string.format(i18n:getText("spu_attention_chainSuggests"), entry.count or 0)
|
||||
end
|
||||
if entry.kind == "chainProblem" then
|
||||
local text = string.format(i18n:getText("spu_attention_chainProblem"), tostring(entry.rootTitle), tostring(entry.itemsText))
|
||||
if (entry.more or 0) > 0 then text = text .. string.format(" (+%d)", entry.more) end
|
||||
return text
|
||||
return string.format(i18n:getText("spu_attention_chainProblems"), entry.count or 0)
|
||||
end
|
||||
if entry.kind == "dependencyOff" then
|
||||
local text = string.format(i18n:getText("spu_attention_depOff"), tostring(entry.buildingName))
|
||||
if (entry.more or 0) > 0 then text = text .. string.format(" (+%d)", entry.more) end
|
||||
return text
|
||||
if (entry.more or 0) > 0 then
|
||||
return string.format(i18n:getText("spu_attention_depOffMore"), tostring(entry.buildingName), entry.more)
|
||||
end
|
||||
return string.format(i18n:getText("spu_attention_depOff"), tostring(entry.buildingName))
|
||||
end
|
||||
if entry.kind == "empty" then
|
||||
return string.format(i18n:getText("spu_alert_empty"), stat.title, self:formatDays(stat.days), fc(stat.farmLevel or 0), fc(math.abs(stat.net or 0)))
|
||||
|
||||
Reference in New Issue
Block a user