from retail

This commit is contained in:
NoM0Re
2025-01-25 17:45:42 +01:00
parent 6eafc394ae
commit 1152abe6a5
10 changed files with 82 additions and 44 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ end
-- Wrapping a unit's name in its class colour is very common in custom Auras -- Wrapping a unit's name in its class colour is very common in custom Auras
local WA_ClassColorName = function(unit) local WA_ClassColorName = function(unit)
if unit and UnitExists(unit) then if unit and UnitExists(unit) then
local name = UnitName(unit) local name = WeakAuras.UnitName(unit)
local _, class = UnitClass(unit) local _, class = UnitClass(unit)
if not class then if not class then
return name return name
-4
View File
@@ -41,10 +41,6 @@ do
} }
local LibStubLibs = { local LibStubLibs = {
"CallbackHandler-1.0", "CallbackHandler-1.0",
"AceConfig-3.0",
"AceConsole-3.0",
"AceGUI-3.0",
"AceGUISharedMediaWidgets-1.0",
"AceTimer-3.0", "AceTimer-3.0",
"AceSerializer-3.0", "AceSerializer-3.0",
"AceComm-3.0", "AceComm-3.0",
+8 -5
View File
@@ -404,14 +404,14 @@ Private.format_types = {
if realm == "never" then if realm == "never" then
nameFunc = function(unit) nameFunc = function(unit)
return unit and UnitName(unit) return unit and WeakAuras.UnitName(unit)
end end
elseif realm == "star" then elseif realm == "star" then
nameFunc = function(unit) nameFunc = function(unit)
if not unit then if not unit then
return "" return ""
end end
local name, realm = UnitName(unit) local name, realm = WeakAuras.UnitName(unit)
if realm then if realm then
return name .. "*" return name .. "*"
end end
@@ -422,7 +422,7 @@ Private.format_types = {
if not unit then if not unit then
return "" return ""
end end
local name, realm = UnitName(unit) local name, realm = WeakAuras.UnitName(unit)
if realm then if realm then
return name .. "-" .. realm return name .. "-" .. realm
end end
@@ -433,7 +433,7 @@ Private.format_types = {
if not unit then if not unit then
return "" return ""
end end
local name, realm = WeakAuras.UnitNameWithRealm(unit) local name, realm = WeakAuras.UnitNameWithRealmCustomName(unit)
return name .. "-" .. realm return name .. "-" .. realm
end end
end end
@@ -529,10 +529,11 @@ Private.format_types = {
if realm == "never" then if realm == "never" then
nameFunc = function(name, realm) nameFunc = function(name, realm)
return name return WeakAuras.GetName(name)
end end
elseif realm == "star" then elseif realm == "star" then
nameFunc = function(name, realm) nameFunc = function(name, realm)
name = WeakAuras.GetName(name)
if realm ~= "" then if realm ~= "" then
return name .. "*" return name .. "*"
end end
@@ -540,6 +541,7 @@ Private.format_types = {
end end
elseif realm == "differentServer" then elseif realm == "differentServer" then
nameFunc = function(name, realm) nameFunc = function(name, realm)
name = WeakAuras.GetName(name)
if realm ~= "" then if realm ~= "" then
return name .. "-" .. realm return name .. "-" .. realm
end end
@@ -547,6 +549,7 @@ Private.format_types = {
end end
elseif realm == "always" then elseif realm == "always" then
nameFunc = function(name, realm) nameFunc = function(name, realm)
name = WeakAuras.GetName(name)
if realm == "" then if realm == "" then
realm = select(2, WeakAuras.UnitNameWithRealm("player")) realm = select(2, WeakAuras.UnitNameWithRealm("player"))
end end
+18
View File
@@ -53,6 +53,19 @@ local LDBIcon = LibStub("LibDBIcon-1.0")
local LCG = LibStub("LibCustomGlow-1.0") local LCG = LibStub("LibCustomGlow-1.0")
local LGF = LibStub("LibGetFrame-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 local timer = WeakAurasTimers
WeakAuras.timer = timer WeakAuras.timer = timer
@@ -5424,6 +5437,11 @@ do
local name, realm = UnitName(unit) local name, realm = UnitName(unit)
return name or "", realm or ownRealm or "" return name or "", realm or ownRealm or ""
end end
function WeakAuras.UnitNameWithRealmCustomName(unit)
local name, realm = WeakAuras.UnitFullName(unit)
return name or "", realm or ownRealm or ""
end
end end
function Private.ExecEnv.ParseNameCheck(name) function Private.ExecEnv.ParseNameCheck(name)
-4
View File
@@ -2,14 +2,10 @@
..\FrameXML\UI.xsd"> ..\FrameXML\UI.xsd">
<Script file="Libs\LibStub\LibStub.lua"/> <Script file="Libs\LibStub\LibStub.lua"/>
<Include file="Libs\CallbackHandler-1.0\CallbackHandler-1.0.xml"/> <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\AceTimer-3.0\AceTimer-3.0.xml"/>
<Include file="Libs\AceSerializer-3.0\AceSerializer-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\AceComm-3.0\AceComm-3.0.xml"/>
<Include file="Libs\LibSharedMedia-3.0\lib.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\LibCompress\LibCompress.lua"/>
<Script file="Libs\LibDataBroker-1.1\LibDataBroker-1.1.lua"/> <Script file="Libs\LibDataBroker-1.1\LibDataBroker-1.1.lua"/>
<Script file="Libs\LibSpellRange-1.0\LibSpellRange-1.0.lua"/> <Script file="Libs\LibSpellRange-1.0\LibSpellRange-1.0.lua"/>
@@ -209,14 +209,12 @@ function OptionsPrivate.CreateFrame()
if self.minimized then if self.minimized then
WeakAurasOptionsTitleText:Hide() WeakAurasOptionsTitleText:Hide()
self.buttonsContainer.frame:Hide() self.buttonsContainer.frame:Hide()
self.texturePicker.frame:Hide() for _, fn in ipairs({"TexturePicker", "IconPicker", "ModelPicker", "ImportExport", "TextEditor", "CodeReview", "UpdateFrame", "DebugLog"}) do
self.iconPicker.frame:Hide() local obj = OptionsPrivate[fn](self, true)
self.modelPicker.frame:Hide() if obj then
self.importexport.frame:Hide() obj.frame:Hide()
self.update.frame:Hide() end
self.texteditor.frame:Hide() end
self.codereview.frame:Hide()
self.debugLog.frame:Hide()
if self.newView then if self.newView then
self.newView.frame:Hide() self.newView.frame:Hide()
end end
+24 -10
View File
@@ -1329,14 +1329,28 @@ end
local methods = { local methods = {
Open = function(self, data, children, target, linkedAuras, sender, callbackFunc) Open = function(self, data, children, target, linkedAuras, sender, callbackFunc)
if(self.optionsWindow.window == "importexport") then local optionsWindow = self.optionsWindow
self.optionsWindow.importexport:Close(); local optionsWindowTitle = self.optionsWindow.window
elseif(self.optionsWindow.window == "texture") then if(optionsWindowTitle == "importexport") then
self.optionsWindow.texturePicker:CancelClose(); local importexport = OptionsPrivate.ImportExport(optionsWindow, true)
elseif(self.optionsWindow.window == "icon") then if importexport then
self.optionsWindow.iconPicker:CancelClose(); importexport:Close();
elseif(self.optionsWindow.window == "model") then end
self.optionsWindow.modelPicker:CancelClose(); 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 end
self.optionsWindow.window = "update" self.optionsWindow.window = "update"
self.optionsWindow:UpdateFrameVisible() self.optionsWindow:UpdateFrameVisible()
@@ -2207,7 +2221,7 @@ local function ConstructUpdateFrame(frame)
return group return group
end end
function OptionsPrivate.UpdateFrame(frame) function OptionsPrivate.UpdateFrame(frame, noConstruct)
updateFrame = updateFrame or ConstructUpdateFrame(frame) updateFrame = updateFrame or (not noConstruct and ConstructUpdateFrame(frame))
return updateFrame return updateFrame
end end
+16 -12
View File
@@ -875,7 +875,10 @@ function WeakAuras.ShowOptions(msg)
end end
if (frame.window == "codereview") then if (frame.window == "codereview") then
frame.codereview:Close(); local codereview = OptionsPrivate.CodeReview(frame, true)
if codereview then
codereview:Close();
end
end end
if firstLoad then if firstLoad then
@@ -908,27 +911,27 @@ function OptionsPrivate.GetPickedDisplay()
end end
function OptionsPrivate.OpenTextEditor(...) function OptionsPrivate.OpenTextEditor(...)
frame.texteditor:Open(...); OptionsPrivate.TextEditor(frame):Open(...);
end end
function OptionsPrivate.ExportToString(id) function OptionsPrivate.ExportToString(id)
frame.importexport:Open("export", id); OptionsPrivate.ImportExport(frame):Open("export", id);
end end
function OptionsPrivate.ExportToTable(id) function OptionsPrivate.ExportToTable(id)
frame.importexport:Open("table", id); OptionsPrivate.ImportExport(frame):Open("table", id);
end end
function OptionsPrivate.ImportFromString() function OptionsPrivate.ImportFromString()
frame.importexport:Open("import"); OptionsPrivate.ImportExport(frame):Open("import");
end end
function OptionsPrivate.OpenDebugLog(text) function OptionsPrivate.OpenDebugLog(text)
frame.debugLog:Open(text) OptionsPrivate.DebugLog(frame):Open(text)
end end
function OptionsPrivate.OpenUpdate(data, children, target, linkedAuras, sender, callbackFunc) 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 end
function OptionsPrivate.ConvertDisplay(data, newType) function OptionsPrivate.ConvertDisplay(data, newType)
@@ -1675,11 +1678,11 @@ function WeakAuras.UpdateThumbnail(data)
end end
function OptionsPrivate.OpenTexturePicker(baseObject, paths, properties, textures, SetTextureFunc) 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 end
function OptionsPrivate.OpenIconPicker(baseObject, paths, groupIcon) function OptionsPrivate.OpenIconPicker(baseObject, paths, groupIcon)
frame.iconPicker:Open(baseObject, paths, groupIcon) OptionsPrivate.IconPicker(frame):Open(baseObject, paths, groupIcon)
end end
function OptionsPrivate.OpenModelPicker(baseObject, path) 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.prettyPrint(string.format(L["ModelPaths could not be loaded, the addon is %s"], reason));
WeakAuras.ModelPaths = {}; WeakAuras.ModelPaths = {};
end end
frame.modelPicker.modelTree:SetTree(WeakAuras.ModelPaths);
OptionsPrivate.ModelPicker(frame).modelTree:SetTree(WeakAuras.ModelPaths)
end end
frame.modelPicker:Open(baseObject, path); OptionsPrivate.ModelPicker(frame):Open(baseObject, path);
end end
function OptionsPrivate.OpenCodeReview(data) function OptionsPrivate.OpenCodeReview(data)
frame.codereview:Open(data); OptionsPrivate.CodeReview(frame):Open(data);
end end
function OptionsPrivate.OpenTriggerTemplate(data, targetId) function OptionsPrivate.OpenTriggerTemplate(data, targetId)
+1
View File
@@ -14,6 +14,7 @@
## Dependencies: WeakAuras ## Dependencies: WeakAuras
## SavedVariables: WeakAurasOptionsSaved ## SavedVariables: WeakAurasOptionsSaved
embeds.xml
locales.xml locales.xml
ForAllIndentsAndPurposes.lua ForAllIndentsAndPurposes.lua
+8
View File
@@ -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>