ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Multiple saved variables (https://www.esoui.com/forums/showthread.php?t=147)

Myrroddin 03/02/14 01:11 AM

Multiple saved variables
 
Based on the Wiki, most things that have multiple entries in the toc/txt file are space-delineated. If you have more than one SV file, does it follow this pattern, or do you need 2, 3, etc SavedVariables entries?

Seerah 03/02/14 01:54 PM

What do you mean by, "If you have more than one SV file" ?

Myrroddin 03/02/14 05:37 PM

I mean if you want, say, MyAddOn_SV and MyAddOnDB. One would be general settings, the other could be character specific, with both in the same AddOn. You could do this in WoW, so I'm guessing you can do this in ESO. I just want to know the syntax in the .txt file, whether the two are separated by spaces or commas or listed on two lines.

The other option would be one SV file, where you would have MyAddOnDB.universal_setting.someSetting and MyAddOnDB.character_setting.someSetting.

Think of how AceDB allowed this. You could have MyAddOnDB.profile.someSetting and MyAddOn.Seerah.someSetting.

The second option would be better, but I could work with either. Just wondering how you would set it up.

Errc 03/02/14 05:41 PM

Quote:

Originally Posted by Myrroddin (Post 766)
I mean if you want, say, MyAddOn_SV and MyAddOnDB. One would be general settings, the other could be character specific, with both in the same AddOn. You could do this in WoW, so I'm guessing you can do this in ESO. I just want to know the syntax in the .txt file, whether the two are separated by spaces or commas or listed on two lines.

The other option would be one SV file, where you would have MyAddOnDB.universal_setting.someSetting and MyAddOnDB.character_setting.someSetting.

Think of how AceDB allowed this. You could have MyAddOnDB.profile.someSetting and MyAddOn.Seerah.someSetting.

The second option would be better, but I could work with either. Just wondering how you would set it up.

No need to make multiple saved vars files. Can make separate SV for character specific or for the whole account.

Code:

sv.char = sv.char or ZO_SavedVars:New( SvName , version , "main" , defaultChar )
sv.profile = sv.profile or ZO_SavedVars:NewAccountWide( SvName , version , "main" , defaultAccount )


Myrroddin 03/02/14 05:47 PM

Quote:

Originally Posted by Errc (Post 767)
No need to make multiple saved vars files. Can make separate SV for character specific or for the whole account.

Code:

sv.char = sv.char or ZO_SavedVars:New( SvName , version , "main" , defaultChar )
sv.profile = sv.profile or ZO_SavedVars:NewAccountWide( SvName , version , "main" , defaultAccount )


Ah, thank you. I've been pouring over the Wiki with no luck or love trying to find the following syntax:

* ZO_SavedVars
* EVENT_MANAGER
* CHAT_SYSTEM
* CALLBACK_MANAGER
* others?

If I had found ZO_SavedVars, I might have been able to answer this myself. Where are they documented, if they are?

Errc 03/02/14 06:29 PM

Quote:

Originally Posted by Myrroddin (Post 769)
Ah, thank you. I've been pouring over the Wiki with no luck or love trying to find the following syntax:

* ZO_SavedVars
* EVENT_MANAGER
* CHAT_SYSTEM
* CALLBACK_MANAGER
* others?

If I had found ZO_SavedVars, I might have been able to answer this myself. Where are they documented, if they are?

http://wiki.esoui.com/AddOn_Quick_Questions

Myrroddin 03/02/14 06:44 PM

Okay, that's a start, and thank you. I missed that. But it still leaves me with things like ZO_SavedVars:New() and :NewAccountWide(), d (really, "d" is print??) and some others. How did you guys figure out all the variants to those APIs?

Seerah 03/02/14 09:50 PM

d() is their dump(), really.

Even in WoW, when listing two saved variables in the .toc (or .txt here) file, there is only one saved variable *file* created, it just has both saved variables in it. The difference with WoW, was that you could have a line in the .toc to create account saved variables and a line to create character specific saved variables. If you wish to do something automated like that, you need to use ESO's saved variables API for the profiles.

Otherwise, you are still able to create and use saved variables that are created manually, without using their API layer on top of it. (Think of the ESO saved var API as AceDB)


All times are GMT -6. The time now is 01:32 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI