Download
(28 Kb)
Download
Updated: 10/30/21 10:52 AM
Pictures
File Info
Compatibility:
Deadlands (7.2.5)
Waking Flame (7.1.5)
Updated:10/30/21 10:52 AM
Created:10/03/18 10:28 PM
Monthly downloads:18,195
Total downloads:1,691,791
Favorites:848
MD5:
LibSavedVars  Popular! (More than 5000 hits)
Version: 6.0.7
by: silvereyes [More]
PSA: silvereyes is no longer playing ESO, so this addon is looking for a new maintainer. Please reach out to Dolby via PM if you want to take ownership of this addon.

This library is intended to standardize and extend the built-in saved vars functionality of ESO.

See https://github.com/silvereyes333/LibSavedVars for full usage instructions with examples.
PSA: silvereyes is no longer playing ESO, so this addon is looking for a new maintainer. Please reach out to Dolby via PM if you want to take ownership of this addon.

Version 6.0.7
- Update 32 Deadlands compatibility
- This version is compatible with both PTS (Deadlands) and live (Waking Flame)

Version 6.0.6
- Update 31 Waking Flame compatibility

Version 6.0.5
- Update 30 Blackwood compatibility
- This version is compatible with both live (Flames of Ambition) and PTS (Blackwood)
- Bugfix: Fix exception that can sometimes be thrown when switching Account-Wide settings off
- Bugfix: Fix leak of global underscore (_) variable

Version 6.0.4
- This version is compatible with both live (Markarth) and PTS (Flames of Ambition)
- Fix bug that caused the Account-Wide settings toggle to not work in some rare cases.

Version 6.0.3
- Update 29 Flames of Ambition compatibility
- This version is compatible with both live (Markarth) and PTS (Flames of Ambition)

Version 6.0.2
- Update 28 Markarth compatibility

Version 6.0.1
- Update 27 Stonethorn compatibility
- This version is compatible with both live (Greymoor) and PTS (Stonethorn)

Version 6.0.0
- Update 26 Greymoor compatibility
- New Feature: Defaults Trimming!
+ Reduces the size of saved vars on disk and during load screens.
+ Note, this option is off by default and must be enabled with the new EnableDefaultsTrimming() method, since it can lead to a short delay during logoff and may not provide any value, depending on your saved vars.
- Deprecated the following old methods
+ LibSavedVars:New()
+ LibSavedVars:Init()
+ LibSavedVars:Get(addon, key)
+ LibSavedVars:GetLibAddonMenuSetting(addon, default)
+ LibSavedVars:Set(addon, key, value)
+ LSV_Data:New()
+ LSV_Data:Migrate(legacySavedVars, newSavedVars, beforeCallback, addon, ...)

Version 5.0.4
- Update 25 Harrowstorm compatibility
- This version is compatible with both PTS (Harrowstorm) and live (Dragonhold)
- Clicking the Reset to Default button will now set default values within the current scope and leave the "account-wide settings" toggle alone

Version 5.0.3
- Fix bug with LSV_Data functions not working when account / character toggle not enabled.

Version 5.0.2
- Fix bug with saved vars not being loaded when a character or account toggle isn't used

Version 5.0.1
- Update 24 Dragonhold API bump

Version 5.0.0
- Update 23 Scalebreaker compatibility. This version is compatible with both Update 22 Elsweyr and Update 23.
- Removed LibStub support. Simply refer to the library by the LibSavedVars global now.
- Improved German tooltip for the "Account-Wide" LibAddonMenu checkbox (thanks, Baertram!)

Version 4.2.2
- Fix for character-scope settings not receiving new default saved vars values when they are only specified at the account-level.

Version 4.2.1
- Fix for error being thrown when LibStub is not installed

Version 4.2.0
- Remove LibStub dependency
- Add new global LibSavedVars for addon authors to use instead of LibStub
- Add ESO - Japanese Localization addon compatibility

Version 4.1.0
- API bump for Update 22 Elsweyr
- Marked as library in manifest with new ## IsLibrary flag.

Version 4.0.1
- Fix load order problem with older versions

Version 4.0.0

- Added saved vars version support that does not wipe all settings during upgrade. See classes/LSV_Data.lua:
* RemoveSettings()
* RenameSettings()
* RenameSettingsAndInvert()
* Version()

- Changed constructor method names and parameters to match ZO_SavedVars exactly. See LibSavedVars.lua:
* NewAccountWide()
* NewCharacterSettings() / NewCharacterIdSettings()

- Added new chainable methods for adding account or character-specific saved vars toggle. See classes/LSV_Data.lua:
* AddAccountWideToggle()
* AddCharacterSettingsToggle()

- Added several new helper methods:
* GetAccountsAndProfiles(savedVarName): Gets a list of tables of the form { account = "@displayName", profile = "NA Megaserver" } for all accounts within the given saved var table.
* GetInfo(savedVars): Gets table containing information about the given saved vars, such as addon name, constructor parameters, raw saved vars table, etc.

- Migration no longer requires creating a ZO_SavedVars instance or leaves any data behind in the legacy saved vars tables. See LibSavedVars.lua:
* MigrateAccountWide()
* MigrateCharacterId()
* MigrateCharacterName()
* MigrateCharacterNameToId()
* MigrateToMegaserverProfiles()

- Deprecated the following methods in LibSavedVars.lua:
* New(). See NewAccountWide() and NewCharacterSettings()
* GetClass(). You can now access classes directly by name (e.g. LSV_Data, LSV_SavedVarsManager)

- Deprecated the following methods in classes\LSV_Data.lua (formerly just Data.lua):
* New(). See NewAccountWide and NewCharacterSettings().
* Migrate(). See MigrateFrom().

- Moved Lua 5.2 pairs(), ipairs() and next() overrides into a separate library, LibLua5.2, to avoid the performance penalty for non-developers or anyone else who doesn't care about iterating saved vars.

- API bump for Update 21 Wrathstone

Version 3.0

- New methods New(), NewAccountWide() and NewCharacterIdSettings() return a data object that can be used as a 1:1 replacement for ZO_SavedVars instances
- New helper method GetRawDataTable() returns the underlying data table for a ZO_SavedVars instance, since ZO_SavedVars:New() just returns an interface, not the data itself.
- Added usage documentation / comments to all public methods in code.

- Data class features:
* data["key"] and data.key operator support
* data["key"] = value and data.key = value operator support
* next(), pairs() and ipairs() support for iterating saved vars
* GetAccountSavedVarsActive() and SetAccountSavedVarsActive(value) methods for toggling the active scope between account and character-specific settings
* Migrate(legacySavedVars, beforeCallback, addon, ...) method to call directly and control when migration is executed.
* GetActiveSavedVars() method to return a reference to the active ZO_SavedVars instance for the currently logged-in character
* GetLength() returns the # length of the data for the active ZO_SavedVars instance for the currently logged-in character
* GetLibAddonMenuAccountCheckbox() replaces the old library-wide method that took an "addon" parameter.

- DEPRECATED METHODS:
* Get() Use data["key"] or data.key of the new data class instead.
* Set(value) Use data["key"] = value or data.key = value of the new data class instead.
* Init() Legacy var migration moved to data class. Use data:Migrate() of the new data class and New(), NewAccountWide() and NewCharacterIdSettings() instead.
* GetLibAddonMenuSetting(addon) Use data:GetLibAddonMenuSetting() of the new data class instead.


Version 2
- Fix bug where account wide settings overwrite character settings when toggling in LAM2

Version 1
- Initial release
Optional Files (0)


Archived Files (21)
File Name
Version
Size
Uploader
Date
6.0.6
28kB
silvereyes
08/23/21 07:56 AM
6.0.5
28kB
silvereyes
05/30/21 04:27 PM
6.0.4
28kB
silvereyes
02/17/21 02:10 PM
6.0.3
28kB
silvereyes
02/14/21 04:21 PM
6.0.2
28kB
silvereyes
11/02/20 08:40 AM
6.0.1
28kB
silvereyes
08/18/20 10:04 PM
6.0.0
28kB
silvereyes
05/25/20 10:45 PM
5.0.4
26kB
silvereyes
02/16/20 09:58 PM
5.0.3
26kB
silvereyes
11/11/19 10:11 PM
5.0.2
26kB
silvereyes
11/11/19 04:07 PM
5.0.1
26kB
silvereyes
10/21/19 11:56 AM
5.0.0
26kB
silvereyes
08/01/19 05:12 PM
4.2.2
26kB
silvereyes
05/27/19 02:14 PM
4.2.1
26kB
silvereyes
05/25/19 09:35 AM
4.2.0
26kB
silvereyes
05/17/19 08:33 PM
4.1.0
25kB
silvereyes
04/15/19 09:50 PM
4.0.1
25kB
silvereyes
01/28/19 12:59 PM
4.0.0
25kB
silvereyes
01/27/19 02:07 AM
3.0
10kB
silvereyes
10/07/18 11:28 PM
2
5kB
silvereyes
10/04/18 10:27 AM
0.1.0
5kB
silvereyes
10/03/18 10:28 PM


Post A Reply Comment Options
Unread 01/01/24, 01:32 PM  
heinrich6745

Forum posts: 0
File comments: 17
Uploads: 0
Originally Posted by Baertram
It's definately LibsavedVars which creates the global _ table in the SV as I can find one with CraftBagExtended too for example
came here after replying to CraftBagExtended page as well

Are you getting this error?

Code:
user:/AddOns/CraftBagExtended/classes/Settings.lua:5: Cannot find a library instance of "LibSavedVars".
stack traceback:
user:/AddOns/LibStub/LibStub/LibStub.lua:29: in function 'LibStub:GetLibrary'
<Locals> self = [table:1]{minor = 5, SILENT = T}, major = "LibSavedVars" </Locals>
user:/AddOns/CraftBagExtended/classes/Settings.lua:5: in function '(main chunk)'
<Locals> cbe = [table:2]{apiVersion = 1, title = "|c99CCEFCraft Bag Extended|r", author = "|c99CCEFsilvereyes|r", debug = F, version = "2.7.1", name = "CraftBagExtended"}, class = [table:3]{} </Locals>
Report comment to moderator  
Reply With Quote
Unread 12/18/23, 10:35 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4969
File comments: 6035
Uploads: 78
It's definately LibsavedVars which creates the global _ table in the SV as I can find one with CraftBagExtended too for example
Report comment to moderator  
Reply With Quote
Unread 07/11/22, 07:46 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4969
File comments: 6035
Uploads: 78
Hey silvereyes,

the addon Lost Treasure uses LibSavedVars for accountwide settings etc.
The account wide table exists as LostTreasure_Account but with the same table reference as a global variable _ too!


I think LibSavedVars is somewhere leaking a global _ as I was not able to find any _ usage within Lost Treasure.#

Edit:
I found a _ within LostTreasure but it does not reference the SavedVariables!
So I guess this is another global leaking _ which gets overwritten by SV table reference later on then.
Startup.lua

Code:
locla name, author
...
name, _, author = addOnManager:GetAddOnInfo(i)
_ is the addon title here, so no SV table with the name LostTreasure_Account
Last edited by Baertram : 07/11/22 at 09:07 AM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: