Bossmod triggers show timers regardless of bossmod settings
This commit is contained in:
@@ -72,6 +72,7 @@ globals = {
|
|||||||
"APIDocumentation",
|
"APIDocumentation",
|
||||||
"APIDocumentation_LoadUI",
|
"APIDocumentation_LoadUI",
|
||||||
"BigWigs",
|
"BigWigs",
|
||||||
|
"BigWigsAPI",
|
||||||
"BigWigsLoader",
|
"BigWigsLoader",
|
||||||
"CUSTOM_CLASS_COLORS",
|
"CUSTOM_CLASS_COLORS",
|
||||||
"DBM",
|
"DBM",
|
||||||
|
|||||||
+109
-43
@@ -32,6 +32,7 @@ Private.ExecEnv.BossMods.DBM = {
|
|||||||
state.dbmType = bar.dbmType
|
state.dbmType = bar.dbmType
|
||||||
state.dbmColor = bar.dbmColor
|
state.dbmColor = bar.dbmColor
|
||||||
state.extend = extendTimer
|
state.extend = extendTimer
|
||||||
|
state.isBarEnabled = bar.isBarEnabled
|
||||||
if extendTimer ~= 0 then
|
if extendTimer ~= 0 then
|
||||||
state.autoHide = true
|
state.autoHide = true
|
||||||
end
|
end
|
||||||
@@ -39,7 +40,7 @@ Private.ExecEnv.BossMods.DBM = {
|
|||||||
state.remaining = bar.remaining
|
state.remaining = bar.remaining
|
||||||
end,
|
end,
|
||||||
|
|
||||||
TimerMatches = function(self, timerId, message, operator, spellId, counter, triggerId, dbmType, noCastBar)
|
TimerMatches = function(self, timerId, message, operator, spellId, counter, triggerId, dbmType, noCastBar, isBarEnabled)
|
||||||
if not self.bars[timerId] then
|
if not self.bars[timerId] then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
@@ -51,6 +52,9 @@ Private.ExecEnv.BossMods.DBM = {
|
|||||||
if spellId and spellId ~= "" and spellId ~= v.spellId then
|
if spellId and spellId ~= "" and spellId ~= v.spellId then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
if isBarEnabled ~= nil and isBarEnabled ~= v.isBarEnabled then
|
||||||
|
return false
|
||||||
|
end
|
||||||
if message and message ~= "" and operator then
|
if message and message ~= "" and operator then
|
||||||
if operator == "==" then
|
if operator == "==" then
|
||||||
if v.message ~= message then
|
if v.message ~= message then
|
||||||
@@ -83,8 +87,8 @@ Private.ExecEnv.BossMods.DBM = {
|
|||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
|
|
||||||
TimerMatchesGeneric = function(self, timerId, message, operator, spellId, counter)
|
TimerMatchesGeneric = function(self, timerId, message, operator, spellId, counter, isBarEnabled)
|
||||||
return self:TimerMatches(timerId, message, operator, spellId, counter, nil, nil, true)
|
return self:TimerMatches(timerId, message, operator, spellId, counter, nil, nil, true, isBarEnabled)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
GetStage = function()
|
GetStage = function()
|
||||||
@@ -102,10 +106,10 @@ Private.ExecEnv.BossMods.DBM = {
|
|||||||
return self.bars[timerId]
|
return self.bars[timerId]
|
||||||
end,
|
end,
|
||||||
|
|
||||||
GetTimer = function(self, message, operator, spellId, extendTimer, count, triggerId, dbmType, noCastBar)
|
GetTimer = function(self, message, operator, spellId, extendTimer, count, triggerId, dbmType, noCastBar, isBarEnabled)
|
||||||
local bestMatch
|
local bestMatch
|
||||||
for timerId, bar in pairs(self.bars) do
|
for timerId, bar in pairs(self.bars) do
|
||||||
if self:TimerMatches(timerId, message, operator, spellId, count, triggerId, dbmType, noCastBar)
|
if self:TimerMatches(timerId, message, operator, spellId, count, triggerId, dbmType, noCastBar, isBarEnabled)
|
||||||
and (bestMatch == nil or bar.expirationTime < bestMatch.expirationTime)
|
and (bestMatch == nil or bar.expirationTime < bestMatch.expirationTime)
|
||||||
and bar.expirationTime + extendTimer > GetTime()
|
and bar.expirationTime + extendTimer > GetTime()
|
||||||
then
|
then
|
||||||
@@ -115,8 +119,8 @@ Private.ExecEnv.BossMods.DBM = {
|
|||||||
return bestMatch
|
return bestMatch
|
||||||
end,
|
end,
|
||||||
|
|
||||||
GetTimerGeneric = function(self, message, operator, spellId, extendTimer, count)
|
GetTimerGeneric = function(self, message, operator, spellId, extendTimer, count, isBarEnabled)
|
||||||
return self:GetTimer(message, operator, spellId, extendTimer, count, nil, nil, true)
|
return self:GetTimer(message, operator, spellId, extendTimer, count, nil, nil, true, isBarEnabled)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
RecheckTimers = function(self)
|
RecheckTimers = function(self)
|
||||||
@@ -161,8 +165,8 @@ Private.ExecEnv.BossMods.DBM = {
|
|||||||
count = count and tostring(count) or "0"
|
count = count and tostring(count) or "0"
|
||||||
Private.ScanEvents("BossMod_Announce", spellId, message, icon, count)
|
Private.ScanEvents("BossMod_Announce", spellId, message, icon, count)
|
||||||
end
|
end
|
||||||
elseif event == "DBM_TimerStart" then
|
elseif event == "DBM_TimerBegin" then
|
||||||
local timerId, msg, duration, icon, timerType, spellId, dbmType, _, _, _, _, _, timerCount = ...
|
local timerId, msg, duration, icon, timerType, spellId, dbmType, _, _, _, _, _, timerCount, _, _, _, _, isBarEnabled = ...
|
||||||
local now = GetTime()
|
local now = GetTime()
|
||||||
local expirationTime = now + duration
|
local expirationTime = now + duration
|
||||||
self.bars[timerId] = self.bars[timerId] or {}
|
self.bars[timerId] = self.bars[timerId] or {}
|
||||||
@@ -176,6 +180,7 @@ Private.ExecEnv.BossMods.DBM = {
|
|||||||
bar.count = timerCount and tostring(timerCount) or "0"
|
bar.count = timerCount and tostring(timerCount) or "0"
|
||||||
bar.dbmType = dbmType
|
bar.dbmType = dbmType
|
||||||
bar.expired = nil
|
bar.expired = nil
|
||||||
|
bar.isBarEnabled = isBarEnabled
|
||||||
|
|
||||||
local r, g, b = 0, 0, 0
|
local r, g, b = 0, 0, 0
|
||||||
if DBT.GetColorForType then
|
if DBT.GetColorForType then
|
||||||
@@ -318,7 +323,7 @@ Private.ExecEnv.BossMods.DBM = {
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
RegisterTimer = function(self)
|
RegisterTimer = function(self)
|
||||||
self:RegisterCallback("DBM_TimerStart")
|
self:RegisterCallback("DBM_TimerBegin")
|
||||||
self:RegisterCallback("DBM_TimerStop")
|
self:RegisterCallback("DBM_TimerStop")
|
||||||
self:RegisterCallback("DBM_TimerPause")
|
self:RegisterCallback("DBM_TimerPause")
|
||||||
self:RegisterCallback("DBM_TimerResume")
|
self:RegisterCallback("DBM_TimerResume")
|
||||||
@@ -478,6 +483,7 @@ Private.event_prototypes["DBM Timer"] = {
|
|||||||
local triggerUseRemaining = %s
|
local triggerUseRemaining = %s
|
||||||
local triggerRemaining = %s
|
local triggerRemaining = %s
|
||||||
local triggerDbmType = %s
|
local triggerDbmType = %s
|
||||||
|
local isBarEnabled = %s
|
||||||
local cloneId = useClone and timerId or ""
|
local cloneId = useClone and timerId or ""
|
||||||
local state = states[cloneId]
|
local state = states[cloneId]
|
||||||
local counter = counter
|
local counter = counter
|
||||||
@@ -527,7 +533,7 @@ Private.event_prototypes["DBM Timer"] = {
|
|||||||
or event == "DBM_TimerPause"
|
or event == "DBM_TimerPause"
|
||||||
or event == "DBM_TimerResume"
|
or event == "DBM_TimerResume"
|
||||||
then
|
then
|
||||||
if Private.ExecEnv.BossMods.DBM:TimerMatches(timerId, triggerText, triggerTextOperator, triggerSpellId, counter, triggerId, triggerDbmType) then
|
if Private.ExecEnv.BossMods.DBM:TimerMatches(timerId, triggerText, triggerTextOperator, triggerSpellId, counter, triggerId, triggerDbmType, isBarEnabled) then
|
||||||
local bar = Private.ExecEnv.BossMods.DBM:GetTimerById(timerId)
|
local bar = Private.ExecEnv.BossMods.DBM:GetTimerById(timerId)
|
||||||
if bar then
|
if bar then
|
||||||
return copyOrSchedule(bar, cloneId)
|
return copyOrSchedule(bar, cloneId)
|
||||||
@@ -543,7 +549,7 @@ Private.event_prototypes["DBM Timer"] = {
|
|||||||
elseif event == "DBM_TimerUpdate" or event == "DBM_TimerUpdateIcon" then
|
elseif event == "DBM_TimerUpdate" or event == "DBM_TimerUpdateIcon" then
|
||||||
local changed
|
local changed
|
||||||
for timerId, bar in pairs(Private.ExecEnv.BossMods.DBM:GetAllTimers()) do
|
for timerId, bar in pairs(Private.ExecEnv.BossMods.DBM:GetAllTimers()) do
|
||||||
if Private.ExecEnv.BossMods.DBM:TimerMatches(timerId, triggerText, triggerTextOperator, triggerSpellId, counter, triggerId, triggerDbmType) then
|
if Private.ExecEnv.BossMods.DBM:TimerMatches(timerId, triggerText, triggerTextOperator, triggerSpellId, counter, triggerId, triggerDbmType, isBarEnabled) then
|
||||||
changed = copyOrSchedule(bar, timerId) or changed
|
changed = copyOrSchedule(bar, timerId) or changed
|
||||||
else
|
else
|
||||||
local state = states[timerId]
|
local state = states[timerId]
|
||||||
@@ -566,7 +572,7 @@ Private.event_prototypes["DBM Timer"] = {
|
|||||||
changed = true
|
changed = true
|
||||||
end
|
end
|
||||||
for timerId, bar in pairs(Private.ExecEnv.BossMods.DBM:GetAllTimers()) do
|
for timerId, bar in pairs(Private.ExecEnv.BossMods.DBM:GetAllTimers()) do
|
||||||
if Private.ExecEnv.BossMods.DBM:TimerMatches(timerId, triggerText, triggerTextOperator, triggerSpellId, counter, triggerId, triggerDbmType) then
|
if Private.ExecEnv.BossMods.DBM:TimerMatches(timerId, triggerText, triggerTextOperator, triggerSpellId, counter, triggerId, triggerDbmType, isBarEnabled) then
|
||||||
changed = copyOrSchedule(bar, timerId) or changed
|
changed = copyOrSchedule(bar, timerId) or changed
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -575,13 +581,13 @@ Private.event_prototypes["DBM Timer"] = {
|
|||||||
else
|
else
|
||||||
if event == "DBM_TimerStart" or event == "DBM_TimerUpdate" then
|
if event == "DBM_TimerStart" or event == "DBM_TimerUpdate" then
|
||||||
if extendTimer ~= 0 then
|
if extendTimer ~= 0 then
|
||||||
if Private.ExecEnv.BossMods.DBM:TimerMatches(timerId, triggerText, triggerTextOperator, triggerSpellId, counter, triggerId, triggerDbmType) then
|
if Private.ExecEnv.BossMods.DBM:TimerMatches(timerId, triggerText, triggerTextOperator, triggerSpellId, counter, triggerId, triggerDbmType, isBarEnabled) then
|
||||||
local bar = Private.ExecEnv.BossMods.DBM:GetTimerById(timerId)
|
local bar = Private.ExecEnv.BossMods.DBM:GetTimerById(timerId)
|
||||||
Private.ExecEnv.BossMods.DBM:ScheduleCheck(bar.expirationTime + extendTimer)
|
Private.ExecEnv.BossMods.DBM:ScheduleCheck(bar.expirationTime + extendTimer)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local bar = Private.ExecEnv.BossMods.DBM:GetTimer(triggerText, triggerTextOperator, triggerSpellId, extendTimer, counter, triggerId, triggerDbmType)
|
local bar = Private.ExecEnv.BossMods.DBM:GetTimer(triggerText, triggerTextOperator, triggerSpellId, extendTimer, counter, triggerId, triggerDbmType, isBarEnabled)
|
||||||
if bar then
|
if bar then
|
||||||
if extendTimer == 0
|
if extendTimer == 0
|
||||||
or not (state and state.show)
|
or not (state and state.show)
|
||||||
@@ -614,6 +620,7 @@ Private.event_prototypes["DBM Timer"] = {
|
|||||||
trigger.use_remaining and "true" or "false",
|
trigger.use_remaining and "true" or "false",
|
||||||
trigger.remaining and tonumber(trigger.remaining or 0) or 0,
|
trigger.remaining and tonumber(trigger.remaining or 0) or 0,
|
||||||
trigger.use_dbmType and trigger.dbmType or "nil",
|
trigger.use_dbmType and trigger.dbmType or "nil",
|
||||||
|
trigger.use_isBarEnabled == nil and "nil" or trigger.use_isBarEnabled and "true" or "false",
|
||||||
trigger.remaining_operator or "<"
|
trigger.remaining_operator or "<"
|
||||||
)
|
)
|
||||||
end,
|
end,
|
||||||
@@ -665,6 +672,15 @@ Private.event_prototypes["DBM Timer"] = {
|
|||||||
conditionType = "select",
|
conditionType = "select",
|
||||||
test = "true"
|
test = "true"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name = "isBarEnabled",
|
||||||
|
display = L["Bar enabled in DBM settings"],
|
||||||
|
desc = L["Test if bar is enabled in DBM settings"],
|
||||||
|
type = "tristate",
|
||||||
|
test = "true",
|
||||||
|
init = "false",
|
||||||
|
conditionType = "bool"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name = "cloneId",
|
name = "cloneId",
|
||||||
display = L["Clone per Event"],
|
display = L["Clone per Event"],
|
||||||
@@ -710,9 +726,10 @@ Private.ExecEnv.BossMods.BigWigs = {
|
|||||||
state.paused = bar.paused
|
state.paused = bar.paused
|
||||||
state.remaining = bar.remaining
|
state.remaining = bar.remaining
|
||||||
state.isCooldown = bar.isCooldown
|
state.isCooldown = bar.isCooldown
|
||||||
|
state.isBarEnabled = bar.isBarEnabled
|
||||||
end,
|
end,
|
||||||
|
|
||||||
TimerMatches = function(self, timerId, message, operator, spellId, counter, cast, cooldown)
|
TimerMatches = function(self, timerId, message, operator, spellId, counter, cast, cooldown, isBarEnabled)
|
||||||
if not self.bars[timerId] then
|
if not self.bars[timerId] then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
@@ -721,6 +738,9 @@ Private.ExecEnv.BossMods.BigWigs = {
|
|||||||
if spellId and spellId ~= "" and spellId ~= v.spellId then
|
if spellId and spellId ~= "" and spellId ~= v.spellId then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
if isBarEnabled ~= nil and isBarEnabled ~= v.isBarEnabled then
|
||||||
|
return false
|
||||||
|
end
|
||||||
if message and message ~= "" and operator then
|
if message and message ~= "" and operator then
|
||||||
if operator == "==" then
|
if operator == "==" then
|
||||||
if v.text ~= message then
|
if v.text ~= message then
|
||||||
@@ -751,8 +771,8 @@ Private.ExecEnv.BossMods.BigWigs = {
|
|||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
|
|
||||||
TimerMatchesGeneric = function(self, timerId, message, operator, spellId, counter)
|
TimerMatchesGeneric = function(self, timerId, message, operator, spellId, counter, isBarEnabled)
|
||||||
return self:TimerMatches(timerId, message, operator, spellId, counter, false, nil)
|
return self:TimerMatches(timerId, message, operator, spellId, counter, false, nil, isBarEnabled)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
GetStage = function(self)
|
GetStage = function(self)
|
||||||
@@ -767,10 +787,10 @@ Private.ExecEnv.BossMods.BigWigs = {
|
|||||||
return self.bars[timerId]
|
return self.bars[timerId]
|
||||||
end,
|
end,
|
||||||
|
|
||||||
GetTimer = function(self, text, operator, spellId, extendTimer, counter, cast, cooldown)
|
GetTimer = function(self, text, operator, spellId, extendTimer, counter, cast, cooldown, isBarEnabled)
|
||||||
local bestMatch
|
local bestMatch
|
||||||
for timerId, bar in pairs(self.bars) do
|
for timerId, bar in pairs(self.bars) do
|
||||||
if self:TimerMatches(timerId, text, operator, spellId, counter, cast, cooldown)
|
if self:TimerMatches(timerId, text, operator, spellId, counter, cast, cooldown, isBarEnabled)
|
||||||
and (bestMatch == nil or bar.expirationTime < bestMatch.expirationTime)
|
and (bestMatch == nil or bar.expirationTime < bestMatch.expirationTime)
|
||||||
and bar.expirationTime + extendTimer > GetTime()
|
and bar.expirationTime + extendTimer > GetTime()
|
||||||
then
|
then
|
||||||
@@ -780,8 +800,8 @@ Private.ExecEnv.BossMods.BigWigs = {
|
|||||||
return bestMatch
|
return bestMatch
|
||||||
end,
|
end,
|
||||||
|
|
||||||
GetTimerGeneric = function(self, text, operator, spellId, extendTimer, counter)
|
GetTimerGeneric = function(self, text, operator, spellId, extendTimer, counter, isBarEnabled)
|
||||||
return self:GetTimer(text, operator, spellId, extendTimer, counter, false, nil)
|
return self:GetTimer(text, operator, spellId, extendTimer, counter, false, nil, isBarEnabled)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
RecheckTimers = function(self)
|
RecheckTimers = function(self)
|
||||||
@@ -827,8 +847,28 @@ Private.ExecEnv.BossMods.BigWigs = {
|
|||||||
local count = text and text:match("%((%d+)%)") or text:match("((%d+))") or "0"
|
local count = text and text:match("%((%d+)%)") or text:match("((%d+))") or "0"
|
||||||
Private.ScanEvents("BossMod_Announce", spellId, text, icon, count)
|
Private.ScanEvents("BossMod_Announce", spellId, text, icon, count)
|
||||||
end
|
end
|
||||||
elseif event == "BigWigs_StartBar" then
|
elseif event == "BigWigs_Timer"
|
||||||
local addon, spellId, text, duration, icon, isCD = ...
|
or event == "BigWigs_TargetTimer"
|
||||||
|
or event == "BigWigs_CastTimer"
|
||||||
|
or event == "BigWigs_StartBreak"
|
||||||
|
or event == "BigWigs_StartPull"
|
||||||
|
then
|
||||||
|
local addon, spellId, duration, _, text, count, icon, isCooldown, isBarEnabled
|
||||||
|
if event == "BigWigs_Timer" then
|
||||||
|
addon, spellId, duration, _, text, count, icon, isCooldown, isBarEnabled = ...
|
||||||
|
elseif event == "BigWigs_TargetTimer" or event == "BigWigs_CastTimer" then
|
||||||
|
addon, spellId, duration, _, text, count, icon, _, isBarEnabled = ...
|
||||||
|
isCooldown = false
|
||||||
|
elseif event == "BigWigs_StartBreak" or event == "BigWigs_StartPull" then
|
||||||
|
addon, duration = ...
|
||||||
|
local BwLocale = BigWigsAPI:GetLocale("BigWigs")
|
||||||
|
text = event == "BigWigs_StartBreak" and BwLocale.breakBar or BwLocale.pull
|
||||||
|
spellId = 0
|
||||||
|
count = 0
|
||||||
|
icon = 136116
|
||||||
|
isCooldown = false
|
||||||
|
isBarEnabled = true
|
||||||
|
end
|
||||||
local now = GetTime()
|
local now = GetTime()
|
||||||
local expirationTime = now + duration
|
local expirationTime = now + duration
|
||||||
|
|
||||||
@@ -841,14 +881,15 @@ Private.ExecEnv.BossMods.BigWigs = {
|
|||||||
bar.duration = duration
|
bar.duration = duration
|
||||||
bar.expirationTime = expirationTime
|
bar.expirationTime = expirationTime
|
||||||
bar.icon = icon
|
bar.icon = icon
|
||||||
bar.isCooldown = isCD or false
|
bar.isCooldown = isCooldown or false
|
||||||
bar.expired = nil
|
bar.expired = nil
|
||||||
local BWColorModule = BigWigs:GetPlugin("Colors")
|
local BWColorModule = BigWigs:GetPlugin("Colors")
|
||||||
bar.bwBarColor = BWColorModule:GetColorTable("barColor", addon, spellId)
|
bar.bwBarColor = BWColorModule:GetColorTable("barColor", addon, spellId)
|
||||||
bar.bwTextColor = BWColorModule:GetColorTable("barText", addon, spellId)
|
bar.bwTextColor = BWColorModule:GetColorTable("barText", addon, spellId)
|
||||||
bar.bwBackgroundColor = BWColorModule:GetColorTable("barBackground", addon, spellId)
|
bar.bwBackgroundColor = BWColorModule:GetColorTable("barBackground", addon, spellId)
|
||||||
bar.count = text:match("%((%d+)%)") or text:match("((%d+))") or "0"
|
bar.count = count or 0
|
||||||
bar.cast = not(text:match("^[^<]") and true)
|
bar.isBarEnabled = isBarEnabled
|
||||||
|
bar.cast = event == "BigWigs_CastTimer"
|
||||||
|
|
||||||
Private.ScanEvents("BigWigs_StartBar", text)
|
Private.ScanEvents("BigWigs_StartBar", text)
|
||||||
if self.isGeneric then
|
if self.isGeneric then
|
||||||
@@ -961,12 +1002,16 @@ Private.ExecEnv.BossMods.BigWigs = {
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
RegisterTimer = function(self)
|
RegisterTimer = function(self)
|
||||||
self:RegisterCallback("BigWigs_StartBar")
|
self:RegisterCallback("BigWigs_Timer")
|
||||||
|
self:RegisterCallback("BigWigs_TargetTimer")
|
||||||
|
self:RegisterCallback("BigWigs_StartBreak")
|
||||||
|
self:RegisterCallback("BigWigs_CastTimer")
|
||||||
self:RegisterCallback("BigWigs_StopBar")
|
self:RegisterCallback("BigWigs_StopBar")
|
||||||
self:RegisterCallback("BigWigs_StopBars")
|
self:RegisterCallback("BigWigs_StopBars")
|
||||||
self:RegisterCallback("BigWigs_OnBossDisable")
|
self:RegisterCallback("BigWigs_OnBossDisable")
|
||||||
self:RegisterCallback("BigWigs_PauseBar")
|
self:RegisterCallback("BigWigs_PauseBar")
|
||||||
self:RegisterCallback("BigWigs_ResumeBar")
|
self:RegisterCallback("BigWigs_ResumeBar")
|
||||||
|
self:RegisterCallback("BigWigs_StartPull")
|
||||||
end,
|
end,
|
||||||
|
|
||||||
RegisterMessage = function(self)
|
RegisterMessage = function(self)
|
||||||
@@ -1118,6 +1163,7 @@ Private.event_prototypes["BigWigs Timer"] = {
|
|||||||
local triggerRemaining = %s
|
local triggerRemaining = %s
|
||||||
local triggerCast = %s
|
local triggerCast = %s
|
||||||
local triggerIsCooldown = %s
|
local triggerIsCooldown = %s
|
||||||
|
local isBarEnabled = %s
|
||||||
local cloneId = useClone and timerId or ""
|
local cloneId = useClone and timerId or ""
|
||||||
local state = states[cloneId]
|
local state = states[cloneId]
|
||||||
local counter = counter
|
local counter = counter
|
||||||
@@ -1167,7 +1213,7 @@ Private.event_prototypes["BigWigs Timer"] = {
|
|||||||
or event == "BigWigs_PauseBar"
|
or event == "BigWigs_PauseBar"
|
||||||
or event == "BigWigs_ResumeBar"
|
or event == "BigWigs_ResumeBar"
|
||||||
then
|
then
|
||||||
if Private.ExecEnv.BossMods.BigWigs:TimerMatches(timerId, triggerText, triggerTextOperator, triggerSpellId, counter, triggerCast, triggerIsCooldown) then
|
if Private.ExecEnv.BossMods.BigWigs:TimerMatches(timerId, triggerText, triggerTextOperator, triggerSpellId, counter, triggerCast, triggerIsCooldown, isBarEnabled) then
|
||||||
local bar = Private.ExecEnv.BossMods.BigWigs:GetTimerById(timerId)
|
local bar = Private.ExecEnv.BossMods.BigWigs:GetTimerById(timerId)
|
||||||
if bar then
|
if bar then
|
||||||
return copyOrSchedule(bar, cloneId)
|
return copyOrSchedule(bar, cloneId)
|
||||||
@@ -1183,7 +1229,7 @@ Private.event_prototypes["BigWigs Timer"] = {
|
|||||||
elseif event == "BigWigs_Timer_Update" then
|
elseif event == "BigWigs_Timer_Update" then
|
||||||
local changed
|
local changed
|
||||||
for timerId, bar in pairs(Private.ExecEnv.BossMods.BigWigs:GetAllTimers()) do
|
for timerId, bar in pairs(Private.ExecEnv.BossMods.BigWigs:GetAllTimers()) do
|
||||||
if Private.ExecEnv.BossMods.BigWigs:TimerMatches(timerId, triggerText, triggerTextOperator, triggerSpellId, counter, triggerCast, triggerIsCooldown) then
|
if Private.ExecEnv.BossMods.BigWigs:TimerMatches(timerId, triggerText, triggerTextOperator, triggerSpellId, counter, triggerCast, triggerIsCooldown, isBarEnabled) then
|
||||||
changed = copyOrSchedule(bar, timerId) or changed
|
changed = copyOrSchedule(bar, timerId) or changed
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1196,7 +1242,7 @@ Private.event_prototypes["BigWigs Timer"] = {
|
|||||||
changed = true
|
changed = true
|
||||||
end
|
end
|
||||||
for timerId, bar in pairs(Private.ExecEnv.BossMods.BigWigs:GetAllTimers()) do
|
for timerId, bar in pairs(Private.ExecEnv.BossMods.BigWigs:GetAllTimers()) do
|
||||||
if Private.ExecEnv.BossMods.BigWigs:TimerMatches(timerId, triggerText, triggerTextOperator, triggerSpellId, counter, triggerCast, triggerIsCooldown) then
|
if Private.ExecEnv.BossMods.BigWigs:TimerMatches(timerId, triggerText, triggerTextOperator, triggerSpellId, counter, triggerCast, triggerIsCooldown, isBarEnabled) then
|
||||||
changed = copyOrSchedule(bar, timerId) or changed
|
changed = copyOrSchedule(bar, timerId) or changed
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1205,13 +1251,13 @@ Private.event_prototypes["BigWigs Timer"] = {
|
|||||||
else
|
else
|
||||||
if event == "BigWigs_StartBar" then
|
if event == "BigWigs_StartBar" then
|
||||||
if extendTimer ~= 0 then
|
if extendTimer ~= 0 then
|
||||||
if Private.ExecEnv.BossMods.BigWigs:TimerMatches(timerId, triggerText, triggerTextOperator, triggerSpellId, counter, triggerCast, triggerIsCooldown) then
|
if Private.ExecEnv.BossMods.BigWigs:TimerMatches(timerId, triggerText, triggerTextOperator, triggerSpellId, counter, triggerCast, triggerIsCooldown, isBarEnabled) then
|
||||||
local bar = Private.ExecEnv.BossMods.BigWigs:GetTimerById(timerId)
|
local bar = Private.ExecEnv.BossMods.BigWigs:GetTimerById(timerId)
|
||||||
Private.ExecEnv.BossMods.BigWigs:ScheduleCheck(bar.expirationTime + extendTimer)
|
Private.ExecEnv.BossMods.BigWigs:ScheduleCheck(bar.expirationTime + extendTimer)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local bar = Private.ExecEnv.BossMods.BigWigs:GetTimer(triggerText, triggerTextOperator, triggerSpellId, extendTimer, counter, triggerCast, triggerIsCooldown)
|
local bar = Private.ExecEnv.BossMods.BigWigs:GetTimer(triggerText, triggerTextOperator, triggerSpellId, extendTimer, counter, triggerCast, triggerIsCooldown, isBarEnabled)
|
||||||
if bar then
|
if bar then
|
||||||
if extendTimer == 0
|
if extendTimer == 0
|
||||||
or not (state and state.show)
|
or not (state and state.show)
|
||||||
@@ -1243,6 +1289,7 @@ Private.event_prototypes["BigWigs Timer"] = {
|
|||||||
trigger.remaining and tonumber(trigger.remaining or 0) or 0,
|
trigger.remaining and tonumber(trigger.remaining or 0) or 0,
|
||||||
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",
|
||||||
|
trigger.use_isBarEnabled == nil and "nil" or trigger.use_isBarEnabled and "true" or "false",
|
||||||
trigger.remaining_operator or "<"
|
trigger.remaining_operator or "<"
|
||||||
)
|
)
|
||||||
end,
|
end,
|
||||||
@@ -1300,6 +1347,15 @@ Private.event_prototypes["BigWigs Timer"] = {
|
|||||||
init = "false",
|
init = "false",
|
||||||
conditionType = "bool"
|
conditionType = "bool"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name = "isBarEnabled",
|
||||||
|
display = L["Bar enabled in BigWigs settings"],
|
||||||
|
desc = L["Test if bar is enabled in BigWigs settings"],
|
||||||
|
type = "tristate",
|
||||||
|
test = "true",
|
||||||
|
init = "false",
|
||||||
|
conditionType = "bool"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name = "cloneId",
|
name = "cloneId",
|
||||||
display = L["Clone per Event"],
|
display = L["Clone per Event"],
|
||||||
@@ -1429,7 +1485,6 @@ Private.event_prototypes["Boss Mod Announce"] = {
|
|||||||
conditionType = "string",
|
conditionType = "string",
|
||||||
noValidation = true,
|
noValidation = true,
|
||||||
showExactOption = false,
|
showExactOption = false,
|
||||||
negativeIsEJ = true
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = "message",
|
name = "message",
|
||||||
@@ -1517,6 +1572,7 @@ Private.event_prototypes["Boss Mod Timer"] = {
|
|||||||
local extendTimer = %s
|
local extendTimer = %s
|
||||||
local triggerUseRemaining = %s
|
local triggerUseRemaining = %s
|
||||||
local triggerRemaining = %s
|
local triggerRemaining = %s
|
||||||
|
local isBarEnabled = %s
|
||||||
local cloneId = useClone and timerId or ""
|
local cloneId = useClone and timerId or ""
|
||||||
local state = states[cloneId]
|
local state = states[cloneId]
|
||||||
local counter = counter
|
local counter = counter
|
||||||
@@ -1566,7 +1622,7 @@ Private.event_prototypes["Boss Mod Timer"] = {
|
|||||||
or event == "BossMod_TimerPause"
|
or event == "BossMod_TimerPause"
|
||||||
or event == "BossMod_TimerResume"
|
or event == "BossMod_TimerResume"
|
||||||
then
|
then
|
||||||
if Private.ExecEnv.BossMods.Generic:TimerMatchesGeneric(timerId, triggerText, triggerTextOperator, triggerSpellId, counter) then
|
if Private.ExecEnv.BossMods.Generic:TimerMatchesGeneric(timerId, triggerText, triggerTextOperator, triggerSpellId, counter, isBarEnabled) then
|
||||||
local bar = Private.ExecEnv.BossMods.Generic:GetTimerById(timerId)
|
local bar = Private.ExecEnv.BossMods.Generic:GetTimerById(timerId)
|
||||||
if bar then
|
if bar then
|
||||||
return copyOrSchedule(bar, cloneId)
|
return copyOrSchedule(bar, cloneId)
|
||||||
@@ -1582,7 +1638,7 @@ Private.event_prototypes["Boss Mod Timer"] = {
|
|||||||
elseif event == "BossMod_TimerUpdate" or event == "BossMod_TimerUpdateIcon" then
|
elseif event == "BossMod_TimerUpdate" or event == "BossMod_TimerUpdateIcon" then
|
||||||
local changed
|
local changed
|
||||||
for timerId, bar in pairs(Private.ExecEnv.BossMods.Generic:GetAllTimers()) do
|
for timerId, bar in pairs(Private.ExecEnv.BossMods.Generic:GetAllTimers()) do
|
||||||
if Private.ExecEnv.BossMods.Generic:TimerMatchesGeneric(timerId, triggerText, triggerTextOperator, triggerSpellId, counter) then
|
if Private.ExecEnv.BossMods.Generic:TimerMatchesGeneric(timerId, triggerText, triggerTextOperator, triggerSpellId, counter, isBarEnabled) then
|
||||||
changed = copyOrSchedule(bar, timerId) or changed
|
changed = copyOrSchedule(bar, timerId) or changed
|
||||||
else
|
else
|
||||||
local state = states[timerId]
|
local state = states[timerId]
|
||||||
@@ -1605,7 +1661,7 @@ Private.event_prototypes["Boss Mod Timer"] = {
|
|||||||
changed = true
|
changed = true
|
||||||
end
|
end
|
||||||
for timerId, bar in pairs(Private.ExecEnv.BossMods.Generic:GetAllTimers()) do
|
for timerId, bar in pairs(Private.ExecEnv.BossMods.Generic:GetAllTimers()) do
|
||||||
if Private.ExecEnv.BossMods.Generic:TimerMatchesGeneric(timerId, triggerText, triggerTextOperator, triggerSpellId, counter) then
|
if Private.ExecEnv.BossMods.Generic:TimerMatchesGeneric(timerId, triggerText, triggerTextOperator, triggerSpellId, counter, isBarEnabled) then
|
||||||
changed = copyOrSchedule(bar, timerId) or changed
|
changed = copyOrSchedule(bar, timerId) or changed
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1614,13 +1670,13 @@ Private.event_prototypes["Boss Mod Timer"] = {
|
|||||||
else
|
else
|
||||||
if event == "BossMod_TimerStart" or event == "BossMod_TimerUpdate" then
|
if event == "BossMod_TimerStart" or event == "BossMod_TimerUpdate" then
|
||||||
if extendTimer ~= 0 then
|
if extendTimer ~= 0 then
|
||||||
if Private.ExecEnv.BossMods.Generic:TimerMatchesGeneric(timerId, triggerText, triggerTextOperator, triggerSpellId, counter) then
|
if Private.ExecEnv.BossMods.Generic:TimerMatchesGeneric(timerId, triggerText, triggerTextOperator, triggerSpellId, counter, isBarEnabled) then
|
||||||
local bar = Private.ExecEnv.BossMods.Generic:GetTimerById(timerId)
|
local bar = Private.ExecEnv.BossMods.Generic:GetTimerById(timerId)
|
||||||
Private.ExecEnv.BossMods.Generic:ScheduleCheck(bar.expirationTime + extendTimer)
|
Private.ExecEnv.BossMods.Generic:ScheduleCheck(bar.expirationTime + extendTimer)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local bar = Private.ExecEnv.BossMods.Generic:GetTimerGeneric(triggerText, triggerTextOperator, triggerSpellId, extendTimer, counter)
|
local bar = Private.ExecEnv.BossMods.Generic:GetTimerGeneric(triggerText, triggerTextOperator, triggerSpellId, extendTimer, counter, isBarEnabled)
|
||||||
if bar then
|
if bar then
|
||||||
if extendTimer == 0
|
if extendTimer == 0
|
||||||
or not (state and state.show)
|
or not (state and state.show)
|
||||||
@@ -1651,6 +1707,7 @@ Private.event_prototypes["Boss Mod Timer"] = {
|
|||||||
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 and tonumber(trigger.remaining or 0) or 0,
|
trigger.remaining and tonumber(trigger.remaining or 0) or 0,
|
||||||
|
trigger.use_isBarEnabled == nil and "nil" or trigger.use_isBarEnabled and "true" or "false",
|
||||||
trigger.remaining_operator or "<"
|
trigger.remaining_operator or "<"
|
||||||
)
|
)
|
||||||
end,
|
end,
|
||||||
@@ -1664,7 +1721,6 @@ Private.event_prototypes["Boss Mod Timer"] = {
|
|||||||
conditionType = "string",
|
conditionType = "string",
|
||||||
noValidation = true,
|
noValidation = true,
|
||||||
showExactOption = false,
|
showExactOption = false,
|
||||||
negativeIsEJ = true
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = "message",
|
name = "message",
|
||||||
@@ -1690,6 +1746,15 @@ Private.event_prototypes["Boss Mod Timer"] = {
|
|||||||
type = "string",
|
type = "string",
|
||||||
conditionType = "string",
|
conditionType = "string",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name = "isBarEnabled",
|
||||||
|
display = L["Bar enabled in Boss Mod addon settings"],
|
||||||
|
desc = L["Test if bar is enabled in Boss Mod addon settings"],
|
||||||
|
type = "tristate",
|
||||||
|
test = "true",
|
||||||
|
init = "false",
|
||||||
|
conditionType = "bool",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name = "cloneId",
|
name = "cloneId",
|
||||||
display = L["Clone per Event"],
|
display = L["Clone per Event"],
|
||||||
@@ -1707,11 +1772,12 @@ Private.event_prototypes["Boss Mod Timer"] = {
|
|||||||
Private.category_event_prototype.addons["Boss Mod Timer"] = L["Boss Mod Timer"]
|
Private.category_event_prototype.addons["Boss Mod Timer"] = L["Boss Mod Timer"]
|
||||||
|
|
||||||
-- Disable DBM for users with an outdated DBM version and always disable BigWigs triggers
|
-- Disable DBM for users with an outdated DBM version and always disable BigWigs triggers
|
||||||
-- Only disable DBM triggers if the DBM version is older than 2025-Feb-09
|
-- Only disable DBM triggers if the DBM version is older than 2025-Feb-09 and 2025-Mar-12
|
||||||
-- References:
|
-- References:
|
||||||
-- Commit: https://github.com/Zidras/DBM-Warmane/commit/5791dac460a07225c5d617d0252a88ce1e210618
|
-- Commit: https://github.com/Zidras/DBM-Warmane/commit/5791dac460a07225c5d617d0252a88ce1e210618 - 20250209000000
|
||||||
|
-- Commit2: https://github.com/Zidras/DBM-Warmane/commit/b6804570cab39a1c0412f964d1f2c15a63b96eed - 20250312000000
|
||||||
-- Download: https://github.com/Zidras/DBM-Warmane/archive/refs/heads/main.zip
|
-- Download: https://github.com/Zidras/DBM-Warmane/archive/refs/heads/main.zip
|
||||||
if not (DBM and type(DBM.Revision) == "number" and DBM.Revision >= 20250209000000) then
|
if not (DBM and type(DBM.Revision) == "number" and DBM.Revision >= 20250312000000) then
|
||||||
local dbm_trigger = {
|
local dbm_trigger = {
|
||||||
"DBM Stage",
|
"DBM Stage",
|
||||||
"DBM Announce",
|
"DBM Announce",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
local AddonName, Private = ...
|
local AddonName, Private = ...
|
||||||
|
|
||||||
local internalVersion = 83.25
|
local internalVersion = 84
|
||||||
|
|
||||||
-- Lua APIs
|
-- Lua APIs
|
||||||
local insert = table.insert
|
local insert = table.insert
|
||||||
|
|||||||
Reference in New Issue
Block a user