from retail

This commit is contained in:
NoM0Re
2025-01-16 02:47:58 +01:00
parent ccb4d4af95
commit 24196cd7ce
11 changed files with 164 additions and 52 deletions
+3 -3
View File
@@ -148,7 +148,7 @@ local blockedFunctions = {
GuildUninvite = true, GuildUninvite = true,
securecall = true, securecall = true,
DeleteCursorItem = true, DeleteCursorItem = true,
ChatEdit_SendText = true ChatEdit_SendText = true,
} }
local blockedTables = { local blockedTables = {
@@ -263,7 +263,6 @@ end
function Private.ActivateAuraEnvironment(id, cloneId, state, states, onlyConfig) function Private.ActivateAuraEnvironment(id, cloneId, state, states, onlyConfig)
local data = id and WeakAuras.GetData(id) local data = id and WeakAuras.GetData(id)
local region = id and Private.EnsureRegion(id, cloneId)
if not data then if not data then
-- Pop the last aura_env from the stack, and update current_aura_env appropriately. -- Pop the last aura_env from the stack, and update current_aura_env appropriately.
tremove(aura_env_stack) tremove(aura_env_stack)
@@ -276,6 +275,7 @@ function Private.ActivateAuraEnvironment(id, cloneId, state, states, onlyConfig)
else else
-- Existing config is initialized to a high enough value -- Existing config is initialized to a high enough value
if environment_initialized[id] == 2 or (onlyConfig and environment_initialized[id] == 1) then if environment_initialized[id] == 2 or (onlyConfig and environment_initialized[id] == 1) then
local region = WeakAuras.GetRegion(id, cloneId)
-- Point the current environment to the correct table -- Point the current environment to the correct table
current_uid = data.uid current_uid = data.uid
current_aura_env = aura_environments[id] current_aura_env = aura_environments[id]
@@ -296,7 +296,6 @@ function Private.ActivateAuraEnvironment(id, cloneId, state, states, onlyConfig)
current_aura_env.cloneId = cloneId current_aura_env.cloneId = cloneId
current_aura_env.state = state current_aura_env.state = state
current_aura_env.states = states current_aura_env.states = states
current_aura_env.region = region
tinsert(aura_env_stack, {current_aura_env, data.uid}) tinsert(aura_env_stack, {current_aura_env, data.uid})
if not data.controlledChildren then if not data.controlledChildren then
@@ -304,6 +303,7 @@ function Private.ActivateAuraEnvironment(id, cloneId, state, states, onlyConfig)
end end
else else
-- Either this aura environment has not yet been initialized, or it was reset via an edit in WeakaurasOptions -- Either this aura environment has not yet been initialized, or it was reset via an edit in WeakaurasOptions
local region = id and Private.EnsureRegion(id, cloneId)
environment_initialized[id] = 2 environment_initialized[id] = 2
aura_environments[id] = aura_environments[id] or {} aura_environments[id] = aura_environments[id] or {}
getDataCallCounts[id] = getDataCallCounts[id] or 0 getDataCallCounts[id] = getDataCallCounts[id] or 0
+30 -5
View File
@@ -251,11 +251,11 @@ local function UpdateToolTipDataInMatchData(matchData, time)
local changed = false local changed = false
if matchData.unit and matchData.index and matchData.filter then if matchData.unit and matchData.index and matchData.filter then
local tooltip, _, tooltip1, tooltip2, tooltip3 = WeakAuras.GetAuraTooltipInfo(matchData.unit, matchData.index, matchData.filter) local tooltip, _, tooltip1, tooltip2, tooltip3, tooltip4 = WeakAuras.GetAuraTooltipInfo(matchData.unit, matchData.index, matchData.filter)
changed = matchData.tooltip ~= tooltip or matchData.tooltip1 ~= tooltip1 changed = matchData.tooltip ~= tooltip or matchData.tooltip1 ~= tooltip1
or matchData.tooltip2 ~= tooltip2 or matchData.tooltip3 ~= tooltip3 or matchData.tooltip2 ~= tooltip2 or matchData.tooltip3 ~= tooltip3 or matchData.tooltip4 ~= tooltip4
matchData.tooltip, matchData.tooltip1, matchData.tooltip2, matchData.tooltip3 = tooltip, tooltip1, tooltip2, tooltip3 matchData.tooltip, matchData.tooltip1, matchData.tooltip2, matchData.tooltip3, matchData.tooltip4 = tooltip, tooltip1, tooltip2, tooltip3, tooltip4
end end
matchData.tooltipUpdated = time matchData.tooltipUpdated = time
@@ -491,6 +491,7 @@ local function UpdateStateWithMatch(time, bestMatch, triggerStates, cloneId, mat
tooltip1 = bestMatch.tooltip1, tooltip1 = bestMatch.tooltip1,
tooltip2 = bestMatch.tooltip2, tooltip2 = bestMatch.tooltip2,
tooltip3 = bestMatch.tooltip3, tooltip3 = bestMatch.tooltip3,
tooltip4 = bestMatch.tooltip4,
affected = affected, affected = affected,
unaffected = unaffected, unaffected = unaffected,
totalStacks = totalStacks, totalStacks = totalStacks,
@@ -626,6 +627,11 @@ local function UpdateStateWithMatch(time, bestMatch, triggerStates, cloneId, mat
changed = true changed = true
end end
if state.tooltip4 ~= bestMatch.tooltip4 then
state.tooltip4 = bestMatch.tooltip4
changed = true
end
if state.matchCount ~= matchCount then if state.matchCount ~= matchCount then
state.matchCount = matchCount state.matchCount = matchCount
changed = true changed = true
@@ -790,8 +796,8 @@ local function UpdateStateWithNoMatch(time, triggerStates, triggerInfo, cloneId,
changed = true changed = true
end end
if state.tooltip or state.tooltip1 or state.tooltip2 or state.tooltip3 then if state.tooltip or state.tooltip1 or state.tooltip2 or state.tooltip3 or state.tooltip4 then
state.tooltip, state.tooltip1, state.tooltip2, state.tooltip3 = nil, nil, nil, nil state.tooltip, state.tooltip1, state.tooltip2, state.tooltip3, state.tooltip4 = nil, nil, nil, nil, nil
changed = true changed = true
end end
@@ -1864,6 +1870,8 @@ local function UnloadAura(scanFuncName, id)
if triggerInfo.id == id or not id then if triggerInfo.id == id or not id then
if triggerInfo.nextScheduledCheckHandle then if triggerInfo.nextScheduledCheckHandle then
timer:CancelTimer(triggerInfo.nextScheduledCheckHandle) timer:CancelTimer(triggerInfo.nextScheduledCheckHandle)
triggerInfo.nextScheduledCheck = nil
triggerInfo.nextScheduledCheckHandle = nil
end end
nameData[triggerInfo] = nil nameData[triggerInfo] = nil
end end
@@ -1890,6 +1898,8 @@ local function UnloadGeneral(scanFuncGeneral, id)
if triggerInfo.id == id or not id then if triggerInfo.id == id or not id then
if triggerInfo.nextScheduledCheckHandle then if triggerInfo.nextScheduledCheckHandle then
timer:CancelTimer(triggerInfo.nextScheduledCheckHandle) timer:CancelTimer(triggerInfo.nextScheduledCheckHandle)
triggerInfo.nextScheduledCheck = nil
triggerInfo.nextScheduledCheckHandle = nil
end end
debuffData[triggerInfo] = nil debuffData[triggerInfo] = nil
end end
@@ -2619,6 +2629,7 @@ function BuffTrigger.GetAdditionalProperties(data, triggernum)
ret = ret .. "|cFFFF0000%".. triggernum .. ".tooltip1|r - " .. L["First Value of Tooltip Text"] .. "\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 .. ".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 .. ".tooltip3|r - " .. L["Third Value of Tooltip Text"] .. "\n"
ret = ret .. "|cFFFF0000%".. triggernum .. ".tooltip4|r - " .. L["Fourth Value of Tooltip Text"] .. "\n"
end end
if trigger.unit ~= "multi" and trigger.fetchRaidMark then if trigger.unit ~= "multi" and trigger.fetchRaidMark then
@@ -2726,6 +2737,10 @@ function BuffTrigger.GetTriggerConditions(data, triggernum)
display = L["Tooltip Value 3"], display = L["Tooltip Value 3"],
type = "number" type = "number"
} }
result["tooltip4"] = {
display = L["Tooltip Value 4"],
type = "number"
}
end end
if trigger.unit ~= "multi" then if trigger.unit ~= "multi" then
@@ -3362,6 +3377,11 @@ function BuffTrigger.GetTriggerDescription(data, triggernum, namestable)
local trigger = data.triggers[triggernum].trigger local trigger = data.triggers[triggernum].trigger
if trigger.useName and trigger.auranames then if trigger.useName and trigger.auranames then
for index, name in pairs(trigger.auranames) do for index, name in pairs(trigger.auranames) do
if index > 10 then
tinsert(namestable, {" ", "[...]"})
break
end
local left = " " local left = " "
if(index == 1) then if(index == 1) then
if(#trigger.auranames > 0) then if(#trigger.auranames > 0) then
@@ -3386,6 +3406,11 @@ function BuffTrigger.GetTriggerDescription(data, triggernum, namestable)
if trigger.useExactSpellId and trigger.auraspellids then if trigger.useExactSpellId and trigger.auraspellids then
for index, spellId in pairs(trigger.auraspellids) do for index, spellId in pairs(trigger.auraspellids) do
if index > 10 then
tinsert(namestable, {" ", "[...]"})
break
end
local left = " " local left = " "
if index == 1 then if index == 1 then
if #trigger.auraspellids > 0 then if #trigger.auraspellids > 0 then
+15 -5
View File
@@ -3136,10 +3136,8 @@ do
end end
end end
WeakAuras.ScanEvents("DBM_TimerUpdate", id) WeakAuras.ScanEvents("DBM_TimerUpdate", id)
elseif event == "DBM_SetStage" then elseif event == "DBM_SetStage" or event == "DBM_Pull" or event == "DBM_Wipe" or event == "DBM_Kill" then
local mod, modId, stage = ... WeakAuras.ScanEvents("DBM_SetStage")
currentStage = stage
WeakAuras.ScanEvents("DBM_SetStage", ...)
else -- DBM_Announce else -- DBM_Announce
WeakAuras.ScanEvents(event, ...) WeakAuras.ScanEvents(event, ...)
end end
@@ -3185,7 +3183,7 @@ do
end end
function WeakAuras.GetDBMStage() function WeakAuras.GetDBMStage()
return currentStage return DBM:GetStage()
end end
function WeakAuras.GetDBMTimerById(id) function WeakAuras.GetDBMTimerById(id)
@@ -3349,6 +3347,18 @@ do
if BigWigsLoader then if BigWigsLoader then
BigWigsLoader.RegisterMessage(WeakAuras, event, bigWigsEventCallback) BigWigsLoader.RegisterMessage(WeakAuras, event, bigWigsEventCallback)
registeredBigWigsEvents[event] = true registeredBigWigsEvents[event] = true
if event == "BigWigs_SetStage" then
-- on init of BigWigs_SetStage callback, we want to fetch currentStage in case we are already in an encounter when this is run
if BigWigs and BigWigs.IterateBossModules then
local stage = 0
for _, module in BigWigs:IterateBossModules() do
if module:IsEngaged() then
stage = math.max(stage, module:GetStage() or 1)
end
end
currentStage = stage
end
end
end end
end end
+10 -5
View File
@@ -3868,9 +3868,12 @@ Private.event_prototypes = {
internal_events = { internal_events = {
"DBM_SetStage" "DBM_SetStage"
}, },
force_events = "DBM_SetStage",
name = L["DBM Stage"], name = L["DBM Stage"],
init = function(trigger) init = function(trigger)
WeakAuras.RegisterDBMCallback("DBM_SetStage"); WeakAuras.RegisterDBMCallback("DBM_SetStage")
WeakAuras.RegisterDBMCallback("DBM_Pull")
WeakAuras.RegisterDBMCallback("DBM_Kill")
return "" return ""
end, end,
args = { args = {
@@ -4150,7 +4153,8 @@ Private.event_prototypes = {
{ {
name = "spellId", name = "spellId",
init = "arg", init = "arg",
display = L["Spell Id"], display = L["Key"],
desc = L["The 'Key' value can be found in the BigWigs options of a specific spell"],
type = "longstring" type = "longstring"
}, },
{ {
@@ -4306,7 +4310,7 @@ Private.event_prototypes = {
trigger.use_cloneId and "true" or "false", trigger.use_cloneId and "true" or "false",
trigger.use_extend and tonumber(trigger.extend or 0) or 0, trigger.use_extend and tonumber(trigger.extend or 0) or 0,
trigger.use_remaining and "true" or "false", trigger.use_remaining and "true" or "false",
trigger.remaining or 0, type(trigger.remaining) == "number" and trigger.remaining or 0,
trigger.use_emphasized == nil and "nil" or trigger.use_emphasized and "true" or "false", trigger.use_emphasized == nil and "nil" or trigger.use_emphasized and "true" or "false",
trigger.use_cast == nil and "nil" or trigger.use_cast and "true" or "false", trigger.use_cast == nil and "nil" or trigger.use_cast and "true" or "false",
trigger.use_isCooldown == nil and "nil" or trigger.use_isCooldown and "true" or "false", trigger.use_isCooldown == nil and "nil" or trigger.use_isCooldown and "true" or "false",
@@ -4317,7 +4321,8 @@ Private.event_prototypes = {
args = { args = {
{ {
name = "spellId", name = "spellId",
display = L["Spell Id"], display = L["Key"],
desc = L["The 'Key' value can be found in the BigWigs options of a specific spell"],
type = "string", type = "string",
conditionType = "string", conditionType = "string",
}, },
@@ -6420,7 +6425,7 @@ Private.event_prototypes = {
type = "toggle", type = "toggle",
test = "true", test = "true",
enable = function(trigger) enable = function(trigger)
return trigger.unit == "player" return trigger.unit == "player" and not trigger.use_inverse
end, end,
reloadOptions = true reloadOptions = true
}, },
+45 -7
View File
@@ -160,6 +160,16 @@ local function SoundRepeatStop(self)
Private.StopProfileSystem("sound"); Private.StopProfileSystem("sound");
end end
--[[
local function SoundStop(self)
Private.StartProfileSystem("sound");
if (self.soundHandle) then
StopSound(self.soundHandle);
end
Private.StopProfileSystem("sound");
end
]]
local function SoundPlayHelper(self) local function SoundPlayHelper(self)
Private.StartProfileSystem("sound"); Private.StartProfileSystem("sound");
local options = self.soundOptions; local options = self.soundOptions;
@@ -174,24 +184,52 @@ local function SoundPlayHelper(self)
end end
if (options.sound == " custom") then if (options.sound == " custom") then
if (options.sound_path) then local ok, _, handle = pcall(PlaySoundFile, options.sound_path, options.sound_channel or "Master")
pcall(PlaySoundFile, options.sound_path, options.sound_channel or "Master"); --if ok then
end --self.soundHandle = handle
--end
elseif (options.sound == " KitID") then elseif (options.sound == " KitID") then
if (options.sound_kit_id) then local ok, _, handle = pcall(PlaySound, options.sound_kit_id, options.sound_channel or "Master")
pcall(PlaySound, options.sound_kit_id, options.sound_channel or "Master"); --if ok then
end --self.soundHandle = handle
--end
else else
pcall(PlaySoundFile, options.sound, options.sound_channel or "Master"); local ok, _, handle = pcall(PlaySoundFile, options.sound, options.sound_channel or "Master")
--if ok then
--self.soundHandle = handle
--end
end end
Private.StopProfileSystem("sound"); Private.StopProfileSystem("sound");
end end
local function hasSound(options)
if (options.sound == " custom") then
if (options.sound_path and options.sound_path ~= "") then
return true
end
elseif (options.sound == " KitID") then
if (options.sound_kit_id and options.sound_kit_id ~= "") then
return true
end
else
if options.sound and options.sound ~= "" then
return true
end
end
return false
end
local function SoundPlay(self, options) local function SoundPlay(self, options)
if (not options or WeakAuras.IsOptionsOpen()) then if (not options or WeakAuras.IsOptionsOpen()) then
return return
end end
Private.StartProfileSystem("sound"); Private.StartProfileSystem("sound");
if not hasSound(options) then
Private.StopProfileSystem("sound")
return
end
--self:SoundStop();
self:SoundRepeatStop(); self:SoundRepeatStop();
self.soundOptions = options; self.soundOptions = options;
+8 -8
View File
@@ -1392,8 +1392,8 @@ local function scanForLoadsImpl(toCheck, event, arg1, ...)
local inCombat = UnitAffectingCombat("player") -- or UnitAffectingCombat("pet"); local inCombat = UnitAffectingCombat("player") -- or UnitAffectingCombat("pet");
local alive = not UnitIsDeadOrGhost('player') local alive = not UnitIsDeadOrGhost('player')
local pvp = UnitIsPVPFreeForAll("player") or UnitIsPVP("player") local pvp = UnitIsPVPFreeForAll("player") or UnitIsPVP("player")
local vehicle = UnitInVehicle("player") or UnitOnTaxi("player") local vehicle = UnitInVehicle("player") or UnitOnTaxi("player") or false
local vehicleUi = UnitHasVehicleUI("player") local vehicleUi = UnitHasVehicleUI("player") or false
local raidMemberType = 0 local raidMemberType = 0
if UnitIsPartyLeader("player") then if UnitIsPartyLeader("player") then
@@ -2691,7 +2691,7 @@ local function pAdd(data, simpleChange)
end end
end end
-- If the aura has a onHide animation we need to cancel it to ensure it's truely hidden now -- If the aura has a onHide animation we need to cancel it to ensure it's truly hidden now
if Private.regions[id] then if Private.regions[id] then
Private.CancelAnimation(Private.regions[id].region, true, true, true, true, true, true) Private.CancelAnimation(Private.regions[id].region, true, true, true, true, true, true)
end end
@@ -5012,11 +5012,11 @@ local function GetAnchorFrame(data, region, parent)
if unit then if unit then
local frame = unit and WeakAuras.GetNamePlateForUnit(unit) local frame = unit and WeakAuras.GetNamePlateForUnit(unit)
if frame then return frame end if frame then return frame end
if WeakAuras.IsOptionsOpen() then end
Private.ensurePRDFrame() if WeakAuras.IsOptionsOpen() then
personalRessourceDisplayFrame:anchorFrame(id, anchorFrameType) Private.ensurePRDFrame()
return personalRessourceDisplayFrame personalRessourceDisplayFrame:anchorFrame(id, anchorFrameType)
end return personalRessourceDisplayFrame
end end
end end
@@ -5,7 +5,7 @@ local L = WeakAuras.L
local pairs, next, type, unpack = pairs, next, type, unpack local pairs, next, type, unpack = pairs, next, type, unpack
local Type, Version = "WeakAurasPendingUpdateButton", 3 local Type, Version = "WeakAurasPendingUpdateButton", 5
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then
@@ -100,7 +100,7 @@ local methods = {
local auraData = WeakAuras.GetData(auraId) local auraData = WeakAuras.GetData(auraId)
if auraData then if auraData then
local success, error = WeakAuras.Import(self.companionData.encoded, auraData) local success, error = WeakAuras.Import(self.companionData.encoded, auraData)
if not success then if not success and error ~= nil then
WeakAuras.prettyPrint(error) WeakAuras.prettyPrint(error)
end end
end end
+1 -1
View File
@@ -587,7 +587,7 @@ local function GetBuffTriggerOptions(data, triggernum)
fetchTooltip = { fetchTooltip = {
type = "toggle", type = "toggle",
name = L["Fetch Tooltip Information"], 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."], desc = L["This adds %tooltip, %tooltip1, %tooltip2, %tooltip3 and %tooltip4 as text replacements and also allows filtering based on the tooltip content/values."],
order = 64.5, order = 64.5,
width = WeakAuras.doubleWidth, width = WeakAuras.doubleWidth,
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and not IsSingleMissing(trigger)) end hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and not IsSingleMissing(trigger)) end
+29
View File
@@ -91,6 +91,35 @@ function OptionsPrivate.GetInformationOptions(data)
} }
order = order + 1 order = order + 1
end end
if OptionsPrivate.HasWagoUrl(data.id) then
args.ignoreWagoUpdate = {
type = "toggle",
name = L["Ignore Wago updates"],
desc = OptionsPrivate.IsWagoUpdateIgnored(data.id) and L["Do you want to enable updates for this aura"] or L["Do you want to ignore updates for this aura"],
width = WeakAuras.doubleWidth,
get = function() return OptionsPrivate.IsWagoUpdateIgnored(data.id) end,
set = function(info, v)
local auraData = WeakAuras.GetData(data.id)
if auraData then
local ignoreUpdate
if OptionsPrivate.IsWagoUpdateIgnored(data.id) then
ignoreUpdate = nil
else
ignoreUpdate = true
end
for child in OptionsPrivate.Private.TraverseAll(auraData) do
child.ignoreWagoUpdate = ignoreUpdate
OptionsPrivate.ClearOptions(child.id)
end
WeakAuras.ClearAndUpdateOptions(data.id)
end
OptionsPrivate.SortDisplayButtons(nil, true)
end,
order = order
}
order = order + 1
end
-- Description -- Description
@@ -765,6 +765,7 @@ local function ConstructTextEditor(frame)
editor.editBox:SetScript("OnTextChanged", self.oldOnTextChanged) editor.editBox:SetScript("OnTextChanged", self.oldOnTextChanged)
editor:ClearFocus() editor:ClearFocus()
frame.window = "default" frame.window = "default"
frame:UpdateFrameVisible() frame:UpdateFrameVisible()
WeakAuras.FillOptions() WeakAuras.FillOptions()
+20 -16
View File
@@ -479,25 +479,29 @@ StaticPopupDialogs["WEAKAURAS_CONFIRM_DELETE"] = {
preferredindex = STATICPOPUP_NUMDIALOGS, preferredindex = STATICPOPUP_NUMDIALOGS,
} }
StaticPopupDialogs["WEAKAURAS_CONFIRM_IGNORE_UPDATES"] = { function OptionsPrivate.IsWagoUpdateIgnored(auraId)
text = L["Do you want to ignore all future updates for this aura"], local auraData = WeakAuras.GetData(auraId)
button1 = L["Yes"], if auraData then
button2 = L["Cancel"], for child in OptionsPrivate.Private.TraverseAll(auraData) do
OnAccept = function(self) if child.ignoreWagoUpdate then
if self.data then return true
local auraData = WeakAuras.GetData(self.data)
if auraData then
for child in OptionsPrivate.Private.TraverseAll(auraData) do
child.ignoreWagoUpdate = true
end end
end end
OptionsPrivate.SortDisplayButtons(nil, true)
end end
end, return false
OnCancel = function(self) end, end
whileDead = true,
preferredindex = STATICPOPUP_NUMDIALOGS, function OptionsPrivate.HasWagoUrl(auraId)
} local auraData = WeakAuras.GetData(auraId)
if auraData then
for child in OptionsPrivate.Private.TraverseAll(auraData) do
if child.url and child.url ~= "" then
return true
end
end
end
return false
end
function OptionsPrivate.ConfirmDelete(toDelete, parents) function OptionsPrivate.ConfirmDelete(toDelete, parents)
if toDelete then if toDelete then