Saved Variables Bug and AddOns ToU - ESOUI
Thread Tools Display Modes
Prev Previous Post   Next Post Next
07/02/14, 04:01 AM   #25
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 281
Originally Posted by farangkao View Post
2nd Toughts about Garkin's Code....

I'm not sure if i see this correctly, but be aware, if you replace the default GetDisplayName() function,
it might affect other Addons as well, and therefore make their Saved Data invalid.
I see only one problem: It ends up overriding GetDisplayName() regardless if it works properly or not.
And if you put that code into multiple Addons, each of those would would verride GetDisplayName() again.

Based on that data, this verison might be slightly better:
    --First get the current function
    local currentGDN = GetDisplayName

    --Second, defined your corrected function
    local function newGDN()
       local displayName

       if GetNumGuilds() > 0 then
          displayName = GetGuildMemberInfo(GetGuildId(1), GetPlayerGuildMemberIndex(GetGuildId(1)))
          displayName = "@" .. GetCVar("AccountName")

       return displayName
    --Thrid, check if the currently used GDN function is faulty
    local displayName = currentGDN()
    if displayName == nil or displayName == "" then
       --Overwrite the current version
       GetDisplayName = newGDN
Just putting it in your code would be too agressive/out of user hands. How about:
We make a Addon just for this (call it "DisplayNameFix" or something like this)
Users can choose to install it or not. And can prerpar thier settings files accordingly.
We put this addon as OptionalDependency for all our Addons, so it runs before them (only nessesary if we need the DisplayName before the LoadedEvent/Settings loading).
Once the issues is solved Zenimax Side, we can just make it a blank (empty the .lua file and remove the entry from the manifest, as well as).

Noticed one mistake - we do not check if our retrival functiosn returns anything valid either. Each of those functions might bug out. I need to look into it a bit more...

Last edited by zgrssd : 07/02/14 at 04:06 AM.
  Reply With Quote

ESOUI » Site Forums » News » Saved Variables Bug and AddOns ToU

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