Skip to content

Commit

Permalink
Add character identification to per character saved variables
Browse files Browse the repository at this point in the history
  • Loading branch information
b-morgan committed Mar 2, 2021
1 parent 4bf4698 commit 4a6a991
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Skillet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ end
-- Called when the addon is loaded
--
function Skillet:OnInitialize()
if not SkilletWho then
SkilletWho = {}
end
if not SkilletDBPC then
SkilletDBPC = {}
end
Expand Down Expand Up @@ -730,6 +733,13 @@ function Skillet:PLAYER_ENTERING_WORLD()
local player, realm = UnitFullName("player")
local faction = UnitFactionGroup("player")
local guid = UnitGUID("player") -- example: guid="Player-970-0002FD64" kind=="Player" server=="970" ID="0002FD64"
--
-- Store some identifying data in the per character saved variables file
--
SkilletWho.player = player
SkilletWho.realm = realm
SkilletWho.faction = faction
SkilletWho.guid = guid
if guid then
local kind, server, ID = strsplit("-", guid)
DA.DEBUG(1,"player="..tostring(player)..", faction="..tostring(faction)..", guid="..tostring(guid)..", server="..tostring(server))
Expand Down
2 changes: 1 addition & 1 deletion Skillet.toc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
## X-Tukui-ProjectID: 205
## X-Website: https://www.curseforge.com/wow/addons/skillet
## SavedVariables: SkilletDB
## SavedVariablesPerCharacter: SkilletDBPC, SkilletMemory, SkilletProfile
## SavedVariablesPerCharacter: SkilletWho, SkilletDBPC, SkilletMemory, SkilletProfile
## OptionalDeps: Ace3, LibDialog-1.0, LibWindow-1.1, LibPeriodicTable-3.1, TradeSkillMaster, TheUndermineJournal, TradeSkillInfo, Auctionator, BeanCounter
## X-Embeds: Ace3, LibStub, CallbackHandler-1.0, LibDialog-1.0, LibWindow-1.1, LibPeriodicTable-3.1

Expand Down

0 comments on commit 4a6a991

Please sign in to comment.