AceDB lost default values on SetProfile
View Single Post
09-17-17, 05:28 PM
A Pyroguard Emberseer
Join Date: Oct 2008
AceDB only writes settings that have been altered to the SavedVariables file. It does not write if nothing has been changed.
In your example,
has a default of
; you did not change it to
, it is still
. Therefore it is
in your SV file. Nothing is lost. In fact, it retains the default value from
BTW, here's a tip: change this line. This will create a literal profile called
in the Profiles options tree when presented to the user. You will see what I mean when you load into the game. It makes the life of the user a lot easier.
self.db = LibStub("AceDB-3.0"):New("MyAddonDB", PROFILE_DEFAULTS, true) -- add true to the end
Also, using SetProfile() as I understand it (could be wrong, but based on your question...) only sets the profile name, it does not set the values of the profile being set. For that, you want CopyProfile(). In any case, if you want people to have one set of values universally upon login, see the code line above.
Last edited by myrroddin : 09-17-17 at
. Reason: grammar
View Public Profile
Send a private message to myrroddin
Visit myrroddin's homepage!
Find More Posts by myrroddin