from retail

This commit is contained in:
NoM0Re
2025-01-16 21:11:14 +01:00
parent ba4039dae2
commit ec42e803b4
8 changed files with 186 additions and 141 deletions
+161 -91
View File
@@ -16,7 +16,6 @@ Private.ExecEnv.BossMods.DBM = {
CopyBarToState = function(self, bar, states, timerId, extendTimer) CopyBarToState = function(self, bar, states, timerId, extendTimer)
extendTimer = extendTimer or 0 extendTimer = extendTimer or 0
if extendTimer + bar.duration < 0 then return end
states[timerId] = states[timerId] or {} states[timerId] = states[timerId] or {}
local state = states[timerId] local state = states[timerId]
state.show = true state.show = true
@@ -127,10 +126,21 @@ Private.ExecEnv.BossMods.DBM = {
for timerId, bar in pairs(self.bars) do for timerId, bar in pairs(self.bars) do
if not bar.paused then if not bar.paused then
if bar.expirationTime < now then if bar.expirationTime < now then
self.bars[timerId] = nil if bar.scheduledScanExpireAt == nil or bar.scheduledScanExpireAt <= GetTime() then
WeakAuras.ScanEvents("DBM_TimerStop", timerId) self.bars[timerId] = nil
if self.isGeneric then else
WeakAuras.ScanEvents("BossMod_TimerStop", timerId) if self.nextExpire == nil then
self.nextExpire = bar.scheduledScanExpireAt
elseif bar.scheduledScanExpireAt < self.nextExpire then
self.nextExpire = bar.scheduledScanExpireAt
end
end
if not bar.expired then
bar.expired = true
WeakAuras.ScanEvents("DBM_TimerStop", timerId)
if self.isGeneric then
WeakAuras.ScanEvents("BossMod_TimerStop", timerId)
end
end end
elseif self.nextExpire == nil then elseif self.nextExpire == nil then
self.nextExpire = bar.expirationTime self.nextExpire = bar.expirationTime
@@ -166,6 +176,7 @@ Private.ExecEnv.BossMods.DBM = {
bar.spellId = tostring(spellId) bar.spellId = tostring(spellId)
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
local r, g, b = 0, 0, 0 local r, g, b = 0, 0, 0
if DBT.GetColorForType then if DBT.GetColorForType then
@@ -212,10 +223,16 @@ Private.ExecEnv.BossMods.DBM = {
end end
elseif event == "DBM_TimerStop" then elseif event == "DBM_TimerStop" then
local timerId = ... local timerId = ...
self.bars[timerId] = nil local bar = self.bars[timerId]
WeakAuras.ScanEvents("DBM_TimerStop", timerId) if bar then
if self.isGeneric then if bar.scheduledScanExpireAt == nil or bar.scheduledScanExpireAt <= GetTime() then
WeakAuras.ScanEvents("BossMod_TimerStop", timerId) self.bars[timerId] = nil
end
bar.expired = true
WeakAuras.ScanEvents("DBM_TimerStop", timerId)
if self.isGeneric then
WeakAuras.ScanEvents("BossMod_TimerStop", timerId)
end
end end
elseif event == "DBM_TimerPause" then elseif event == "DBM_TimerPause" then
local timerId = ... local timerId = ...
@@ -321,7 +338,7 @@ Private.ExecEnv.BossMods.DBM = {
ScheduleCheck = function(self, fireTime) ScheduleCheck = function(self, fireTime)
if not self.scheduled_scans[fireTime] then if not self.scheduled_scans[fireTime] then
self.scheduled_scans[fireTime] = timer:ScheduleTimerFixed(self.DoScan, fireTime - GetTime() + 0.1, self, fireTime) self.scheduled_scans[fireTime] = timer:ScheduleTimerFixed(self.DoScan, fireTime - GetTime(), self, fireTime)
end end
end end
} }
@@ -384,6 +401,7 @@ Private.event_prototypes["DBM Announce"] = {
type = "spell", type = "spell",
noValidation = true, noValidation = true,
showExactOption = false, showExactOption = false,
negativeIsEJ = true
}, },
{ {
name = "message", name = "message",
@@ -453,28 +471,43 @@ Private.event_prototypes["DBM Timer"] = {
local counter = counter local counter = counter
function copyOrSchedule(bar, cloneId) function copyOrSchedule(bar, cloneId)
local remainingTime
local changed
if bar.paused then
remainingTime = bar.remaining + extendTimer
else
remainingTime = bar.expirationTime - GetTime() + extendTimer
end
if triggerUseRemaining then if triggerUseRemaining then
local remainingTime if remainingTime > 0 and remainingTime %s triggerRemaining then
if bar.paused then
remainingTime = bar.remaining + extendTimer
else
remainingTime = bar.expirationTime - GetTime() + extendTimer
end
if remainingTime %s triggerRemaining then
Private.ExecEnv.BossMods.DBM:CopyBarToState(bar, states, cloneId, extendTimer) Private.ExecEnv.BossMods.DBM:CopyBarToState(bar, states, cloneId, extendTimer)
changed = true
else else
local state = states[cloneId] local state = states[cloneId]
if state and state.show then if state and state.show then
state.show = false state.show = false
state.changed = true state.changed = true
changed = true
end end
end end
if remainingTime >= triggerRemaining and not bar.paused then if not bar.paused then
Private.ExecEnv.BossMods.DBM:ScheduleCheck(bar.expirationTime - triggerRemaining + extendTimer) if extendTimer > 0 then
bar.scheduledScanExpireAt = math.max(bar.scheduledScanExpireAt or 0, bar.expirationTime + extendTimer)
end
if remainingTime >= triggerRemaining then
Private.ExecEnv.BossMods.DBM:ScheduleCheck(bar.expirationTime - triggerRemaining + extendTimer)
end
end end
else else
Private.ExecEnv.BossMods.DBM:CopyBarToState(bar, states, cloneId, extendTimer) if not bar.paused and extendTimer > 0 then
bar.scheduledScanExpireAt = math.max(bar.scheduledScanExpireAt or 0, bar.expirationTime + extendTimer)
end
if remainingTime > 0 then
Private.ExecEnv.BossMods.DBM:CopyBarToState(bar, states, cloneId, extendTimer)
changed = true
end
end end
return changed
end end
if useClone then if useClone then
@@ -485,13 +518,12 @@ Private.event_prototypes["DBM Timer"] = {
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) then
local bar = Private.ExecEnv.BossMods.DBM:GetTimerById(timerId) local bar = Private.ExecEnv.BossMods.DBM:GetTimerById(timerId)
if bar then if bar then
copyOrSchedule(bar, cloneId) return copyOrSchedule(bar, cloneId)
return true
end end
end end
elseif event == "DBM_TimerStop" and state then elseif event == "DBM_TimerStop" and state then
local bar_remainingTime = GetTime() - state.expirationTime + (state.extend or 0) local bar_remainingTime = state.expirationTime - GetTime() + (state.extend or 0)
if state.extend == 0 or bar_remainingTime > 0.2 then if state.extend == 0 or bar_remainingTime <= 0 then
state.show = false state.show = false
state.changed = true state.changed = true
return true return true
@@ -500,13 +532,12 @@ Private.event_prototypes["DBM Timer"] = {
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) then
copyOrSchedule(bar, timerId) changed = copyOrSchedule(bar, timerId) or changed
changed = true
else else
local state = states[timerId] local state = states[timerId]
if state then if state then
local bar_remainingTime = GetTime() - state.expirationTime + (state.extend or 0) local bar_remainingTime = state.expirationTime - GetTime() + (state.extend or 0)
if state.extend == 0 or bar_remainingTime > 0.2 then if state.extend == 0 or bar_remainingTime <= 0 then
state.show = false state.show = false
state.changed = true state.changed = true
changed = true changed = true
@@ -524,8 +555,7 @@ Private.event_prototypes["DBM Timer"] = {
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) then
copyOrSchedule(bar, timerId) changed = copyOrSchedule(bar, timerId) or changed
changed = true
end end
end end
return changed return changed
@@ -545,13 +575,12 @@ Private.event_prototypes["DBM Timer"] = {
or not (state and state.show) or not (state and state.show)
or (state and state.show and state.expirationTime > (bar.expirationTime + extendTimer)) or (state and state.show and state.expirationTime > (bar.expirationTime + extendTimer))
then then
copyOrSchedule(bar, cloneId) return copyOrSchedule(bar, cloneId)
return true
end end
else else
if state and state.show then if state and state.show then
local bar_remainingTime = GetTime() - state.expirationTime + (state.extend or 0) local bar_remainingTime = state.expirationTime - GetTime() + (state.extend or 0)
if state.extend == 0 or bar_remainingTime > 0.2 then if state.extend == 0 or bar_remainingTime <= 0 then
state.show = false state.show = false
state.changed = true state.changed = true
return true return true
@@ -565,7 +594,7 @@ Private.event_prototypes["DBM Timer"] = {
return ret:format( return ret:format(
trigger.use_count and trigger.count or "", trigger.use_count and trigger.count or "",
trigger.use_id and trigger.id or "", trigger.use_id and trigger.id or "",
trigger.use_spellId and trigger.spellId or "", trigger.use_spellId and tostring(trigger.spellId) or "",
trigger.use_message and trigger.message or "", trigger.use_message and trigger.message or "",
trigger.use_message and trigger.message_operator or "", trigger.use_message and trigger.message_operator or "",
trigger.use_cloneId and "true" or "false", trigger.use_cloneId and "true" or "false",
@@ -591,6 +620,7 @@ Private.event_prototypes["DBM Timer"] = {
conditionType = "string", conditionType = "string",
noValidation = true, noValidation = true,
showExactOption = false, showExactOption = false,
negativeIsEJ = true
}, },
{ {
name = "message", name = "message",
@@ -644,7 +674,6 @@ Private.ExecEnv.BossMods.BigWigs = {
CopyBarToState = function(self, bar, states, timerId, extendTimer) CopyBarToState = function(self, bar, states, timerId, extendTimer)
extendTimer = extendTimer or 0 extendTimer = extendTimer or 0
if extendTimer + bar.duration < 0 then return end
states[timerId] = states[timerId] or {} states[timerId] = states[timerId] or {}
local state = states[timerId] local state = states[timerId]
state.show = true state.show = true
@@ -749,10 +778,21 @@ Private.ExecEnv.BossMods.BigWigs = {
for timerId, bar in pairs(self.bars) do for timerId, bar in pairs(self.bars) do
if not bar.paused then if not bar.paused then
if bar.expirationTime < now then if bar.expirationTime < now then
self.bars[timerId] = nil if bar.scheduledScanExpireAt == nil or bar.scheduledScanExpireAt <= GetTime() then
WeakAuras.ScanEvents("BigWigs_StopBar", timerId) self.bars[timerId] = nil
if self.isGeneric then else
WeakAuras.ScanEvents("BossMod_TimerStop", timerId) if self.nextExpire == nil then
self.nextExpire = bar.scheduledScanExpireAt
elseif bar.scheduledScanExpireAt < self.nextExpire then
self.nextExpire = bar.scheduledScanExpireAt
end
end
if not bar.expired then
bar.expired = true
WeakAuras.ScanEvents("BigWigs_StopBar", timerId)
if self.isGeneric then
WeakAuras.ScanEvents("BossMod_TimerStop", timerId)
end
end end
elseif self.nextExpire == nil then elseif self.nextExpire == nil then
self.nextExpire = bar.expirationTime self.nextExpire = bar.expirationTime
@@ -789,6 +829,7 @@ Private.ExecEnv.BossMods.BigWigs = {
bar.expirationTime = expirationTime bar.expirationTime = expirationTime
bar.icon = icon bar.icon = icon
bar.isCooldown = isCD or false bar.isCooldown = isCD or false
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)
@@ -810,8 +851,11 @@ Private.ExecEnv.BossMods.BigWigs = {
end end
elseif event == "BigWigs_StopBar" then elseif event == "BigWigs_StopBar" then
local addon, text = ... local addon, text = ...
if self.bars[text] then local bar = self.bars[text]
self.bars[text] = nil if bar then
if bar.scheduledScanExpireAt == nil or bar.scheduledScanExpireAt <= GetTime() then
self.bars[text] = nil
end
WeakAuras.ScanEvents("BigWigs_StopBar", text) WeakAuras.ScanEvents("BigWigs_StopBar", text)
if self.isGeneric then if self.isGeneric then
WeakAuras.ScanEvents("BossMod_TimerStop", text) WeakAuras.ScanEvents("BossMod_TimerStop", text)
@@ -934,7 +978,7 @@ Private.ExecEnv.BossMods.BigWigs = {
ScheduleCheck = function(self, fireTime) ScheduleCheck = function(self, fireTime)
if not self.scheduled_scans[fireTime] then if not self.scheduled_scans[fireTime] then
self.scheduled_scans[fireTime] = timer:ScheduleTimerFixed(self.DoScan, fireTime - GetTime() + 0.1, self, fireTime) self.scheduled_scans[fireTime] = timer:ScheduleTimerFixed(self.DoScan, fireTime - GetTime(), self, fireTime)
end end
end end
} }
@@ -994,6 +1038,7 @@ Private.event_prototypes["BigWigs Message"] = {
conditionType = "string", conditionType = "string",
noValidation = true, noValidation = true,
showExactOption = false, showExactOption = false,
negativeIsEJ = true
}, },
{ {
name = "text", name = "text",
@@ -1064,28 +1109,43 @@ Private.event_prototypes["BigWigs Timer"] = {
local counter = counter local counter = counter
function copyOrSchedule(bar, cloneId) function copyOrSchedule(bar, cloneId)
local remainingTime
local changed
if bar.paused then
remainingTime = bar.remaining + extendTimer
else
remainingTime = bar.expirationTime - GetTime() + extendTimer
end
if triggerUseRemaining then if triggerUseRemaining then
local remainingTime if remainingTime > 0 and remainingTime %s triggerRemaining then
if bar.paused then
remainingTime = bar.remaining + extendTimer
else
remainingTime = bar.expirationTime - GetTime() + extendTimer
end
if remainingTime %s triggerRemaining then
Private.ExecEnv.BossMods.BigWigs:CopyBarToState(bar, states, cloneId, extendTimer) Private.ExecEnv.BossMods.BigWigs:CopyBarToState(bar, states, cloneId, extendTimer)
changed = true
else else
local state = states[cloneId] local state = states[cloneId]
if state and state.show then if state and state.show then
state.show = false state.show = false
state.changed = true state.changed = true
changed = true
end end
end end
if remainingTime >= triggerRemaining and not bar.paused then if not bar.paused then
Private.ExecEnv.BossMods.BigWigs:ScheduleCheck(bar.expirationTime - triggerRemaining + extendTimer) if extendTimer > 0 then
bar.scheduledScanExpireAt = math.max(bar.scheduledScanExpireAt or 0, bar.expirationTime + extendTimer)
end
if remainingTime >= triggerRemaining then
Private.ExecEnv.BossMods.BigWigs:ScheduleCheck(bar.expirationTime - triggerRemaining + extendTimer)
end
end end
else else
Private.ExecEnv.BossMods.BigWigs:CopyBarToState(bar, states, cloneId, extendTimer) if not bar.paused and extendTimer > 0 then
bar.scheduledScanExpireAt = math.max(bar.scheduledScanExpireAt or 0, bar.expirationTime + extendTimer)
end
if remainingTime > 0 then
Private.ExecEnv.BossMods.BigWigs:CopyBarToState(bar, states, cloneId, extendTimer)
changed = true
end
end end
return changed
end end
if useClone then if useClone then
@@ -1096,13 +1156,12 @@ Private.event_prototypes["BigWigs Timer"] = {
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) then
local bar = Private.ExecEnv.BossMods.BigWigs:GetTimerById(timerId) local bar = Private.ExecEnv.BossMods.BigWigs:GetTimerById(timerId)
if bar then if bar then
copyOrSchedule(bar, cloneId) return copyOrSchedule(bar, cloneId)
return true
end end
end end
elseif event == "BigWigs_StopBar" and state then elseif event == "BigWigs_StopBar" and state then
local bar_remainingTime = GetTime() - state.expirationTime + (state.extend or 0) local bar_remainingTime = state.expirationTime - GetTime() + (state.extend or 0)
if state.extend == 0 or bar_remainingTime > 0.2 then if state.extend == 0 or bar_remainingTime <= 0 then
state.show = false state.show = false
state.changed = true state.changed = true
return true return true
@@ -1111,8 +1170,7 @@ Private.event_prototypes["BigWigs Timer"] = {
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) then
copyOrSchedule(bar, timerId) changed = copyOrSchedule(bar, timerId) or changed
changed = true
end end
end end
return changed return changed
@@ -1125,8 +1183,7 @@ Private.event_prototypes["BigWigs Timer"] = {
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) then
copyOrSchedule(bar, timerId) changed = copyOrSchedule(bar, timerId) or changed
changed = true
end end
end end
return changed return changed
@@ -1146,13 +1203,12 @@ Private.event_prototypes["BigWigs Timer"] = {
or not (state and state.show) or not (state and state.show)
or (state and state.show and state.expirationTime > (bar.expirationTime + extendTimer)) or (state and state.show and state.expirationTime > (bar.expirationTime + extendTimer))
then then
copyOrSchedule(bar, cloneId) return copyOrSchedule(bar, cloneId)
return true
end end
else else
if state and state.show then if state and state.show then
local bar_remainingTime = GetTime() - state.expirationTime + (state.extend or 0) local bar_remainingTime = state.expirationTime - GetTime() + (state.extend or 0)
if state.extend == 0 or bar_remainingTime > 0.2 then if state.extend == 0 or bar_remainingTime <= 0 then
state.show = false state.show = false
state.changed = true state.changed = true
return true return true
@@ -1164,7 +1220,7 @@ Private.event_prototypes["BigWigs Timer"] = {
]=] ]=]
return ret:format( return ret:format(
trigger.use_count and trigger.count or "", trigger.use_count and trigger.count or "",
trigger.use_spellId and trigger.spellId or "", trigger.use_spellId and tostring(trigger.spellId) or "",
trigger.use_text and trigger.text or "", trigger.use_text and trigger.text or "",
trigger.use_text and trigger.text_operator or "", trigger.use_text and trigger.text_operator or "",
trigger.use_cloneId and "true" or "false", trigger.use_cloneId and "true" or "false",
@@ -1186,6 +1242,7 @@ Private.event_prototypes["BigWigs Timer"] = {
conditionType = "string", conditionType = "string",
noValidation = true, noValidation = true,
showExactOption = false, showExactOption = false,
negativeIsEJ = true
}, },
{ {
name = "text", name = "text",
@@ -1353,6 +1410,7 @@ Private.event_prototypes["Boss Mod Announce"] = {
conditionType = "string", conditionType = "string",
noValidation = true, noValidation = true,
showExactOption = false, showExactOption = false,
negativeIsEJ = true
}, },
{ {
name = "message", name = "message",
@@ -1429,28 +1487,43 @@ Private.event_prototypes["Boss Mod Timer"] = {
local counter = counter local counter = counter
function copyOrSchedule(bar, cloneId) function copyOrSchedule(bar, cloneId)
local remainingTime
local changed
if bar.paused then
remainingTime = bar.remaining + extendTimer
else
remainingTime = bar.expirationTime - GetTime() + extendTimer
end
if triggerUseRemaining then if triggerUseRemaining then
local remainingTime if remainingTime > 0 and remainingTime %s triggerRemaining then
if bar.paused then
remainingTime = bar.remaining + extendTimer
else
remainingTime = bar.expirationTime - GetTime() + extendTimer
end
if remainingTime %s triggerRemaining then
Private.ExecEnv.BossMods.Generic:CopyBarToState(bar, states, cloneId, extendTimer) Private.ExecEnv.BossMods.Generic:CopyBarToState(bar, states, cloneId, extendTimer)
changed = true
else else
local state = states[cloneId] local state = states[cloneId]
if state and state.show then if state and state.show then
state.show = false state.show = false
state.changed = true state.changed = true
changed = true
end end
end end
if remainingTime >= triggerRemaining and not bar.paused then if not bar.paused then
Private.ExecEnv.BossMods.Generic:ScheduleCheck(bar.expirationTime - triggerRemaining + extendTimer) if extendTimer > 0 then
bar.scheduledScanExpireAt = math.max(bar.scheduledScanExpireAt or 0, bar.expirationTime + extendTimer)
end
if remainingTime >= triggerRemaining then
Private.ExecEnv.BossMods.Generic:ScheduleCheck(bar.expirationTime - triggerRemaining + extendTimer)
end
end end
else else
Private.ExecEnv.BossMods.Generic:CopyBarToState(bar, states, cloneId, extendTimer) if not bar.paused and extendTimer > 0 then
bar.scheduledScanExpireAt = math.max(bar.scheduledScanExpireAt or 0, bar.expirationTime + extendTimer)
end
if remainingTime > 0 then
Private.ExecEnv.BossMods.Generic:CopyBarToState(bar, states, cloneId, extendTimer)
changed = true
end
end end
return changed
end end
if useClone then if useClone then
@@ -1461,13 +1534,12 @@ Private.event_prototypes["Boss Mod Timer"] = {
if Private.ExecEnv.BossMods.Generic:TimerMatchesGeneric(timerId, triggerText, triggerTextOperator, triggerSpellId, counter) then if Private.ExecEnv.BossMods.Generic:TimerMatchesGeneric(timerId, triggerText, triggerTextOperator, triggerSpellId, counter) then
local bar = Private.ExecEnv.BossMods.Generic:GetTimerById(timerId) local bar = Private.ExecEnv.BossMods.Generic:GetTimerById(timerId)
if bar then if bar then
copyOrSchedule(bar, cloneId) return copyOrSchedule(bar, cloneId)
return true
end end
end end
elseif event == "BossMod_TimerStop" and state then elseif event == "BossMod_TimerStop" and state then
local bar_remainingTime = GetTime() - state.expirationTime + (state.extend or 0) local bar_remainingTime = state.expirationTime - GetTime() + (state.extend or 0)
if state.extend == 0 or bar_remainingTime > 0.2 then if state.extend == 0 or bar_remainingTime <= 0 then
state.show = false state.show = false
state.changed = true state.changed = true
return true return true
@@ -1476,13 +1548,12 @@ Private.event_prototypes["Boss Mod Timer"] = {
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) then
copyOrSchedule(bar, timerId) changed = copyOrSchedule(bar, timerId) or changed
changed = true
else else
local state = states[timerId] local state = states[timerId]
if state then if state then
local bar_remainingTime = GetTime() - state.expirationTime + (state.extend or 0) local bar_remainingTime = state.expirationTime - GetTime() + (state.extend or 0)
if state.extend == 0 or bar_remainingTime > 0.2 then if state.extend == 0 or bar_remainingTime <= 0 then
state.show = false state.show = false
state.changed = true state.changed = true
changed = true changed = true
@@ -1500,8 +1571,7 @@ Private.event_prototypes["Boss Mod Timer"] = {
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) then
copyOrSchedule(bar, timerId) changed = copyOrSchedule(bar, timerId) or changed
changed = true
end end
end end
return changed return changed
@@ -1521,13 +1591,12 @@ Private.event_prototypes["Boss Mod Timer"] = {
or not (state and state.show) or not (state and state.show)
or (state and state.show and state.expirationTime > (bar.expirationTime + extendTimer)) or (state and state.show and state.expirationTime > (bar.expirationTime + extendTimer))
then then
copyOrSchedule(bar, cloneId) return copyOrSchedule(bar, cloneId)
return true
end end
else else
if state and state.show then if state and state.show then
local bar_remainingTime = GetTime() - state.expirationTime + (state.extend or 0) local bar_remainingTime = state.expirationTime - GetTime() + (state.extend or 0)
if state.extend == 0 or bar_remainingTime > 0.2 then if state.extend == 0 or bar_remainingTime <= 0 then
state.show = false state.show = false
state.changed = true state.changed = true
return true return true
@@ -1540,7 +1609,7 @@ Private.event_prototypes["Boss Mod Timer"] = {
return ret:format( return ret:format(
trigger.use_count and trigger.count or "", trigger.use_count and trigger.count or "",
trigger.use_spellId and trigger.spellId or "", trigger.use_spellId and tostring(trigger.spellId) or "",
trigger.use_message and trigger.message or "", trigger.use_message and trigger.message or "",
trigger.use_message and trigger.message_operator or "", trigger.use_message and trigger.message_operator or "",
trigger.use_cloneId and "true" or "false", trigger.use_cloneId and "true" or "false",
@@ -1560,6 +1629,7 @@ Private.event_prototypes["Boss Mod Timer"] = {
conditionType = "string", conditionType = "string",
noValidation = true, noValidation = true,
showExactOption = false, showExactOption = false,
negativeIsEJ = true
}, },
{ {
name = "message", name = "message",
+16 -1
View File
@@ -365,7 +365,11 @@ local function UpdateMatchData(time, matchDataChanged, unit, index, filter, name
-- Tell old auras that used this match data -- Tell old auras that used this match data
for id, triggerData in pairs(data.auras) do for id, triggerData in pairs(data.auras) do
for triggernum in pairs(triggerData) do for triggernum in pairs(triggerData) do
if matchDataByTrigger[id] and matchDataByTrigger[id][triggernum] and matchDataByTrigger[id][triggernum][unit] and matchDataByTrigger[id][triggernum][unit][index] then if matchDataByTrigger[id]
and matchDataByTrigger[id][triggernum]
and matchDataByTrigger[id][triggernum][unit]
and matchDataByTrigger[id][triggernum][unit][index]
then
matchDataByTrigger[id][triggernum][unit][index] = nil matchDataByTrigger[id][triggernum][unit][index] = nil
matchDataChanged[id] = matchDataChanged[id] or {} matchDataChanged[id] = matchDataChanged[id] or {}
matchDataChanged[id][triggernum] = true matchDataChanged[id][triggernum] = true
@@ -1815,6 +1819,17 @@ local function EventHandler(frame, event, arg1, arg2, ...)
tinsert(unitsToRemove, unit) tinsert(unitsToRemove, unit)
end end
end end
if arg1 then
-- Initial login has a bug where the tooltip information is not available,
-- so update tooltips 2s after login
timer:ScheduleTimer(function()
for unit, matchtDataPerUnit in pairs(matchData) do
EventHandler(frame, "UNIT_AURA", unit)
end
end, 2)
end
elseif event == "RAID_TARGET_UPDATE" then elseif event == "RAID_TARGET_UPDATE" then
ScanRaidMarkScanFunc(matchDataChanged) ScanRaidMarkScanFunc(matchDataChanged)
end end
+4 -1
View File
@@ -1398,10 +1398,13 @@ function Private.Modernize(data)
"spellId", "spellId",
"spellName", "spellName",
}, },
["Spell Cast Succeeded"] = {
"spellId"
},
["Location"] = { ["Location"] = {
"zone", "zone",
"subzone", "subzone",
} },
} }
for _, triggerData in ipairs(data.triggers) do for _, triggerData in ipairs(data.triggers) do
local t = triggerData.trigger local t = triggerData.trigger
+2 -2
View File
@@ -985,7 +985,7 @@ Private.load_prototype = {
name = "spellknown", name = "spellknown",
display = L["Spell Known"], display = L["Spell Known"],
type = "spell", type = "spell",
test = "WeakAuras.IsSpellKnownForLoad(%s, %s)", test = "WeakAuras.IsSpellKnownForLoad(%q, %s)",
events = {"SPELLS_CHANGED", "UNIT_PET"}, events = {"SPELLS_CHANGED", "UNIT_PET"},
showExactOption = true showExactOption = true
}, },
@@ -993,7 +993,7 @@ Private.load_prototype = {
name = "not_spellknown", name = "not_spellknown",
display = WeakAuras.newFeatureString .. L["|cFFFF0000Not|r Spell Known"], display = WeakAuras.newFeatureString .. L["|cFFFF0000Not|r Spell Known"],
type = "spell", type = "spell",
test = "not WeakAuras.IsSpellKnownForLoad(%s, %s)", test = "not WeakAuras.IsSpellKnownForLoad(%q, %s)",
events = {"SPELLS_CHANGED", "UNIT_PET"}, events = {"SPELLS_CHANGED", "UNIT_PET"},
showExactOption = true showExactOption = true
}, },
+1 -1
View File
@@ -5114,7 +5114,7 @@ function Private.AnchorFrame(data, region, parent, force)
local anchorPoint = data.anchorPoint local anchorPoint = data.anchorPoint
if data.parent then if data.parent then
if data.anchorFrameType == "SCREEN" or data.anchorFrameType == "UIPARENT" or data.anchorFrameType == "MOUSE" then if data.anchorFrameType == "SCREEN" or data.anchorFrameType == "MOUSE" then
anchorPoint = "CENTER" anchorPoint = "CENTER"
end end
else else
@@ -71,54 +71,12 @@ local methods = {
self.menu = {} self.menu = {}
self.frame:SetScript("OnMouseUp", function()
Hide_Tooltip()
self:SetMenu()
EasyMenu(self.menu, WeakAuras_DropDownMenu, self.frame, 0, 0, "MENU")
end)
self.frame:SetScript("OnEnter", function() self.frame:SetScript("OnEnter", function()
self:SetNormalTooltip() self:SetNormalTooltip()
Show_Long_Tooltip(self.frame, self.frame.description) Show_Long_Tooltip(self.frame, self.frame.description)
end) end)
self.frame:SetScript("OnLeave", Hide_Tooltip) self.frame:SetScript("OnLeave", Hide_Tooltip)
end, end,
["SetMenu"] = function(self)
wipe(self.menu)
for auraId in pairs(self.linkedAuras) do
if not self.linkedChildren[auraId] then
tinsert(self.menu,
{
text = auraId,
notCheckable = true,
hasArrow = true,
menuList = {
{
text = L["Update"],
notCheckable = true,
func = function()
local auraData = WeakAuras.GetData(auraId)
if auraData then
local success, error = WeakAuras.Import(self.companionData.encoded, auraData)
if not success and error ~= nil then
WeakAuras.prettyPrint(error)
end
end
end
},
{
text = L["Ignore updates"],
notCheckable = true,
func = function()
StaticPopup_Show("WEAKAURAS_CONFIRM_IGNORE_UPDATES", "", "", auraId)
end
}
}
}
)
end
end
end,
["SetLogo"] = function(self, path) ["SetLogo"] = function(self, path)
self.frame.updateLogo.tex:SetTexture(path) self.frame.updateLogo.tex:SetTexture(path)
end, end,
-1
View File
@@ -205,7 +205,6 @@ local function CreateNameOptions(aura_options, data, trigger, size, isExactSpell
end, end,
validate = isExactSpellId and WeakAuras.ValidateNumeric or nil, validate = isExactSpellId and WeakAuras.ValidateNumeric or nil,
control = "WeakAurasInputFocus", control = "WeakAurasInputFocus",
getWithFocus = function() return trigger[optionKey] and trigger[optionKey][i] or "" end
} }
end end
-- VALIDATE ? -- VALIDATE ?
+2 -2
View File
@@ -1158,7 +1158,7 @@ local function PositionOptions(id, data, _, hideWidthHeight, disableSelfPoint, g
if IsParentDynamicGroup() then if IsParentDynamicGroup() then
return true return true
end end
return data.anchorFrameType == "SCREEN" or data.anchorFrameType == "UIPARENT" or data.anchorFrameType == "MOUSE"; return data.anchorFrameType == "SCREEN" or data.anchorFrameType == "MOUSE";
else else
return data.anchorFrameType == "MOUSE"; return data.anchorFrameType == "MOUSE";
end end
@@ -1175,7 +1175,7 @@ local function PositionOptions(id, data, _, hideWidthHeight, disableSelfPoint, g
if IsGroupByFrame() then if IsGroupByFrame() then
return true return true
end end
if (data.anchorFrameType ~= "SCREEN" and data.anchorFrameType ~= "UIPARENT") then if (data.anchorFrameType ~= "SCREEN") then
return true; return true;
end end
if (data.parent) then if (data.parent) then