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">
-
-
-
-
diff --git a/WeakAurasOptions/OptionsFrames/OptionsFrame.lua b/WeakAurasOptions/OptionsFrames/OptionsFrame.lua
index 1bfae9f..f9258aa 100644
--- a/WeakAurasOptions/OptionsFrames/OptionsFrame.lua
+++ b/WeakAurasOptions/OptionsFrames/OptionsFrame.lua
@@ -209,14 +209,12 @@ function OptionsPrivate.CreateFrame()
if self.minimized then
WeakAurasOptionsTitleText:Hide()
self.buttonsContainer.frame:Hide()
- self.texturePicker.frame:Hide()
- self.iconPicker.frame:Hide()
- self.modelPicker.frame:Hide()
- self.importexport.frame:Hide()
- self.update.frame:Hide()
- self.texteditor.frame:Hide()
- self.codereview.frame:Hide()
- self.debugLog.frame:Hide()
+ for _, fn in ipairs({"TexturePicker", "IconPicker", "ModelPicker", "ImportExport", "TextEditor", "CodeReview", "UpdateFrame", "DebugLog"}) do
+ local obj = OptionsPrivate[fn](self, true)
+ if obj then
+ obj.frame:Hide()
+ end
+ end
if self.newView then
self.newView.frame:Hide()
end
diff --git a/WeakAurasOptions/OptionsFrames/Update.lua b/WeakAurasOptions/OptionsFrames/Update.lua
index 19e78e9..3fb07c9 100644
--- a/WeakAurasOptions/OptionsFrames/Update.lua
+++ b/WeakAurasOptions/OptionsFrames/Update.lua
@@ -1329,14 +1329,28 @@ end
local methods = {
Open = function(self, data, children, target, linkedAuras, sender, callbackFunc)
- if(self.optionsWindow.window == "importexport") then
- self.optionsWindow.importexport:Close();
- elseif(self.optionsWindow.window == "texture") then
- self.optionsWindow.texturePicker:CancelClose();
- elseif(self.optionsWindow.window == "icon") then
- self.optionsWindow.iconPicker:CancelClose();
- elseif(self.optionsWindow.window == "model") then
- self.optionsWindow.modelPicker:CancelClose();
+ local optionsWindow = self.optionsWindow
+ local optionsWindowTitle = self.optionsWindow.window
+ if(optionsWindowTitle == "importexport") then
+ local importexport = OptionsPrivate.ImportExport(optionsWindow, true)
+ if importexport then
+ importexport:Close();
+ end
+ elseif(optionsWindowTitle == "texture") then
+ local texturepicker = OptionsPrivate.TexturePicker(optionsWindow, true)
+ if texturepicker then
+ texturepicker:CancelClose();
+ end
+ elseif(optionsWindowTitle == "icon") then
+ local iconpicker = OptionsPrivate.IconPicker(optionsWindow, true)
+ if iconpicker then
+ iconpicker:CancelClose();
+ end
+ elseif(optionsWindowTitle == "model") then
+ local modelpicker = OptionsPrivate.ModelPicker(optionsWindow, true)
+ if modelpicker then
+ modelpicker:CancelClose();
+ end
end
self.optionsWindow.window = "update"
self.optionsWindow:UpdateFrameVisible()
@@ -2207,7 +2221,7 @@ local function ConstructUpdateFrame(frame)
return group
end
-function OptionsPrivate.UpdateFrame(frame)
- updateFrame = updateFrame or ConstructUpdateFrame(frame)
+function OptionsPrivate.UpdateFrame(frame, noConstruct)
+ updateFrame = updateFrame or (not noConstruct and ConstructUpdateFrame(frame))
return updateFrame
end
diff --git a/WeakAurasOptions/WeakAurasOptions.lua b/WeakAurasOptions/WeakAurasOptions.lua
index a8bccd7..d965491 100644
--- a/WeakAurasOptions/WeakAurasOptions.lua
+++ b/WeakAurasOptions/WeakAurasOptions.lua
@@ -875,7 +875,10 @@ function WeakAuras.ShowOptions(msg)
end
if (frame.window == "codereview") then
- frame.codereview:Close();
+ local codereview = OptionsPrivate.CodeReview(frame, true)
+ if codereview then
+ codereview:Close();
+ end
end
if firstLoad then
@@ -908,27 +911,27 @@ function OptionsPrivate.GetPickedDisplay()
end
function OptionsPrivate.OpenTextEditor(...)
- frame.texteditor:Open(...);
+ OptionsPrivate.TextEditor(frame):Open(...);
end
function OptionsPrivate.ExportToString(id)
- frame.importexport:Open("export", id);
+ OptionsPrivate.ImportExport(frame):Open("export", id);
end
function OptionsPrivate.ExportToTable(id)
- frame.importexport:Open("table", id);
+ OptionsPrivate.ImportExport(frame):Open("table", id);
end
function OptionsPrivate.ImportFromString()
- frame.importexport:Open("import");
+ OptionsPrivate.ImportExport(frame):Open("import");
end
function OptionsPrivate.OpenDebugLog(text)
- frame.debugLog:Open(text)
+ OptionsPrivate.DebugLog(frame):Open(text)
end
function OptionsPrivate.OpenUpdate(data, children, target, linkedAuras, sender, callbackFunc)
- return frame.update:Open(data, children, target, linkedAuras, sender, callbackFunc)
+ return OptionsPrivate.UpdateFrame(frame):Open(data, children, target, linkedAuras, sender, callbackFunc)
end
function OptionsPrivate.ConvertDisplay(data, newType)
@@ -1675,11 +1678,11 @@ function WeakAuras.UpdateThumbnail(data)
end
function OptionsPrivate.OpenTexturePicker(baseObject, paths, properties, textures, SetTextureFunc)
- frame.texturePicker:Open(baseObject, paths, properties, textures, SetTextureFunc)
+ OptionsPrivate.TexturePicker(frame):Open(baseObject, paths, properties, textures, SetTextureFunc)
end
function OptionsPrivate.OpenIconPicker(baseObject, paths, groupIcon)
- frame.iconPicker:Open(baseObject, paths, groupIcon)
+ OptionsPrivate.IconPicker(frame):Open(baseObject, paths, groupIcon)
end
function OptionsPrivate.OpenModelPicker(baseObject, path)
@@ -1690,13 +1693,14 @@ function OptionsPrivate.OpenModelPicker(baseObject, path)
WeakAuras.prettyPrint(string.format(L["ModelPaths could not be loaded, the addon is %s"], reason));
WeakAuras.ModelPaths = {};
end
- frame.modelPicker.modelTree:SetTree(WeakAuras.ModelPaths);
+
+ OptionsPrivate.ModelPicker(frame).modelTree:SetTree(WeakAuras.ModelPaths)
end
- frame.modelPicker:Open(baseObject, path);
+ OptionsPrivate.ModelPicker(frame):Open(baseObject, path);
end
function OptionsPrivate.OpenCodeReview(data)
- frame.codereview:Open(data);
+ OptionsPrivate.CodeReview(frame):Open(data);
end
function OptionsPrivate.OpenTriggerTemplate(data, targetId)
diff --git a/WeakAurasOptions/WeakAurasOptions.toc b/WeakAurasOptions/WeakAurasOptions.toc
index 5a42662..f762a63 100644
--- a/WeakAurasOptions/WeakAurasOptions.toc
+++ b/WeakAurasOptions/WeakAurasOptions.toc
@@ -14,6 +14,7 @@
## Dependencies: WeakAuras
## SavedVariables: WeakAurasOptionsSaved
+embeds.xml
locales.xml
ForAllIndentsAndPurposes.lua
diff --git a/WeakAurasOptions/embeds.xml b/WeakAurasOptions/embeds.xml
new file mode 100644
index 0000000..8a3cca3
--- /dev/null
+++ b/WeakAurasOptions/embeds.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+