Thread Tools Display Modes
Prev Previous Post   Next Post Next
10-05-05, 03:48 AM   #1
Gorak
A Fallenroot Satyr
Join Date: Oct 2005
Posts: 21
Scope of SavedVariables insruction

Hi !

The SavedVariables directive in an add-on's TOC-file specifies the variables it saves in-between gaming sessions.

I've been developing an add-on for quite some time now, which is constructed in a very Java-like namespacing system, that is, all seperate components of the add-on are placed into different namespaces. This is accomplished by defining nested array/table variables and later-on defining the variables and functions as fields inside the table.

However, when I try to specify a table variable defined inside a namespace as the variable to save, it fails to accomplish it. In order for SavedVariables to find and save te variable, I must define the table at global level, i.e. not inside any namespaces.

While the current approach uses a global variable, that is then copied inside the namespace into the actual table when VARIABLES_LOADED event is triggered, I would certainly like to know what the scope of SavedVariables is, if anyone knows.. To me, it seems it can only identify global-level variables correctly..

- Gorak
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Scope of SavedVariables insruction


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off