Riftui

Riftui (https://www.riftui.com/forums/index.php)
-   Lua Help (https://www.riftui.com/forums/forumdisplay.php?f=16)
-   -   Saved Variables (https://www.riftui.com/forums/showthread.php?t=163)

sarellia 10-24-11 09:17 AM

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

Aieny 10-24-11 10:06 AM

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. }

starlon 10-24-11 02:26 PM

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


All times are GMT -6. The time now is 04:50 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2022 MMOUI