View Single Post
01/26/16, 09:12 AM   #20
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Originally Posted by Terrillyn View Post
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).
Metatables are not saved. If you put a table that has a metatable in saved vars, then after ReloadUI it will be just plain table without metatable. That is why when you save for example a ZO_ColorDef instance, in saved vars it'll be just a plain table {r=1,g=1,b=1,a=1}, after ReloadUI it won't be a ZO_ColorDef (unless you setmetatable yourself).

ZO_DeepTableCopy has an optional second argument, the destination table. If you don't provide it, a new table is created.
  Reply With Quote