View Single Post
11/16/23, 03:50 AM   #4
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,001
Please re-read what I described above!
I'm not talking about your ZO_SavedVars wrapper which you're already using. I'm talking about "global tables" in lua code!
The ZO_SavedVars wrapper just handles the GetDisplayName() to get your @AccountName and GetCurrentCharacterId() to get the characterId for you and then updates the "global SV able of your addon, specified at ## SavedVariables: <globalTableName>" for you.
But <globalTableName> can be read and changed directly too!

Try /tbug <globalTableName> and you see your SV table in merTorchbug.
Try /tbug MyAddon.charVariables to see the difference where ZO_SavedVars was used as a wrapper around the table.

Check your SV file on the disk to get the correct table name, subtables etc. and then simply access it like described, directly, without ZO_SavedVars usage or any pointer variable like your MyAddon.charVariables or MyAddon.savedVariables

You can do both: With ZO_SavedVars and without, even at the same addon.

Last edited by Baertram : 11/16/23 at 04:08 AM.
  Reply With Quote