From d5c19a28e5f6b3dd075dd6257552659e978bb78f Mon Sep 17 00:00:00 2001 From: Bunny67 Date: Sun, 12 Jul 2020 02:03:03 +0300 Subject: [PATCH] from retail --- WeakAuras/BuffTrigger2.lua | 22 +++++++-------- WeakAuras/Init.lua | 2 +- WeakAuras/Prototypes.lua | 8 +++--- WeakAuras/RegionTypes/Icon.lua | 2 +- WeakAuras/WeakAuras.lua | 45 +++++++++++++++++++++++-------- WeakAuras/WeakAuras.toc | 2 +- WeakAurasOptions/BuffTrigger2.lua | 36 ++++++++++++------------- 7 files changed, 70 insertions(+), 47 deletions(-) diff --git a/WeakAuras/BuffTrigger2.lua b/WeakAuras/BuffTrigger2.lua index 2924eec..c5060fe 100644 --- a/WeakAuras/BuffTrigger2.lua +++ b/WeakAuras/BuffTrigger2.lua @@ -1852,12 +1852,12 @@ local function createScanFunc(trigger) local use_tooltip = not isSingleMissing and not isMulti and trigger.fetchTooltip and trigger.use_tooltip local use_tooltipValue = not isSingleMissing and not isMulti and trigger.fetchTooltip and trigger.use_tooltipValue local use_total = not isSingleMissing and not isMulti and trigger.useTotal and trigger.total - local use_blacklist_name = not isSingleMissing and not isMulti and trigger.useBlackName and trigger.blackauranames - local use_blacklist_spellId = not isSingleMissing and not isMulti and trigger.useBlackExactSpellId and trigger.blackauraspellids + local use_ignore_name = not isSingleMissing and not isMulti and trigger.useIgnoreName and trigger.ignoreAuraNames + local use_ignore_spellId = not isSingleMissing and not isMulti and trigger.useIgnoreExactSpellId and trigger.ignoreAuraSpellids if not useStacks and use_stealable == nil and not use_debuffClass and trigger.ownOnly == nil and not use_tooltip and not use_tooltipValue and not trigger.useNamePattern and not use_total - and not use_blacklist_name and not use_blacklist_spellId then + and not use_ignore_name and not use_ignore_spellId then return nil end @@ -1982,29 +1982,29 @@ local function createScanFunc(trigger) end end - if use_blacklist_name then + if use_ignore_name then local names = {} - for index, spellName in ipairs(trigger.blackauranames) do + for index, spellName in ipairs(trigger.ignoreAuraNames) do local spellId = WeakAuras.SafeToNumber(spellName) local name = GetSpellInfo(spellId or 0) or spellName tinsert(names, name) end - preamble = preamble .. "local blacklistNames = {\n" + preamble = preamble .. "local ignoreNames = {\n" for index, name in ipairs(names) do preamble = preamble .. string.format(" [%q] = true,\n", name) end preamble = preamble .. "}\n" ret = ret .. [[ - if blacklistNames[matchData.name] then + if ignoreNames[matchData.name] then return false end ]] end - if use_blacklist_spellId then - preamble = preamble .. "local blacklistSpellId = {\n" - for index, spellId in ipairs(trigger.blackauraspellids) do + if use_ignore_spellId then + preamble = preamble .. "local ignoreSpellId = {\n" + for index, spellId in ipairs(trigger.ignoreAuraSpellids) do local spell = WeakAuras.SafeToNumber(spellId) if spell then preamble = preamble .. string.format(" [%s] = true,\n", spell) @@ -2012,7 +2012,7 @@ local function createScanFunc(trigger) end preamble = preamble .. "}\n" ret = ret .. [[ - if blacklistSpellId[matchData.spellId] then + if ignoreSpellId[matchData.spellId] then return false end ]] diff --git a/WeakAuras/Init.lua b/WeakAuras/Init.lua index 770863a..e6ca5bf 100644 --- a/WeakAuras/Init.lua +++ b/WeakAuras/Init.lua @@ -7,7 +7,7 @@ WeakAuras.halfWidth = WeakAuras.normalWidth / 2 WeakAuras.doubleWidth = WeakAuras.normalWidth * 2 local versionStringFromToc = GetAddOnMetadata("WeakAuras", "Version") -local versionString = "2.17.11" +local versionString = "2.17.12" local buildTime = "20200511190745" WeakAuras.versionString = versionStringFromToc diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index 4b22636..6712960 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -749,11 +749,11 @@ WeakAuras.load_prototype = { desc = constants.nameRealmFilterDesc, }, { - name = "namerealmblack", - display = L["Blacklisted Player Name/Realm"], + name = "ignoreNameRealm", + display = L["|cFFFF0000Not|r Player Name/Realm"], type = "string", - test = "not nameRealmBlacklistChecker:Check(player, realm)", - preamble = "local nameRealmBlacklistChecker = WeakAuras.ParseNameCheck(%q)", + test = "not nameRealmIgnoreChecker:Check(player, realm)", + preamble = "local nameRealmIgnoreChecker = WeakAuras.ParseNameCheck(%q)", desc = constants.nameRealmFilterDesc, }, { diff --git a/WeakAuras/RegionTypes/Icon.lua b/WeakAuras/RegionTypes/Icon.lua index c090d2f..bb4d0b7 100644 --- a/WeakAuras/RegionTypes/Icon.lua +++ b/WeakAuras/RegionTypes/Icon.lua @@ -209,7 +209,7 @@ local function create(parent, data) icon:SetTexture("Interface\\Icons\\INV_Misc_QuestionMark"); --This section creates a unique frame id for the cooldown frame so that it can be created with a global reference - --The reason is so that WeakAuras cooldown frames can interact properly with OmniCC (i.e., put on its blacklist for timer overlays) + --The reason is so that WeakAuras cooldown frames can interact properly with OmniCC (i.e., put on its ignore list for timer overlays) local id = data.id; local frameId = id:lower():gsub(" ", "_"); if(_G["WeakAurasCooldown"..frameId]) then diff --git a/WeakAuras/WeakAuras.lua b/WeakAuras/WeakAuras.lua index 5d2233b..e57bac7 100644 --- a/WeakAuras/WeakAuras.lua +++ b/WeakAuras/WeakAuras.lua @@ -1,4 +1,4 @@ -local internalVersion = 32; +local internalVersion = 33; -- Lua APIs local insert = table.insert @@ -3727,28 +3727,28 @@ function WeakAuras.Modernize(data) -- Introduced in June 2020 in Bfa if data.internalVersion < 31 then - local whitelist - local blacklist + local allowedNames + local ignoredNames if data.load.use_name == true and data.load.name then - whitelist = data.load.name + allowedNames = data.load.name elseif data.load.use_name == false and data.load.name then - blacklist = data.load.name + ignoredNames = data.load.name end if data.load.use_realm == true and data.load.realm then - whitelist = (whitelist or "") .. "-" .. data.load.realm + allowedNames = (allowedNames or "") .. "-" .. data.load.realm elseif data.load.use_realm == false and data.load.realm then - blacklist = (blacklist or "") .. "-" .. data.load.realm + ignoredNames = (ignoredNames or "") .. "-" .. data.load.realm end - if whitelist then + if allowedNames then data.load.use_namerealm = true - data.load.namerealm = whitelist + data.load.namerealm = allowedNames end - if blacklist then + if ignoredNames then data.load.use_namerealmblack = true - data.load.namerealmblack = blacklist + data.load.namerealmblack = ignoredNames end data.load.use_name = nil @@ -3809,6 +3809,29 @@ function WeakAuras.Modernize(data) end end + -- Introduced in July 2020 in Bfa + if data.internalVersion < 33 then + data.load.use_ignoreNameRealm = data.load.use_namerealmblack + data.load.ignoreNameRealm = data.load.namerealmblack + data.load.use_namerealmblack = nil + data.load.namerealmblack = nil + + -- trigger.useBlackExactSpellId and trigger.blackauraspellids + if data.triggers then + for triggerId, triggerData in ipairs(data.triggers) do + triggerData.trigger.useIgnoreName = triggerData.trigger.useBlackName + triggerData.trigger.ignoreAuraNames = triggerData.trigger.blackauranames + triggerData.trigger.useIgnoreExactSpellId = triggerData.trigger.useBlackExactSpellId + triggerData.trigger.ignoreAuraSpellids = triggerData.trigger.blackauraspellids + + triggerData.trigger.useBlackName = nil + triggerData.trigger.blackauranames = nil + triggerData.trigger.useBlackExactSpellId = nil + triggerData.trigger.blackauraspellids = nil + end + end + end + for _, triggerSystem in pairs(triggerSystems) do triggerSystem.Modernize(data); end diff --git a/WeakAuras/WeakAuras.toc b/WeakAuras/WeakAuras.toc index a9ba41c..602c320 100644 --- a/WeakAuras/WeakAuras.toc +++ b/WeakAuras/WeakAuras.toc @@ -1,7 +1,7 @@ ## Interface: 30300 ## Title: WeakAuras 2 ## Author: Mirrored and the WeakAuras Team -## Version: 2.17.11 +## Version: 2.17.12 ## Notes: A powerful, comprehensive utility for displaying graphics and information based on buffs, debuffs, and other triggers. ## Notes-esES: Potente y completa aplicación que te permitirá mostrar por pantalla múltiples diseños, basados en beneficios, perjuicios y otros activadores. ## Notes-deDE: Ein leistungsfähiges, umfassendes Addon zur grafischen Darstellung von Informationen von Auren, Cooldowns, Timern und vielem mehr. diff --git a/WeakAurasOptions/BuffTrigger2.lua b/WeakAurasOptions/BuffTrigger2.lua index 04a582e..18ff90d 100644 --- a/WeakAurasOptions/BuffTrigger2.lua +++ b/WeakAurasOptions/BuffTrigger2.lua @@ -75,12 +75,12 @@ local function IsSingleMissing(trigger) return not IsGroupTrigger(trigger) and trigger.matchesShowOn == "showOnMissing" end -local function CreateNameOptions(aura_options, data, trigger, size, isExactSpellId, blacklist, prefix, baseOrder, useKey, optionKey, name, desc) +local function CreateNameOptions(aura_options, data, trigger, size, isExactSpellId, isIgnoreList, prefix, baseOrder, useKey, optionKey, name, desc) local spellCache = WeakAuras.spellCache for i = 1, size do local hiddenFunction - if blacklist then + if isIgnoreList then hiddenFunction = function() return not (trigger.type == "aura2" and trigger[useKey] and (i == 1 or trigger[optionKey] and trigger[optionKey][i - 1]) and trigger.unit ~= "multi" and not IsSingleMissing(trigger)) end @@ -341,33 +341,33 @@ local function GetBuffTriggerOptions(data, optionTriggerChoices) width = WeakAuras.normalWidth, hidden = function() return not (trigger.type == "aura2" and not trigger.useExactSpellId) end }, - useBlackName = { + useIgnoreName = { type = "toggle", - name = L["Blacklisted Name(s)"], + name = L["Ignored Name(s)"], order = 32, width = WeakAuras.normalWidth - 0.2, hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and not IsSingleMissing(trigger)) end }, - useBlackNameSpace = { + useIgnoreNameSpace = { type = "description", name = "", order = 32.1, width = WeakAuras.normalWidth, - hidden = function() return not (trigger.type == "aura2" and not trigger.useBlackName and trigger.unit ~= "multi" and not IsSingleMissing(trigger)) end + hidden = function() return not (trigger.type == "aura2" and not trigger.useIgnoreName and trigger.unit ~= "multi" and not IsSingleMissing(trigger)) end }, - useBlackExactSpellId = { + useIgnoreExactSpellId = { type = "toggle", - name = L["Blacklisted Exact Spell ID(s)"], + name = L["Ignored Exact Spell ID(s)"], width = WeakAuras.normalWidth - 0.2, order = 42, hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and not IsSingleMissing(trigger)) end }, - useBlackExactSpellIdSpace = { + useIgnoreExactSpellIddSpace = { type = "description", name = "", order = 42.1, width = WeakAuras.normalWidth, - hidden = function() return not (trigger.type == "aura2" and not trigger.useBlackExactSpellId and trigger.unit ~= "multi" and not IsSingleMissing(trigger)) end + hidden = function() return not (trigger.type == "aura2" and not trigger.useIgnoreExactSpellId and trigger.unit ~= "multi" and not IsSingleMissing(trigger)) end }, useNamePattern = { @@ -945,8 +945,8 @@ local function GetBuffTriggerOptions(data, optionTriggerChoices) -- Names local nameOptionSize = CountNames(data, optionTriggerChoices, "auranames") + 1 local spellOptionsSize = CountNames(data, optionTriggerChoices, "auraspellids") + 1 - local blackNameOptionSize = CountNames(data, optionTriggerChoices, "blackauranames") + 1 - local blackSpellOptionsSize = CountNames(data, optionTriggerChoices, "blackauraspellids") + 1 + local ignoreNameOptionSize = CountNames(data, optionTriggerChoices, "ignoreAuraNames") + 1 + local ignoreSpellOptionsSize = CountNames(data, optionTriggerChoices, "ignoreAuraSpellids") + 1 CreateNameOptions(aura_options, data, trigger, nameOptionSize, false, false, "name", 12, "useName", "auranames", @@ -958,14 +958,14 @@ local function GetBuffTriggerOptions(data, optionTriggerChoices) true, false, "spellid", 22, "useExactSpellId", "auraspellids", L["Spell ID"], L["Enter a Spell ID"]) - CreateNameOptions(aura_options, data, trigger, blackNameOptionSize, - false, true, "blackname", 32, "useBlackName", "blackauranames", - L["Blacklisted Aura Name"], + CreateNameOptions(aura_options, data, trigger, ignoreNameOptionSize, + false, true, "ignorename", 32, "useIgnoreName", "ignoreAuraNames", + L["Ignored Aura Name"], L["Enter an Aura Name, partial Aura Name, or Spell ID. A Spell ID will match any spells with the same name."]) - CreateNameOptions(aura_options, data, trigger, blackSpellOptionsSize, - true, true, "blackspellid", 42, "useBlackExactSpellId", "blackauraspellids", - L["Blacklisted Spell ID"], L["Enter a Spell ID"]) + CreateNameOptions(aura_options, data, trigger, ignoreSpellOptionsSize, + true, true, "ignorespellid", 42, "useIgnoreExactSpellId", "ignoreAuraSpellids", + L["Ignored Spell ID"], L["Enter a Spell ID"]) return aura_options