diff --git a/CodexUI.lua b/CodexUI.lua index 31565f3..169c4d2 100644 --- a/CodexUI.lua +++ b/CodexUI.lua @@ -4278,10 +4278,27 @@ local function Build(content) 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() + -- Welche Aenderungen die Liste betreffen: Messwerte (Erfahrung, Kampfdauer, Orte, Verbindungen, Karte, Auktion) + -- gar nicht; grosse Datenaenderungen (Startdaten, Import, Berechtigung, Katalog) immer; Aenderungen an einzelnen + -- Kreaturen/Objekten/Quests nur, wenn der Eintrag gerade in der Liste steht (sonst beim naechsten Bedienen). + local IGNORE_KINDS = { xp = true, ttk = true, spots = true, transport = true, taxi = true, mapscan = true, auction = true } + local BIG_KINDS = { forever = true, import = true, trust = true, catalog = true } + local KIND_OF_EVENT = { unit = "units", object = "objects", quest = "quests", item = "items" } + local function RowShows(id) + for i = 1, #listRows do + local row = listRows[i] + if row:IsShown() and row.entryID == id then return true end + end + return false + end + FW:On("CODEX_CHANGED", function(_, what, id) + if IGNORE_KINDS[what] then return end dirty = true dataVersion = dataVersion + 1 - if f:IsShown() then + if not f:IsShown() then return end + if BIG_KINDS[what] then + ScheduleRefresh(false) + elseif KIND_OF_EVENT[what] == kind and (id == nil or RowShows(id)) then ScheduleRefresh(false) end end, f) diff --git a/Freewood-OctoWoW-Codex.toc b/Freewood-OctoWoW-Codex.toc index 47cdedb..44be124 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.172 +## Version: 0.1.173 ## Dependencies: Freewood-OctoWoW-Core ## OptionalDeps: Freewood-OctoWoW-CodexData, Freewood-OctoWoW-ForeverData