diff --git a/WeakAuras/AuraEnvironment.lua b/WeakAuras/AuraEnvironment.lua index 6540b0e..f2734c9 100644 --- a/WeakAuras/AuraEnvironment.lua +++ b/WeakAuras/AuraEnvironment.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, Private = ... local WeakAuras = WeakAuras local L = WeakAuras.L diff --git a/WeakAuras/BuffTrigger.lua b/WeakAuras/BuffTrigger.lua index 6f0ad0d..826941f 100644 --- a/WeakAuras/BuffTrigger.lua +++ b/WeakAuras/BuffTrigger.lua @@ -57,6 +57,7 @@ Returns the potential conditions for a trigger ]]-- if not WeakAuras.IsCorrectVersion() then return end +local AddonName, Private = ... -- Lua APIs local tinsert, wipe = table.insert, wipe diff --git a/WeakAuras/BuffTrigger2.lua b/WeakAuras/BuffTrigger2.lua index e535e45..09b5189 100644 --- a/WeakAuras/BuffTrigger2.lua +++ b/WeakAuras/BuffTrigger2.lua @@ -57,6 +57,7 @@ GetTriggerConditions(data, triggernum) Returns the potential conditions for a trigger ]]-- if not WeakAuras.IsCorrectVersion() then return end +local AddonName, Private = ... -- Lua APIs local tinsert, wipe = table.insert, wipe diff --git a/WeakAuras/GenericTrigger.lua b/WeakAuras/GenericTrigger.lua index f4b0d8f..413aae2 100644 --- a/WeakAuras/GenericTrigger.lua +++ b/WeakAuras/GenericTrigger.lua @@ -56,6 +56,7 @@ GetTriggerConditions(data, triggernum) Returns potential conditions that this trigger provides. ]]-- if not WeakAuras.IsCorrectVersion() then return end +local AddonName, Private = ... -- Lua APIs local tinsert, tconcat, wipe = table.insert, table.concat, wipe diff --git a/WeakAuras/History.lua b/WeakAuras/History.lua index 3c13c5f..17004e9 100644 --- a/WeakAuras/History.lua +++ b/WeakAuras/History.lua @@ -1,6 +1,5 @@ - - if not WeakAuras.IsCorrectVersion() then return end +local AddonName, Private = ... local WeakAuras = WeakAuras diff --git a/WeakAuras/Init.lua b/WeakAuras/Init.lua index 353bdeb..d4fe8a7 100644 --- a/WeakAuras/Init.lua +++ b/WeakAuras/Init.lua @@ -25,16 +25,13 @@ function WeakAuras.IsCorrectVersion() end WeakAuras.prettyPrint = function(msg) - print(WeakAuras.printPrefix .. msg) + print("|cff9900ffWeakAuras:|r " .. msg) end if versionString ~= versionStringFromToc and versionStringFromToc ~= "Dev" then WeakAuras.prettyPrint("You need to restart your game client to complete the WeakAuras update!") end -WeakAuras.PowerAurasPath = "Interface\\Addons\\WeakAuras\\PowerAurasMedia\\Auras\\" -WeakAuras.PowerAurasSoundPath = "Interface\\Addons\\WeakAuras\\PowerAurasMedia\\Sounds\\" - -- Force enable WeakAurasCompanion and Archive because some addon managers interfere with it EnableAddOn("WeakAurasCompanion") EnableAddOn("WeakAurasArchive") diff --git a/WeakAuras/Profiling.lua b/WeakAuras/Profiling.lua index a00b1e2..d4b2b3e 100644 --- a/WeakAuras/Profiling.lua +++ b/WeakAuras/Profiling.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, Private = ... local WeakAuras = WeakAuras local L = WeakAuras.L diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index 3eaca64..9c0f3a4 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, Private = ... -- Lua APIs local tinsert, tsort = table.insert, table.sort diff --git a/WeakAuras/RegionTypes/AuraBar.lua b/WeakAuras/RegionTypes/AuraBar.lua index e947597..1ed3912 100644 --- a/WeakAuras/RegionTypes/AuraBar.lua +++ b/WeakAuras/RegionTypes/AuraBar.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, Private = ... local SharedMedia = LibStub("LibSharedMedia-3.0"); local L = WeakAuras.L; diff --git a/WeakAuras/RegionTypes/DynamicGroup.lua b/WeakAuras/RegionTypes/DynamicGroup.lua index 1d1af67..4134ca5 100644 --- a/WeakAuras/RegionTypes/DynamicGroup.lua +++ b/WeakAuras/RegionTypes/DynamicGroup.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, Private = ... local WeakAuras = WeakAuras local SharedMedia = LibStub("LibSharedMedia-3.0") diff --git a/WeakAuras/RegionTypes/Group.lua b/WeakAuras/RegionTypes/Group.lua index 5a17df4..220090a 100644 --- a/WeakAuras/RegionTypes/Group.lua +++ b/WeakAuras/RegionTypes/Group.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, Private = ... local SharedMedia = LibStub("LibSharedMedia-3.0"); diff --git a/WeakAuras/RegionTypes/Icon.lua b/WeakAuras/RegionTypes/Icon.lua index ebca4c8..7a57454 100644 --- a/WeakAuras/RegionTypes/Icon.lua +++ b/WeakAuras/RegionTypes/Icon.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, Private = ... local SharedMedia = LibStub("LibSharedMedia-3.0"); local L = WeakAuras.L @@ -6,7 +7,7 @@ local MSQ, MSQ_Version = LibStub("Masque", true); if MSQ then if MSQ_Version <= 80100 then MSQ = nil - print(print(WeakAuras.printPrefix .. L["Please upgrade your Masque version"])) + WeakAuras.prettyPrint(L["Please upgrade your Masque version"]) else MSQ:AddType("WA_Aura", {"Icon", "Cooldown"}) end diff --git a/WeakAuras/RegionTypes/Model.lua b/WeakAuras/RegionTypes/Model.lua index ff19f93..a6bd593 100644 --- a/WeakAuras/RegionTypes/Model.lua +++ b/WeakAuras/RegionTypes/Model.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, Private = ... local SharedMedia = LibStub("LibSharedMedia-3.0"); local L = WeakAuras.L; diff --git a/WeakAuras/RegionTypes/ProgressTexture.lua b/WeakAuras/RegionTypes/ProgressTexture.lua index 7d04914..1cdeaa1 100644 --- a/WeakAuras/RegionTypes/ProgressTexture.lua +++ b/WeakAuras/RegionTypes/ProgressTexture.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, Private = ... local L = WeakAuras.L; diff --git a/WeakAuras/RegionTypes/RegionPrototype.lua b/WeakAuras/RegionTypes/RegionPrototype.lua index 84632ae..445a676 100644 --- a/WeakAuras/RegionTypes/RegionPrototype.lua +++ b/WeakAuras/RegionTypes/RegionPrototype.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, Private = ... local WeakAuras = WeakAuras; local L = WeakAuras.L; diff --git a/WeakAuras/RegionTypes/Text.lua b/WeakAuras/RegionTypes/Text.lua index 9b9a57f..7143a92 100644 --- a/WeakAuras/RegionTypes/Text.lua +++ b/WeakAuras/RegionTypes/Text.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, Private = ... local SharedMedia = LibStub("LibSharedMedia-3.0"); local L = WeakAuras.L; diff --git a/WeakAuras/RegionTypes/Texture.lua b/WeakAuras/RegionTypes/Texture.lua index ee37697..47aae0a 100644 --- a/WeakAuras/RegionTypes/Texture.lua +++ b/WeakAuras/RegionTypes/Texture.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, Private = ... local L = WeakAuras.L; diff --git a/WeakAuras/SubRegionTypes/BarModel.lua b/WeakAuras/SubRegionTypes/BarModel.lua index 8af292c..74fdbf3 100644 --- a/WeakAuras/SubRegionTypes/BarModel.lua +++ b/WeakAuras/SubRegionTypes/BarModel.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, Private = ... local SharedMedia = LibStub("LibSharedMedia-3.0"); local L = WeakAuras.L; diff --git a/WeakAuras/SubRegionTypes/Border.lua b/WeakAuras/SubRegionTypes/Border.lua index 3f3d729..2f89abf 100644 --- a/WeakAuras/SubRegionTypes/Border.lua +++ b/WeakAuras/SubRegionTypes/Border.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, Private = ... local SharedMedia = LibStub("LibSharedMedia-3.0"); local L = WeakAuras.L; diff --git a/WeakAuras/SubRegionTypes/Glow.lua b/WeakAuras/SubRegionTypes/Glow.lua index 9d917ab..11bd433 100644 --- a/WeakAuras/SubRegionTypes/Glow.lua +++ b/WeakAuras/SubRegionTypes/Glow.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, Private = ... local SharedMedia = LibStub("LibSharedMedia-3.0"); local LCG = LibStub("LibCustomGlow-1.0") diff --git a/WeakAuras/SubRegionTypes/SubText.lua b/WeakAuras/SubRegionTypes/SubText.lua index d1ead86..e8cc9a0 100644 --- a/WeakAuras/SubRegionTypes/SubText.lua +++ b/WeakAuras/SubRegionTypes/SubText.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, Private = ... local SharedMedia = LibStub("LibSharedMedia-3.0"); local L = WeakAuras.L; diff --git a/WeakAuras/SubRegionTypes/Tick.lua b/WeakAuras/SubRegionTypes/Tick.lua index 8cd237d..b8509cb 100644 --- a/WeakAuras/SubRegionTypes/Tick.lua +++ b/WeakAuras/SubRegionTypes/Tick.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, Private = ... local SharedMedia = LibStub("LibSharedMedia-3.0"); local L = WeakAuras.L; @@ -12,6 +13,14 @@ local default = function(parentType) automatic_length = true, tick_thickness = 2, tick_length = 30, + use_texture = false, + tick_texture = [[Interface\CastingBar\UI-CastingBar-Spark]], + tick_blend_mode = "ADD", + tick_desaturate = false, + tick_rotation = 0, + tick_xOffset = 0, + tick_yOffset = 0, + tick_mirror = false, } end @@ -61,6 +70,26 @@ local properties = { bigStep = 1, default = 30, }, + tick_desaturate = { + display = L["Desaturate"], + setter = "SetTickDesaturated", + type = "bool", + default = true, + }, + tick_rotation = { + display = L["Rotation"], + setter = "SetTickRotation", + type = "number", + min = 0, + max = 360, + default = 0, + }, + tick_mirror = { + display = L["Mirror"], + setter = "SetTickMirror", + type = "bool", + default = true, + }, } local auraBarAnchor = { @@ -145,7 +174,12 @@ local funcs = { end, SetTickColor = function(self, r, g, b, a) self.tick_color[1], self.tick_color[2], self.tick_color[3], self.tick_color[4] = r, g, b, a or 1 - self.texture:SetTexture(r, g, b, a or 1) + if self.use_texture then + self.texture:SetVertexColor(r, g, b, a or 1) + self:UpdateTickDesaturated() + else + self.texture:SetTexture(r, g, b, a or 1) + end end, SetTickPlacementMode = function(self, placement_mode) if self.tick_placement_mode ~= placement_mode then @@ -232,7 +266,7 @@ local funcs = { end local side = inverse and auraBarAnchorInverse or auraBarAnchor self:ClearAllPoints() - self:SetPoint("CENTER", self.parent.bar, side[self.orientation], offsetx, offsety) + self:SetPoint("CENTER", self.parent.bar, side[self.orientation], offsetx + self.tick_xOffset, offsety + self.tick_yOffset) end, SetAutomaticLength = function(self, automatic_length) if self.automatic_length ~= automatic_length then @@ -265,7 +299,52 @@ local funcs = { else self:SetHeight(length) end - end + end, + SetTickDesaturated = function(self, desaturate) + if self.use_texture and self.tick_desaturate ~= desaturate then + self.tick_desaturate = desaturate + self:UpdateTickDesaturated() + end + end, + UpdateTickDesaturated = function(self) + self.texture:SetDesaturated(self.tick_desaturate) + end, + SetTickRotation = function(self, degrees) + if self.tick_rotation ~= degrees then + self.tick_rotation = degrees + self:UpdateTickRotation() + end + end, + UpdateTickRotation = function(self) + local rad = math.rad(self.tick_rotation) + self.texture:SetRotation(rad) + end, + SetTickMirror = function(self, mirror) + if self.mirror ~= mirror then + self.mirror = mirror + self:UpdateTickMirror() + end + end, + UpdateTickMirror = function(self) + if self.mirror then + self.texture:SetTexCoord(0, 1, 1, 1, 0, 0, 1, 0) + else + self.texture:SetTexCoord(0, 0, 1, 0, 0, 1, 1, 1) + end + end, + SetTickBlendMode = function(self, mode) + if self.tick_blend_mode ~= mode then + self.tick_blend_mode = mode + self:UpdateTickBlendMode() + end + end, + UpdateTickBlendMode = function(self) + if self.use_texture then + self.texture:SetBlendMode(self.tick_blend_mode) + else + self.texture:SetBlendMode("BLEND") + end + end, } local function modify(parent, region, parentData, data, first) @@ -290,13 +369,26 @@ local function modify(parent, region, parentData, data, first) region.automatic_length = data.automatic_length region.tick_thickness = data.tick_thickness region.tick_length = data.tick_length + region.use_texture = data.use_texture + region.tick_texture = data.tick_texture + + region.tick_xOffset = data.tick_xOffset + region.tick_yOffset = data.tick_yOffset for k, v in pairs(funcs) do region[k] = v end + if data.use_texture then + region.texture:SetTexture(data.tick_texture) + end + region:SetVisible(data.tick_visible) region:SetTickColor(unpack(data.tick_color)) + region:SetTickDesaturated(data.tick_desaturate) + region:SetTickBlendMode(data.tick_blend_mode) + region:SetTickRotation(data.tick_rotation) + region:SetTickMirror(data.tick_mirror) region:UpdateTickSize() diff --git a/WeakAuras/Transmission.lua b/WeakAuras/Transmission.lua index 0d4171c..193b327 100644 --- a/WeakAuras/Transmission.lua +++ b/WeakAuras/Transmission.lua @@ -13,7 +13,7 @@ Converts the display id to a formatted table SerializeTable(data) Converts the table data to a formatted table -ShowDisplayTooltip(data, children, icon, icons, import, compressed, alterdesc) +ShowDisplayTooltip(data, children, icon, icons, import, compressed) Shows a tooltip frame for an aura, which allows for importing if import is true Import(str, [target]) @@ -22,6 +22,7 @@ If target is installed data, or is a uid which points to installed data, then th ]]-- if not WeakAuras.IsCorrectVersion() then return end +local AddonName, Private = ... -- Lua APIs local tinsert = table.insert @@ -366,7 +367,7 @@ local function importPendingData() regionOptions[thumbnailAnchor.currentThumbnailType].releaseThumbnail(thumbnailAnchor.currentThumbnail) thumbnailAnchor.currentThumbnail = nil end - if imports and WeakAuras.LoadOptions() then + if imports and Private.LoadOptions() then WeakAuras.ShowOptions() else return @@ -1421,7 +1422,7 @@ function WeakAuras.Update(data, diff) end -function WeakAuras.ShowDisplayTooltip(data, children, matchInfo, icon, icons, import, compressed, alterdesc) +function WeakAuras.ShowDisplayTooltip(data, children, matchInfo, icon, icons, import, compressed) -- since we have new data, wipe the old pending data wipe(pendingData) @@ -1610,105 +1611,6 @@ function WeakAuras.ShowDisplayTooltip(data, children, matchInfo, icon, icons, im end - if alterdesc then -- TODO: simplify this. The frame doesn't need to be a field of ItemRefTooltip, for one. - if not(ItemRefTooltip.WeakAuras_Desc_Box) then - ItemRefTooltip.WeakAuras_Desc_Box = CreateFrame("frame", nil, ItemRefTooltip); - end - local descboxframe = ItemRefTooltip.WeakAuras_Desc_Box; - descboxframe:SetBackdrop({ - bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", - edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", - edgeSize = 16, - insets = { - left = 4, - right = 3, - top = 4, - bottom = 3 - } - }); - descboxframe:SetBackdropColor(0, 0, 0); - descboxframe:SetBackdropBorderColor(0.4, 0.4, 0.4); - if (alterdesc == "desc") then - descboxframe:SetHeight(80); - else - descboxframe:SetHeight(20); - end - descboxframe:SetWidth(260); - descboxframe:SetPoint("TOP", ItemRefTooltip, "BOTTOM"); - descboxframe:Show(); - - local descbox = descboxframe.descbox; - if not(descbox) then - descbox = CreateFrame("editbox", nil, descboxframe); - descboxframe.descbox = descbox; - end - descbox:SetPoint("BOTTOMLEFT", descboxframe, "BOTTOMLEFT", 8, 8); - descbox:SetPoint("TOPRIGHT", descboxframe, "TOPRIGHT", -8, -8); - descbox:SetFont(STANDARD_TEXT_FONT, 12); - descbox:EnableMouse(true); - descbox:SetAutoFocus(false); - descbox:SetCountInvisibleLetters(false); - descbox:SetMultiLine(alterdesc == "desc"); - - if (alterdesc == "url") then - if (not descbox.label) then - local label = descbox:CreateFontString(nil, "BACKGROUND", "GameFontHighlightSmall"); - label:SetPoint("TOPLEFT", descboxframe, "BOTTOMLEFT", 8, 0); - label:SetText(L["Press Ctrl+C to copy"]); - descbox.label = label; - end - descbox.label:Show(); - else - if (descbox.label) then - descbox.label:Hide(); - end - end - - local text = data[alterdesc] and data[alterdesc] ~= "" and data[alterdesc] or ""; - descbox:SetText(text); - - descbox:SetScript("OnEscapePressed", function() - descbox:ClearFocus(); - if (alterdesc == "url") then - return; - end - if(data.desc and data.desc ~= "") then - descbox:SetText(data.desc); - else - descbox:SetText(""); - end - end); - descbox:SetScript("OnEnterPressed", function() - descbox:ClearFocus(); - if (alterdesc == "url") then - return; - end - if(descbox:GetText() ~= "") then - data.desc = descbox:GetText(); - else - data.desc = nil; - end - WeakAuras.ShowDisplayTooltip(data, children, nil, nil, nil, import, nil, "desc"); - if(WeakAuras.GetDisplayButton) then - local button = WeakAuras.GetDisplayButton(data.id); - if(button) then - button:SetNormalTooltip(); - end - end - end); - if (alterdesc == "url") then - descbox:SetScript("OnChar", function() descbox:SetText(text); descbox:HighlightText(); end); - descbox:SetScript("OnMouseUp", function() descbox:HighlightText(); end); - else - descbox:SetScript("OnChar", nil); - descbox:SetScript("OnMouseUp", nil); - end - - descbox:Show(); - elseif ItemRefTooltip.WeakAuras_Desc_Box then - ItemRefTooltip.WeakAuras_Desc_Box:Hide() - end - if not IsAddOnLoaded('WeakAurasOptions') then LoadAddOn('WeakAurasOptions') end @@ -1741,13 +1643,6 @@ function WeakAuras.ShowDisplayTooltip(data, children, matchInfo, icon, icons, im end WeakAuras.GetData = RegularGetData or WeakAuras.GetData ShowTooltip(tooltip, linesFromTop, matchInfo and matchInfo.activeCategories) - - if alterdesc then - ItemRefTooltip.WeakAuras_Desc_Box.descbox:SetFocus(); - if (alterdesc == "url") then - ItemRefTooltip.WeakAuras_Desc_Box.descbox:HighlightText(); - end - end end function WeakAuras.Import(inData, target) diff --git a/WeakAuras/Types.lua b/WeakAuras/Types.lua index 2c35999..e5336e6 100644 --- a/WeakAuras/Types.lua +++ b/WeakAuras/Types.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, Private = ... local WeakAuras = WeakAuras; local L = WeakAuras.L; @@ -241,7 +242,6 @@ WeakAuras.format_types = { type = "range", name = L["Max Char "], width = WeakAuras.normalWidth, - hidden = hidden, min = 1, max = 20, hidden = hidden, @@ -363,7 +363,6 @@ WeakAuras.format_types = { type = "range", name = L["Max Char "], width = WeakAuras.normalWidth, - hidden = hidden, min = 1, max = 20, hidden = hidden, @@ -1371,163 +1370,162 @@ WeakAuras.texture_types = { } } -if(WeakAuras.PowerAurasPath ~= "") then - WeakAuras.texture_types["PowerAuras Heads-Up"] = { - [WeakAuras.PowerAurasPath.."Aura1"] = "Runed Text", - [WeakAuras.PowerAurasPath.."Aura2"] = "Runed Text On Ring", - [WeakAuras.PowerAurasPath.."Aura3"] = "Power Waves", - [WeakAuras.PowerAurasPath.."Aura4"] = "Majesty", - [WeakAuras.PowerAurasPath.."Aura5"] = "Runed Ends", - [WeakAuras.PowerAurasPath.."Aura6"] = "Extra Majesty", - [WeakAuras.PowerAurasPath.."Aura7"] = "Triangular Highlights", - [WeakAuras.PowerAurasPath.."Aura11"] = "Oblong Highlights", - [WeakAuras.PowerAurasPath.."Aura16"] = "Thin Crescents", - [WeakAuras.PowerAurasPath.."Aura17"] = "Crescent Highlights", - [WeakAuras.PowerAurasPath.."Aura18"] = "Dense Runed Text", - [WeakAuras.PowerAurasPath.."Aura23"] = "Runed Spiked Ring", - [WeakAuras.PowerAurasPath.."Aura24"] = "Smoke", - [WeakAuras.PowerAurasPath.."Aura28"] = "Flourished Text", - [WeakAuras.PowerAurasPath.."Aura33"] = "Droplet Highlights" - } - WeakAuras.texture_types["PowerAuras Icons"] = { - [WeakAuras.PowerAurasPath.."Aura8"] = "Rune", - [WeakAuras.PowerAurasPath.."Aura9"] = "Stylized Ghost", - [WeakAuras.PowerAurasPath.."Aura10"] = "Skull and Crossbones", - [WeakAuras.PowerAurasPath.."Aura12"] = "Snowflake", - [WeakAuras.PowerAurasPath.."Aura13"] = "Flame", - [WeakAuras.PowerAurasPath.."Aura14"] = "Holy Rune", - [WeakAuras.PowerAurasPath.."Aura15"] = "Zig-Zag Exclamation Point", - [WeakAuras.PowerAurasPath.."Aura19"] = "Crossed Swords", - [WeakAuras.PowerAurasPath.."Aura21"] = "Shield", - [WeakAuras.PowerAurasPath.."Aura22"] = "Glow", - [WeakAuras.PowerAurasPath.."Aura25"] = "Cross", - [WeakAuras.PowerAurasPath.."Aura26"] = "Droplet", - [WeakAuras.PowerAurasPath.."Aura27"] = "Alert", - [WeakAuras.PowerAurasPath.."Aura29"] = "Paw", - [WeakAuras.PowerAurasPath.."Aura30"] = "Bull", - -- [WeakAuras.PowerAurasPath.."Aura31"] = "Heiroglyphics Horizontal", - [WeakAuras.PowerAurasPath.."Aura32"] = "Heiroglyphics", - [WeakAuras.PowerAurasPath.."Aura34"] = "Circled Arrow", - [WeakAuras.PowerAurasPath.."Aura35"] = "Short Sword", - -- [WeakAuras.PowerAurasPath.."Aura36"] = "Short Sword Horizontal", - [WeakAuras.PowerAurasPath.."Aura45"] = "Circular Glow", - [WeakAuras.PowerAurasPath.."Aura48"] = "Totem", - [WeakAuras.PowerAurasPath.."Aura49"] = "Dragon Blade", - [WeakAuras.PowerAurasPath.."Aura50"] = "Ornate Design", - [WeakAuras.PowerAurasPath.."Aura51"] = "Inverted Holy Rune", - [WeakAuras.PowerAurasPath.."Aura52"] = "Stylized Skull", - [WeakAuras.PowerAurasPath.."Aura53"] = "Exclamation Point", - [WeakAuras.PowerAurasPath.."Aura54"] = "Nonagon", - [WeakAuras.PowerAurasPath.."Aura68"] = "Wings", - [WeakAuras.PowerAurasPath.."Aura69"] = "Rectangle", - [WeakAuras.PowerAurasPath.."Aura70"] = "Low Mana", - [WeakAuras.PowerAurasPath.."Aura71"] = "Ghostly Eye", - [WeakAuras.PowerAurasPath.."Aura72"] = "Circle", - [WeakAuras.PowerAurasPath.."Aura73"] = "Ring", - [WeakAuras.PowerAurasPath.."Aura74"] = "Square", - [WeakAuras.PowerAurasPath.."Aura75"] = "Square Brackets", - [WeakAuras.PowerAurasPath.."Aura76"] = "Bob-omb", - [WeakAuras.PowerAurasPath.."Aura77"] = "Goldfish", - [WeakAuras.PowerAurasPath.."Aura78"] = "Check", - [WeakAuras.PowerAurasPath.."Aura79"] = "Ghostly Face", - [WeakAuras.PowerAurasPath.."Aura84"] = "Overlapping Boxes", - -- [WeakAuras.PowerAurasPath.."Aura85"] = "Overlapping Boxes 45°", - -- [WeakAuras.PowerAurasPath.."Aura86"] = "Overlapping Boxes 270°", - [WeakAuras.PowerAurasPath.."Aura87"] = "Fairy", - [WeakAuras.PowerAurasPath.."Aura88"] = "Comet", - [WeakAuras.PowerAurasPath.."Aura95"] = "Dual Spiral", - [WeakAuras.PowerAurasPath.."Aura96"] = "Japanese Character", - [WeakAuras.PowerAurasPath.."Aura97"] = "Japanese Character", - [WeakAuras.PowerAurasPath.."Aura98"] = "Japanese Character", - [WeakAuras.PowerAurasPath.."Aura99"] = "Japanese Character", - [WeakAuras.PowerAurasPath.."Aura100"] = "Japanese Character", - [WeakAuras.PowerAurasPath.."Aura101"] = "Ball of Flame", - [WeakAuras.PowerAurasPath.."Aura102"] = "Zig-Zag", - [WeakAuras.PowerAurasPath.."Aura103"] = "Thorny Ring", - [WeakAuras.PowerAurasPath.."Aura110"] = "Hunter's Mark", - -- [WeakAuras.PowerAurasPath.."Aura111"] = "Hunter's Mark Horizontal", - [WeakAuras.PowerAurasPath.."Aura112"] = "Kaleidoscope", - [WeakAuras.PowerAurasPath.."Aura113"] = "Jesus Face", - [WeakAuras.PowerAurasPath.."Aura114"] = "Green Mushrrom", - [WeakAuras.PowerAurasPath.."Aura115"] = "Red Mushroom", - [WeakAuras.PowerAurasPath.."Aura116"] = "Fire Flower", - [WeakAuras.PowerAurasPath.."Aura117"] = "Radioactive", - [WeakAuras.PowerAurasPath.."Aura118"] = "X", - [WeakAuras.PowerAurasPath.."Aura119"] = "Flower", - [WeakAuras.PowerAurasPath.."Aura120"] = "Petal", - [WeakAuras.PowerAurasPath.."Aura130"] = "Shoop Da Woop", - [WeakAuras.PowerAurasPath.."Aura131"] = "8-Bit Symbol", - [WeakAuras.PowerAurasPath.."Aura132"] = "Cartoon Skull", - [WeakAuras.PowerAurasPath.."Aura138"] = "Stop", - [WeakAuras.PowerAurasPath.."Aura139"] = "Thumbs Up", - [WeakAuras.PowerAurasPath.."Aura140"] = "Palette", - [WeakAuras.PowerAurasPath.."Aura141"] = "Blue Ring", - [WeakAuras.PowerAurasPath.."Aura142"] = "Ornate Ring", - [WeakAuras.PowerAurasPath.."Aura143"] = "Ghostly Skull" - } - WeakAuras.texture_types["PowerAuras Separated"] = { - [WeakAuras.PowerAurasPath.."Aura46"] = "8-Part Ring 1", - [WeakAuras.PowerAurasPath.."Aura47"] = "8-Part Ring 2", - [WeakAuras.PowerAurasPath.."Aura55"] = "Skull on Gear 1", - [WeakAuras.PowerAurasPath.."Aura56"] = "Skull on Gear 2", - [WeakAuras.PowerAurasPath.."Aura57"] = "Skull on Gear 3", - [WeakAuras.PowerAurasPath.."Aura58"] = "Skull on Gear 4", - [WeakAuras.PowerAurasPath.."Aura59"] = "Rune Ring Full", - [WeakAuras.PowerAurasPath.."Aura60"] = "Rune Ring Empty", - [WeakAuras.PowerAurasPath.."Aura61"] = "Rune Ring Left", - [WeakAuras.PowerAurasPath.."Aura62"] = "Rune Ring Right", - [WeakAuras.PowerAurasPath.."Aura63"] = "Spiked Rune Ring Full", - [WeakAuras.PowerAurasPath.."Aura64"] = "Spiked Rune Ring Empty", - [WeakAuras.PowerAurasPath.."Aura65"] = "Spiked Rune Ring Left", - [WeakAuras.PowerAurasPath.."Aura66"] = "Spiked Rune Ring Bottom", - [WeakAuras.PowerAurasPath.."Aura67"] = "Spiked Rune Ring Right", - [WeakAuras.PowerAurasPath.."Aura80"] = "Spiked Helm Background", - [WeakAuras.PowerAurasPath.."Aura81"] = "Spiked Helm Full", - [WeakAuras.PowerAurasPath.."Aura82"] = "Spiked Helm Bottom", - [WeakAuras.PowerAurasPath.."Aura83"] = "Spiked Helm Top", - [WeakAuras.PowerAurasPath.."Aura89"] = "5-Part Ring 1", - [WeakAuras.PowerAurasPath.."Aura90"] = "5-Part Ring 2", - [WeakAuras.PowerAurasPath.."Aura91"] = "5-Part Ring 3", - [WeakAuras.PowerAurasPath.."Aura92"] = "5-Part Ring 4", - [WeakAuras.PowerAurasPath.."Aura93"] = "5-Part Ring 5", - [WeakAuras.PowerAurasPath.."Aura94"] = "5-Part Ring Full", - [WeakAuras.PowerAurasPath.."Aura104"] = "Shield Center", - [WeakAuras.PowerAurasPath.."Aura105"] = "Shield Full", - [WeakAuras.PowerAurasPath.."Aura106"] = "Shield Top Right", - [WeakAuras.PowerAurasPath.."Aura107"] = "Shiled Top Left", - [WeakAuras.PowerAurasPath.."Aura108"] = "Shield Bottom Right", - [WeakAuras.PowerAurasPath.."Aura109"] = "Shield Bottom Left", - [WeakAuras.PowerAurasPath.."Aura121"] = "Vine Top Right Leaf", - [WeakAuras.PowerAurasPath.."Aura122"] = "Vine Left Leaf", - [WeakAuras.PowerAurasPath.."Aura123"] = "Vine Bottom Right Leaf", - [WeakAuras.PowerAurasPath.."Aura124"] = "Vine Stem", - [WeakAuras.PowerAurasPath.."Aura125"] = "Vine Thorns", - [WeakAuras.PowerAurasPath.."Aura126"] = "3-Part Circle 1", - [WeakAuras.PowerAurasPath.."Aura127"] = "3-Part Circle 2", - [WeakAuras.PowerAurasPath.."Aura128"] = "3-Part Circle 3", - [WeakAuras.PowerAurasPath.."Aura129"] = "3-Part Circle Full", - [WeakAuras.PowerAurasPath.."Aura133"] = "Sliced Orb 1", - [WeakAuras.PowerAurasPath.."Aura134"] = "Sliced Orb 2", - [WeakAuras.PowerAurasPath.."Aura135"] = "Sliced Orb 3", - [WeakAuras.PowerAurasPath.."Aura136"] = "Sliced Orb 4", - [WeakAuras.PowerAurasPath.."Aura137"] = "Sliced Orb 5", - [WeakAuras.PowerAurasPath.."Aura144"] = "Taijitu Bottom", - [WeakAuras.PowerAurasPath.."Aura145"] = "Taijitu Top" - } - WeakAuras.texture_types["PowerAuras Words"] = { - [WeakAuras.PowerAurasPath.."Aura20"] = "Power", - [WeakAuras.PowerAurasPath.."Aura37"] = "Slow", - [WeakAuras.PowerAurasPath.."Aura38"] = "Stun", - [WeakAuras.PowerAurasPath.."Aura39"] = "Silence", - [WeakAuras.PowerAurasPath.."Aura40"] = "Root", - [WeakAuras.PowerAurasPath.."Aura41"] = "Disorient", - [WeakAuras.PowerAurasPath.."Aura42"] = "Dispell", - [WeakAuras.PowerAurasPath.."Aura43"] = "Danger", - [WeakAuras.PowerAurasPath.."Aura44"] = "Buff", - [WeakAuras.PowerAurasPath.."Aura44"] = "Buff", - ["Interface\\AddOns\\WeakAuras\\Media\\Textures\\interrupt"] = "Interrupt" - } -end +local PowerAurasPath = "Interface\\Addons\\WeakAuras\\PowerAurasMedia\\Auras\\" +WeakAuras.texture_types["PowerAuras Heads-Up"] = { + [PowerAurasPath.."Aura1"] = "Runed Text", + [PowerAurasPath.."Aura2"] = "Runed Text On Ring", + [PowerAurasPath.."Aura3"] = "Power Waves", + [PowerAurasPath.."Aura4"] = "Majesty", + [PowerAurasPath.."Aura5"] = "Runed Ends", + [PowerAurasPath.."Aura6"] = "Extra Majesty", + [PowerAurasPath.."Aura7"] = "Triangular Highlights", + [PowerAurasPath.."Aura11"] = "Oblong Highlights", + [PowerAurasPath.."Aura16"] = "Thin Crescents", + [PowerAurasPath.."Aura17"] = "Crescent Highlights", + [PowerAurasPath.."Aura18"] = "Dense Runed Text", + [PowerAurasPath.."Aura23"] = "Runed Spiked Ring", + [PowerAurasPath.."Aura24"] = "Smoke", + [PowerAurasPath.."Aura28"] = "Flourished Text", + [PowerAurasPath.."Aura33"] = "Droplet Highlights" +} +WeakAuras.texture_types["PowerAuras Icons"] = { + [PowerAurasPath.."Aura8"] = "Rune", + [PowerAurasPath.."Aura9"] = "Stylized Ghost", + [PowerAurasPath.."Aura10"] = "Skull and Crossbones", + [PowerAurasPath.."Aura12"] = "Snowflake", + [PowerAurasPath.."Aura13"] = "Flame", + [PowerAurasPath.."Aura14"] = "Holy Rune", + [PowerAurasPath.."Aura15"] = "Zig-Zag Exclamation Point", + [PowerAurasPath.."Aura19"] = "Crossed Swords", + [PowerAurasPath.."Aura21"] = "Shield", + [PowerAurasPath.."Aura22"] = "Glow", + [PowerAurasPath.."Aura25"] = "Cross", + [PowerAurasPath.."Aura26"] = "Droplet", + [PowerAurasPath.."Aura27"] = "Alert", + [PowerAurasPath.."Aura29"] = "Paw", + [PowerAurasPath.."Aura30"] = "Bull", + -- [PowerAurasPath.."Aura31"] = "Heiroglyphics Horizontal", + [PowerAurasPath.."Aura32"] = "Heiroglyphics", + [PowerAurasPath.."Aura34"] = "Circled Arrow", + [PowerAurasPath.."Aura35"] = "Short Sword", + -- [PowerAurasPath.."Aura36"] = "Short Sword Horizontal", + [PowerAurasPath.."Aura45"] = "Circular Glow", + [PowerAurasPath.."Aura48"] = "Totem", + [PowerAurasPath.."Aura49"] = "Dragon Blade", + [PowerAurasPath.."Aura50"] = "Ornate Design", + [PowerAurasPath.."Aura51"] = "Inverted Holy Rune", + [PowerAurasPath.."Aura52"] = "Stylized Skull", + [PowerAurasPath.."Aura53"] = "Exclamation Point", + [PowerAurasPath.."Aura54"] = "Nonagon", + [PowerAurasPath.."Aura68"] = "Wings", + [PowerAurasPath.."Aura69"] = "Rectangle", + [PowerAurasPath.."Aura70"] = "Low Mana", + [PowerAurasPath.."Aura71"] = "Ghostly Eye", + [PowerAurasPath.."Aura72"] = "Circle", + [PowerAurasPath.."Aura73"] = "Ring", + [PowerAurasPath.."Aura74"] = "Square", + [PowerAurasPath.."Aura75"] = "Square Brackets", + [PowerAurasPath.."Aura76"] = "Bob-omb", + [PowerAurasPath.."Aura77"] = "Goldfish", + [PowerAurasPath.."Aura78"] = "Check", + [PowerAurasPath.."Aura79"] = "Ghostly Face", + [PowerAurasPath.."Aura84"] = "Overlapping Boxes", + -- [PowerAurasPath.."Aura85"] = "Overlapping Boxes 45°", + -- [PowerAurasPath.."Aura86"] = "Overlapping Boxes 270°", + [PowerAurasPath.."Aura87"] = "Fairy", + [PowerAurasPath.."Aura88"] = "Comet", + [PowerAurasPath.."Aura95"] = "Dual Spiral", + [PowerAurasPath.."Aura96"] = "Japanese Character", + [PowerAurasPath.."Aura97"] = "Japanese Character", + [PowerAurasPath.."Aura98"] = "Japanese Character", + [PowerAurasPath.."Aura99"] = "Japanese Character", + [PowerAurasPath.."Aura100"] = "Japanese Character", + [PowerAurasPath.."Aura101"] = "Ball of Flame", + [PowerAurasPath.."Aura102"] = "Zig-Zag", + [PowerAurasPath.."Aura103"] = "Thorny Ring", + [PowerAurasPath.."Aura110"] = "Hunter's Mark", + -- [PowerAurasPath.."Aura111"] = "Hunter's Mark Horizontal", + [PowerAurasPath.."Aura112"] = "Kaleidoscope", + [PowerAurasPath.."Aura113"] = "Jesus Face", + [PowerAurasPath.."Aura114"] = "Green Mushrrom", + [PowerAurasPath.."Aura115"] = "Red Mushroom", + [PowerAurasPath.."Aura116"] = "Fire Flower", + [PowerAurasPath.."Aura117"] = "Radioactive", + [PowerAurasPath.."Aura118"] = "X", + [PowerAurasPath.."Aura119"] = "Flower", + [PowerAurasPath.."Aura120"] = "Petal", + [PowerAurasPath.."Aura130"] = "Shoop Da Woop", + [PowerAurasPath.."Aura131"] = "8-Bit Symbol", + [PowerAurasPath.."Aura132"] = "Cartoon Skull", + [PowerAurasPath.."Aura138"] = "Stop", + [PowerAurasPath.."Aura139"] = "Thumbs Up", + [PowerAurasPath.."Aura140"] = "Palette", + [PowerAurasPath.."Aura141"] = "Blue Ring", + [PowerAurasPath.."Aura142"] = "Ornate Ring", + [PowerAurasPath.."Aura143"] = "Ghostly Skull" +} +WeakAuras.texture_types["PowerAuras Separated"] = { + [PowerAurasPath.."Aura46"] = "8-Part Ring 1", + [PowerAurasPath.."Aura47"] = "8-Part Ring 2", + [PowerAurasPath.."Aura55"] = "Skull on Gear 1", + [PowerAurasPath.."Aura56"] = "Skull on Gear 2", + [PowerAurasPath.."Aura57"] = "Skull on Gear 3", + [PowerAurasPath.."Aura58"] = "Skull on Gear 4", + [PowerAurasPath.."Aura59"] = "Rune Ring Full", + [PowerAurasPath.."Aura60"] = "Rune Ring Empty", + [PowerAurasPath.."Aura61"] = "Rune Ring Left", + [PowerAurasPath.."Aura62"] = "Rune Ring Right", + [PowerAurasPath.."Aura63"] = "Spiked Rune Ring Full", + [PowerAurasPath.."Aura64"] = "Spiked Rune Ring Empty", + [PowerAurasPath.."Aura65"] = "Spiked Rune Ring Left", + [PowerAurasPath.."Aura66"] = "Spiked Rune Ring Bottom", + [PowerAurasPath.."Aura67"] = "Spiked Rune Ring Right", + [PowerAurasPath.."Aura80"] = "Spiked Helm Background", + [PowerAurasPath.."Aura81"] = "Spiked Helm Full", + [PowerAurasPath.."Aura82"] = "Spiked Helm Bottom", + [PowerAurasPath.."Aura83"] = "Spiked Helm Top", + [PowerAurasPath.."Aura89"] = "5-Part Ring 1", + [PowerAurasPath.."Aura90"] = "5-Part Ring 2", + [PowerAurasPath.."Aura91"] = "5-Part Ring 3", + [PowerAurasPath.."Aura92"] = "5-Part Ring 4", + [PowerAurasPath.."Aura93"] = "5-Part Ring 5", + [PowerAurasPath.."Aura94"] = "5-Part Ring Full", + [PowerAurasPath.."Aura104"] = "Shield Center", + [PowerAurasPath.."Aura105"] = "Shield Full", + [PowerAurasPath.."Aura106"] = "Shield Top Right", + [PowerAurasPath.."Aura107"] = "Shiled Top Left", + [PowerAurasPath.."Aura108"] = "Shield Bottom Right", + [PowerAurasPath.."Aura109"] = "Shield Bottom Left", + [PowerAurasPath.."Aura121"] = "Vine Top Right Leaf", + [PowerAurasPath.."Aura122"] = "Vine Left Leaf", + [PowerAurasPath.."Aura123"] = "Vine Bottom Right Leaf", + [PowerAurasPath.."Aura124"] = "Vine Stem", + [PowerAurasPath.."Aura125"] = "Vine Thorns", + [PowerAurasPath.."Aura126"] = "3-Part Circle 1", + [PowerAurasPath.."Aura127"] = "3-Part Circle 2", + [PowerAurasPath.."Aura128"] = "3-Part Circle 3", + [PowerAurasPath.."Aura129"] = "3-Part Circle Full", + [PowerAurasPath.."Aura133"] = "Sliced Orb 1", + [PowerAurasPath.."Aura134"] = "Sliced Orb 2", + [PowerAurasPath.."Aura135"] = "Sliced Orb 3", + [PowerAurasPath.."Aura136"] = "Sliced Orb 4", + [PowerAurasPath.."Aura137"] = "Sliced Orb 5", + [PowerAurasPath.."Aura144"] = "Taijitu Bottom", + [PowerAurasPath.."Aura145"] = "Taijitu Top" +} +WeakAuras.texture_types["PowerAuras Words"] = { + [PowerAurasPath.."Aura20"] = "Power", + [PowerAurasPath.."Aura37"] = "Slow", + [PowerAurasPath.."Aura38"] = "Stun", + [PowerAurasPath.."Aura39"] = "Silence", + [PowerAurasPath.."Aura40"] = "Root", + [PowerAurasPath.."Aura41"] = "Disorient", + [PowerAurasPath.."Aura42"] = "Dispell", + [PowerAurasPath.."Aura43"] = "Danger", + [PowerAurasPath.."Aura44"] = "Buff", + [PowerAurasPath.."Aura44"] = "Buff", + ["Interface\\AddOns\\WeakAuras\\Media\\Textures\\interrupt"] = "Interrupt" +} WeakAuras.operator_types = { ["=="] = "=", @@ -1909,50 +1907,49 @@ LSM:Register("sound", "Voice: Taunt", "Interface\\AddOns\\WeakAuras\\Media\\Soun LSM:Register("sound", "Voice: Triangle", "Interface\\AddOns\\WeakAuras\\Media\\Sounds\\Triangle.ogg") -if(WeakAuras.PowerAurasSoundPath ~= "") then - LSM:Register("sound", "Aggro", WeakAuras.PowerAurasSoundPath.."aggro.ogg") - LSM:Register("sound", "Arrow Swoosh", WeakAuras.PowerAurasSoundPath.."Arrow_swoosh.ogg") - LSM:Register("sound", "Bam", WeakAuras.PowerAurasSoundPath.."bam.ogg") - LSM:Register("sound", "Polar Bear", WeakAuras.PowerAurasSoundPath.."bear_polar.ogg") - LSM:Register("sound", "Big Kiss", WeakAuras.PowerAurasSoundPath.."bigkiss.ogg") - LSM:Register("sound", "Bite", WeakAuras.PowerAurasSoundPath.."BITE.ogg") - LSM:Register("sound", "Burp", WeakAuras.PowerAurasSoundPath.."burp4.ogg") - LSM:Register("sound", "Cat", WeakAuras.PowerAurasSoundPath.."cat2.ogg") - LSM:Register("sound", "Chant Major 2nd", WeakAuras.PowerAurasSoundPath.."chant2.ogg") - LSM:Register("sound", "Chant Minor 3rd", WeakAuras.PowerAurasSoundPath.."chant4.ogg") - LSM:Register("sound", "Chimes", WeakAuras.PowerAurasSoundPath.."chimes.ogg") - LSM:Register("sound", "Cookie Monster", WeakAuras.PowerAurasSoundPath.."cookie.ogg") - LSM:Register("sound", "Electrical Spark", WeakAuras.PowerAurasSoundPath.."ESPARK1.ogg") - LSM:Register("sound", "Fireball", WeakAuras.PowerAurasSoundPath.."Fireball.ogg") - LSM:Register("sound", "Gasp", WeakAuras.PowerAurasSoundPath.."Gasp.ogg") - LSM:Register("sound", "Heartbeat", WeakAuras.PowerAurasSoundPath.."heartbeat.ogg") - LSM:Register("sound", "Hiccup", WeakAuras.PowerAurasSoundPath.."hic3.ogg") - LSM:Register("sound", "Huh?", WeakAuras.PowerAurasSoundPath.."huh_1.ogg") - LSM:Register("sound", "Hurricane", WeakAuras.PowerAurasSoundPath.."hurricane.ogg") - LSM:Register("sound", "Hyena", WeakAuras.PowerAurasSoundPath.."hyena.ogg") - LSM:Register("sound", "Kaching", WeakAuras.PowerAurasSoundPath.."kaching.ogg") - LSM:Register("sound", "Moan", WeakAuras.PowerAurasSoundPath.."moan.ogg") - LSM:Register("sound", "Panther", WeakAuras.PowerAurasSoundPath.."panther1.ogg") - LSM:Register("sound", "Phone", WeakAuras.PowerAurasSoundPath.."phone.ogg") - LSM:Register("sound", "Punch", WeakAuras.PowerAurasSoundPath.."PUNCH.ogg") - LSM:Register("sound", "Rain", WeakAuras.PowerAurasSoundPath.."rainroof.ogg") - LSM:Register("sound", "Rocket", WeakAuras.PowerAurasSoundPath.."rocket.ogg") - LSM:Register("sound", "Ship's Whistle", WeakAuras.PowerAurasSoundPath.."shipswhistle.ogg") - LSM:Register("sound", "Gunshot", WeakAuras.PowerAurasSoundPath.."shot.ogg") - LSM:Register("sound", "Snake Attack", WeakAuras.PowerAurasSoundPath.."snakeatt.ogg") - LSM:Register("sound", "Sneeze", WeakAuras.PowerAurasSoundPath.."sneeze.ogg") - LSM:Register("sound", "Sonar", WeakAuras.PowerAurasSoundPath.."sonar.ogg") - LSM:Register("sound", "Splash", WeakAuras.PowerAurasSoundPath.."splash.ogg") - LSM:Register("sound", "Squeaky Toy", WeakAuras.PowerAurasSoundPath.."Squeakypig.ogg") - LSM:Register("sound", "Sword Ring", WeakAuras.PowerAurasSoundPath.."swordecho.ogg") - LSM:Register("sound", "Throwing Knife", WeakAuras.PowerAurasSoundPath.."throwknife.ogg") - LSM:Register("sound", "Thunder", WeakAuras.PowerAurasSoundPath.."thunder.ogg") - LSM:Register("sound", "Wicked Male Laugh", WeakAuras.PowerAurasSoundPath.."wickedmalelaugh1.ogg") - LSM:Register("sound", "Wilhelm Scream", WeakAuras.PowerAurasSoundPath.."wilhelm.ogg") - LSM:Register("sound", "Wicked Female Laugh", WeakAuras.PowerAurasSoundPath.."wlaugh.ogg") - LSM:Register("sound", "Wolf Howl", WeakAuras.PowerAurasSoundPath.."wolf5.ogg") - LSM:Register("sound", "Yeehaw", WeakAuras.PowerAurasSoundPath.."yeehaw.ogg") -end +local PowerAurasSoundPath = "Interface\\Addons\\WeakAuras\\PowerAurasMedia\\Sounds\\" +LSM:Register("sound", "Aggro", PowerAurasSoundPath.."aggro.ogg") +LSM:Register("sound", "Arrow Swoosh", PowerAurasSoundPath.."Arrow_swoosh.ogg") +LSM:Register("sound", "Bam", PowerAurasSoundPath.."bam.ogg") +LSM:Register("sound", "Polar Bear", PowerAurasSoundPath.."bear_polar.ogg") +LSM:Register("sound", "Big Kiss", PowerAurasSoundPath.."bigkiss.ogg") +LSM:Register("sound", "Bite", PowerAurasSoundPath.."BITE.ogg") +LSM:Register("sound", "Burp", PowerAurasSoundPath.."burp4.ogg") +LSM:Register("sound", "Cat", PowerAurasSoundPath.."cat2.ogg") +LSM:Register("sound", "Chant Major 2nd", PowerAurasSoundPath.."chant2.ogg") +LSM:Register("sound", "Chant Minor 3rd", PowerAurasSoundPath.."chant4.ogg") +LSM:Register("sound", "Chimes", PowerAurasSoundPath.."chimes.ogg") +LSM:Register("sound", "Cookie Monster", PowerAurasSoundPath.."cookie.ogg") +LSM:Register("sound", "Electrical Spark", PowerAurasSoundPath.."ESPARK1.ogg") +LSM:Register("sound", "Fireball", PowerAurasSoundPath.."Fireball.ogg") +LSM:Register("sound", "Gasp", PowerAurasSoundPath.."Gasp.ogg") +LSM:Register("sound", "Heartbeat", PowerAurasSoundPath.."heartbeat.ogg") +LSM:Register("sound", "Hiccup", PowerAurasSoundPath.."hic3.ogg") +LSM:Register("sound", "Huh?", PowerAurasSoundPath.."huh_1.ogg") +LSM:Register("sound", "Hurricane", PowerAurasSoundPath.."hurricane.ogg") +LSM:Register("sound", "Hyena", PowerAurasSoundPath.."hyena.ogg") +LSM:Register("sound", "Kaching", PowerAurasSoundPath.."kaching.ogg") +LSM:Register("sound", "Moan", PowerAurasSoundPath.."moan.ogg") +LSM:Register("sound", "Panther", PowerAurasSoundPath.."panther1.ogg") +LSM:Register("sound", "Phone", PowerAurasSoundPath.."phone.ogg") +LSM:Register("sound", "Punch", PowerAurasSoundPath.."PUNCH.ogg") +LSM:Register("sound", "Rain", PowerAurasSoundPath.."rainroof.ogg") +LSM:Register("sound", "Rocket", PowerAurasSoundPath.."rocket.ogg") +LSM:Register("sound", "Ship's Whistle", PowerAurasSoundPath.."shipswhistle.ogg") +LSM:Register("sound", "Gunshot", PowerAurasSoundPath.."shot.ogg") +LSM:Register("sound", "Snake Attack", PowerAurasSoundPath.."snakeatt.ogg") +LSM:Register("sound", "Sneeze", PowerAurasSoundPath.."sneeze.ogg") +LSM:Register("sound", "Sonar", PowerAurasSoundPath.."sonar.ogg") +LSM:Register("sound", "Splash", PowerAurasSoundPath.."splash.ogg") +LSM:Register("sound", "Squeaky Toy", PowerAurasSoundPath.."Squeakypig.ogg") +LSM:Register("sound", "Sword Ring", PowerAurasSoundPath.."swordecho.ogg") +LSM:Register("sound", "Throwing Knife", PowerAurasSoundPath.."throwknife.ogg") +LSM:Register("sound", "Thunder", PowerAurasSoundPath.."thunder.ogg") +LSM:Register("sound", "Wicked Male Laugh", PowerAurasSoundPath.."wickedmalelaugh1.ogg") +LSM:Register("sound", "Wilhelm Scream", PowerAurasSoundPath.."wilhelm.ogg") +LSM:Register("sound", "Wicked Female Laugh", PowerAurasSoundPath.."wlaugh.ogg") +LSM:Register("sound", "Wolf Howl", PowerAurasSoundPath.."wolf5.ogg") +LSM:Register("sound", "Yeehaw", PowerAurasSoundPath.."yeehaw.ogg") WeakAuras.sound_types = { [" custom"] = " " .. L["Custom"], diff --git a/WeakAuras/WeakAuras.lua b/WeakAuras/WeakAuras.lua index 22146d5..3113e94 100644 --- a/WeakAuras/WeakAuras.lua +++ b/WeakAuras/WeakAuras.lua @@ -1,3 +1,5 @@ +local AddonName, Private = ... + local internalVersion = 33; -- Lua APIs @@ -59,7 +61,7 @@ function WeakAuras.InternalVersion() return internalVersion; end -function WeakAuras.LoadOptions(msg) +function Private.LoadOptions(msg) if not(IsAddOnLoaded("WeakAurasOptions")) then if not WeakAuras.IsLoginFinished() then prettyPrint(WeakAuras.LoginMessage()) @@ -74,7 +76,7 @@ function WeakAuras.LoadOptions(msg) local loaded, reason = LoadAddOn("WeakAurasOptions"); if not(loaded) then reason = string.lower("|cffff2020" .. _G["ADDON_" .. reason] .. "|r.") - print(WeakAuras.printPrefix .. "Options could not be loaded, the addon is " .. reason); + WeakAuras.prettyPrint("Options could not be loaded, the addon is " .. reason); return false; end end @@ -85,12 +87,12 @@ end function WeakAuras.OpenOptions(msg) if WeakAuras.NeedToRepairDatabase() then StaticPopup_Show("WEAKAURAS_CONFIRM_REPAIR", nil, nil, {reason = "downgrade"}) - elseif (WeakAuras.IsLoginFinished() and WeakAuras.LoadOptions(msg)) then + elseif (WeakAuras.IsLoginFinished() and Private.LoadOptions(msg)) then WeakAuras.ToggleOptions(msg); end end -function WeakAuras.PrintHelp() +function Private.PrintHelp() print(L["Usage:"]) print(L["/wa help - Show this message"]) print(L["/wa minimap - Toggle the minimap icon"]) @@ -120,9 +122,9 @@ function SlashCmdList.WEAKAURAS(input) elseif msg == "pcancel" then WeakAuras.CancelScheduledProfile() elseif msg == "minimap" then - WeakAuras.ToggleMinimap(); + Private.ToggleMinimap(); elseif msg == "help" then - WeakAuras.PrintHelp(); + Private.PrintHelp(); elseif msg == "repair" then StaticPopup_Show("WEAKAURAS_CONFIRM_REPAIR", nil, nil, {reason = "user"}) else @@ -143,7 +145,7 @@ function WeakAuras.ApplyToDataOrChildData(data, func, ...) end end -function WeakAuras.ToggleMinimap() +function Private.ToggleMinimap() WeakAurasSaved.minimap.hide = not WeakAurasSaved.minimap.hide if WeakAurasSaved.minimap.hide then LDBIcon:Hide("WeakAuras"); @@ -169,10 +171,6 @@ local registeredFromAddons; WeakAuras.addons = {}; local addons = WeakAuras.addons; --- A list of tutorials, filled in by the WeakAuras_Tutorials addon by calling RegisterTutorial -WeakAuras.tutorials = {}; -local tutorials = WeakAuras.tutorials; - -- used if an addon tries to register a display under an id that the user already has a display with that id WeakAuras.collisions = {}; local collisions = WeakAuras.collisions; @@ -908,6 +906,19 @@ local function CreateTestForCondition(uid, input, allConditionsTemplate, usedSta check = string.format("state and WeakAuras.CallCustomConditionTest(%q, %s, state[%s], %s, %s, %s)", uid, testFunctionNumber, trigger, valueString, (opString or "nil"), preambleString or "nil"); end + elseif (cType == "customcheck") then + if value then + local customCheck = WeakAuras.LoadFunction("return " .. value, "custom check") + if customCheck then + WeakAuras.conditionHelpers[uid] = WeakAuras.conditionHelpers[uid] or {} + WeakAuras.conditionHelpers[uid].customTestFunctions = WeakAuras.conditionHelpers[uid].customTestFunctions or {} + tinsert(WeakAuras.conditionHelpers[uid].customTestFunctions, customCheck); + local testFunctionNumber = #(WeakAuras.conditionHelpers[uid].customTestFunctions); + + check = string.format("state and WeakAuras.CallCustomConditionTest(%q, %s, state)", + uid, testFunctionNumber, trigger); + end + end elseif (cType == "number" and op) then local v = tonumber(value) if (v) then @@ -1212,6 +1223,10 @@ local globalConditions = state.attackabletarget = UnitCanAttack("player", "target") == 1 and true or false; end }, + ["customcheck"] = { + display = L["Custom Check"], + type = "customcheck" + } } function WeakAuras.GetGlobalConditions() @@ -1362,6 +1377,16 @@ local function EvaluateCheckForRegisterForGlobalConditions(id, check, allConditi EvaluateCheckForRegisterForGlobalConditions(id, subcheck, allConditionsTemplate, register); end end + elseif trigger == -1 and variable == "customcheck" then + if check.op then + for event in string.gmatch(check.op, "[%w_]+") do + if (not dynamicConditions[event]) then + register[event] = true; + dynamicConditions[event] = {}; + end + dynamicConditions[event][id] = true; + end + end elseif (trigger and variable) then local conditionTemplate = allConditionsTemplate[trigger] and allConditionsTemplate[trigger][variable]; if (conditionTemplate and conditionTemplate.events) then @@ -1414,7 +1439,7 @@ function WeakAuras.RegisterForGlobalConditions(id) dynamicConditionsFrame.onUpdate = true; end else - dynamicConditionsFrame:RegisterEvent(event); + pcall(dynamicConditionsFrame.RegisterEvent, dynamicConditionsFrame, event); end end end @@ -1530,7 +1555,7 @@ Broker_WeakAuras = LDB:NewDataObject("WeakAuras", { WeakAuras.OpenOptions(); end elseif(button == 'MiddleButton') then - WeakAuras.ToggleMinimap(); + Private.ToggleMinimap(); else WeakAuras.RealTimeProfilingWindow:Toggle() end @@ -2433,6 +2458,9 @@ function WeakAuras.Rename(data, newid) WeakAuras.ProfileRenameAura(oldid, newid); WeakAuras.RenameCollapsedData(oldid, newid) + + -- This should not be necessary + WeakAuras.Add(data) end function WeakAuras.Convert(data, newType) @@ -5664,17 +5692,6 @@ function WeakAuras.ProfileDisplays(all) end end -function WeakAuras.RegisterTutorial(name, displayName, description, icon, steps, order) - tutorials[name] = { - name = name, - displayName = displayName, - description = description, - icon = icon, - steps = steps, - order = order - }; -end - function WeakAuras.ValueFromPath(data, path) if not data then return nil @@ -5847,7 +5864,7 @@ end function WeakAuras.RegisterTriggerSystemOptions(types, func) for _, v in ipairs(types) do - triggerTypesOptions[v] = func; + WeakAuras.triggerTypesOptions[v] = func; end end @@ -7021,41 +7038,44 @@ function WeakAuras.ReplaceLocalizedRaidMarkers(txt) end end -local trackableUnits = {} -trackableUnits["player"] = true -trackableUnits["target"] = true -trackableUnits["focus"] = true -trackableUnits["pet"] = true -trackableUnits["vehicle"] = true +do + local trackableUnits = {} + trackableUnits["player"] = true + trackableUnits["target"] = true + trackableUnits["focus"] = true + trackableUnits["pet"] = true + trackableUnits["vehicle"] = true + + for i = 1, 5 do + trackableUnits["arena" .. i] = true + trackableUnits["arenapet" .. i] = true + end + + for i = 1, 4 do + trackableUnits["party" .. i] = true + trackableUnits["partypet" .. i] = true + end + + for i = 1, MAX_BOSS_FRAMES do + trackableUnits["boss" .. i] = true + end + + for i = 1, 40 do + trackableUnits["raid" .. i] = true + trackableUnits["raidpet" .. i] = true + end -for i = 1, 5 do - trackableUnits["arena" .. i] = true - trackableUnits["arenapet" .. i] = true + function WeakAuras.UntrackableUnit(unit) + return not trackableUnits[unit] + end end -for i = 1, 4 do - trackableUnits["party" .. i] = true - trackableUnits["partypet" .. i] = true -end - -for i = 1, MAX_BOSS_FRAMES do - trackableUnits["boss" .. i] = true -end - -for i = 1, 40 do - trackableUnits["raid" .. i] = true - trackableUnits["raidpet" .. i] = true -end - - -function WeakAuras.UntrackableUnit(unit) - return not trackableUnits[unit] -end - -local ownRealm = GetRealmName() -function WeakAuras.UnitNameWithRealm(unit) - local name, realm = UnitName(unit) - return name or "", realm or ownRealm or "" +do + local ownRealm = GetRealmName() + function WeakAuras.UnitNameWithRealm(unit) + local name, realm = UnitName(unit) + return name or "", realm or ownRealm or "" + end end function WeakAuras.ParseNameCheck(name) diff --git a/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasDisplayButton.lua b/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasDisplayButton.lua index 4d3ae43..207eb3a 100644 --- a/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasDisplayButton.lua +++ b/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasDisplayButton.lua @@ -807,24 +807,7 @@ local methods = { if not(newid == oldid) then WeakAuras.Rename(data, newid); - WeakAuras.Add(data) - - WeakAuras.displayButtons[newid] = WeakAuras.displayButtons[oldid]; - WeakAuras.displayButtons[newid]:SetData(data) - WeakAuras.displayButtons[oldid] = nil; - WeakAuras.ClearOptions(oldid) - - WeakAuras.displayButtons[newid]:SetTitle(newid); - - if(data.controlledChildren) then - for index, childId in pairs(data.controlledChildren) do - WeakAuras.displayButtons[childId]:SetGroup(newid); - end - end - - WeakAuras.SetGrouping(); - WeakAuras.SortDisplayButtons(); - WeakAuras.PickDisplay(newid); + WeakAuras.HandleRename(data, oldid, newid) end end @@ -943,21 +926,6 @@ local methods = { func = self.callbacks.OnDuplicateClick }); - tinsert(self.menu, { - text = L["Set tooltip description"], - notCheckable = true, - func = function() WeakAuras.ShowDisplayTooltip(data, nil, nil, nil, nil, nil, nil, "desc") end - }); - - - if (data.url and data.url ~= "") then - tinsert(self.menu, { - text = L["Copy URL"], - notCheckable = true, - func = function() WeakAuras.ShowDisplayTooltip(data, nil, nil, nil, nil, nil, nil, "url") end - }); - end - tinsert(self.menu, { text = L["Export to string..."], notCheckable = true, diff --git a/WeakAurasOptions/ActionOptions.lua b/WeakAurasOptions/ActionOptions.lua index 6e66051..9dbd2c2 100644 --- a/WeakAurasOptions/ActionOptions.lua +++ b/WeakAurasOptions/ActionOptions.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... local L = WeakAuras.L diff --git a/WeakAurasOptions/AnimationOptions.lua b/WeakAurasOptions/AnimationOptions.lua index f249a59..490d589 100644 --- a/WeakAurasOptions/AnimationOptions.lua +++ b/WeakAurasOptions/AnimationOptions.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... local L = WeakAuras.L diff --git a/WeakAurasOptions/AuthorOptions.lua b/WeakAurasOptions/AuthorOptions.lua index 7c08444..d71c62e 100644 --- a/WeakAurasOptions/AuthorOptions.lua +++ b/WeakAurasOptions/AuthorOptions.lua @@ -59,6 +59,7 @@ step (optional) -> like bigStep, but applies to number input as well ]] if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... local WeakAuras = WeakAuras local L = WeakAuras.L diff --git a/WeakAurasOptions/BuffTrigger.lua b/WeakAurasOptions/BuffTrigger.lua index 1056355..5522388 100644 --- a/WeakAurasOptions/BuffTrigger.lua +++ b/WeakAurasOptions/BuffTrigger.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... local L = WeakAuras.L; diff --git a/WeakAurasOptions/BuffTrigger2.lua b/WeakAurasOptions/BuffTrigger2.lua index 83fb797..bc5338e 100644 --- a/WeakAurasOptions/BuffTrigger2.lua +++ b/WeakAurasOptions/BuffTrigger2.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... local L = WeakAuras.L diff --git a/WeakAurasOptions/Cache.lua b/WeakAurasOptions/Cache.lua index ce0e596..fb463e6 100644 --- a/WeakAurasOptions/Cache.lua +++ b/WeakAurasOptions/Cache.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... -- Lua APIs local pairs, error, coroutine = pairs, error, coroutine diff --git a/WeakAurasOptions/CommonOptions.lua b/WeakAurasOptions/CommonOptions.lua index 4931452..93deb18 100644 --- a/WeakAurasOptions/CommonOptions.lua +++ b/WeakAurasOptions/CommonOptions.lua @@ -1,4 +1,5 @@ --- Nothing here +if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... local L = WeakAuras.L local regionOptions = WeakAuras.regionOptions diff --git a/WeakAurasOptions/ConditionOptions.lua b/WeakAurasOptions/ConditionOptions.lua index 528b183..d1ddc27 100644 --- a/WeakAurasOptions/ConditionOptions.lua +++ b/WeakAurasOptions/ConditionOptions.lua @@ -45,6 +45,7 @@ --- - action: The action function, called on activating a condition -- - type: The type if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... local WeakAuras = WeakAuras; local L = WeakAuras.L; @@ -96,7 +97,8 @@ local function valueToString(a, propertytype) else return ""; end - elseif (propertytype == "chat" or propertytype == "sound" or propertytype == "customcode" or propertytype == "glowexternal") then + elseif (propertytype == "chat" or propertytype == "sound" or propertytype == "customcode" + or propertytype == "glowexternal" or propertytype == "customcheck") then return tostring(a); elseif (propertytype == "bool") then return (a == 1 or a == true) and L["True"] or L["False"]; @@ -785,9 +787,9 @@ local function addControlsForChange(args, order, data, conditionVariable, condit local changeIndex = reference.changeIndex; multipath[id] = {"conditions", conditionIndex, "changes", changeIndex, "value", "custom"}; end - WeakAuras.OpenTextEditor(data, multipath, nil, true, nil, nil, "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#chat-message---custom-code-1"); + WeakAuras.OpenTextEditor(data, multipath, nil, true, nil, nil, "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-check"); else - WeakAuras.OpenTextEditor(data, {"conditions", i, "changes", j, "value", "custom"}, nil, nil, nil, nil, "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#chat-message---custom-code-1"); + WeakAuras.OpenTextEditor(data, {"conditions", i, "changes", j, "value", "custom"}, nil, nil, nil, nil, "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-check"); end end } @@ -1493,11 +1495,13 @@ local function addControlsForIfLine(args, order, data, conditionVariable, condit check = getOrCreateSubCheck(conditions[i].check, path); check.op = v; WeakAuras.Add(data); + WeakAuras.ClearAndUpdateOptions(data.id) end setValue = function(info, v) check = getOrCreateSubCheck(conditions[i].check, path); check.value = v; - WeakAuras.Add(data); + WeakAuras.Add(data) + WeakAuras.ClearAndUpdateOptions(data.id) end end @@ -1644,6 +1648,98 @@ local function addControlsForIfLine(args, order, data, conditionVariable, condit set = setValue } order = order + 1; + elseif currentConditionTemplate.type == "customcheck" then + args["condition" .. i .. tostring(path) .. "_op"] = { + name = blueIfNoValue(data, conditions[i].check, "op", L["Events"], L["Events"]), + desc = descIfNoValue(data, conditions[i].check, "op", currentConditionTemplate.type) or "", + type = "input", + width = WeakAuras.doubleWidth, + order = order, + get = function() + return check and check.op; + end, + set = setOp + } + order = order + 1; + + local multipath = {} + + args["condition" .. i .. tostring(path) .. "_value"] = { + type = "input", + width = WeakAuras.doubleWidth, + name = blueIfNoValue(data, conditions[i].check, "value", L["Custom Check"], L["Custom Check"]), + desc = descIfNoValue(data, conditions[i].check, "value", currentConditionTemplate.type) or "", + order = order, + get = function() + return check and check.value; + end, + set = setValue, + multiline = true, + control = "WeakAurasMultiLineEditBox", + arg = { + extraFunctions = { + { + buttonLabel = L["Expand"], + func = function() + if (data.controlledChildren) then + -- Collect multi paths + local multipath = {}; + for id, reference in pairs(conditions[i].check.references) do + local conditionIndex = conditions[i].check.references[id].conditionIndex; + multipath[id] ={ "conditions", i, "check" } + for i, v in ipairs(path) do + tinsert(multipath[id], "checks") + tinsert(multipath[id], v) + end + tinsert(multipath[id], "value") + end + WeakAuras.OpenTextEditor(data, multipath, nil, true, nil, nil, "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#chat-message---custom-code-1"); + else + for i, v in ipairs(path) do + print(i, v) + end + + local fullPath = { "conditions", i, "check" } + for i, v in ipairs(path) do + tinsert(fullPath, "checks") + tinsert(fullPath, v) + end + tinsert(fullPath, "value") + + WeakAuras.OpenTextEditor(data, fullPath, nil, nil, nil, nil, "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#chat-message---custom-code-1"); + end + end + } + } + } + } + order = order + 1 + + args["condition" .. i .. tostring(path) .. "_value_error"] = { + type = "description", + name = function() + if (not check.value) then + return "" + end + local _, errorString = loadstring("return " .. check.value); + return errorString and "|cFFFF0000"..errorString or ""; + end, + width = WeakAuras.doubleWidth, + order = order, + hidden = function() + if (not check.value) then + return true; + end + + local loadedFunction, errorString = loadstring("return " .. check.value); + if(errorString and not loadedFunction) then + return false; + else + return true; + end + end + } + order = order + 1 elseif (currentConditionTemplate.type == "combination") then -- Do nothing else @@ -2109,7 +2205,7 @@ local function compareSubChecks(a, b, allConditionTemplates) end local type = currentConditionTemplate.type; - if (type == "number" or type == "timer" or type == "select" or type == "string") then + if (type == "number" or type == "timer" or type == "select" or type == "string" or type == "customcheck") then if (a[i].op ~= b[i].op or a[i].value ~= b[i].value) then return false; end @@ -2131,7 +2227,12 @@ local function findMatchingCondition(all, needle, start, allConditionTemplates) end if (condition.check.trigger == needle.check.trigger and condition.check.variable == needle.check.variable) then - if (condition.check.trigger == -2) then + if condition.check.variable == "customcheck" then + -- Be a bit more strict for custom checks, there's little benefit in merging them + if condition.check.op == needle.check.op and condition.check.value == needle.check.value then + return start + end + elseif (condition.check.trigger == -2) then if (compareSubChecks(condition.check.checks, needle.check.checks, allConditionTemplates)) then return start; end diff --git a/WeakAurasOptions/DisplayOptions.lua b/WeakAurasOptions/DisplayOptions.lua index 283a77d..d1d3ff6 100644 --- a/WeakAurasOptions/DisplayOptions.lua +++ b/WeakAurasOptions/DisplayOptions.lua @@ -1,3 +1,6 @@ +if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... + local L = WeakAuras.L local regionOptions = WeakAuras.regionOptions diff --git a/WeakAurasOptions/ExternalAddons.lua b/WeakAurasOptions/ExternalAddons.lua index b398bd3..1d18dae 100644 --- a/WeakAurasOptions/ExternalAddons.lua +++ b/WeakAurasOptions/ExternalAddons.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... -- Lua APIs local tinsert, wipe = table.insert, wipe diff --git a/WeakAurasOptions/GenericTrigger.lua b/WeakAurasOptions/GenericTrigger.lua index 4923316..dc28e00 100644 --- a/WeakAurasOptions/GenericTrigger.lua +++ b/WeakAurasOptions/GenericTrigger.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... local L = WeakAuras.L; diff --git a/WeakAurasOptions/GroupOptions.lua b/WeakAurasOptions/GroupOptions.lua index d56889e..f35dbed 100644 --- a/WeakAurasOptions/GroupOptions.lua +++ b/WeakAurasOptions/GroupOptions.lua @@ -1,3 +1,6 @@ +if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... + local L = WeakAuras.L local regionOptions = WeakAuras.regionOptions; local parsePrefix = WeakAuras.commonOptions.parsePrefix diff --git a/WeakAurasOptions/InformationOptions.lua b/WeakAurasOptions/InformationOptions.lua new file mode 100644 index 0000000..4797c94 --- /dev/null +++ b/WeakAurasOptions/InformationOptions.lua @@ -0,0 +1,147 @@ +if not WeakAuras.IsCorrectVersion() then return end + +local L = WeakAuras.L + +function WeakAuras.GetInformationOptions(data) + local isGroup = data.controlledChildren + local isTmpGroup = type(data.id) == "table" + + local options = { + type = "group", + name = L["Information"], + order = 1, + args = { + + } + } + + local order = 1 + local args = options.args + + -- NAME + -- One Aura or Group: Allows editing of aura/group name + -- Multi-selection: Don't allow any editing + if not isTmpGroup then + args.name = { + type = "input", + name = L["Name:"], + width = WeakAuras.doubleWidth, + order = order, + get = function() + return data.id + end, + set = function(info, newid) + if data.id ~= newid and not WeakAuras.GetData(newid) then + local oldid = data.id + WeakAuras.Rename(data, newid); + WeakAuras.HandleRename(data, oldid, newid) + end + end + } + order = order + 1 + end + + -- URL + -- One Aura: Edit URL of the aura + -- Group/Multi-selection: Edit URLs of both parent and children + local sameURL = true + local commonURL + local desc = "" + if not isTmpGroup then + commonURL = data.url + if data.url then + desc = "|cFFE0E000"..data.id..": |r".. data.url .. "\n" + end + end + if data.controlledChildren then + for _, childId in ipairs(data.controlledChildren) do + local childData = WeakAuras.GetData(childId) + if childData.url then + desc = desc .. "|cFFE0E000"..childData.id..": |r"..childData.url .. "\n" + end + if not commonURL then + commonURL = childData.url or "" + elseif childData.url ~= commonURL then + sameURL = false + end + end + end + + args.url = { + type = "input", + name = sameURL and L["URL"] or "|cFF4080FF" .. L["URL"], + width = WeakAuras.doubleWidth, + get = function() + if data.controlledChildren then + return sameURL and commonURL or "" + else + return data.url + end + end, + set = function(info, v) + if data.controlledChildren then + for _, childId in ipairs(data.controlledChildren) do + local childData = WeakAuras.GetData(childId) + childData.url = v + WeakAuras.Add(childData) + WeakAuras.ClearOptions(childData.id) + end + end + + if not isTmpGroup then + data.url = v + WeakAuras.Add(data) + end + WeakAuras.ClearAndUpdateOptions(data.id) + end, + desc = sameURL and "" or desc, + order = order + } + order = order + 1 + + if isGroup then + args.url_note = { + type = "description", + name = isTmpGroup and L["|cFFE0E000Note:|r This sets the URL on all selected auras"] + or L["|cFFE0E000Note:|r This sets the URL on this group and all its members."], + width = WeakAuras.doubleWidth, + order = order + } + order = order + 1 + end + + + -- Description + -- One Aura/Group: Edit description of the aura or group + -- Multi-selection: No editing + if not isTmpGroup then + args.description = { + type = "input", + name = isGroup and L["Group Description"] or L["Description"], + width = WeakAuras.doubleWidth, + multiline = true, + order = order, + get = function() + return data.desc + end, + set = function(info, v) + data.desc = v + WeakAuras.Add(data) + WeakAuras.ClearAndUpdateOptions(data.id) + end + } + order = order + 1 + + if isGroup then + args.description_note = { + type = "description", + name = string.format(L["|cFFE0E000Note:|r This sets the description only on '%s'"], data.id), + width = WeakAuras.doubleWidth, + order = order, + } + order = order + 1 + end + end + + return options +end diff --git a/WeakAurasOptions/LoadOptions.lua b/WeakAurasOptions/LoadOptions.lua index f9bdf14..0a843d3 100644 --- a/WeakAurasOptions/LoadOptions.lua +++ b/WeakAurasOptions/LoadOptions.lua @@ -1,3 +1,6 @@ +if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... + local L = WeakAuras.L local removeFuncs = WeakAuras.commonOptions.removeFuncs diff --git a/WeakAurasOptions/OptionsFrames/OptionsFrame.lua b/WeakAurasOptions/OptionsFrames/OptionsFrame.lua index 1f18ed8..b05840e 100644 --- a/WeakAurasOptions/OptionsFrames/OptionsFrame.lua +++ b/WeakAurasOptions/OptionsFrames/OptionsFrame.lua @@ -807,7 +807,8 @@ function WeakAuras.CreateFrame() load = WeakAuras.GetLoadOptions, action = WeakAuras.GetActionOptions, animation = WeakAuras.GetAnimationOptions, - authorOptions = WeakAuras.GetAuthorOptions + authorOptions = WeakAuras.GetAuthorOptions, + information = WeakAuras.GetInformationOptions, } if optionsGenerator[tab] then aceOptions[id][tab] = optionsGenerator[tab](data) @@ -845,11 +846,12 @@ function WeakAuras.CreateFrame() local tabs = { { value = "region", text = L["Display"]}, { value = "trigger", text = L["Trigger"]}, - { value = "conditions", text = L["Conditions"]}, { value = "load", text = L["Load"]}, { value = "action", text = L["Actions"]}, { value = "animation", text = L["Animations"]}, - { value = "authorOptions", text = L["Custom Options"]} + { value = "conditions", text = L["Conditions"]}, + { value = "authorOptions", text = L["Custom Options"]}, + { value = "information", text = L["Information"]}, } -- Check if group and not the temp group if data.controlledChildren and type(data.id) == "string" then diff --git a/WeakAurasOptions/OptionsFrames/TexturePicker.lua b/WeakAurasOptions/OptionsFrames/TexturePicker.lua index 15c0f64..38b0089 100644 --- a/WeakAurasOptions/OptionsFrames/TexturePicker.lua +++ b/WeakAurasOptions/OptionsFrames/TexturePicker.lua @@ -161,17 +161,18 @@ local function ConstructTexturePicker(frame) end SetAll(self.data, self.field, texturePath); - if(type(self.data.id) == "string") then - WeakAuras.Add(self.data); - WeakAuras.UpdateThumbnail(self.data); + if(type(self.parentData.id) == "string") then + WeakAuras.Add(self.parentData); + WeakAuras.UpdateThumbnail(self.parentData); end group:UpdateList(); local status = dropdown.status or dropdown.localstatus dropdown.dropdown:SetText(dropdown.list[status.selected]); end - function group.Open(self, data, field, textures, SetTextureFunc) - self.data = data; + function group.Open(self, data, parentData, field, textures, SetTextureFunc) + self.data = data + self.parentData = parentData self.field = field; self.textures = textures; self.SetTextureFunc = SetTextureFunc @@ -247,8 +248,8 @@ local function ConstructTexturePicker(frame) end function group.CancelClose() - if(group.data.controlledChildren) then - for index, childId in pairs(group.data.controlledChildren) do + if(group.parentData.controlledChildren) then + for index, childId in pairs(group.parentData.controlledChildren) do local childData = WeakAuras.GetData(childId); if(childData) then childData[group.field] = group.givenPath[childId]; diff --git a/WeakAurasOptions/RegionOptions/AuraBar.lua b/WeakAurasOptions/RegionOptions/AuraBar.lua index 335f8b0..cdcf90b 100644 --- a/WeakAurasOptions/RegionOptions/AuraBar.lua +++ b/WeakAurasOptions/RegionOptions/AuraBar.lua @@ -240,7 +240,7 @@ local function createOptions(id, data) width = WeakAuras.halfWidth, order = 44.3, func = function() - WeakAuras.OpenTexturePicker(data, "sparkTexture", WeakAuras.texture_types); + WeakAuras.OpenTexturePicker(data, data, "sparkTexture", WeakAuras.texture_types); end, disabled = function() return not data.spark end, hidden = function() return not data.spark end, diff --git a/WeakAurasOptions/RegionOptions/ProgressTexture.lua b/WeakAurasOptions/RegionOptions/ProgressTexture.lua index 6e21770..3897afd 100644 --- a/WeakAurasOptions/RegionOptions/ProgressTexture.lua +++ b/WeakAurasOptions/RegionOptions/ProgressTexture.lua @@ -33,7 +33,7 @@ local function createOptions(id, data) width = WeakAuras.halfWidth, order = 12, func = function() - WeakAuras.OpenTexturePicker(data, "foregroundTexture", WeakAuras.texture_types); + WeakAuras.OpenTexturePicker(data, data, "foregroundTexture", WeakAuras.texture_types); end }, sameTexture = { @@ -48,7 +48,7 @@ local function createOptions(id, data) width = WeakAuras.halfWidth, order = 17, func = function() - WeakAuras.OpenTexturePicker(data, "backgroundTexture", WeakAuras.texture_types); + WeakAuras.OpenTexturePicker(data, data, "backgroundTexture", WeakAuras.texture_types); end, disabled = function() return data.sameTexture; end }, diff --git a/WeakAurasOptions/RegionOptions/Texture.lua b/WeakAurasOptions/RegionOptions/Texture.lua index 2f78cad..f383fd0 100644 --- a/WeakAurasOptions/RegionOptions/Texture.lua +++ b/WeakAurasOptions/RegionOptions/Texture.lua @@ -31,7 +31,7 @@ local function createOptions(id, data) width = WeakAuras.halfWidth, order = 7, func = function() - WeakAuras.OpenTexturePicker(data, "texture", WeakAuras.texture_types); + WeakAuras.OpenTexturePicker(data, data, "texture", WeakAuras.texture_types); end }, color = { diff --git a/WeakAurasOptions/SubRegionOptions/Tick.lua b/WeakAurasOptions/SubRegionOptions/Tick.lua index d10698d..a1ba46e 100644 --- a/WeakAurasOptions/SubRegionOptions/Tick.lua +++ b/WeakAurasOptions/SubRegionOptions/Tick.lua @@ -6,6 +6,9 @@ local L = WeakAuras.L; local indentWidth = WeakAuras.normalWidth * 0.06 local function createOptions(parentData, data, index, subIndex) + local hiddentickextras = function() + return WeakAuras.IsCollapsed("subtext", "subtext", "tickextras" .. index, true) + end local options = { __title = L["Tick %s"]:format(subIndex), __order = 1, @@ -57,27 +60,66 @@ local function createOptions(parentData, data, index, subIndex) validate = WeakAuras.ValidateNumeric, desc = L["Enter in a value for the tick's placement."], }, - tick_space1 = { - type = "description", + tick_thickness = { + type = "range", width = WeakAuras.normalWidth, - name = "", + name = L["Thickness"], order = 5, + min = 0, + softMax = 20, + step = 1, + }, + tick_extrasDescription = { + type = "execute", + control = "WeakAurasExpandSmall", + name = function() + local lengthtext = "" + if data.automatic_length then + lengthtext = L["|cFFFF0000Automatic|r length"] + else + lengthtext = L["Length of |cFFFF0000%s|r"]:format(data.tick_length) + end + + local texturetext = "" + if data.use_texture then + local desaturatetext = data.tick_desaturate and L["|cFFFF0000desaturated|r "] or "" + local blendtext = WeakAuras.blend_types[data.tick_blend_mode] + local rotationtext = data.tick_rotation ~= 0 and L[" rotated |cFFFF0000%s|r degrees"]:format(data.tick_rotation) or "" + local mirrortext = data.tick_mirror and L[" and |cFFFF0000mirrored|r"] or "" + texturetext = L["%s|cFFFF0000custom|r texture with |cFFFF0000%s|r blend mode%s%s"]:format(desaturatetext, blendtext, rotationtext, mirrortext) + else + texturetext = L["|cFFFF0000default|r texture"] + end + + local offsettext = "" + if data.tick_xOffset ~=0 or data.tick_yOffset ~=0 then + offsettext = L["Offset by |cFFFF0000%s|r/|cFFFF0000%s|r"]:format(data.tick_xOffset, data.tick_yOffset) + end + + local description = L["|cFFffcc00Extra:|r %s and %s %s"]:format(lengthtext, texturetext, offsettext) + + return description + end, + width = WeakAuras.doubleWidth, + order = 6, + func = function(info, button) + local collapsed = WeakAuras.IsCollapsed("subtext", "subtext", "tickextras" .. index, true) + WeakAuras.SetCollapsed("subtext", "subtext", "tickextras" .. index, not collapsed) + end, + image = function() + local collapsed = WeakAuras.IsCollapsed("subtext", "subtext", "tickextras" .. index, true) + return collapsed and "Interface\\AddOns\\WeakAuras\\Media\\Textures\\edit" or "Interface\\AddOns\\WeakAuras\\Media\\Textures\\editdown" + end, + imageWidth = 24, + imageHeight = 24 }, automatic_length = { type = "toggle", width = WeakAuras.normalWidth, name = L["Automatic length"], - order = 6, - desc = L["Matches the height setting of a horizontal bar or width for a vertical bar."], - }, - tick_thickness = { - type = "range", - width = WeakAuras.normalWidth, - name = L["Thickness"], order = 7, - min = 0, - softMax = 20, - step = 1, + desc = L["Matches the height setting of a horizontal bar or width for a vertical bar."], + hidden = hiddentickextras, }, tick_length = { type = "range", @@ -88,6 +130,84 @@ local function createOptions(parentData, data, index, subIndex) softMax = 50, step = 1, disabled = function() return data.automatic_length end, + hidden = hiddentickextras, + }, + use_texture = { + type = "toggle", + width = WeakAuras.normalWidth, + name = L["Use Texture"], + order = 9, + hidden = hiddentickextras, + }, + tick_blend_mode = { + type = "select", + width = WeakAuras.normalWidth, + name = L["Blend Mode"], + order = 10, + values = WeakAuras.blend_types, + disabled = function() return not data.use_texture end, + hidden = hiddentickextras, + }, + tick_texture = { + type = "input", + name = L["Texture"], + order = 11, + width = WeakAuras.doubleWidth, + disabled = function() return not data.use_texture end, + hidden = hiddentickextras, + }, + tick_desaturate = { + type = "toggle", + width = WeakAuras.normalWidth, + name = L["Desaturate"], + order = 12, + hidden = hiddentickextras, + }, + texture_chooser = { + type = "execute", + name = L["Choose"], + width = WeakAuras.normalWidth, + order = 13, + func = function() + WeakAuras.OpenTexturePicker(data, "tick_texture", WeakAuras.texture_types); + end, + disabled = function() return not data.use_texture end, + hidden = hiddentickextras, + }, + tick_rotation = { + type = "range", + width = WeakAuras.normalWidth, + name = L["Rotation"], + min = 0, + max = 360, + order = 14, + hidden = hiddentickextras, + }, + tick_mirror = { + type = "toggle", + width = WeakAuras.normalWidth, + name = L["Mirror"], + order = 15, + disabled = function() return not data.use_texture end, + hidden = hiddentickextras, + }, + tick_xOffset = { + type = "range", + width = WeakAuras.normalWidth, + name = L["x-Offset"], + order = 16, + softMin = -200, + softMax = 200, + hidden = hiddentickextras, + }, + tick_yOffset = { + type = "range", + width = WeakAuras.normalWidth, + name = L["y-Offset"], + order = 17, + softMin = -200, + softMax = 200, + hidden = hiddentickextras, }, } return options diff --git a/WeakAurasOptions/TriggerOptions.lua b/WeakAurasOptions/TriggerOptions.lua index 18716ca..93a50f3 100644 --- a/WeakAurasOptions/TriggerOptions.lua +++ b/WeakAurasOptions/TriggerOptions.lua @@ -1,3 +1,5 @@ +if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... local L = WeakAuras.L diff --git a/WeakAurasOptions/WeakAurasOptions.lua b/WeakAurasOptions/WeakAurasOptions.lua index 119e8f8..cddce91 100644 --- a/WeakAurasOptions/WeakAurasOptions.lua +++ b/WeakAurasOptions/WeakAurasOptions.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... -- Lua APIs local tinsert, tremove, wipe = table.insert, table.remove, wipe @@ -1214,7 +1215,7 @@ function WeakAuras.DropIndicator() indicator:SetHeight(4) indicator:SetFrameStrata("FULLSCREEN") - local texture = indicator:CreateTexture(nil, "FULLSCREEN") + local texture = indicator:CreateTexture(nil, "HIGHLIGHT") texture:SetBlendMode("ADD") texture:SetAllPoints(indicator) texture:SetTexture("Interface\\PaperDollInfoFrame\\UI-Character-Tab-Highlight") @@ -1253,8 +1254,8 @@ function WeakAuras.UpdateThumbnail(data) button:UpdateThumbnail() end -function WeakAuras.OpenTexturePicker(data, field, textures, stopMotion) - frame.texturePicker:Open(data, field, textures, stopMotion); +function WeakAuras.OpenTexturePicker(data, parentData, field, textures, stopMotion) + frame.texturePicker:Open(data, parentData, field, textures, stopMotion); end function WeakAuras.OpenIconPicker(data, field, groupIcon) @@ -1266,7 +1267,7 @@ function WeakAuras.OpenModelPicker(data, field, parentData) local loaded, reason = LoadAddOn("WeakAurasModelPaths"); if not(loaded) then reason = string.lower("|cffff2020" .. _G["ADDON_" .. reason] .. "|r.") - print(WeakAuras.printPrefix .. "ModelPaths could not be loaded, the addon is " .. reason); + WeakAuras.prettyPrint("ModelPaths could not be loaded, the addon is " .. reason); WeakAuras.ModelPaths = {}; end frame.modelPicker.modelTree:SetTree(WeakAuras.ModelPaths); @@ -1287,7 +1288,7 @@ function WeakAuras.OpenTriggerTemplate(data, targetId) local loaded, reason = LoadAddOn("WeakAurasTemplates"); if not(loaded) then reason = string.lower("|cffff2020" .. _G["ADDON_" .. reason] .. "|r.") - print(WeakAuras.printPrefix .. "Templates could not be loaded, the addon is " .. reason); + WeakAuras.prettyPrint("Templates could not be loaded, the addon is " .. reason); return; end frame.newView = WeakAuras.CreateTemplateView(frame); @@ -1663,3 +1664,22 @@ function WeakAuras.AddTextFormatOption(input, withHeader, get, addOption, hidden return next(seenSymbols) ~= nil end + +function WeakAuras.HandleRename(data, oldid, newid) + WeakAuras.displayButtons[newid] = WeakAuras.displayButtons[oldid]; + WeakAuras.displayButtons[newid]:SetData(data) + WeakAuras.displayButtons[oldid] = nil; + WeakAuras.ClearOptions(oldid) + + WeakAuras.displayButtons[newid]:SetTitle(newid); + + if(data.controlledChildren) then + for index, childId in pairs(data.controlledChildren) do + WeakAuras.displayButtons[childId]:SetGroup(newid) + end + end + + WeakAuras.SetGrouping() + WeakAuras.SortDisplayButtons() + WeakAuras.PickDisplay(newid) +end \ No newline at end of file diff --git a/WeakAurasOptions/WeakAurasOptions.toc b/WeakAurasOptions/WeakAurasOptions.toc index 234a415..41efb54 100644 --- a/WeakAurasOptions/WeakAurasOptions.toc +++ b/WeakAurasOptions/WeakAurasOptions.toc @@ -44,6 +44,7 @@ TriggerOptions.lua LoadOptions.lua ActionOptions.lua AnimationOptions.lua +InformationOptions.lua BuffTrigger.lua BuffTrigger2.lua