You cannot "save" frames, and your AddOn's main frame (a frame is a special kind of table in WoW) should handle all of the functions and variables of the AddOn but the SavedVariables must always be a normal global-scope table. You'll have to settle with using something like "self.db" instead of "self", or simply SkullMeDB.
So does that mean I can create the frame once and saved var it with all the settings?
EDIT: I used a SkullMeG = SkullMeG or CreateFrame("Frame", "SkullMe") to get my desired results...Turns out since its just a table thats created you can save frames?...Wow thought it was more complex than that lol
You cannot save a wow frame (i.e a table that is returned by CreateFrame()) because the table contains quite a bit of information that would really just become garbage when saved. It may even hang your wow trying to write a 600 mb savedvariables file if you try.
It may even hang your wow trying to write a 600 mb savedvariables file if you try.
Data types that can't be easily written as text are just skipped when writing out the savedvariables file. (Even some of the Lua types that can be converted to a "serializable" text format with a little effort are skipped for simplicity's sake.) So the game wouldn't hang, but what got written out would be only the uninteresting bits of the table. You'd end up with an incomplete copy of SkullMeG written to disk, and when read back in, it would no longer be recognized as a UI frame.
Data types that can't be easily written as text are just skipped when writing out the savedvariables file. (Even some of the Lua types that can be converted to a "serializable" text format with a little effort are skipped for simplicity's sake.) So the game wouldn't hang, but what got written out would be only the uninteresting bits of the table. You'd end up with an incomplete copy of SkullMeG written to disk, and when read back in, it would no longer be recognized as a UI frame.
That's not really true. Go try it. :)
Then try to save _G[].
That's not really true. Go try it. :)
Then try to save _G[].
I did, once, a long time ago, out of ignorance. I got all of the strings, numbers, booleans, and subtables out of my SV table, but function pointers were silently dropped (even though there is a way to save and restore them). Since then, coroutines have been exposed to the scripting sandbox, but I don't know anybody brave/foolish/silly enough to try saving them.
Bah I decided to do a full rewrite of all my code, with the goal of it being clean to start out with, remaking code pieces at a time is becoming a major pain.
EDIT: Im doing alot of commenting to make sure my old logic is smart, does alot of comments effect anything in the addon other than maybe file size?...Should I make sure to release my SkullMe releases commentless to speed up loading the file or does it matter?
You cannot save a wow frame (i.e a table that is returned by CreateFrame()) because the table contains quite a bit of information that would really just become garbage when saved. It may even hang your wow trying to write a 600 mb savedvariables file if you try.
Data types that can't be easily written as text are just skipped when writing out the savedvariables file. (Even some of the Lua types that can be converted to a "serializable" text format with a little effort are skipped for simplicity's sake.) So the game wouldn't hang, but what got written out would be only the uninteresting bits of the table. You'd end up with an incomplete copy of SkullMeG written to disk, and when read back in, it would no longer be recognized as a UI frame.
That's not really true. Go try it. :)
Then try to save _G[].
SkullMeSV = SkullMeG.db
and put SkullMeSV into your TOC ## SavedVariables
I did, once, a long time ago, out of ignorance. I got all of the strings, numbers, booleans, and subtables out of my SV table, but function pointers were silently dropped (even though there is a way to save and restore them). Since then, coroutines have been exposed to the scripting sandbox, but I don't know anybody brave/foolish/silly enough to try saving them.
EDIT: Im doing alot of commenting to make sure my old logic is smart, does alot of comments effect anything in the addon other than maybe file size?...Should I make sure to release my SkullMe releases commentless to speed up loading the file or does it matter?