SavedVars
Hello Folks.
I am creating an addon and I have run into a little issue. What I am trying to do is access the data in my saved file and display it on which ever character is logged in. I can access my current characters data fine but I am unsure how to load up the values from my other characters. Here is a simple example.. Lua Code:
What I am trying to do is just create a string from this data that I can display on screen. The string would be something like Tarlac Sorc = 337 Tarlac Night = 9400 Tarlac Ramos = 21853 The I would display this data in my addon. I can access my current character, but I have not figured out how to access the other characters. Does anyone have any suggestions on where I would begin? Thanks. Tarlac. |
I think the easiest thing to do is save account wide, then specify the subtable for each character.
|
First save your non accountwide data by help of the unique char id, instead of using the old way by their name! Names can change, ids wont.
Then you are able to access your savedvars via their global variable MyAddonSavedVariable. Your account name will be GetDisplayName(). Just do something like local sv = MyAddonSavefVariable['Default'][GetDisplayName()]. For uniqueCharId, charSavedVars in pairs(sv) do d(charSavedVars["OffsetX"]) End |
Quote:
Tarlac. |
Addon showing during scene change
OK I have almost finished but am running into a small little issue. I only want my addon to be displayed when the normal scene is up . I found command to add as fragment
Lua Code:
Thanks Tarlac. |
Check my addon FCOStarveStop. Somewhere at the events (I think event_add_on_loaded) there is the code to register a new scene fragment for hud and/or hud_ui + the callback function for the OnStateChanged event, which shows/hides the toplevel control.
Hope it helps. |
Quote:
|
Quote:
|
All times are GMT -6. The time now is 08:18 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI