Originally Posted by votan
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
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
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
Lua Code:
setFunc = function(val) if val then -- purge data, due to different version ZO_SavedVars:NewAccountWide("SimpleXPBar_Settings", "2", nil, nil) -- purge again, back to old version, take over char settings SimpleXPBar.AWSV = ZO_SavedVars:NewAccountWide("SimpleXPBar_Settings", "1", nil, SimpleXPBar.CharSV) SimpleXPBar.CurSV = SimpleXPBar.AWSV else -- purge data, due to different version ZO_SavedVars:New("SimpleXPBar_Settings", "2", nil, nil) -- purge again, back to old version, take over account settings SimpleXPBar.CharSV = ZO_SavedVars:New("SimpleXPBar_Settings", "1", nil, SimpleXPBar.AWSV) SimpleXPBar.CurSV = SimpleXPBar.CharSV end SimpleXPBar.AWSV.general.account_wide = val SimpleXPBar:UpdateStats() SimpleXPBar:UpdateValues() end,
|
^This is probably what I'll have to end up doing.