View Single Post
05/18/14, 10:52 AM   #16
zgrssd
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 280
Originally Posted by Edda View Post
d(#RJ.Memory); --> ALWAYS 0 !![/highlight]

RJ.Memory size is always 0 even tho I add stuff to it. And the savedVars file correctly displays saved data, and everything is working correctly but not the var size check.
# does not work on the "top" layer of int indexes for the Settings Object itself (propably because they work via metatables and the "index not found" action). The trick is to just create a string index and store your table one index level "deeper" (taken from one of my addons):
Code:
--Generate default CCD, then try to load saved Container from disk
	local defaultCCD = {}
	defaultCCD.CCD = getCCD(1,TopContainerIndex)
	PER_GL_CCD = ZO_SavedVars:NewAccountWide("UTC_Persistent", 1, "UCT_ChatContainerData", defaultCCD, nil)
I can itterate over defaultCCD.CCD as if it was any other table from any other source and usually jsut hand/assign it directly.
In fact the only times I use PER_GL_CCD at all is the get/set the String Index "CCD".

When is this function running? Calling d() too soon after a reloadui won't do anything as the chat windows aren't initialized
One of libDebugs functions is to buffer those "early d() messages", to give them out when the chat is ready.
Note the bug with swallowed .lua parsing errors however (as long as it is not fixed).
  Reply With Quote