View Single Post
12/20/14, 09:57 AM   #14
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by votan View Post
If I compare Garkin and sirinsidiator, the difference is, that Garkin uses only one ## SavedVariables.
If more than one saved variable can be specified, sharing data should be possible, by simply using a shared variable name.

tja.
This is how it does default UI. It has just one global name for saved variables defined in manifest:

from Ingame.txt:
Code:
; Ingame Script Files
## DependsOn: ZO_IngameLocalization ZO_Common

## SavedVariables: ZO_Ingame_SavedVariables
And then each part of the UI uses the same variable with different namespace:
Lua Code:
  1. --Provisioner.lua:
  2. self.savedVars = ZO_SavedVars:New("ZO_Ingame_SavedVariables", 1, "Provisioner", defaults)
  3.  
  4. --SmithingCreation.lua:
  5. self.savedVars = ZO_SavedVars:New("ZO_Ingame_SavedVariables", 2, "SmithingCreation", defaults)
  6.  
  7. --WorldMap.lua:
  8. g_savedVars = ZO_SavedVars:New("ZO_Ingame_SavedVariables", 4, "WorldMap", defaults)
  9.  
  10. --etc.

All you need is some data sharing addon (because of manifest) where you define global variable name for saved variables. But as you said, it is possible to use "ZO_Ingame_SavedVariables" instead which will be always available as default UI is loaded first. You should just use unique namespace for the data.
  Reply With Quote