Загрузить файлы в «/»
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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))
|
||||
|
||||
+4
-1
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user