-
Posted by cralor on Mon, 03 Nov 2008 21:11:01
Hello.
I am currently having a bit of issues with Saved Variables. I wish this was covered in WoW Programming. I'd like to learn a bit more about implementing options and saved variables into an addon. I have done some work, but not knowing enough of it has halted development on my addon.
Is there any resources available to help me learn more about Saved Variables?
Thank you.
-
Posted by cralor on Mon, 03 Nov 2008 21:11:01
Hello.
I am currently having a bit of issues with Saved Variables. I wish this was covered in WoW Programming. I'd like to learn a bit more about implementing options and saved variables into an addon. I have done some work, but not knowing enough of it has halted development on my addon.
Is there any resources available to help me learn more about Saved Variables?
Thank you.
-
Posted by jnwhiteh on Tue, 04 Nov 2008 03:08:47
There's nothing more to be said about them than what appears in Chapter 9, under the table of contents metadata section. You specify a name of a saved variable, and then when you log out of the game the contents of that variable (string, number or table) are output to a file. When you log back into the game, after the
ADDON_LOADED
event fires for your addon, the data is loaded back into the game.Could you be more specific about what is troubling you? The reason they are not covered in depth is that there really isn't much to them at all.
-
Posted by cralor on Tue, 04 Nov 2008 11:47:20
I have just been having a little bit of trouble saving the position of a frame. (X, Y coords)
Here is my pastey: http://wowuidev.pastey.net/100667
Thank you for your response.
-
Posted by morlando on Tue, 04 Nov 2008 13:15:20
You actually don't need to worry about saving frame positions yourself, for the most part. If you have a frame that's declared
movable="true"
in XML or:SetUserPlaced(true)
in Lua, its position will be saved in WoW\WTF\Account\account name\realm name\character name\layout-cache.txt. Just be sure if you're setting its initial position in Lua that you're doing it before the VARIABLES_LOADED event (e.g. in an OnLoad script).