comparison Export.lua @ 185:a7f2ba17c39a v90

Shadowlands pre-patch update.
author yellowfive
date Tue, 13 Oct 2020 10:49:07 -0700
parents 3be9cc6f7d20
children 4aeedce4c995
comparison
equal deleted inserted replaced
184:f374d84470db 185:a7f2ba17c39a
121 if itemLink ~= nil then 121 if itemLink ~= nil then
122 local itemData = Amr.Serializer.ParseItemLink(itemLink) 122 local itemData = Amr.Serializer.ParseItemLink(itemLink)
123 if itemData ~= nil then 123 if itemData ~= nil then
124 124
125 -- see if this is an azerite item and read azerite power ids 125 -- see if this is an azerite item and read azerite power ids
126 loc:SetBagAndSlot(bagId, slotId) 126 --[[loc:SetBagAndSlot(bagId, slotId)
127 if C_AzeriteEmpoweredItem.IsAzeriteEmpoweredItem(loc) then 127 if C_AzeriteEmpoweredItem.IsAzeriteEmpoweredItem(loc) then
128 local powers = Amr.ReadAzeritePowers(loc) 128 local powers = Amr.ReadAzeritePowers(loc)
129 if powers then 129 if powers then
130 itemData.azerite = powers 130 itemData.azerite = powers
131 end 131 end
132 end 132 end]]
133 133
134 if isBank then 134 if isBank then
135 _lastBankBagId = bagId 135 _lastBankBagId = bagId
136 _lastBankSlotId = slotId 136 _lastBankSlotId = slotId
137 end 137 end
257 end 257 end
258 258
259 end 259 end
260 ]] 260 ]]
261 261
262 local function scanSoulbinds()
263 if not C_Soulbinds then return end
264
265 -- read which conduits this player has unlocked
266 Amr.db.char.UnlockedConduits = {}
267
268 for t = 0,2 do
269 local conduits = C_Soulbinds.GetConduitCollection(t)
270 for i, conduit in ipairs(conduits) do
271 table.insert(Amr.db.char.UnlockedConduits, { conduit.conduitID, conduit.conduitRank })
272 end
273 end
274
275 if not Amr.db.char.ActiveSoulbinds then
276 Amr.db.char.ActiveSoulbinds = {}
277 end
278
279 -- read the currently active soulbind for this spec
280 local specPos = GetSpecialization()
281 if specPos and specPos >= 1 and specPos <= 4 then
282 Amr.db.char.ActiveSoulbinds[specPos] = C_Soulbinds.GetActiveSoulbindID() or 0
283 end
284
285 -- update soulbind tree info for all soulbinds
286 Amr.db.char.Soulbinds = {}
287
288 local covenantData = C_Covenants.GetCovenantData(C_Covenants.GetActiveCovenantID())
289
290 if covenantData and covenantData.soulbindIDs then
291 for i, soulbindId in ipairs(covenantData.soulbindIDs) do
292 local soulbindData = soulbindId and C_Soulbinds.GetSoulbindData(soulbindId)
293 local nodes = {}
294 local unlockedTier = 0
295
296 if soulbindData and soulbindData.tree and soulbindData.tree.nodes then
297 for i, node in ipairs(soulbindData.tree.nodes) do
298 if node.state == 3 then
299 nodes[node.row] = { soulbindId, node.row, node.column, node.conduitID, node.conduitRank }
300 end
301 if node.state > 0 then
302 unlockedTier = math.max(node.row, unlockedTier)
303 end
304 end
305 end
306
307 Amr.db.char.Soulbinds[soulbindId] = {
308 UnlockedTier = unlockedTier,
309 Nodes = nodes
310 }
311
312 end
313 end
314
315 end
316
317 --[[
262 local function scanEssences() 318 local function scanEssences()
263 if not C_AzeriteEssence then return end 319 if not C_AzeriteEssence then return end
264 320
265 -- read which essences this player has unlocked 321 -- read which essences this player has unlocked
266 Amr.db.char.UnlockedEssences = {} 322 Amr.db.char.UnlockedEssences = {}
298 end 354 end
299 end 355 end
300 end 356 end
301 end 357 end
302 end 358 end
359 ]]
303 360
304 local function scanTalents() 361 local function scanTalents()
305 local specPos = GetSpecialization() 362 local specPos = GetSpecialization()
306 if not specPos or specPos < 1 or specPos > 4 then return end 363 if not specPos or specPos < 1 or specPos > 4 then return end
307 364
343 scanBags() 400 scanBags()
344 401
345 -- scan current spec's talents just before exporting 402 -- scan current spec's talents just before exporting
346 scanTalents() 403 scanTalents()
347 404
405 -- scan all soulbinds just before exporting
406 scanSoulbinds()
407
348 -- scan current spec's essences just before exporting 408 -- scan current spec's essences just before exporting
349 scanEssences() 409 --scanEssences()
350 410
351 data.Talents = Amr.db.char.Talents 411 data.Talents = Amr.db.char.Talents
352 data.UnlockedEssences = Amr.db.char.UnlockedEssences 412 data.UnlockedConduits = Amr.db.char.UnlockedConduits
353 data.Essences = Amr.db.char.Essences 413 data.ActiveSoulbinds = Amr.db.char.ActiveSoulbinds
414 data.Soulbinds = Amr.db.char.Soulbinds
415 --data.UnlockedEssences = Amr.db.char.UnlockedEssences
416 --data.Essences = Amr.db.char.Essences
354 data.Equipped = Amr.db.char.Equipped 417 data.Equipped = Amr.db.char.Equipped
355 data.BagItems = Amr.db.char.BagItems 418 data.BagItems = Amr.db.char.BagItems
356 419
357 -- flatten bank data (which is stored by bag for more efficient updating) 420 -- flatten bank data (which is stored by bag for more efficient updating)
358 data.BankItems = {} 421 data.BankItems = {}
383 --Amr:AddEventHandler("VOID_STORAGE_DEPOSIT_UPDATE", scanVoid) 446 --Amr:AddEventHandler("VOID_STORAGE_DEPOSIT_UPDATE", scanVoid)
384 --Amr:AddEventHandler("VOID_STORAGE_UPDATE", scanVoid) 447 --Amr:AddEventHandler("VOID_STORAGE_UPDATE", scanVoid)
385 448
386 Amr:AddEventHandler("PLAYER_TALENT_UPDATE", scanTalents) 449 Amr:AddEventHandler("PLAYER_TALENT_UPDATE", scanTalents)
387 450
388 if C_AzeriteEssence then 451 --if C_AzeriteEssence then
389 Amr:AddEventHandler("AZERITE_ESSENCE_UPDATE", scanEssences) 452 -- Amr:AddEventHandler("AZERITE_ESSENCE_UPDATE", scanEssences)
390 end 453 --end
454
455 if C_Soulbinds then
456 Amr:AddEventHandler("SOULBIND_ACTIVATED", scanSoulbinds)
457 end