diff --git a/WeakAuras/AuraEnvironment.lua b/WeakAuras/AuraEnvironment.lua index c33e78e..2857ec0 100644 --- a/WeakAuras/AuraEnvironment.lua +++ b/WeakAuras/AuraEnvironment.lua @@ -53,7 +53,7 @@ end -- Wrapping a unit's name in its class colour is very common in custom Auras local WA_ClassColorName = function(unit) if unit and UnitExists(unit) then - local name = UnitName(unit) + local name = WeakAuras.UnitName(unit) local _, class = UnitClass(unit) if not class then return name diff --git a/WeakAuras/Init.lua b/WeakAuras/Init.lua index aab0fef..17a5ab6 100644 --- a/WeakAuras/Init.lua +++ b/WeakAuras/Init.lua @@ -41,10 +41,6 @@ do } local LibStubLibs = { "CallbackHandler-1.0", - "AceConfig-3.0", - "AceConsole-3.0", - "AceGUI-3.0", - "AceGUISharedMediaWidgets-1.0", "AceTimer-3.0", "AceSerializer-3.0", "AceComm-3.0", diff --git a/WeakAuras/Types.lua b/WeakAuras/Types.lua index f726790..71e5d11 100644 --- a/WeakAuras/Types.lua +++ b/WeakAuras/Types.lua @@ -404,14 +404,14 @@ Private.format_types = { if realm == "never" then nameFunc = function(unit) - return unit and UnitName(unit) + return unit and WeakAuras.UnitName(unit) end elseif realm == "star" then nameFunc = function(unit) if not unit then return "" end - local name, realm = UnitName(unit) + local name, realm = WeakAuras.UnitName(unit) if realm then return name .. "*" end @@ -422,7 +422,7 @@ Private.format_types = { if not unit then return "" end - local name, realm = UnitName(unit) + local name, realm = WeakAuras.UnitName(unit) if realm then return name .. "-" .. realm end @@ -433,7 +433,7 @@ Private.format_types = { if not unit then return "" end - local name, realm = WeakAuras.UnitNameWithRealm(unit) + local name, realm = WeakAuras.UnitNameWithRealmCustomName(unit) return name .. "-" .. realm end end @@ -529,10 +529,11 @@ Private.format_types = { if realm == "never" then nameFunc = function(name, realm) - return name + return WeakAuras.GetName(name) end elseif realm == "star" then nameFunc = function(name, realm) + name = WeakAuras.GetName(name) if realm ~= "" then return name .. "*" end @@ -540,6 +541,7 @@ Private.format_types = { end elseif realm == "differentServer" then nameFunc = function(name, realm) + name = WeakAuras.GetName(name) if realm ~= "" then return name .. "-" .. realm end @@ -547,6 +549,7 @@ Private.format_types = { end elseif realm == "always" then nameFunc = function(name, realm) + name = WeakAuras.GetName(name) if realm == "" then realm = select(2, WeakAuras.UnitNameWithRealm("player")) end diff --git a/WeakAuras/WeakAuras.lua b/WeakAuras/WeakAuras.lua index 03c2366..efc3523 100644 --- a/WeakAuras/WeakAuras.lua +++ b/WeakAuras/WeakAuras.lua @@ -53,6 +53,19 @@ local LDBIcon = LibStub("LibDBIcon-1.0") local LCG = LibStub("LibCustomGlow-1.0") local LGF = LibStub("LibGetFrame-1.0") +local CustomNames = IsAddOnLoaded("CustomNames") and LibStub("CustomNames") -- optional addon +if CustomNames then + WeakAuras.GetName = CustomNames.Get + WeakAuras.UnitName = CustomNames.UnitName + WeakAuras.GetUnitName = CustomNames.GetUnitName + WeakAuras.UnitFullName = CustomNames.UnitFullName +else + WeakAuras.GetName = function(name) return name end + WeakAuras.UnitName = UnitName + WeakAuras.GetUnitName = UnitName + WeakAuras.UnitFullName = UnitName +end + local timer = WeakAurasTimers WeakAuras.timer = timer @@ -5424,6 +5437,11 @@ do local name, realm = UnitName(unit) return name or "", realm or ownRealm or "" end + + function WeakAuras.UnitNameWithRealmCustomName(unit) + local name, realm = WeakAuras.UnitFullName(unit) + return name or "", realm or ownRealm or "" + end end function Private.ExecEnv.ParseNameCheck(name) diff --git a/WeakAuras/embeds.xml b/WeakAuras/embeds.xml index 0497f38..fa7a525 100644 --- a/WeakAuras/embeds.xml +++ b/WeakAuras/embeds.xml @@ -2,14 +2,10 @@ ..\FrameXML\UI.xsd">