View Single Post
01/26/16, 01:55 AM   #16
Terrillyn
AddOn Author - Click to view addons
Join Date: Jan 2016
Posts: 24
Originally Posted by votan View Post
If working with ZO_DeepTableCopy, the resulting table is not referenced by the saved variable. => not serialized to disk.
This is what I figured was happening which is why I was trying to set the values and not just make a copy, but idk how serialization or metatables really work in this case and tbh I'm having trouble understanding the lua docs on them (metatables).


Originally Posted by votan View Post
1. What is the expected behavior if you switch from char to account? Current settings taken over? Or switching to account settings?
I want the characters current settings to overwrite the account settings (by value), and switch to using the accounts SavedVars.
Originally Posted by votan View Post
2. What is the expected behavior if you switch from account to char? Current settings taken over? Or switching to char settings what ever they were?
I want the account settings to overwrite the current characters settings (by value), and switch to using the current characters SavedVars.

Originally Posted by votan View Post
Lua Code:
  1. setFunc = function(val)
  2.     if val then
  3.         -- purge data, due to different version
  4.         ZO_SavedVars:NewAccountWide("SimpleXPBar_Settings", "2", nil, nil)
  5.         -- purge again, back to old version, take over char settings
  6.         SimpleXPBar.AWSV = ZO_SavedVars:NewAccountWide("SimpleXPBar_Settings", "1", nil, SimpleXPBar.CharSV)
  7.         SimpleXPBar.CurSV = SimpleXPBar.AWSV
  8.     else
  9.         -- purge data, due to different version
  10.         ZO_SavedVars:New("SimpleXPBar_Settings", "2", nil, nil)
  11.         -- purge again, back to old version, take over account settings
  12.         SimpleXPBar.CharSV = ZO_SavedVars:New("SimpleXPBar_Settings", "1", nil, SimpleXPBar.AWSV)
  13.         SimpleXPBar.CurSV = SimpleXPBar.CharSV
  14.     end
  15.     SimpleXPBar.AWSV.general.account_wide = val
  16.     SimpleXPBar:UpdateStats()
  17.     SimpleXPBar:UpdateValues()
  18. end,
^This is probably what I'll have to end up doing.

Last edited by Terrillyn : 01/26/16 at 02:05 AM.
  Reply With Quote