Quantcast ESOUI - View Single Post - Saved Variables Bug and AddOns ToU
View Single Post
09/15/14, 09:47 AM   #57
Are you Wykkyd Gaming?
Wykkyd's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 112
My fix suggestion still stands and I honestly think more developers should switch to it.

I save everything to the variable declared in each addon's manifest. And I still filter by version number and character name. I do nothing at all with account names, because that's basically pointless.

if manifestGlobalVarName == nil then manifestGlobalVarName = {} end
if manifestGlobalVarName[<versionNum>] == nil then manifestGlobalVarName[<versionNum>] = {} end
<youraddon>.GlobalSettings = manifestGlobalVarName[<versionNum>]["GLOBAL"]
<youraddon>.Settings = manifestGlobalVarName[<versionNum>][<characterName>]
<load your defaults if need be>
<make sure to gsub() the ^ characters off the end of the character name>

Done. I then save/load things in and out of GlobalSettings or Settings as appropriate. Works like a charm. Not a single addon using this method has had a saved variable problem since they switched to this system months ago (some switched more recently).
  Reply With Quote