from retail

This commit is contained in:
NoM0Re
2025-01-16 17:04:03 +01:00
parent c133385b44
commit 64a21e9030
5 changed files with 1604 additions and 967 deletions
-526
View File
@@ -3861,532 +3861,6 @@ Private.event_prototypes = {
},
timedrequired = true
},
-- DBM events
["DBM Stage"] = {
type = "addons",
events = {},
internal_events = {
"DBM_SetStage"
},
force_events = "DBM_SetStage",
name = L["DBM Stage"],
init = function(trigger)
WeakAuras.RegisterDBMCallback("DBM_SetStage")
WeakAuras.RegisterDBMCallback("DBM_Pull")
WeakAuras.RegisterDBMCallback("DBM_Kill")
return ""
end,
args = {
{
name = "stage",
init = "WeakAuras.GetDBMStage()",
display = L["Stage"],
type = "number",
conditionType = "number",
store = true,
}
},
automaticrequired = true,
statesParameter = "one",
},
["DBM Announce"] = {
type = "addons",
events = {},
internal_events = {
"DBM_Announce"
},
name = L["DBM Announce"],
init = function(trigger)
WeakAuras.RegisterDBMCallback("DBM_Announce");
local ret = "local use_cloneId = %s;"
return ret:format(trigger.use_cloneId and "true" or "false");
end,
statesParameter = "all",
args = {
{
name = "message",
init = "arg",
display = L["Message"],
type = "longstring",
store = true,
conditionType = "string"
},
{
name = "name",
init = "message",
hidden = true,
test = "true",
store = true,
},
{
name = "icon",
init = "arg",
store = true,
hidden = true,
test = "true"
},
{
name = "cloneId",
display = L["Clone per Event"],
type = "toggle",
test = "true",
init = "use_cloneId and WeakAuras.GetUniqueCloneId() or ''"
},
},
timedrequired = true
},
["DBM Timer"] = {
type = "addons",
events = {},
internal_events = {
"DBM_TimerStart", "DBM_TimerStop", "DBM_TimerStopAll", "DBM_TimerUpdate", "DBM_TimerForce"
},
force_events = "DBM_TimerForce",
name = L["DBM Timer"],
canHaveDuration = "timed",
triggerFunction = function(trigger)
WeakAuras.RegisterDBMCallback("DBM_TimerStart")
WeakAuras.RegisterDBMCallback("DBM_TimerStop")
WeakAuras.RegisterDBMCallback("DBM_TimerUpdate")
WeakAuras.RegisterDBMCallback("wipe")
WeakAuras.RegisterDBMCallback("kill")
local ret = [=[
local triggerCounter = %q
local counter
if triggerCounter and triggerCounter ~= "" then
counter = Private.ExecEnv.CreateTriggerCounter(triggerCounter)
else
counter = Private.ExecEnv.CreateTriggerCounter()
end
return function (states, event, id)
local triggerId = %q
local triggerSpellId = %q
local triggerText = %q
local triggerTextOperator = %q
local useClone = %s
local extendTimer = %s
local triggerUseRemaining = %s
local triggerRemaining = %s
local triggerDbmType = %s
local cloneId = useClone and id or ""
local state = states[cloneId]
local counter = counter
function copyOrSchedule(bar, cloneId)
if triggerUseRemaining then
local remainingTime = bar.expirationTime - GetTime() + extendTimer
if remainingTime %s triggerRemaining then
Private.ExecEnv.CopyBarToState(bar, states, cloneId, extendTimer)
else
local state = states[cloneId]
if state and state.show then
state.show = false
state.changed = true
end
end
if remainingTime >= triggerRemaining then
Private.ExecEnv.ScheduleDbmCheck(bar.expirationTime - triggerRemaining + extendTimer)
end
else
Private.ExecEnv.CopyBarToState(bar, states, cloneId, extendTimer)
end
end
if useClone then
if event == "DBM_TimerStart" then
if Private.ExecEnv.DBMTimerMatches(id, triggerId, triggerText, triggerTextOperator, triggerSpellId, triggerDbmType, counter) then
local bar = WeakAuras.GetDBMTimerById(id)
if bar then
copyOrSchedule(bar, cloneId)
end
end
elseif event == "DBM_TimerStop" and state then
local bar_remainingTime = GetTime() - state.expirationTime + (state.extend or 0)
if state.extend == 0 or bar_remainingTime > 0.2 then
state.show = false
state.changed = true
end
elseif event == "DBM_TimerUpdate" then
for id, bar in pairs(WeakAuras.GetAllDBMTimers()) do
if Private.ExecEnv.DBMTimerMatches(id, triggerId, triggerText, triggerTextOperator, triggerSpellId, triggerDbmType, counter) then
copyOrSchedule(bar, id)
else
local state = states[id]
if state then
local bar_remainingTime = GetTime() - state.expirationTime + (state.extend or 0)
if state.extend == 0 or bar_remainingTime > 0.2 then
state.show = false
state.changed = true
end
end
end
end
elseif event == "DBM_TimerForce" then
wipe(states)
for id, bar in pairs(WeakAuras.GetAllDBMTimers()) do
if Private.ExecEnv.DBMTimerMatches(id, triggerId, triggerText, triggerTextOperator, triggerSpellId, triggerDbmType, counter) then
copyOrSchedule(bar, cloneId)
end
end
end
else
if event == "DBM_TimerStart" or event == "DBM_TimerUpdate" then
if extendTimer ~= 0 then
if Private.ExecEnv.DBMTimerMatches(id, triggerId, triggerText, triggerTextOperator, triggerSpellId, triggerDbmType, counter) then
local bar = WeakAuras.GetDBMTimerById(id)
Private.ExecEnv.ScheduleDbmCheck(bar.expirationTime + extendTimer)
end
end
end
local bar = WeakAuras.GetDBMTimer(triggerId, triggerText, triggerTextOperator, triggerSpellId, extendTimer, triggerDbmType, counter)
if bar then
if extendTimer == 0
or not (state and state.show)
or (state and state.show and state.expirationTime > (bar.expirationTime + extendTimer))
then
copyOrSchedule(bar, cloneId)
end
else
if state and state.show then
local bar_remainingTime = GetTime() - state.expirationTime + (state.extend or 0)
if state.extend == 0 or bar_remainingTime > 0.2 then
state.show = false
state.changed = true
end
end
end
end
return true
end
]=]
return ret:format(
trigger.use_count and trigger.count or "",
trigger.use_id and trigger.id or "",
trigger.use_spellId and tostring(trigger.spellId) or "",
trigger.use_message and trigger.message or "",
trigger.use_message and trigger.message_operator or "",
trigger.use_cloneId and "true" or "false",
trigger.use_extend and tonumber(trigger.extend or 0) or 0,
trigger.use_remaining and "true" or "false",
trigger.remaining and tonumber(trigger.remaining or 0) or 0,
trigger.use_dbmType and trigger.dbmType or "nil",
trigger.remaining_operator or "<"
)
end,
statesParameter = "full",
args = {
{
name = "id",
display = L["Timer Id"],
type = "string",
},
{
name = "spellId",
display = L["Spell Id"],
type = "string",
store = true,
conditionType = "string"
},
{
name = "message",
display = L["Message"],
type = "longstring",
store = true,
conditionType = "string"
},
{
name = "remaining",
display = L["Remaining Time"],
type = "number",
},
{
name = "extend",
display = L["Offset Timer"],
type = "string",
},
{
name = "count",
display = L["Count"],
desc = L["Occurrence of the event, reset when aura is unloaded\nCan be a range of values\nCan have multiple values separated by a comma or a space\n\nExamples:\n2nd 5th and 6th events: 2, 5, 6\n2nd to 6th: 2-6\nevery 2 events: /2\nevery 3 events starting from 2nd: 2/3\nevery 3 events starting from 2nd and ending at 11th: 2-11/3\n\nOnly if DBM shows it on it's bar"],
type = "string",
conditionType = "string",
},
{
name = "dbmType",
display = L["Type"],
type = "select",
values = "dbm_types",
conditionType = "select",
test = "true"
},
{
name = "cloneId",
display = L["Clone per Event"],
type = "toggle"
}
},
automaticrequired = true,
},
-- BigWigs
["BigWigs Message"] = {
type = "addons",
events = {},
internal_events = {
"BigWigs_Message"
},
name = L["BigWigs Message"],
init = function(trigger)
WeakAuras.RegisterBigWigsCallback("BigWigs_Message");
local ret = "local use_cloneId = %s;"
return ret:format(trigger.use_cloneId and "true" or "false");
end,
statesParameter = "all",
args = {
{
name = "addon",
init = "arg",
display = L["BigWigs Addon"],
type = "string"
},
{
name = "spellId",
init = "arg",
display = L["Key"],
desc = L["The 'Key' value can be found in the BigWigs options of a specific spell"],
type = "longstring"
},
{
name = "text",
init = "arg",
display = L["Message"],
type = "longstring",
store = true,
conditionType = "string"
},
{
name = "name",
init = "text",
hidden = true,
test = "true",
store = true
},
{}, -- Importance, might be useful
{
name = "icon",
init = "arg",
hidden = true,
test = "true",
store = true
},
{
name = "cloneId",
display = L["Clone per Event"],
type = "toggle",
test = "true",
init = "use_cloneId and WeakAuras.GetUniqueCloneId() or ''"
},
},
timedrequired = true
},
["BigWigs Timer"] = {
type = "addons",
events = {},
internal_events = {
"BigWigs_StartBar", "BigWigs_StopBar", "BigWigs_Timer_Update",
},
force_events = "BigWigs_Timer_Force",
name = L["BigWigs Timer"],
canHaveDuration = "timed",
triggerFunction = function(trigger)
WeakAuras.RegisterBigWigsTimer()
local ret = [=[
local triggerCounter = %q
local counter
if triggerCounter and triggerCounter ~= "" then
counter = Private.ExecEnv.CreateTriggerCounter(triggerCounter)
else
counter = Private.ExecEnv.CreateTriggerCounter()
end
return function(states, event, id)
local triggerSpellId = %q
local triggerText = %q
local triggerTextOperator = %q
local useClone = %s
local extendTimer = %s
local triggerUseRemaining = %s
local triggerRemaining = %s
local triggerEmphasized = %s
local triggerCast = %s
local triggerIsCooldown = %s
local cloneId = useClone and id or ""
local state = states[cloneId]
local counter = counter
function copyOrSchedule(bar, cloneId)
if triggerUseRemaining then
local remainingTime = bar.expirationTime - GetTime() + extendTimer
if remainingTime %s triggerRemaining then
Private.ExecEnv.CopyBigWigsTimerToState(bar, states, cloneId, extendTimer)
else
local state = states[cloneId]
if state and state.show then
state.show = false
state.changed = true
end
end
if remainingTime >= triggerRemaining then
Private.ExecEnv.ScheduleBigWigsCheck(bar.expirationTime - triggerRemaining + extendTimer)
end
else
Private.ExecEnv.CopyBigWigsTimerToState(bar, states, cloneId, extendTimer)
end
end
if useClone then
if event == "BigWigs_StartBar" then
if Private.ExecEnv.BigWigsTimerMatches(id, triggerText, triggerTextOperator, triggerSpellId, triggerEmphasized, counter, triggerCast, triggerIsCooldown) then
local bar = WeakAuras.GetBigWigsTimerById(id)
if bar then
copyOrSchedule(bar, cloneId)
end
end
elseif event == "BigWigs_StopBar" and state then
local bar_remainingTime = GetTime() - state.expirationTime + (state.extend or 0)
if state.extend == 0 or bar_remainingTime > 0.2 then
state.show = false
state.changed = true
end
elseif event == "BigWigs_Timer_Update" then
for id, bar in pairs(WeakAuras.GetAllBigWigsTimers()) do
if Private.ExecEnv.BigWigsTimerMatches(id, triggerText, triggerTextOperator, triggerSpellId, triggerEmphasized, counter, triggerCast) then
copyOrSchedule(bar, id)
end
end
elseif event == "BigWigs_Timer_Force" then
wipe(states)
for id, bar in pairs(WeakAuras.GetAllBigWigsTimers()) do
if Private.ExecEnv.BigWigsTimerMatches(id, triggerText, triggerTextOperator, triggerSpellId, triggerEmphasized, counter, triggerCast) then
copyOrSchedule(bar, id)
end
end
end
else
if event == "BigWigs_StartBar" then
if extendTimer ~= 0 then
if Private.ExecEnv.BigWigsTimerMatches(id, triggerText, triggerTextOperator, triggerSpellId, triggerEmphasized, counter, triggerCast) then
local bar = WeakAuras.GetBigWigsTimerById(id)
Private.ExecEnv.ScheduleBigWigsCheck(bar.expirationTime + extendTimer)
end
end
end
local bar = WeakAuras.GetBigWigsTimer(triggerText, triggerTextOperator, triggerSpellId, extendTimer, triggerEmphasized, counter, triggerCast)
if bar then
if extendTimer == 0
or not (state and state.show)
or (state and state.show and state.expirationTime > (bar.expirationTime + extendTimer))
then
copyOrSchedule(bar, cloneId)
end
else
if state and state.show then
local bar_remainingTime = GetTime() - state.expirationTime + (state.extend or 0)
if state.extend == 0 or bar_remainingTime > 0.2 then
state.show = false
state.changed = true
end
end
end
end
return true
end
]=]
return ret:format(
trigger.use_count and trigger.count or "",
trigger.use_spellId and tostring(trigger.spellId) or "",
trigger.use_text and trigger.text or "",
trigger.use_text and trigger.text_operator or "",
trigger.use_cloneId and "true" or "false",
trigger.use_extend and tonumber(trigger.extend or 0) or 0,
trigger.use_remaining and "true" or "false",
trigger.remaining and tonumber(trigger.remaining or 0) or 0,
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_isCooldown == nil and "nil" or trigger.use_isCooldown and "true" or "false",
trigger.remaining_operator or "<"
)
end,
statesParameter = "full",
args = {
{
name = "spellId",
display = L["Key"],
desc = L["The 'Key' value can be found in the BigWigs options of a specific spell"],
type = "string",
conditionType = "string",
},
{
name = "text",
display = L["Message"],
type = "longstring",
store = true,
conditionType = "string"
},
{
name = "remaining",
display = L["Remaining Time"],
type = "number",
},
{
name = "extend",
display = L["Offset Timer"],
type = "string",
},
{
name = "count",
display = L["Count"],
desc = L["Occurrence of the event, reset when aura is unloaded\nCan be a range of values\nCan have multiple values separated by a comma or a space\n\nExamples:\n2nd 5th and 6th events: 2, 5, 6\n2nd to 6th: 2-6\nevery 2 events: /2\nevery 3 events starting from 2nd: 2/3\nevery 3 events starting from 2nd and ending at 11th: 2-11/3\n\nOnly if BigWigs shows it on it's bar"],
type = "string",
conditionType = "string",
},
{
name = "emphasized",
display = L["Emphasized"],
type = "tristate",
desc = L["Emphasized option checked in BigWigs's spell options"],
test = "true",
init = "false",
conditionType = "bool"
},
{
name = "cast",
display = L["Cast Bar"],
desc = L["Filter messages with format <message>"],
type = "tristate",
test = "true",
init = "false",
conditionType = "bool"
},
{
name = "isCooldown",
display = L["Cooldown"],
desc = L["Cooldown bars show time before an ability is ready to be use, BigWigs prefix them with '~'"],
type = "tristate",
test = "true",
init = "false",
conditionType = "bool"
},
{
name = "cloneId",
display = L["Clone per Event"],
type = "toggle",
test = "true",
init = "false"
},
},
automaticrequired = true,
},
["Global Cooldown"] = {
type = "spell",
events = {},