ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Using LAM2.0. Settings keep defaulting everytime I change the version. (https://www.esoui.com/forums/showthread.php?t=6885)

Jhenox 03/06/17 09:37 PM

Using LAM2.0. Settings keep defaulting everytime I change the version.
 
Hello. I am using LAM2.0. I put out regular updates but I keep finding my saved settings keep defaulting everytime I increase the addon version. This has got to be frustrating for people using my addon. What am I missing? Thank you.

Scootworks 03/06/17 10:28 PM

Quote:

Originally Posted by Jhenox (Post 30155)
Hello. I am using LAM2.0. I put out regular updates but I keep finding my saved settings keep defaulting everytime I increase the addon version. This has got to be frustrating for people using my addon. What am I missing? Thank you.

do you change the saved variables version too?

Phinix 03/06/17 10:30 PM

The version number on your saved variable declaration should only change when you have made significant changes to the data format and WANT the user's saved variables to reset. This is the version of your saved vars database and is separate from your addon version. You will rarely if ever need to change this. Every time you do, the addon's saved variables will reset on the next load. (Actually all the old settings are still there in the same saved variables file under the old version number.)

To use Dungeon Tracker as an example, change this when you update:
Code:

local DTAddon = _G['DTAddon']
local L = DTAddon:GetLanguage()
DTAddon.Name = 'DungeonTracker'
DTAddon.Author = '|c66ccffPhinix|r'
DTAddon.Version = '1.02a'

Don't change this unless you WANT saved vars to reset:
Code:

DTAddon.SV = ZO_SavedVars:New(DTAddon.Name, 1.0, 'CharacterSettings', DTAddon.SVarDefaultC)
DTAddon.ASV = ZO_SavedVars:NewAccountWide(DTAddon.Name, 1.0, 'AccountSettings', DTAddon.SVarDefaultA)

Also remember to update the version in your manifest .txt file. You don't even technically NEED a version number in your LUA files anywhere.

Jhenox 03/07/17 08:57 AM

Ah! I understand now. I inherited some code initially and just kept following along as I kept making changes. Thank you!


All times are GMT -6. The time now is 06:21 AM.

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