from retail

diffchecked
This commit is contained in:
NoM0Re
2025-02-13 18:18:03 +01:00
parent ff7efc349b
commit 4c6277c667
10 changed files with 157 additions and 113 deletions
+3 -2
View File
@@ -2018,8 +2018,9 @@ StaticPopupDialogs["WEAKAURAS_CONFIRM_REPAIR"] = {
Private.Login()
end
end,
whileDead = true,
showAlert = true,
whileDead = 1,
showAlert = 1,
timeout = 0,
preferredindex = STATICPOPUP_NUMDIALOGS
}
+4 -3
View File
@@ -17,8 +17,8 @@ local setAll = OptionsPrivate.commonOptions.CreateSetAll("animation", getAll)
local function filterAnimPresetTypes(intable, id)
local ret = {};
OptionsPrivate.Private.EnsureRegion(id)
local region = OptionsPrivate.Private.regions[id] and OptionsPrivate.Private.regions[id].region;
local regionType = OptionsPrivate.Private.regions[id] and OptionsPrivate.Private.regions[id].regionType;
local region = OptionsPrivate.Private.regions[id] and OptionsPrivate.Private.regions[id].region
local regionType = OptionsPrivate.Private.regions[id] and OptionsPrivate.Private.regions[id].regionType
local data = WeakAuras.GetData(id);
if data.controlledChildren then
@@ -84,7 +84,8 @@ function OptionsPrivate.GetAnimationOptions(data)
OptionsPrivate.Private.Animate("display", data.uid, "main", data.animation.main, region, false, nil, true);
if(OptionsPrivate.Private.clones[id]) then
for cloneId, cloneRegion in pairs(OptionsPrivate.Private.clones[id]) do
OptionsPrivate.Private.Animate("display", data.uid, "main", data.animation.main, cloneRegion, false, nil, true, cloneId);
OptionsPrivate.Private.Animate("display", data.uid, "main", data.animation.main,
cloneRegion, false, nil, true, cloneId);
end
end
end
+2 -1
View File
@@ -138,7 +138,7 @@ local function nameUserDesc(option)
return option.text
else
local text = {}
for _, optionData in pairs(option.references) do
for id, optionData in pairs(option.references) do
local childOption = optionData.options[optionData.index]
if childOption.text and childOption.text ~= nil then
tinsert(text, childOption.text)
@@ -2587,6 +2587,7 @@ local function valuesAreEqual(t1, t2)
return false
end
end
for k2, v2 in pairs(t2) do
local v1 = t1[k2]
if v1 == nil or not valuesAreEqual(v1, v2) then
+14 -9
View File
@@ -237,7 +237,6 @@ local function GetBuffTriggerOptions(data, triggernum)
name = L["Unit"],
order = 10,
disabled = true,
hidden = function() return not trigger.type == "aura2" end,
get = function() return true end
},
unit = {
@@ -248,8 +247,7 @@ local function GetBuffTriggerOptions(data, triggernum)
values = function()
return OptionsPrivate.Private.unit_types_bufftrigger_2
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."],
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",
@@ -283,7 +281,6 @@ local function GetBuffTriggerOptions(data, triggernum)
name = L["Aura Type"],
order = 11,
disabled = true,
hidden = function() return not trigger.type == "aura2" end,
get = function() return true end
},
debuffType = {
@@ -292,7 +289,6 @@ local function GetBuffTriggerOptions(data, triggernum)
name = L["Aura Type"],
order = 11.1,
values = OptionsPrivate.Private.debuff_types,
hidden = function() return not trigger.type == "aura2" end
},
spell_filters_header = {
type = "header",
@@ -304,7 +300,7 @@ local function GetBuffTriggerOptions(data, triggernum)
width = WeakAuras.normalWidth,
name = L["Debuff Type"],
order = 11.2,
desc = L["Filter to only dispellable de/buffs of the given type(s)"],
desc = L["Filter to only dispellable de/buffs of the given type(s)\nBleed classification via LibDispel"],
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and CanHaveMatchCheck(trigger)) end
},
debuffClass = {
@@ -335,7 +331,6 @@ local function GetBuffTriggerOptions(data, triggernum)
name = L["Name(s)"],
order = 12,
width = WeakAuras.normalWidth - 0.2,
hidden = function() return not trigger.type == "aura2" end
},
useNameSpace = {
type = "description",
@@ -349,7 +344,6 @@ local function GetBuffTriggerOptions(data, triggernum)
name = L["Exact Spell ID(s)"],
width = WeakAuras.normalWidth - 0.2,
order = 22,
hidden = function() return not trigger.type == "aura2" end
},
useExactSpellIdSpace = {
type = "description",
@@ -523,7 +517,7 @@ local function GetBuffTriggerOptions(data, triggernum)
},
use_stealable = {
type = "toggle",
name = function()
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"] .. "|r"
@@ -674,6 +668,16 @@ local function GetBuffTriggerOptions(data, triggernum)
order = 65.1,
hidden = function() return not (trigger.type == "aura2" and (trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party")) end
},
fetchRole = {
type = "toggle",
name = L["Fetch Role Information"],
desc = L["This adds %role, %roleIcon as text replacements. Does nothing if the unit is not a group member."],
order = 65.2,
width = WeakAuras.doubleWidth,
hidden = function()
return not (trigger.type == "aura2" and trigger.unit ~= "multi")
end
},
fetchRaidMark = {
type = "toggle",
name = L["Fetch Raid Mark Information"],
@@ -711,6 +715,7 @@ local function GetBuffTriggerOptions(data, triggernum)
and (trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party") and not trigger.use_includePets)
end
},
useActualSpec = {
type = "toggle",
width = WeakAuras.normalWidth,
+14 -5
View File
@@ -759,7 +759,6 @@ local function replaceNameDescFuncs(intable, data, subOption)
display = math.floor(display * 100) / 100;
else
local nullBytePos = display:find("\0", nil, true)
if nullBytePos then
display = display:sub(1, nullBytePos - 1)
end
@@ -824,6 +823,13 @@ local function replaceImageFuncs(intable, data, subOption)
recurse(intable);
end
local concatenableTypes = {
string = true,
number = true
}
local function isConcatenableValue(value)
return value and concatenableTypes[type(value)]
end
local function replaceValuesFuncs(intable, data, subOption)
local function valuesAll(info)
local combinedValues = {};
@@ -854,7 +860,9 @@ local function replaceValuesFuncs(intable, data, subOption)
-- Already known key/value pair
else
if (combinedValues[k]) then
if isConcatenableValue(k) and isConcatenableValue(v) then
combinedValues[k] = combinedValues[k] .. "/" .. v;
end
else
combinedValues[k] = v;
end
@@ -1390,6 +1398,7 @@ local function PositionOptions(id, data, _, hideWidthHeight, disableSelfPoint, g
},
anchorFramePoints = {
type = "execute",
width = WeakAuras.normalWidth,
name = "",
order = 78,
image = function() return "", 0, 0 end,
@@ -1400,9 +1409,9 @@ local function PositionOptions(id, data, _, hideWidthHeight, disableSelfPoint, g
xOffset = {
type = "range",
control = "WeakAurasSpinBox",
width = WeakAuras.normalWidth,
name = L["X Offset"],
order = 79,
width = WeakAuras.normalWidth,
softMin = (-1 * screenWidth),
min = (-4 * screenWidth),
softMax = screenWidth,
@@ -1420,9 +1429,9 @@ local function PositionOptions(id, data, _, hideWidthHeight, disableSelfPoint, g
yOffset = {
type = "range",
control = "WeakAurasSpinBox",
width = WeakAuras.normalWidth,
name = L["Y Offset"],
order = 80,
width = WeakAuras.normalWidth,
softMin = (-1 * screenHeight),
min = (-4 * screenHeight),
softMax = screenHeight,
@@ -1911,7 +1920,7 @@ local function AddCodeOption(args, data, name, prefix, url, order, hiddenFunc, p
OptionsPrivate.ClearOptions(data.id)
end
end,
get = function()
get = function(info)
return GetCustomCode(data, path);
end
};
@@ -1995,7 +2004,7 @@ local function AddCommonTriggerOptions(options, data, triggernum, doubleWidth)
order = 1.1,
values = trigger_types,
sorting = OptionsPrivate.Private.SortOrderForValues(trigger_types),
get = function(info)
get = function()
return trigger.type
end,
set = function(info, v)
+7 -6
View File
@@ -223,7 +223,6 @@ end
--- a sound from each setter
local lastPlayedSoundFromSet
local function wrapWithPlaySound(func, kit)
return function(info, v)
func(info, v);
@@ -380,11 +379,7 @@ local function addControlsForChange(args, order, data, conditionVariable, totalA
conditions[i].changes[j].value[4] = a;
WeakAuras.ClearAndUpdateOptions(data.id)
end
setValueTable = function(info, v)
conditions[i].changes[j].value = CopyTable(v)
WeakAuras.Add(data)
WeakAuras.ClearAndUpdateOptions(data.id)
end
setValueComplex = function(property)
return function(info, v)
for id, reference in pairs(conditions[i].changes[j].references) do
@@ -442,6 +437,11 @@ local function addControlsForChange(args, order, data, conditionVariable, totalA
WeakAuras.Add(data);
WeakAuras.ClearAndUpdateOptions(data.id)
end
setValueTable = function(info, v)
conditions[i].changes[j].value = CopyTable(v)
WeakAuras.Add(data)
WeakAuras.ClearAndUpdateOptions(data.id)
end
setValueColor = function(info, r, g, b, a)
conditions[i].changes[j].value = conditions[i].changes[j].value or {};
conditions[i].changes[j].value[1] = r;
@@ -625,6 +625,7 @@ local function addControlsForChange(args, order, data, conditionVariable, totalA
WeakAuras.Mixin(statusbarList, SharedMedia:HashTable("statusbar"))
values = statusbarList
end
args["condition" .. i .. "value" .. j] = {
type = "select",
width = WeakAuras.normalWidth,
+18 -10
View File
@@ -121,7 +121,7 @@ local function GetCustomTriggerOptions(data, triggernum)
end
elseif trueEvent:match("^UNIT_") then
local unit = string.lower(i)
if not ((OptionsPrivate.Private.baseUnitId[unit] and OptionsPrivate.Private.multiUnitId[unit]) or unit ~= "nameplate") then
if not OptionsPrivate.Private.baseUnitId[unit] and not OptionsPrivate.Private.multiUnitId[unit] then
return "|cFFFF0000"..L["Unit %s is not a valid unit for RegisterUnitEvent"]:format(unit)
end
elseif trueEvent == "TRIGGER" then
@@ -169,7 +169,7 @@ local function GetCustomTriggerOptions(data, triggernum)
end
elseif trueEvent:match("^UNIT_") then
local unit = string.lower(i)
if not (OptionsPrivate.Private.baseUnitId[unit] or unit ~= "nameplate") then
if not OptionsPrivate.Private.baseUnitId[unit] then
return false
end
elseif trueEvent == "TRIGGER" then
@@ -403,14 +403,22 @@ local function GetCustomTriggerOptions(data, triggernum)
17 + i / 10, hideOverlay, appendToTriggerPath("customOverlay" .. i), false, { multipath = false, extraSetFunction = extraSetFunctionReload, extraFunctions = extraFunctions});
end
OptionsPrivate.commonOptions.AddCodeOption(customOptions, data, L["Name Info"], "custom_name", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#name-info",
18, hideIfTriggerStateUpdate, appendToTriggerPath("customName"), false, { multipath = false, extraSetFunction = extraSetFunctionReload});
OptionsPrivate.commonOptions.AddCodeOption(customOptions, data, L["Icon Info"], "custom_icon", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#icon-info",
20, hideIfTriggerStateUpdate, appendToTriggerPath("customIcon"), false, { multipath = false, extraSetFunction = extraSetFunction});
OptionsPrivate.commonOptions.AddCodeOption(customOptions, data, L["Texture Info"], "custom_texture", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#texture-info",
22, hideIfTriggerStateUpdate, appendToTriggerPath("customTexture"), false, { multipath = false, extraSetFunction = extraSetFunction});
OptionsPrivate.commonOptions.AddCodeOption(customOptions, data, L["Stack Info"], "custom_stacks", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#stack-info",
23, hideIfTriggerStateUpdate, appendToTriggerPath("customStacks"), false, { multipath = false, extraSetFunction = extraSetFunctionReload});
OptionsPrivate.commonOptions.AddCodeOption(customOptions, data, L["Name Info"], "custom_name",
"https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#name-info",
18, hideIfTriggerStateUpdate, appendToTriggerPath("customName"), false,
{ multipath = false, extraSetFunction = extraSetFunctionReload});
OptionsPrivate.commonOptions.AddCodeOption(customOptions, data, L["Icon Info"], "custom_icon",
"https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#icon-info",
20, hideIfTriggerStateUpdate, appendToTriggerPath("customIcon"), false,
{ multipath = false, extraSetFunction = extraSetFunction});
OptionsPrivate.commonOptions.AddCodeOption(customOptions, data, L["Texture Info"], "custom_texture",
"https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#texture-info",
22, hideIfTriggerStateUpdate, appendToTriggerPath("customTexture"), false,
{ multipath = false, extraSetFunction = extraSetFunction});
OptionsPrivate.commonOptions.AddCodeOption(customOptions, data, L["Stack Info"], "custom_stacks",
"https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#stack-info",
23, hideIfTriggerStateUpdate, appendToTriggerPath("customStacks"), false,
{ multipath = false, extraSetFunction = extraSetFunctionReload});
return customOptions;
end
+5
View File
@@ -332,6 +332,7 @@ function OptionsPrivate.GetInformationOptions(data)
order = order,
}
order = order + 1
args.debugLogDesc = {
type = "description",
name = L["This enables the collection of debug logs. Custom code can add debug information to the log through the function DebugPrint."],
@@ -358,6 +359,7 @@ function OptionsPrivate.GetInformationOptions(data)
end
end
end
args.debugLogToggle = {
type = "toggle",
name = sameDebugLog and L["Enable Debug Logging"] or "|cFF4080FF" .. L["Enable Debug Logging"],
@@ -378,10 +380,12 @@ function OptionsPrivate.GetInformationOptions(data)
OptionsPrivate.ClearOptions(child.id)
end
end
WeakAuras.ClearAndUpdateOptions(data.id)
end
}
order = order + 1
if not sameDebugLog or commonDebugLog then
args.debugLogShow = {
type = "execute",
@@ -425,6 +429,7 @@ function OptionsPrivate.GetInformationOptions(data)
end
}
order = order + 1
args.debugLogClear = {
type = "execute",
name = L["Clear Debug Logs"],
+6 -1
View File
@@ -364,7 +364,11 @@ function OptionsPrivate.ConstructOptions(prototype, data, startorder, triggernum
options["use_"..name].desc = arg.desc;
end
if(arg.required) then
trigger["use_"..realname] = true;
if arg.type == "multiselect" and arg.multiNoSingle then
trigger["use_"..realname] = false
else
trigger["use_"..realname] = true
end
if not(triggertype) then
options["use_"..name].disabled = true;
else
@@ -438,6 +442,7 @@ function OptionsPrivate.ConstructOptions(prototype, data, startorder, triggernum
values = arg.operator_types == "without_equal" and OptionsPrivate.Private.operator_types_without_equal
or arg.operator_types == "only_equal" and OptionsPrivate.Private.equality_operator_types
or OptionsPrivate.Private.operator_types,
get = function()
return getValue(trigger, "use_"..realname, realname.."_operator", multiEntry, entryNumber)
end,
+15 -7
View File
@@ -801,6 +801,7 @@ function OptionsPrivate.DeleteAuras(auras, parents)
parentButton:SetNormalTooltip()
WeakAuras.Add(parentData)
WeakAuras.ClearAndUpdateOptions(parentData.id)
parentButton:UpdateParentWarning()
frame.loadProgress:SetText(L["Finishing..."])
coroutine.yield()
end
@@ -887,6 +888,7 @@ function WeakAuras.ShowOptions(msg)
if firstLoad then
frame:ShowTip()
end
end
function OptionsPrivate.UpdateOptions()
@@ -1407,7 +1409,10 @@ function OptionsPrivate.StartGrouping(data)
end
for id, button in pairs(displayButtons) do
button:StartGrouping({data.id}, data.id == id, data.regionType == "dynamicgroup" or data.regionType == "group", children[id]);
button:StartGrouping({data.id},
data.id == id,
data.regionType == "dynamicgroup" or data.regionType == "group",
children[id]);
end
end
end
@@ -1587,7 +1592,7 @@ function OptionsPrivate.StartDrag(mainAura)
children[child.id] = true
end
-- set dragging for non selected buttons
for _, button in pairs(displayButtons) do
for id, button in pairs(displayButtons) do
if not children[button.data.id] then
button:DragStart("MULTI", false, mainAura);
end
@@ -1603,7 +1608,7 @@ function OptionsPrivate.StartDrag(mainAura)
children[child.id] = true
end
-- set dragging for non selected buttons
for id, button in pairs(displayButtons) do
for _, button in pairs(displayButtons) do
if not children[button.data.id] then
button:DragStart(mode, false, mainAura);
end
@@ -1696,7 +1701,6 @@ function OptionsPrivate.OpenModelPicker(baseObject, path)
WeakAuras.prettyPrint(string.format(L["ModelPaths could not be loaded, the addon is %s"], reason));
WeakAuras.ModelPaths = {};
end
OptionsPrivate.ModelPicker(frame).modelTree:SetTree(WeakAuras.ModelPaths)
end
OptionsPrivate.ModelPicker(frame):Open(baseObject, path);
@@ -2044,7 +2048,8 @@ function OptionsPrivate.MoveCollapseDataUp(id, namespace, path)
collapsedOptions[id] = collapsedOptions[id] or {}
collapsedOptions[id][namespace] = collapsedOptions[id][namespace] or {}
if type(path) ~= "table" then
collapsedOptions[id][namespace][path], collapsedOptions[id][namespace][path - 1] = collapsedOptions[id][namespace][path - 1], collapsedOptions[id][namespace][path]
collapsedOptions[id][namespace][path], collapsedOptions[id][namespace][path - 1]
= collapsedOptions[id][namespace][path - 1], collapsedOptions[id][namespace][path]
else
local tmp = collapsedOptions[id][namespace]
local lastKey = tremove(path)
@@ -2060,7 +2065,8 @@ function OptionsPrivate.MoveCollapseDataDown(id, namespace, path)
collapsedOptions[id] = collapsedOptions[id] or {}
collapsedOptions[id][namespace] = collapsedOptions[id][namespace] or {}
if type(path) ~= "table" then
collapsedOptions[id][namespace][path], collapsedOptions[id][namespace][path + 1] = collapsedOptions[id][namespace][path + 1], collapsedOptions[id][namespace][path]
collapsedOptions[id][namespace][path], collapsedOptions[id][namespace][path + 1]
= collapsedOptions[id][namespace][path + 1], collapsedOptions[id][namespace][path]
else
local tmp = collapsedOptions[id][namespace]
local lastKey = tremove(path)
@@ -2155,7 +2161,8 @@ function OptionsPrivate.DuplicateCollapseData(id, namespace, path)
end
end
function OptionsPrivate.AddTextFormatOption(input, withHeader, get, addOption, hidden, setHidden, withoutColor, index, total)
function OptionsPrivate.AddTextFormatOption(input, withHeader, get, addOption, hidden, setHidden,
withoutColor, index, total)
local headerOption
if withHeader and (not index or index == 1) then
headerOption = {
@@ -2182,6 +2189,7 @@ function OptionsPrivate.AddTextFormatOption(input, withHeader, get, addOption, h
local seenSymbols = {}
local parseFn = function(symbol)
if not seenSymbols[symbol] then
local _, sym = string.match(symbol, "(.+)%.(.+)")