diff --git a/WeakAuras/AnchorToWeakAuras.lua b/WeakAuras/AnchorToWeakAuras.lua index ae24901..008ba91 100644 --- a/WeakAuras/AnchorToWeakAuras.lua +++ b/WeakAuras/AnchorToWeakAuras.lua @@ -39,7 +39,7 @@ local function OnRename(_, uid, oldId, newId) local data = WeakAuras.GetData(attached) if data then data.anchorFrameFrame = "WeakAuras:" .. newId - WeakAuras.Add(data, nil, true) + WeakAuras.Add(data, true) end attachedToTarget[attached] = newId diff --git a/WeakAuras/BuffTrigger2.lua b/WeakAuras/BuffTrigger2.lua index 82b5338..46b6743 100644 --- a/WeakAuras/BuffTrigger2.lua +++ b/WeakAuras/BuffTrigger2.lua @@ -2636,40 +2636,40 @@ end function BuffTrigger.GetAdditionalProperties(data, triggernum) local trigger = data.triggers[triggernum].trigger - local ret = "|cFFFF0000%".. triggernum .. ".spellId|r - " .. L["Spell ID"] .. "\n" - ret = ret .. "|cFFFF0000%".. triggernum .. ".debuffClass|r - " .. L["Debuff Class"] .. "\n" - ret = ret .. "|cFFFF0000%".. triggernum .. ".unitCaster|r - " .. L["Caster Unit"] .. "\n" - ret = ret .. "|cFFFF0000%".. triggernum .. ".casterName|r - " .. L["Caster Name"] .. "\n" + local ret = "|cFFFFCC00%".. triggernum .. ".spellId|r - " .. L["Spell ID"] .. "\n" + ret = ret .. "|cFFFFCC00%".. triggernum .. ".debuffClass|r - " .. L["Debuff Class"] .. "\n" + ret = ret .. "|cFFFFCC00%".. triggernum .. ".unitCaster|r - " .. L["Caster Unit"] .. "\n" + ret = ret .. "|cFFFFCC00%".. triggernum .. ".casterName|r - " .. L["Caster Name"] .. "\n" if trigger.unit ~= "multi" then - ret = ret .. "|cFFFF0000%".. triggernum .. ".unit|r - " .. L["Unit"] .. "\n" + ret = ret .. "|cFFFFCC00%".. triggernum .. ".unit|r - " .. L["Unit"] .. "\n" end - ret = ret .. "|cFFFF0000%".. triggernum .. ".unitName|r - " .. L["Unit Name"] .. "\n" - ret = ret .. "|cFFFF0000%".. triggernum .. ".matchCount|r - " .. L["Match Count"] .. "\n" - ret = ret .. "|cFFFF0000%".. triggernum .. ".matchCountPerUnit|r - " .. L["Match Count per Unit"] .. "\n" - ret = ret .. "|cFFFF0000%".. triggernum .. ".unitCount|r - " .. L["Units Affected"] .. "\n" - ret = ret .. "|cFFFF0000%".. triggernum .. ".totalStacks|r - " .. L["Total stacks over all matches"] .. "\n" + ret = ret .. "|cFFFFCC00%".. triggernum .. ".unitName|r - " .. L["Unit Name"] .. "\n" + ret = ret .. "|cFFFFCC00%".. triggernum .. ".matchCount|r - " .. L["Match Count"] .. "\n" + ret = ret .. "|cFFFFCC00%".. triggernum .. ".matchCountPerUnit|r - " .. L["Match Count per Unit"] .. "\n" + ret = ret .. "|cFFFFCC00%".. triggernum .. ".unitCount|r - " .. L["Units Affected"] .. "\n" + ret = ret .. "|cFFFFCC00%".. triggernum .. ".totalStacks|r - " .. L["Total stacks over all matches"] .. "\n" if trigger.unit ~= "multi" then - ret = ret .. "|cFFFF0000%".. triggernum .. ".maxUnitCount|r - " .. L["Total Units"] .. "\n" + ret = ret .. "|cFFFFCC00%".. triggernum .. ".maxUnitCount|r - " .. L["Total Units"] .. "\n" end if not IsSingleMissing(trigger) and trigger.unit ~= "multi" and trigger.fetchTooltip then - ret = ret .. "|cFFFF0000%".. triggernum .. ".tooltip|r - " .. L["Tooltip"] .. "\n" - ret = ret .. "|cFFFF0000%".. triggernum .. ".tooltip1|r - " .. L["First Value of Tooltip Text"] .. "\n" - ret = ret .. "|cFFFF0000%".. triggernum .. ".tooltip2|r - " .. L["Second Value of Tooltip Text"] .. "\n" - ret = ret .. "|cFFFF0000%".. triggernum .. ".tooltip3|r - " .. L["Third Value of Tooltip Text"] .. "\n" - ret = ret .. "|cFFFF0000%".. triggernum .. ".tooltip4|r - " .. L["Fourth Value of Tooltip Text"] .. "\n" + ret = ret .. "|cFFFFCC00%".. triggernum .. ".tooltip|r - " .. L["Tooltip"] .. "\n" + ret = ret .. "|cFFFFCC00%".. triggernum .. ".tooltip1|r - " .. L["First Value of Tooltip Text"] .. "\n" + ret = ret .. "|cFFFFCC00%".. triggernum .. ".tooltip2|r - " .. L["Second Value of Tooltip Text"] .. "\n" + ret = ret .. "|cFFFFCC00%".. triggernum .. ".tooltip3|r - " .. L["Third Value of Tooltip Text"] .. "\n" + ret = ret .. "|cFFFFCC00%".. triggernum .. ".tooltip4|r - " .. L["Fourth Value of Tooltip Text"] .. "\n" end if trigger.unit ~= "multi" and trigger.fetchRaidMark then - ret = ret .. "|cFFFF0000%".. triggernum .. ".raidMark|r - " .. L["Raid Mark"] .. "\n" + ret = ret .. "|cFFFFCC00%".. triggernum .. ".raidMark|r - " .. L["Raid Mark"] .. "\n" end if (trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party") and trigger.useAffected then - ret = ret .. "|cFFFF0000%".. triggernum .. ".affected|r - " .. L["Names of affected Players"] .. "\n" - ret = ret .. "|cFFFF0000%".. triggernum .. ".unaffected|r - " .. L["Names of unaffected Players"] .. "\n" - ret = ret .. "|cFFFF0000%".. triggernum .. ".affectedUnits|r - " .. L["Units of affected Players in a table format"] .. "\n" - ret = ret .. "|cFFFF0000%".. triggernum .. ".unaffectedUnits|r - " .. L["Units of unaffected Players in a table format"] .. "\n" + ret = ret .. "|cFFFFCC00%".. triggernum .. ".affected|r - " .. L["Names of affected Players"] .. "\n" + ret = ret .. "|cFFFFCC00%".. triggernum .. ".unaffected|r - " .. L["Names of unaffected Players"] .. "\n" + ret = ret .. "|cFFFFCC00%".. triggernum .. ".affectedUnits|r - " .. L["Units of affected Players in a table format"] .. "\n" + ret = ret .. "|cFFFFCC00%".. triggernum .. ".unaffectedUnits|r - " .. L["Units of unaffected Players in a table format"] .. "\n" end return ret diff --git a/WeakAuras/GenericTrigger.lua b/WeakAuras/GenericTrigger.lua index 22ab767..96b2f48 100644 --- a/WeakAuras/GenericTrigger.lua +++ b/WeakAuras/GenericTrigger.lua @@ -177,12 +177,25 @@ function TestForLongString(trigger, arg) local name = arg.name; local test; local needle = trigger[name] + local caseInsensitive = arg.canBeCaseInsensitive and trigger[name .. "_caseInsensitive"] if(trigger[name.."_operator"] == "==") then - test = ("(%s == %s)"):format(name, Private.QuotedString(needle)) + if caseInsensitive then + test = ("(%s and (%s):lower() == (%s):lower())"):format(name, name, Private.QuotedString(needle)) + else + test = ("(%s == %s)"):format(name, Private.QuotedString(needle)) + end elseif(trigger[name.."_operator"] == "find('%s')") then - test = "(" .. name .. " and " .. name .. string.format(":find(%s, 1, true)", Private.QuotedString(needle)) .. ")" + if caseInsensitive then + test = ("(%s and %s:lower():find((%s):lower(), 1, true))"):format(name, name, Private.QuotedString(needle)) + else + test = ("(%s and %s:find(%s, 1, true))"):format(name, name, Private.QuotedString(needle)) + end elseif(trigger[name.."_operator"] == "match('%s')") then - test = "(" .. name .. " and " .. name .. string.format(":match(%s)", Private.QuotedString(needle)) .. ")" + if caseInsensitive then + test = ("(%s and %s:lower():match((%s):lower()))"):format(name, name, Private.QuotedString(needle)) + else + test = ("(%s and %s:match(%s))"):format(name, name, Private.QuotedString(needle)) + end end return test; end @@ -3765,12 +3778,12 @@ function GenericTrigger.GetAdditionalProperties(data, triggernum) if (enable and v.store and v.name and v.display) then found = true; - additional = additional .. "|cFFFF0000%".. triggernum .. "." .. v.name .. "|r - " .. v.display .. "\n"; + additional = additional .. "|cFFFFCC00%".. triggernum .. "." .. v.name .. "|r - " .. v.display .. "\n"; end end if prototype.countEvents then found = true; - additional = additional .. "|cFFFF0000%".. triggernum .. ".count|r - " .. L["Count"] .. "\n"; + additional = additional .. "|cFFFFCC00%".. triggernum .. ".count|r - " .. L["Count"] .. "\n"; end if (found) then ret = ret .. additional; @@ -3782,7 +3795,7 @@ function GenericTrigger.GetAdditionalProperties(data, triggernum) for var, varData in pairs(variables) do if (type(varData) == "table") then if varData.display then - ret = ret .. "|cFFFF0000%".. triggernum .. "." .. var .. "|r - " .. varData.display .. "\n" + ret = ret .. "|cFFFFCC00%".. triggernum .. "." .. var .. "|r - " .. varData.display .. "\n" end end end diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index 9df6346..93383b5 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -4958,6 +4958,7 @@ Private.event_prototypes = { display = L["Message"], init = "arg", type = "longstring", + canBeCaseInsensitive = true, store = true, conditionType = "string", }, diff --git a/WeakAuras/Transmission.lua b/WeakAuras/Transmission.lua index b89e9b5..5e6f66d 100644 --- a/WeakAuras/Transmission.lua +++ b/WeakAuras/Transmission.lua @@ -146,6 +146,7 @@ local function filterFunc(_, event, msg, player, l, cs, t, flag, channelId, ...) local newMsg = ""; local remaining = msg; local done; + local anyLinkFound = false repeat local start, finish, characterName, displayName = remaining:find("%[WeakAuras: ([^%s]+) %- (.*)%]"); if(characterName and displayName) then @@ -154,11 +155,13 @@ local function filterFunc(_, event, msg, player, l, cs, t, flag, channelId, ...) newMsg = newMsg..remaining:sub(1, start-1); newMsg = newMsg.."|HBNplayer::weakauras|h|cFF8800FF["..characterName.." |r|cFF8800FF- "..displayName.."]|h|r"; remaining = remaining:sub(finish + 1); + anyLinkFound = true else + newMsg = newMsg .. remaining done = true; end until(done) - if newMsg ~= "" then + if anyLinkFound then if event == "CHAT_MSG_WHISPER" and not UnitInRaid(player) and not UnitInParty(player) then -- XXX: Need a guild check local _, num = BNGetNumFriends() for i=1, num do diff --git a/WeakAuras/Types.lua b/WeakAuras/Types.lua index ba911b5..30d44db 100644 --- a/WeakAuras/Types.lua +++ b/WeakAuras/Types.lua @@ -342,7 +342,7 @@ Private.format_types = { end }, Unit = { - display = L["Formats |cFFFF0000%unit|r"], + display = L["Formats |cFFFFCC00%unit|r"], AddOptions = function(symbol, hidden, addOption, get, withoutColor) if not withoutColor then addOption(symbol .. "_color", { @@ -470,7 +470,7 @@ Private.format_types = { end }, guid = { - display = L["Formats Player's |cFFFF0000%guid|r"], + display = L["Formats Player's |cFFFFCC00%guid|r"], AddOptions = function(symbol, hidden, addOption, get, withoutColor) if not withoutColor then addOption(symbol .. "_color", { diff --git a/WeakAuras/WeakAuras.lua b/WeakAuras/WeakAuras.lua index ffb6d92..57d19b4 100644 --- a/WeakAuras/WeakAuras.lua +++ b/WeakAuras/WeakAuras.lua @@ -1112,6 +1112,7 @@ function Private.Login(initialTime, takeNewSnapshots) for _, region in pairs(Private.regions) do if (region.region and region.region.RunDelayedActions) then region.region:RunDelayedActions(); + coroutine.yield() end end end) @@ -2205,34 +2206,58 @@ function Private.AddMany(tbl, takeSnapshots) local order = loadOrder(tbl, idtable) coroutine.yield() - local groups = {} - for _, data in ipairs(order) do - WeakAuras.PreAdd(data) - if data.regionType == "dynamicgroup" or data.regionType == "group" then - groups[data] = true + + if takeSnapshots then + for _, data in ipairs(order) do + Private.SetMigrationSnapshot(data.uid, data) + coroutine.yield() + end + end + + local groups = {} + local bads = {} + for _, data in ipairs(order) do + if data.parent and bads[data.parent] then + bads[data.id] = true + else + local ok = pcall(WeakAuras.PreAdd, data) + if not ok then + geterrorhandler() + prettyPrint(L["Unable to modernize aura '%s'. This is probably due to corrupt data or a bad migration, please report this to the WeakAuras team."]:format(data.id)) + if data.regionType == "dynamicgroup" or data.regionType == "group" then + prettyPrint(L["All children of this aura will also not be loaded, to minimize the chance of further corruption."]) + end + bads[data.id] = true + elseif data.regionType == "dynamicgroup" or data.regionType == "group" then + groups[data] = true + end + coroutine.yield() end - coroutine.yield() end for _, data in ipairs(order) do - WeakAuras.Add(data, takeSnapshots); - coroutine.yield() + if not bads[data.id] then + WeakAuras.Add(data) + coroutine.yield() + end end for id in pairs(anchorTargets) do local data = idtable[id] - if data and (data.parent == nil or idtable[data.parent].regionType ~= "dynamicgroup") then + if data and not bads[data.id] and (data.parent == nil or idtable[data.parent].regionType ~= "dynamicgroup") then Private.EnsureRegion(id) end end for data in pairs(groups) do - if data.type == "dynamicgroup" then - if Private.regions[data.id] and Private.regions[data.id].region then - Private.regions[data.id].region:ReloadControlledChildren() + if not bads[data.id] then + if data.type == "dynamicgroup" then + if Private.regions[data.id] and Private.regions[data.id].region then + Private.regions[data.id].region:ReloadControlledChildren() + end + else + WeakAuras.Add(data) end - else - WeakAuras.Add(data) end coroutine.yield(); end @@ -2762,13 +2787,9 @@ local function pAdd(data, simpleChange) end end -function WeakAuras.Add(data, takeSnapshot, simpleChange) - local snapshot - if takeSnapshot or (data.internalVersion or 0) < internalVersion then - snapshot = CopyTable(data) - end - if takeSnapshot then - Private.SetMigrationSnapshot(data.uid, snapshot) +function WeakAuras.Add(data, simpleChange) + if (data.internalVersion or 0) < internalVersion then + Private.SetMigrationSnapshot(data.uid, data) end local ok, ret = pcall(WeakAuras.PreAdd, data) if not ok then @@ -3639,21 +3660,35 @@ local function SetFrameLevel(id, frameLevel) Private.frameLevels[id] = frameLevel; end -function Private.FixGroupChildrenOrderForGroup(data) - SetFrameLevel(data.id, 0) - local frameLevel, offset - if data.regionType == "dynamicgroup" then - frameLevel, offset = 5, 0 +local function FixGroupChildrenOrderImpl(data, frameLevel) + SetFrameLevel(data.id, frameLevel) + local offset + if data.sharedFrameLevel then + offset = 0 else - frameLevel, offset = 2, 4 + offset = 4 end for _, childId in ipairs(data.controlledChildren) do - local data = WeakAuras.GetData(childId) - if data.regionType ~= "group" and data.regionType ~= "dynamicgroup" then - SetFrameLevel(childId, frameLevel); - frameLevel = frameLevel + offset; + local childData = WeakAuras.GetData(childId) + if childData.regionType ~= "group" and childData.regionType ~= "dynamicgroup" then + frameLevel = frameLevel + offset + SetFrameLevel(childId, frameLevel) + else + frameLevel = frameLevel + offset + local endFrameLevel = FixGroupChildrenOrderImpl(childData, frameLevel) + if not data.sharedFrameLevel then + frameLevel = endFrameLevel + end end end + return frameLevel +end + +function Private.FixGroupChildrenOrderForGroup(data) + if data.parent then + return + end + FixGroupChildrenOrderImpl(data, 0) end local function GetFrameLevelFor(id) diff --git a/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasDisplayButton.lua b/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasDisplayButton.lua index 894ff34..cae4661 100644 --- a/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasDisplayButton.lua +++ b/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasDisplayButton.lua @@ -468,7 +468,11 @@ local methods = { fullName = name end end - editbox:Insert("[WeakAuras: "..fullName.." - "..self.data.id.."]"); + local url = "" + if self.data.url then + url = " ".. self.data.url + end + editbox:Insert("[WeakAuras: "..fullName.." - "..self.data.id.."]"..url) OptionsPrivate.Private.linked = OptionsPrivate.Private.linked or {} OptionsPrivate.Private.linked[self.data.id] = GetTime() elseif not self.data.controlledChildren then diff --git a/WeakAurasOptions/OptionsFrames/MoverSizer.lua b/WeakAurasOptions/OptionsFrames/MoverSizer.lua index 3219a1c..26efe73 100644 --- a/WeakAurasOptions/OptionsFrames/MoverSizer.lua +++ b/WeakAurasOptions/OptionsFrames/MoverSizer.lua @@ -40,7 +40,7 @@ local function moveOnePxl(direction) elseif direction == "right" then data.xOffset = data.xOffset + 1 end - WeakAuras.Add(data, nil, true) + WeakAuras.Add(data, true) WeakAuras.UpdateThumbnail(data) OptionsPrivate.ResetMoverSizer() OptionsPrivate.Private.AddParents(data) @@ -706,7 +706,7 @@ local function ConstructMoverSizer(parent) end end region:ResetPosition() - WeakAuras.Add(data, nil, true) + WeakAuras.Add(data, true) frame:ScaleCorners(region:GetWidth(), region:GetHeight()) WeakAuras.FillOptions() end) @@ -753,7 +753,7 @@ local function ConstructMoverSizer(parent) data.height = height region:ResetPosition() - WeakAuras.Add(data, nil, true) + WeakAuras.Add(data, true) OptionsPrivate.Private.AddParents(data) WeakAuras.UpdateThumbnail(data) diff --git a/WeakAurasOptions/RegionOptions/DynamicGroup.lua b/WeakAurasOptions/RegionOptions/DynamicGroup.lua index 63dd083..0cc8850 100644 --- a/WeakAurasOptions/RegionOptions/DynamicGroup.lua +++ b/WeakAurasOptions/RegionOptions/DynamicGroup.lua @@ -556,6 +556,20 @@ local function createOptions(id, data) bigStep = 0.01, isPercent = true }, + sharedFrameLevel = { + type = "toggle", + width = WeakAuras.normalWidth, + name = L["Flat Framelevels"], + desc = L["The group and all direct children will share the same base frame level."], + order = 30, + set = function(info, v) + data.sharedFrameLevel = v + WeakAuras.Add(data) + for parent in OptionsPrivate.Private.TraverseParents(data) do + WeakAuras.Add(parent) + end + end + }, endHeader = { type = "header", order = 100, diff --git a/WeakAurasOptions/RegionOptions/Group.lua b/WeakAurasOptions/RegionOptions/Group.lua index d581c51..aefe3a5 100644 --- a/WeakAurasOptions/RegionOptions/Group.lua +++ b/WeakAurasOptions/RegionOptions/Group.lua @@ -596,6 +596,20 @@ local function createOptions(id, data) bigStep = 0.01, isPercent = true }, + sharedFrameLevel = { + type = "toggle", + width = WeakAuras.normalWidth, + name = L["Flat Framelevels"], + desc = L["The group and all direct children will share the same base frame level."], + order = 47, + set = function(info, v) + data.sharedFrameLevel = v + WeakAuras.Add(data) + for parent in OptionsPrivate.Private.TraverseParents(data) do + WeakAuras.Add(parent) + end + end + }, endHeader = { type = "header", order = 100,