from retail
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
+8
-5
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -2,14 +2,10 @@
|
||||
..\FrameXML\UI.xsd">
|
||||
<Script file="Libs\LibStub\LibStub.lua"/>
|
||||
<Include file="Libs\CallbackHandler-1.0\CallbackHandler-1.0.xml"/>
|
||||
<Include file="Libs\AceGUI-3.0\AceGUI-3.0.xml"/>
|
||||
<Include file="Libs\AceConsole-3.0\AceConsole-3.0.xml"/>
|
||||
<Include file="Libs\AceConfig-3.0\AceConfig-3.0.xml"/>
|
||||
<Include file="Libs\AceTimer-3.0\AceTimer-3.0.xml"/>
|
||||
<Include file="Libs\AceSerializer-3.0\AceSerializer-3.0.xml"/>
|
||||
<Include file="Libs\AceComm-3.0\AceComm-3.0.xml"/>
|
||||
<Include file="Libs\LibSharedMedia-3.0\lib.xml"/>
|
||||
<Include file="Libs\AceGUI-3.0-SharedMediaWidgets\widget.xml"/>
|
||||
<Script file="Libs\LibCompress\LibCompress.lua"/>
|
||||
<Script file="Libs\LibDataBroker-1.1\LibDataBroker-1.1.lua"/>
|
||||
<Script file="Libs\LibSpellRange-1.0\LibSpellRange-1.0.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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
## Dependencies: WeakAuras
|
||||
## SavedVariables: WeakAurasOptionsSaved
|
||||
|
||||
embeds.xml
|
||||
locales.xml
|
||||
|
||||
ForAllIndentsAndPurposes.lua
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
|
||||
..\FrameXML\UI.xsd">
|
||||
<Include file="Libs\AceGUI-3.0\AceGUI-3.0.xml"/>
|
||||
<Include file="Libs\AceConfig-3.0\AceConfig-3.0.xml"/>
|
||||
<Include file="Libs\AceGUI-3.0-SharedMediaWidgets\widget.xml"/>
|
||||
<Include file="Libs\LibUIDropDownMenu\LibUIDropDownMenu.xml"/>
|
||||
<Include file="Libs\LibAPIAutoComplete-1.0\LibAPIAutoComplete-1.0.xml"/>
|
||||
</Ui>
|
||||
Reference in New Issue
Block a user