Open Raid update

This commit is contained in:
Tercio Jose
2024-08-19 11:50:23 -03:00
committed by andrew6180
parent a1b78cf9bd
commit d10c2083c5
+16 -4
View File
@@ -31,7 +31,7 @@ LIB_OPEN_RAID_CAN_LOAD = false
local major = "LibOpenRaid-1.0" local major = "LibOpenRaid-1.0"
local CONST_LIB_VERSION = 137 local CONST_LIB_VERSION = 138
if (LIB_OPEN_RAID_MAX_VERSION) then if (LIB_OPEN_RAID_MAX_VERSION) then
if (CONST_LIB_VERSION <= LIB_OPEN_RAID_MAX_VERSION) then if (CONST_LIB_VERSION <= LIB_OPEN_RAID_MAX_VERSION) then
@@ -534,10 +534,17 @@ end
registeredUniqueTimers = {} registeredUniqueTimers = {}
} }
local timersCanRunWithoutGroup = {
["mainControl"] = {
["updatePlayerData_Schedule"] = true
}
}
--run a scheduled function with its payload --run a scheduled function with its payload
local triggerScheduledTick = function(tickerObject) local triggerScheduledTick = function(tickerObject)
local payload = tickerObject.payload local payload = tickerObject.payload
local callback = tickerObject.callback local callback = tickerObject.callback
local bCanRunWithoutGroup = tickerObject.bCanRunWithoutGroup
if (tickerObject.isUnique) then if (tickerObject.isUnique) then
local namespace = tickerObject.namespace local namespace = tickerObject.namespace
@@ -547,7 +554,9 @@ end
--check if the player is still in group --check if the player is still in group
if (not openRaidLib.IsInGroup()) then if (not openRaidLib.IsInGroup()) then
return if (not bCanRunWithoutGroup) then
return
end
end end
local result, errortext = xpcall(callback, geterrorhandler(), unpack(payload)) local result, errortext = xpcall(callback, geterrorhandler(), unpack(payload))
@@ -559,9 +568,10 @@ end
end end
--create a new schedule --create a new schedule
function openRaidLib.Schedules.NewTimer(time, callback, ...) function openRaidLib.Schedules.NewTimer(time, callback, bCanRunWithoutGroup, ...)
local payload = {...} local payload = {...}
local newTimer = C_Timer.NewTimer(time, triggerScheduledTick) local newTimer = C_Timer.NewTimer(time, triggerScheduledTick)
newTimer.bCanRunWithoutGroup = bCanRunWithoutGroup
newTimer.payload = payload newTimer.payload = payload
newTimer.callback = callback newTimer.callback = callback
--newTimer.stack = debugstack() --newTimer.stack = debugstack()
@@ -581,7 +591,9 @@ end
openRaidLib.Schedules.CancelUniqueTimer(namespace, scheduleName) openRaidLib.Schedules.CancelUniqueTimer(namespace, scheduleName)
end end
local newTimer = openRaidLib.Schedules.NewTimer(time, callback, ...) local bCanRunWithoutGroup = timersCanRunWithoutGroup[namespace] and timersCanRunWithoutGroup[namespace][scheduleName]
local newTimer = openRaidLib.Schedules.NewTimer(time, callback, bCanRunWithoutGroup, ...)
newTimer.namespace = namespace newTimer.namespace = namespace
newTimer.scheduleName = scheduleName newTimer.scheduleName = scheduleName
--newTimer.stack = debugstack() --newTimer.stack = debugstack()