Thread Tools Display Modes
08/04/14, 05:12 PM   #1
Flamage
 
Flamage's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 60
Post GetDisplayName is fixed - However addons will lose their saved variables again.

The GetDisplayName() bug is fixed and now we can return to a world of normalcy. Rejoice!

The downside is that your addons will have lost all of their SavedVariables again (unless you were storing these manually or your users were using zgrssd's Display Name Fix addon).

Fortunately, the data isn't lost, and I added a routine in Librarian to migrate the data back to its rightful place.

Modify it to work with your addons as you will:

Code:
if Librarian_SavedVariables["Default"][""] ~= nil then
	Librarian_SavedVariables["Default"][GetDisplayName()] = Librarian_SavedVariables["Default"][""]
	Librarian_SavedVariables["Default"][""] = nil
	SLASH_COMMANDS["/reloadui"]()
end
Note that Librarian_SavedVariables is the name you gave your saved variable parent, for example:
self.localSavedVars = ZO_SavedVars:New("Librarian_SavedVariables", 1, nil, self.defaults, nil)
  Reply With Quote
08/04/14, 05:37 PM   #2
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by Flamage View Post
The GetDisplayName() bug is fixed and now we can return to a world of normalcy. Rejoice!

The downside is that your addons will have lost all of their SavedVariables again (unless you were storing these manually or your users were using zgrssd's Display Name Fix addon).

Fortunately, the data isn't lost, and I added a routine in Librarian to migrate the data back to its rightful place.

Modify it to work with your addons as you will:

Code:
if Librarian_SavedVariables["Default"][""] ~= nil then
	Librarian_SavedVariables["Default"][GetDisplayName()] = Librarian_SavedVariables["Default"][""]
	Librarian_SavedVariables["Default"][""] = nil
	SLASH_COMMANDS["/reloadui"]()
end
Note that Librarian_SavedVariables is the name you gave your saved variable parent, for example:
self.localSavedVars = ZO_SavedVars:New("Librarian_SavedVariables", 1, nil, self.defaults, nil)
Good idea. However for users who are using Display Name Fix this could overwrite all their data. It's because savedVariables[""] exists, almost everyone at least once have loaded game without Display Name Fix. I recommend making this code optional - for example as a slash command.
  Reply With Quote
08/04/14, 05:45 PM   #3
Flamage
 
Flamage's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 60
I'd agree that it should be optional, in my addon there is a button in the settings screen which runs this import, and the user is only prompted that they might need to run the migration if their library is empty.

But very good point, I'd hate to have people nuking their settings based on this advice.
  Reply With Quote
08/06/14, 01:12 PM   #4
Deome
 
Deome's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 29
Arrow

Originally Posted by Flamage View Post
The GetDisplayName() bug is fixed and now we can return to a world of normalcy. Rejoice!

The downside is that your addons will have lost all of their SavedVariables again (unless you were storing these manually or your users were using zgrssd's Display Name Fix addon).

Fortunately, the data isn't lost, and I added a routine in Librarian to migrate the data back to its rightful place.

Modify it to work with your addons as you will:

Code:
if Librarian_SavedVariables["Default"][""] ~= nil then
    Librarian_SavedVariables["Default"][GetDisplayName()] = Librarian_SavedVariables["Default"][""]
    Librarian_SavedVariables["Default"][""] = nil
    SLASH_COMMANDS["/reloadui"]()
end
Note that Librarian_SavedVariables is the name you gave your saved variable parent, for example:
self.localSavedVars = ZO_SavedVars:New("Librarian_SavedVariables", 1, nil, self.defaults, nil)
Bless you, bless you, bless you. I have many users who don't like to lose data, and I was *just* searching the forums for hints on recovering info from saved variables.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » GetDisplayName is fixed - However addons will lose their saved variables again.


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