Well I spoke too soon, it wouldn't let me set accountwide settings when I did that, seems nothing I try lets me copy over another table, aside from writing a large function to manually copy over all the vars.
For now I'll just keep character and account settings in separate SavedVars, this means the user should enable the Account-Wide toggle before making any changes.
checkbox
Lua Code:
setFunc = function(val)
if val then
SimpleXPBar.CurSV = SimpleXPBar.AWSV
else
SimpleXPBar.CurSV = SimpleXPBar.CharSV
end
SimpleXPBar.AWSV.general.account_wide = val
SimpleXPBar:UpdateStats()
SimpleXPBar:UpdateValues()
end,
At playerload
Lua Code:
SimpleXPBar.AWSV = ZO_SavedVars:New("SimpleXPBar_Settings", "1", nil, SimpleXPBar.default_settings, nil, nil, '$' .. SimpleXPBar.name)
SimpleXPBar.CharSV = ZO_SavedVars:New("SimpleXPBar_Settings", "1", nil, SimpleXPBar.default_settings)
if SimpleXPBar.AWSV.general.account_wide then
SimpleXPBar.CurSV = SimpleXPBar.AWSV
else
SimpleXPBar.CurSV = SimpleXPBar.CharSV
end