0.1.172: Codex-Liste gebuendelt (3 s), Zonen-Cache 60 s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016onJCSHLwhs9udhC9ZLzk9
This commit is contained in:
Lacustat
2026-10-29 15:33:15 +01:00
co-authored by Claude Sonnet 5.5
parent b94d8a1b44
commit f38c028916
3 changed files with 24 additions and 7 deletions
+22 -5
View File
@@ -4258,20 +4258,37 @@ local function Build(content)
return table.concat(t, "\n")
end
-- Der Listenaufbau (alle Eintraege filtern und sortieren) kostet mit den Startdaten 0,2 bis 0,9 s. Aenderungen kommen
-- aber im Sekundentakt (Name gelernt, Haendler, Erfahrung, Beute): gesammelt hoechstens alle REFRESH_GAP Sekunden aufbauen.
local REFRESH_GAP = 3
local refreshPending, refreshDetail = false, false
local function ScheduleRefresh(detail)
if detail then refreshDetail = true end
if refreshPending then return end
refreshPending = true
local function Run()
refreshPending = false
local wantDetail = refreshDetail
refreshDetail = false
if not f:IsShown() then return end
RefreshList()
if wantDetail and (kind == "units" or kind == "objects") and selected and detailMissing then
ShowDetail()
end
end
if _G.C_Timer and _G.C_Timer.After then _G.C_Timer.After(REFRESH_GAP, Run) else Run() end
end
FW:On("CODEX_CHANGED", function()
dirty = true
dataVersion = dataVersion + 1
if f:IsShown() then
RefreshList()
ScheduleRefresh(false)
end
end, f)
FW:On("CODEX_ITEMS_LOADED", function()
dataVersion = dataVersion + 1
if f:IsShown() and (kind == "items" or kind == "units" or kind == "objects") then
RefreshList()
if (kind == "units" or kind == "objects") and selected and detailMissing then
ShowDetail()
end
ScheduleRefresh(true)
end
end, f)