diff --git a/WeakAuras/GenericTrigger.lua b/WeakAuras/GenericTrigger.lua index 1fe8722..f466d76 100644 --- a/WeakAuras/GenericTrigger.lua +++ b/WeakAuras/GenericTrigger.lua @@ -2453,6 +2453,7 @@ do local bars = {} local nextExpire -- time of next expiring timer local recheckTimer -- handle of timer + local currentStage = 0 local function dbmRecheckTimers() local now = GetTime() @@ -2542,6 +2543,10 @@ do end end WeakAuras.ScanEvents("DBM_TimerUpdate", id) + elseif event == "DBM_SetStage" then + local mod, modId, stage = ... + currentStage = stage + WeakAuras.ScanEvents("DBM_SetStage", ...) else -- DBM_Announce WeakAuras.ScanEvents(event, ...) end @@ -2583,6 +2588,10 @@ do return true end + function WeakAuras.GetDBMStage() + return currentStage + end + function WeakAuras.GetDBMTimerById(id) return bars[id] end diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index 4f4884a..e624933 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -3115,6 +3115,30 @@ Private.event_prototypes = { timedrequired = true }, -- DBM events + ["DBM Stage"] = { + type = "addons", + events = {}, + internal_events = { + "DBM_SetStage" + }, + name = L["DBM Stage"], + init = function(trigger) + WeakAuras.RegisterDBMCallback("DBM_SetStage"); + 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 = {}, @@ -6059,10 +6083,13 @@ Private.event_prototypes = { }; -if not (DBM and (tonumber(DBM.Revision) or 0) >= 7003) then +if not (DBM and DBM.ReleaseRevision >= 7003) then Private.event_prototypes["DBM Announce"] = nil Private.event_prototypes["DBM Timer"] = nil end +if not (DBM and DBM.ReleaseRevision >= 7005) then + Private.event_prototypes["DBM Stage"] = nil +end Private.event_prototypes["BigWigs Message"] = nil Private.event_prototypes["BigWigs Timer"] = nil