From 4af9e667349134659bdd398896e1abb088dcf491 Mon Sep 17 00:00:00 2001 From: Ade <923+ade@noreply.octowow.st> Date: Sat, 17 Oct 2026 20:51:59 +0000 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D1=84=D0=B0=D0=B9=D0=BB=D1=8B=20=D0=B2=20=C2=AB?= =?UTF-8?q?/=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AdeAlts.toc | 2 +- core.lua | 2 +- scan.lua | 16 ++++++++++++---- sync.lua | 21 +++++++++++++++++++-- ui_panel.lua | 5 ++++- 5 files changed, 37 insertions(+), 9 deletions(-) diff --git a/AdeAlts.toc b/AdeAlts.toc index 066de7a..2a336b8 100644 --- a/AdeAlts.toc +++ b/AdeAlts.toc @@ -2,7 +2,7 @@ ## Title: Ade Alts ## Notes: Alt manager: cooldowns, inventory, bank, gear, professions and missing recipes of all your characters. /ade ## Author: Ade -## Version: 1.2.1 +## Version: 1.2.2 ## SavedVariables: AdeAltsDB, ProfCDTrackerDB ## OptionalDeps: pfUI, SuperWoW, nampower core.lua diff --git a/core.lua b/core.lua index 08664df..0b7d750 100644 --- a/core.lua +++ b/core.lua @@ -7,7 +7,7 @@ local AA = AdeAlts -- Command: /pcd Minimap button: auto-docked by pfUI's addon button panel. AA.ADDON = "AdeAlts" -AA.VERSION = "1.2.1" +AA.VERSION = "1.2.2" AA.PREFIX = "PCDT" AA.DAY = 86400 AA.RDATA = {} -- recipe database, filled by the data_*.lua files diff --git a/scan.lua b/scan.lua index 40019e1..f508137 100644 --- a/scan.lua +++ b/scan.lua @@ -32,6 +32,7 @@ end local function StoreRecipes(prof, recs, rank, maxrank) if not AA.me or not prof or prof == "" or table.getn(recs) == 0 then return end AA.me.prof = AA.me.prof or {} + if AA.me.profGone then AA.me.profGone[prof] = nil end local p = AA.me.prof[prof] if not p then p = {} @@ -379,6 +380,7 @@ local function ScanSkills() if not header and name and PROFN[name] and not AA.BadProf(name, maxRank) and not (name == "Survival" and section == "Class Skills") then seen[name] = true + if AA.me.profGone then AA.me.profGone[name] = nil end local p = AA.me.prof[name] if not p then p = {} @@ -392,10 +394,16 @@ local function ScanSkills() end end end - for name, p in pairs(AA.me.prof) do - if not seen[name] and PROFN[name] then - AA.me.prof[name] = nil -- profession was unlearned - changed = true + -- a profession that is gone from a complete skill list was unlearned: remember when, so that + -- the shared file / chat cannot bring the old entry back + if n >= 5 and GetTime() - AA.enterTime >= 15 then + for name, p in pairs(AA.me.prof) do + if not seen[name] and PROFN[name] then + AA.me.prof[name] = nil + AA.me.profGone = AA.me.profGone or {} + AA.me.profGone[name] = time() + changed = true + end end end return changed diff --git a/sync.lua b/sync.lua index a25da68..898c2d1 100644 --- a/sync.lua +++ b/sync.lua @@ -133,7 +133,8 @@ local function ReceiveProf(text) local _, _, name, realm, pname, r, m, ts, rts, rec = string.find(text, "^P%^([^%^]*)%^([^%^]*)%^([^%^]*)%^(%d*)%^(%d*)%^(%d*)%^(%d*)%^(.*)$") if not name or name == "" or pname == "" then return false end - if AA.BadProf(pname, tonumber(m)) then return false end + local gone = (tonumber(m) or 0) == 0 and (tonumber(r) or 0) == 0 -- tombstone: profession was dropped + if not gone and AA.BadProf(pname, tonumber(m)) then return false end local k = name .. "-" .. realm if AA.db.ignored and AA.db.ignored[k] then return false end local c = AA.db.chars[k] @@ -142,12 +143,23 @@ local function ReceiveProf(text) AA.db.chars[k] = c end c.prof = c.prof or {} + c.profGone = c.profGone or {} + ts, rts = tonumber(ts) or 0, tonumber(rts) or 0 + if gone then + if ts > (c.profGone[pname] or 0) then + c.profGone[pname] = ts + local p0 = c.prof[pname] + if p0 and ts > (p0.ts or 0) then c.prof[pname] = nil end + return true + end + return false + end + if ts <= (c.profGone[pname] or 0) then return false end -- dropped after this data was written local p = c.prof[pname] if not p then p = {} c.prof[pname] = p end - ts, rts = tonumber(ts) or 0, tonumber(rts) or 0 local ch = false if ts > (p.ts or 0) then p.ts = ts @@ -284,6 +296,11 @@ local function FileWrite() if c.prof then for pname, p in pairs(c.prof) do table.insert(parts, EncodeProf(c, pname, p)) end end + for pname, gts in pairs(c.profGone or {}) do + if not (c.prof and c.prof[pname]) then + table.insert(parts, "P^" .. c.name .. "^" .. c.realm .. "^" .. pname .. "^0^0^" .. gts .. "^0^") + end + end if c.invBags or c.bankBags then table.insert(parts, EncodeBags(c)) end if c.equip then table.insert(parts, EncodeEquip(c)) diff --git a/ui_panel.lua b/ui_panel.lua index 4901f96..8a84abd 100644 --- a/ui_panel.lua +++ b/ui_panel.lua @@ -194,7 +194,10 @@ end function AA.SetBoxList(B, list) B.list = list or {} - AA.ResetScroll(B.sf) + if B.ctx ~= AA.selKey then -- only jump to the top when another character is shown + B.ctx = AA.selKey + AA.ResetScroll(B.sf) + end UpdateGrid(B) end