from retail

This commit is contained in:
Bunny67
2022-05-19 22:04:17 +03:00
parent 9465daedd8
commit e7e789686a
86 changed files with 9118 additions and 5486 deletions
+253 -134
View File
@@ -76,7 +76,7 @@ local function CanHaveMatchCheck(trigger)
return trigger.showClones
end
local function CreateNameOptions(aura_options, data, trigger, size, isExactSpellId, isIgnoreList, prefix, baseOrder, useKey, optionKey, name, desc)
local function CreateNameOptions(aura_options, data, trigger, size, isExactSpellId, isIgnoreList, prefix, baseOrder, useKey, optionKey, name, desc, inverse)
local spellCache = WeakAuras.spellCache
for i = 1, size do
@@ -94,7 +94,7 @@ local function CreateNameOptions(aura_options, data, trigger, size, isExactSpell
if i ~= 1 then
aura_options[prefix .. "space" .. i] = {
type = "execute",
name = L["or"],
name = inverse and L["and"] or L["or"],
width = WeakAuras.normalWidth - 0.2,
image = function() return "", 0, 0 end,
order = baseOrder + i / 100 + 0.0001,
@@ -107,13 +107,13 @@ local function CreateNameOptions(aura_options, data, trigger, size, isExactSpell
type = "execute",
width = 0.2,
order = baseOrder + i / 100 + 0.0002,
hidden = hiddenFunction
hidden = hiddenFunction,
control = "WeakAurasIcon"
}
if isExactSpellId then
aura_options[iconOption].name = ""
aura_options[iconOption].desc = function()
local name = GetSpellInfo(trigger[optionKey] and trigger[optionKey][i] or 0)
aura_options[iconOption].name = function()
local name = GetSpellInfo(WeakAuras.SafeToNumber(trigger[optionKey] and trigger[optionKey][i] or 0))
return name
end
aura_options[iconOption].image = function()
@@ -191,7 +191,6 @@ local function CreateNameOptions(aura_options, data, trigger, size, isExactSpell
WeakAuras.Add(data)
WeakAuras.UpdateThumbnail(data)
WeakAuras.UpdateDisplayButton(data)
WeakAuras.ClearAndUpdateOptions(data.id)
end,
validate = isExactSpellId and WeakAuras.ValidateNumeric or nil
@@ -211,6 +210,14 @@ local function GetBuffTriggerOptions(data, triggernum)
end
end
local function HasMatchPerUnitCount(trigger)
if trigger.type == "aura2" and IsGroupTrigger(trigger)
and trigger.showClones and trigger.combinePerUnit and trigger.perUnitMode ~= "unaffected"
then
return trigger.useMatchPerUnit_count
end
end
local ValidateNumeric = WeakAuras.ValidateNumeric
local aura_options = {
useUnit = {
@@ -230,7 +237,8 @@ local function GetBuffTriggerOptions(data, triggernum)
values = function()
return OptionsPrivate.Private.unit_types_bufftrigger_2
end,
hidden = function() return not trigger.type == "aura2" end
hidden = function() return not trigger.type == "aura2" end,
desc = L["• |cff00ff00Player|r, |cff00ff00Target|r, |cff00ff00Focus|r, and |cff00ff00Pet|r correspond directly to those individual unitIDs.\n• |cff00ff00Specific Unit|r lets you provide a specific valid unitID to watch.\n|cffff0000Note|r: The game will not fire events for all valid unitIDs, making some untrackable by this trigger.\n• |cffffff00Party|r, |cffffff00Raid|r, |cffffff00Boss|r, |cffffff00Arena|r, and |cffffff00Nameplate|r can match multiple corresponding unitIDs.\n• |cffffff00Smart Group|r adjusts to your current group type, matching just the \"player\" when solo, \"party\" units (including \"player\") in a party or \"raid\" units in a raid.\n• |cffffff00Multi-target|r attempts to use the Combat Log events, rather than unitID, to track affected units.\n|cffff0000Note|r: Without a direct relationship to actual unitIDs, results may vary.\n\n|cffffff00*|r Yellow Unit settings can match multiple units and will default to being active even while no affected units are found without a Unit Count or Match Count setting."],
},
useSpecificUnit = {
type = "toggle",
@@ -275,11 +283,17 @@ local function GetBuffTriggerOptions(data, triggernum)
values = OptionsPrivate.Private.debuff_types,
hidden = function() return not trigger.type == "aura2" end
},
spell_filters_header = {
type = "header",
name = L["Spell Selection Filters"],
order = 11.15,
},
use_debuffClass = {
type = "toggle",
width = WeakAuras.normalWidth,
name = L["Debuff Type"],
order = 11.2,
desc = L["Filter to only dispellable de/buffs of the given type(s)"],
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and CanHaveMatchCheck(trigger)) end
},
debuffClass = {
@@ -366,6 +380,7 @@ local function GetBuffTriggerOptions(data, triggernum)
type = "toggle",
width = WeakAuras.normalWidth,
name = L["Name Pattern Match"],
desc = L["Filter based on the spell Name string."],
order = 55,
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi") end
},
@@ -391,6 +406,11 @@ local function GetBuffTriggerOptions(data, triggernum)
order = 55.2,
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and trigger.useNamePattern) end
},
aura_filters_header = {
type = "header",
name = L["Active Aura Filters and Info"],
order = 59.9,
},
useStacks = {
type = "toggle",
width = WeakAuras.normalWidth,
@@ -490,90 +510,13 @@ local function GetBuffTriggerOptions(data, triggernum)
order = 61.7,
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and CanHaveMatchCheck(trigger) and not trigger.useTotal) end
},
fetchTooltip = {
type = "toggle",
name = L["Use Tooltip Information"],
desc = L["This adds %tooltip, %tooltip1, %tooltip2, %tooltip3 as text replacements."],
order = 62,
width = WeakAuras.doubleWidth,
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and not IsSingleMissing(trigger)) end
},
use_tooltip = {
type = "toggle",
width = WeakAuras.normalWidth,
name = L["Tooltip Pattern Match"],
order = 62.1,
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and CanHaveMatchCheck(trigger) and trigger.fetchTooltip) end
},
use_tooltipSpace = {
type = "description",
name = "",
order = 62.2,
width = WeakAuras.normalWidth,
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and CanHaveMatchCheck(trigger) and not trigger.use_tooltip and trigger.fetchTooltip) end
},
tooltip_operator = {
type = "select",
width = WeakAuras.normalWidth,
name = L["Operator"],
order = 62.3,
disabled = function() return not trigger.use_tooltip end,
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and CanHaveMatchCheck(trigger) and trigger.use_tooltip and trigger.fetchTooltip) end,
values = OptionsPrivate.Private.string_operator_types
},
tooltip = {
type = "input",
name = L["Tooltip Content"],
width = WeakAuras.doubleWidth,
order = 62.4,
disabled = function() return not trigger.use_tooltip end,
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and CanHaveMatchCheck(trigger) and trigger.use_tooltip and trigger.fetchTooltip) end
},
use_tooltipValue = {
type = "toggle",
width = WeakAuras.normalWidth,
name = L["Tooltip Value"],
order = 63.1,
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and CanHaveMatchCheck(trigger) and trigger.fetchTooltip) end
},
tooltipValueNumber = {
type = "select",
width = WeakAuras.normalWidth,
name = L["Tooltip Value #"],
order = 63.2,
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and CanHaveMatchCheck(trigger) and trigger.use_tooltipValue and trigger.fetchTooltip) end,
values = OptionsPrivate.Private.tooltip_count
},
use_tooltipValueSpace = {
type = "description",
name = "",
order = 63.2,
width = WeakAuras.normalWidth,
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and CanHaveMatchCheck(trigger) and not trigger.use_tooltipValue and trigger.fetchTooltip) end
},
tooltipValue_operator = {
type = "select",
width = WeakAuras.normalWidth,
name = L["Operator"],
order = 63.3,
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and CanHaveMatchCheck(trigger) and trigger.use_tooltipValue and trigger.fetchTooltip) end,
values = OptionsPrivate.Private.operator_types
},
tooltipValue = {
type = "input",
name = L["Tooltip"],
width = WeakAuras.normalWidth,
validate = ValidateNumeric,
order = 63.4,
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and CanHaveMatchCheck(trigger) and trigger.use_tooltipValue and trigger.fetchTooltip) end
},
use_stealable = {
type = "toggle",
name = function(input)
local value = trigger.use_stealable
if value == nil then return L["Is Stealable"]
elseif value == false then return "|cFFFF0000 "..L["Negator"].." "..L["Is Stealable"]
else return "|cFF00FF00"..L["Is Stealable"] end
elseif value == false then return "|cFFFF0000 " .. L["Negator"] .. " " .. L["Is Stealable"] .. "|r"
else return "|cFF00FF00" .. L["Is Stealable"] .. "|r" end
end,
width = WeakAuras.doubleWidth,
order = 64,
@@ -595,21 +538,14 @@ local function GetBuffTriggerOptions(data, triggernum)
WeakAuras.Add(data)
end
},
useAffected = {
type = "toggle",
name = L["Fetch Affected/Unaffected Names"],
width = WeakAuras.doubleWidth,
order = 65,
hidden = function() return not (trigger.type == "aura2" and (trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party")) end
},
ownOnly = {
type = "toggle",
width = WeakAuras.doubleWidth,
name = function()
local value = trigger.ownOnly
if value == nil then return L["Own Only"]
elseif value == false then return "|cFFFF0000 "..L["Negator"].." "..L["Own Only"]
else return "|cFF00FF00"..L["Own Only"] end
elseif value == false then return "|cFFFF0000 " .. L["Negator"] .. " " .. L["Own Only"] .. "|r"
else return "|cFF00FF00" .. L["Own Only"] .. "|r" end
end,
desc = function()
local value = trigger.ownOnly
@@ -633,16 +569,137 @@ local function GetBuffTriggerOptions(data, triggernum)
end
WeakAuras.Add(data)
end,
order = 66,
order = 64.3,
hidden = function() return not trigger.type == "aura2" end
},
ignoreSelf = {
fetchTooltip = {
type = "toggle",
name = L["Ignore Self"],
order = 67.3,
name = L["Fetch Tooltip Information"],
desc = L["This adds %tooltip, %tooltip1, %tooltip2, %tooltip3 as text replacements and also allows filtering based on the tooltip content/values."],
order = 64.5,
width = WeakAuras.doubleWidth,
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and not IsSingleMissing(trigger)) end
},
use_tooltip = {
type = "toggle",
width = WeakAuras.normalWidth,
name = L["Tooltip Pattern Match"],
order = 64.51,
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and CanHaveMatchCheck(trigger) and trigger.fetchTooltip) end
},
use_tooltipSpace = {
type = "description",
name = "",
order = 64.52,
width = WeakAuras.normalWidth,
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and CanHaveMatchCheck(trigger) and not trigger.use_tooltip and trigger.fetchTooltip) end
},
tooltip_operator = {
type = "select",
width = WeakAuras.normalWidth,
name = L["Operator"],
order = 64.53,
disabled = function() return not trigger.use_tooltip end,
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and CanHaveMatchCheck(trigger) and trigger.use_tooltip and trigger.fetchTooltip) end,
values = OptionsPrivate.Private.string_operator_types
},
tooltip = {
type = "input",
name = L["Tooltip Content"],
width = WeakAuras.doubleWidth,
order = 64.54,
disabled = function() return not trigger.use_tooltip end,
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and CanHaveMatchCheck(trigger) and trigger.use_tooltip and trigger.fetchTooltip) end
},
use_tooltipValue = {
type = "toggle",
width = WeakAuras.normalWidth,
name = L["Tooltip Value"],
order = 64.55,
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and CanHaveMatchCheck(trigger) and trigger.fetchTooltip) end
},
tooltipValueNumber = {
type = "select",
width = WeakAuras.normalWidth,
name = L["Tooltip Value #"],
order = 64.56,
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and CanHaveMatchCheck(trigger) and trigger.use_tooltipValue and trigger.fetchTooltip) end,
values = OptionsPrivate.Private.tooltip_count
},
use_tooltipValueSpace = {
type = "description",
name = "",
order = 64.57,
width = WeakAuras.normalWidth,
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and CanHaveMatchCheck(trigger) and not trigger.use_tooltipValue and trigger.fetchTooltip) end
},
tooltipValue_operator = {
type = "select",
width = WeakAuras.normalWidth,
name = L["Operator"],
order = 64.58,
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and CanHaveMatchCheck(trigger) and trigger.use_tooltipValue and trigger.fetchTooltip) end,
values = OptionsPrivate.Private.operator_types
},
tooltipValue = {
type = "input",
name = L["Tooltip"],
width = WeakAuras.normalWidth,
validate = ValidateNumeric,
order = 64.59,
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and CanHaveMatchCheck(trigger) and trigger.use_tooltipValue and trigger.fetchTooltip) end
},
unit_filters_header = {
type = "header",
name = L["Affected Unit Filters and Info"],
order = 65,
hidden = function() return trigger.unit == "multi" end,
},
useAffected = {
type = "toggle",
name = L["Fetch Affected/Unaffected Names"],
width = WeakAuras.doubleWidth,
order = 65.1,
hidden = function() return not (trigger.type == "aura2" and (trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party")) end
},
fetchRaidMark = {
type = "toggle",
name = L["Fetch Raid Mark Information"],
desc = L["This adds %raidMark as text replacements."],
order = 65.3,
width = WeakAuras.doubleWidth,
hidden = function()
return not (trigger.type == "aura2" and trigger.unit ~= "multi")
end
},
use_includePets = {
type = "toggle",
width = WeakAuras.normalWidth,
name = WeakAuras.newFeatureString .. L["Include Pets"],
order = 66.1,
hidden = function() return
not (trigger.type == "aura2" and (trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party"))
end
},
includePets = {
type = "select",
values = OptionsPrivate.Private.include_pets_types,
width = WeakAuras.normalWidth,
name = WeakAuras.newFeatureString .. L["Include Pets"],
order = 66.15,
hidden = function() return not (trigger.type == "aura2" and (trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party") and trigger.use_includePets) end,
},
includePetsSpace = {
type = "description",
name = "",
order = 66.16,
width = WeakAuras.normalWidth,
hidden = function()
return not (trigger.type == "aura2"
and (trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party") and not trigger.use_includePets)
end
},
useClass = {
type = "toggle",
@@ -669,35 +726,11 @@ local function GetBuffTriggerOptions(data, triggernum)
hidden = function() return not (trigger.type == "aura2" and (trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party") and not trigger.useClass) end
},
ignoreDead = {
type = "toggle",
name = L["Ignore Dead"],
order = 68.7,
width = WeakAuras.doubleWidth,
hidden = function() return not (trigger.type == "aura2" and (trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party")) end
},
ignoreDisconnected = {
type = "toggle",
name = L["Ignore Disconnected"],
order = 68.8,
width = WeakAuras.doubleWidth,
hidden = function() return not (trigger.type == "aura2" and (trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party")) end
},
ignoreInvisible = {
type = "toggle",
name = L["Ignore out of checking range"],
desc = L["Uses UnitIsVisible() to check if in range. This is polled every second."],
order = 68.9,
width = WeakAuras.doubleWidth,
hidden = function() return not (trigger.type == "aura2" and (trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party")) end
},
useUnitName = {
type = "toggle",
width = WeakAuras.normalWidth,
name = L["UnitName Filter"],
order = 69.1,
name = L["Filter by Unit Name"],
order = 68.4,
hidden = function() return
not (trigger.type == "aura2" and (trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party"))
end
@@ -705,9 +738,9 @@ local function GetBuffTriggerOptions(data, triggernum)
unitName = {
type = "input",
width = WeakAuras.normalWidth,
name = L["Unit Name Filter"],
desc = L["Filter formats: 'Name', 'Name-Realm', '-Realm'.\n\nSupports multiple entries, separated by commas\n"],
order = 69.2,
name = L["Filter by Unit Name"],
desc = L["Filter formats: 'Name', 'Name-Realm', '-Realm'.\n\nSupports multiple entries, separated by commas\nCan use \\ to escape -."],
order = 68.5,
hidden = function()
return not (trigger.type == "aura2"
and (trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party") and trigger.useUnitName)
@@ -716,7 +749,7 @@ local function GetBuffTriggerOptions(data, triggernum)
unitNameSpace = {
type = "description",
name = "",
order = 69.3,
order = 68.5,
width = WeakAuras.normalWidth,
hidden = function()
return not (trigger.type == "aura2"
@@ -724,7 +757,50 @@ local function GetBuffTriggerOptions(data, triggernum)
end
},
ignoreSelf = {
type = "toggle",
name = L["Ignore Self"],
order = 69.35,
width = WeakAuras.doubleWidth,
hidden = function() return not (trigger.type == "aura2" and (trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party")) end
},
ignoreDead = {
type = "toggle",
name = L["Ignore Dead"],
order = 69.4,
width = WeakAuras.doubleWidth,
hidden = function() return not (trigger.type == "aura2" and (trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party")) end
},
ignoreDisconnected = {
type = "toggle",
name = L["Ignore Disconnected"],
order = 69.8,
width = WeakAuras.doubleWidth,
hidden = function() return not (trigger.type == "aura2" and (trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party")) end
},
ignoreInvisible = {
type = "toggle",
name = L["Ignore out of checking range"],
desc = L["Uses UnitIsVisible() to check if in range. This is polled every second."],
order = 69.9,
width = WeakAuras.doubleWidth,
hidden = function() return not (trigger.type == "aura2" and (trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party")) end
},
show_settings_header = {
type = "header",
name = L["Show and Clone Settings"],
order = 69.91,
},
multi_unit_hint = {
type = "description",
order = 69.92,
width = WeakAuras.doubleWidth,
hidden = function() return not (trigger.type == "aura2" and IsGroupTrigger(trigger)) end,
name = L["|cff999999Triggers tracking multiple units will default to being active even while no affected units are found without a Unit Count or Match Count setting applied.|r"],
},
useGroup_count = {
type = "toggle",
width = WeakAuras.normalWidth,
@@ -833,6 +909,45 @@ local function GetBuffTriggerOptions(data, triggernum)
validate = ValidateNumeric,
desc = L["Counts the number of matches over all units."]
},
useMatchPerUnit_count = {
type = "toggle",
width = WeakAuras.normalWidth,
name = L["Match Count per Unit"],
hidden = function() return not (trigger.type == "aura2" and IsGroupTrigger(trigger)
and trigger.showClones and trigger.combinePerUnit and trigger.perUnitMode ~= "unaffected") end,
order = 71.6
},
useMatchPerUnit_countSpace = {
type = "description",
name = "",
order = 71.7,
width = WeakAuras.normalWidth,
hidden = function()
if trigger.type == "aura2" and IsGroupTrigger(trigger)
and trigger.showClones and trigger.combinePerUnit and trigger.perUnitMode ~= "unaffected" then
return trigger.useMatchPerUnit_count
end
return true
end
},
matchPerUnit_countOperator = {
type = "select",
name = L["Operator"],
order = 71.8,
width = WeakAuras.halfWidth,
values = OptionsPrivate.Private.operator_types,
hidden = function() return not (HasMatchPerUnitCount(trigger)) end,
desc = L["Counts the number of matches per unit."]
},
matchPerUnit_count = {
type = "input",
name = L["Count"],
order = 71.9,
width = WeakAuras.halfWidth,
hidden = function() return not (HasMatchPerUnitCount(trigger)) end,
validate = ValidateNumeric,
desc = L["Counts the number of matches per unit."]
},
showClones = {
type = "toggle",
name = L["Auto-Clone (Show All Matches)"],
@@ -943,21 +1058,25 @@ local function GetBuffTriggerOptions(data, triggernum)
CreateNameOptions(aura_options, data, trigger, nameOptionSize,
false, false, "name", 12, "useName", "auranames",
L["Aura Name"],
L["Enter an Aura Name, partial Aura Name, or Spell ID. A Spell ID will match any spells with the same name."])
L["Enter an Aura Name, partial Aura Name, or Spell ID. A Spell ID will match any spells with the same name."],
IsSingleMissing(trigger))
CreateNameOptions(aura_options, data, trigger, spellOptionsSize,
true, false, "spellid", 22, "useExactSpellId", "auraspellids",
L["Spell ID"], L["Enter a Spell ID"])
L["Spell ID"], L["Enter a Spell ID"],
IsSingleMissing(trigger))
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."])
L["Enter an Aura Name, partial Aura Name, or Spell ID. A Spell ID will match any spells with the same name."],
IsSingleMissing(trigger))
CreateNameOptions(aura_options, data, trigger, ignoreSpellOptionsSize,
true, true, "ignorespellid", 42, "useIgnoreExactSpellId", "ignoreAuraSpellids",
L["Ignored Spell ID"], L["Enter a Spell ID"])
L["Ignored Spell ID"], L["Enter a Spell ID"],
IsSingleMissing(trigger))
OptionsPrivate.commonOptions.AddCommonTriggerOptions(aura_options, data, triggernum, true)
OptionsPrivate.commonOptions.AddTriggerGetterSetter(aura_options, data, triggernum)