Thread Tools Display Modes
03/06/17, 09:37 PM   #1
Jhenox
 
Jhenox's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 42
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.
  Reply With Quote
03/06/17, 10:28 PM   #2
Scootworks
 
Scootworks's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2014
Posts: 312
Originally Posted by Jhenox View Post
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?
  Reply With Quote
03/06/17, 10:30 PM   #3
Phinix
 
Phinix's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 186
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.

Last edited by Phinix : 03/06/17 at 10:34 PM.
  Reply With Quote
03/07/17, 08:57 AM   #4
Jhenox
 
Jhenox's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 42
Ah! I understand now. I inherited some code initially and just kept following along as I kept making changes. Thank you!
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Using LAM2.0. Settings keep defaulting everytime I change the version.

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off