View Single Post
01/26/16, 03:30 PM   #21
Terrillyn
AddOn Author - Click to view addons
Join Date: Jan 2016
Posts: 24
I tried what you said before votan, and its actually just corrupting the table, even a fresh one.

first we call
Lua Code:
  1. SimpleXPBar.AWSV = ZO_SavedVars:New("SimpleXPBar_Settings", "1", nil, SimpleXPBar.default_settings, nil, nil, '$' .. SimpleXPBar.name)

and this is AWSV
Lua Code:
  1. {
  2.     __index = {
  3.         mysaveddata1,
  4.         mysavedata2,
  5.         version = "1",
  6.     },
  7.     __newindex = function,
  8.     default = table...,
  9.     GetINterfaceForCharacter = function,
  10. }

then we call
Lua Code:
  1. SimpleXPBar.CharSV = ZO_SavedVars:New("SimpleXPBar_Settings", "1", nil, SimpleXPBar.AWSV)

and it does this to CharSV
Lua Code:
  1. {
  2.     __index = {
  3.         default = table...,
  4.         GetInterfaceForCharacter = function,
  5.         version = "1",
  6.     },
  7.     __newindex = function,
  8.     default = table...,
  9.     GetINterfaceForCharacter = function,
  10. }

Looks like the meta data is getting copied too.

if I try this instead
Lua Code:
  1. SimpleXPBar.CharSV = ZO_SavedVars:New("SimpleXPBar_Settings", "1", nil, SimpleXPBar.AWSV.__index)

then we get only
Lua Code:
  1. {
  2.     __index = {
  3.         version = "1",
  4.     },
  5.     __newindex = function,
  6.     GetINterfaceForCharacter = function,
  7. }

Basically I want the data between AWSV and the current CharSV to be synced when account_wide is enabled, and not synced when its not.
It doesn't have to be synced all the time, only when changing account_wide, basically what you where trying to do in post 15.

Last edited by Terrillyn : 01/26/16 at 06:10 PM.
  Reply With Quote