Mercurial > wow > askmrrobot
diff AskMrRobot-Serializer/AskMrRobot-Serializer.lua @ 165:3be9cc6f7d20 v77
Updated for 8.2, initial essence support.
author | yellowfive |
---|---|
date | Tue, 25 Jun 2019 10:27:20 -0700 |
parents | 35612aee8e15 |
children | 5c68d3fccff3 |
line wrap: on
line diff
--- a/AskMrRobot-Serializer/AskMrRobot-Serializer.lua Tue May 07 10:32:41 2019 -0700 +++ b/AskMrRobot-Serializer/AskMrRobot-Serializer.lua Tue Jun 25 10:27:20 2019 -0700 @@ -1,6 +1,6 @@ -- AskMrRobot-Serializer will serialize and communicate character data between users. -local MAJOR, MINOR = "AskMrRobot-Serializer", 76 +local MAJOR, MINOR = "AskMrRobot-Serializer", 77 local Amr, oldminor = LibStub:NewLibrary(MAJOR, MINOR) if not Amr then return end -- already loaded by something else @@ -492,6 +492,10 @@ ret.Specs = {} ret.Talents = {} readSpecs(ret) + + -- these get updated later, since need to cache info for inactive specs + ret.UnlockedEssences = {} + ret.Essences = {} ret.Equipped = {} readEquippedItems(ret) @@ -687,7 +691,15 @@ if data.Specs[spec] and (complete or spec == data.ActiveSpec) then table.insert(fields, ".s" .. spec) -- indicates the start of a spec block table.insert(fields, data.Specs[spec]) - table.insert(fields, data.Talents[spec] or "") + table.insert(fields, data.Talents[spec] or "") + + local essences = {} + if data.Essences and data.Essences[spec] then + for i, ess in ipairs(data.Essences[spec]) do + table.insert(essences, table.concat(ess, ".")) + end + end + table.insert(fields, table.concat(essences, "_")) end end @@ -707,6 +719,14 @@ end end end + + -- export unlocked essences + if data.UnlockedEssences then + table.insert(fields, ".ess") + for i, ess in ipairs(data.UnlockedEssences) do + table.insert(fields, table.concat(ess, "_")) + end + end -- if doing a complete export, include bank/bag items too if complete then @@ -735,11 +755,13 @@ end +--[[ -- Shortcut for the common use case: serialize the player's currently active setup with no extras. function Amr:SerializePlayer() local data = self:GetPlayerData() return self:SerializePlayerData(data) end +]] --[[ ----------------------------------------------------------------------------------------------------------------------