Reply
Thread Tools Display Modes
Unread 10-24-11, 09:17 AM   #1
sarellia
Zombie
 
sarellia's Avatar
Join Date: Oct 2011
Posts: 1
Saved Variables

After reading Noax's post about SavedVariables I was wondering if it is currently possible to load saved variables from another character. This would be useful for importing settings for addons, so that a user does not have to change the config in each character they log on for each addon.

To clarify could I take my saved variables for character1 from addon1 and load / import them to character2, addon 1

If this is possible now could someone please give me an example of code that achieves this.

Thanks
Martin
__________________

sarellia is offline   Reply With Quote
Unread 10-24-11, 10:06 AM   #2
Aieny
Veiled Ripper
 
Aieny's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2011
Posts: 40
It's a fair amount of work, but if you really want to implement an easy-to-use solution, create your SavedVariable with account level, but make it a table that stores settings using character name/shard as the key. Then, you can set up a UI to import settings from one character to another. Your SavedVariable would look like this:
lua Code:
  1. MyAddon_Settings = {
  2.     "Aieny" = { Setting1 = 10, Setting2 = 50},
  3.     "Lynda" = { Setting1 = 20, Setting2 = 40}
  4. }
__________________
Lua Code:
  1. local function signature()
  2.     print("Aieny Celenovia")
  3.     print("www.riftcrafter.com")
  4. end
Aieny is offline   Reply With Quote
Unread 10-24-11, 02:26 PM   #3
starlon
Claw of Regulos
 
starlon's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2011
Posts: 10
Dongle-Rift has saved variable profiles support. I think that may do what you want. You'll have to read the source though, as there's not much documentation.

http://www.riftui.com/downloads/info90-Dongle-Rift.html
starlon is offline   Reply With Quote
Reply

Go BackRiftui » Developer Discussions » Lua Help » Saved Variables

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off