from retail
This commit is contained in:
@@ -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
|
||||
|
||||
+21
-21
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -4958,6 +4958,7 @@ Private.event_prototypes = {
|
||||
display = L["Message"],
|
||||
init = "arg",
|
||||
type = "longstring",
|
||||
canBeCaseInsensitive = true,
|
||||
store = true,
|
||||
conditionType = "string",
|
||||
},
|
||||
|
||||
@@ -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
|
||||
|
||||
+2
-2
@@ -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", {
|
||||
|
||||
+66
-31
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user