View Single Post
01/11/16, 04:44 AM   #5
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,013
I do not want the addon to use it anymore
Ok, I read this sentence as "destroy the info"

If you've loaded the data into the addon and don't want the addon to react on it anymore, why do you still need it then? Could you explain what you are trying to do in detail so we can help you better?

Without knowing the details:

You could either set a flag into the savedvariables for this/these entries as they were loaded the first time properly, and react on the flag afterwards.

Or you could move the content of this savedvariables table to a second savedvariables table (like a backup) and use the 2nd savedvariables table then for your checks against the data that you have loaded before.
If the 1st savedvariables doesn't hold the data you can check the 2nd savedvars and this way you know they were read before already and transferred to 2nd saved vars.

To build different SavedVariables you can either change the version number to different ones (one for your current addon versin and one fixed to 999 e.g.), or just specify a different "key" for the SavedVariables, where the data should be saved:

Lua Code:
  1. local addon.settings = ZO_SavedVars:NewAccountWide(addon.name .. "_Settings", addon.version, "Settings", defaultSettings)
  2.  
  3. local addon.transferedSettings = ZO_SavedVars:NewAccountWide(addon.name .. "_TransferredSettings", addon.version, "TransferredSettings", defaultSettings)

You are able to check the "[TransferredSettings]" array in the SavedVariables <addonName>.lua file then for your "backup settings".
  Reply With Quote