From f38c028916a4d5bee54a915e08fd658eb667f885 Mon Sep 17 00:00:00 2001 From: Lacustat Date: Thu, 29 Oct 2026 15:33:15 +0100 Subject: [PATCH] 0.1.172: Codex-Liste gebuendelt (3 s), Zonen-Cache 60 s Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_016onJCSHLwhs9udhC9ZLzk9 --- CodexUI.lua | 27 ++++++++++++++++++++++----- CodexZones.lua | 2 +- Freewood-OctoWoW-Codex.toc | 2 +- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/CodexUI.lua b/CodexUI.lua index d058879..31565f3 100644 --- a/CodexUI.lua +++ b/CodexUI.lua @@ -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) diff --git a/CodexZones.lua b/CodexZones.lua index 86c5e01..617ea15 100644 --- a/CodexZones.lua +++ b/CodexZones.lua @@ -30,7 +30,7 @@ local MIN_UNITS = 3 -- weniger normale Kreaturen: "zu wenig Daten" local LEVEL_SHARE = 0.05 -- Mindestanteil einer Stufe am Gewicht, damit sie zur typischen Spanne gehoert local WEIGHT_CAP = 30 -- eine haeufig gesehene Kreatur zaehlt hoechstens so viel local MAP_SHARE = 0.10 -- Karte zaehlt fuer eine Kreatur erst ab diesem Anteil ihrer Sichtungen -local CACHE_SECS = 5 +local CACHE_SECS = 60 -- die Berechnung geht ueber alle kreaturen (mehrere 100 ms, viel Muell): selten neu local cache, cacheAt, dirty = nil, 0, true diff --git a/Freewood-OctoWoW-Codex.toc b/Freewood-OctoWoW-Codex.toc index 5fbc95e..47cdedb 100644 --- a/Freewood-OctoWoW-Codex.toc +++ b/Freewood-OctoWoW-Codex.toc @@ -3,7 +3,7 @@ ## Notes: Learns quests, creatures and drops while you play: who gives and takes a quest, rewards, objectives, drop chances. ## Notes-deDE: Lernt beim Spielen Quests, Kreaturen und Beute: wer eine Quest vergibt und annimmt, Belohnungen, Ziele, Drop-Chancen. ## Author: Lacustat -## Version: 0.1.171 +## Version: 0.1.172 ## Dependencies: Freewood-OctoWoW-Core ## OptionalDeps: Freewood-OctoWoW-CodexData, Freewood-OctoWoW-ForeverData