Release Candidate 1

This commit is contained in:
Tercio Jose
2022-11-18 16:54:25 -03:00
parent bbbda84c68
commit 1c8dfb3ab7
96 changed files with 3053 additions and 1427 deletions
+49
View File
@@ -1029,3 +1029,52 @@ end
return colorPickButton
end
function DF:SetRegularButtonTexture(button, texture, left, right, top, bottom)
if (type(left) == "table") then
left, right, top, bottom = unpack(left)
end
if (not left) then
left, right, top, bottom = 0, 1, 0, 1
end
local atlas
if (type(texture) == "string") then
atlas = C_Texture.GetAtlasInfo(texture)
end
local normalTexture = button:GetNormalTexture()
local pushedTexture = button:GetPushedTexture()
local highlightTexture = button:GetHightlightTexture()
local disabledTexture = button:GetDisabledTexture()
if (atlas) then
normalTexture:SetAtlas(texture)
pushedTexture:SetAtlas(texture)
highlightTexture:SetAtlas(texture)
disabledTexture:SetAtlas(texture)
else
normalTexture:SetTexture(texture)
pushedTexture:SetTexture(texture)
highlightTexture:SetTexture(texture)
disabledTexture:SetTexture(texture)
normalTexture:SetTexCoord(left, right, top, bottom)
pushedTexture:SetTexCoord(left, right, top, bottom)
highlightTexture:SetTexCoord(left, right, top, bottom)
disabledTexture:SetTexCoord(left, right, top, bottom)
end
end
function DF:SetRegularButtonVertexColor(button, ...)
local r, g, b, a = DF:ParseColor(...)
local normalTexture = button:GetNormalTexture()
local pushedTexture = button:GetPushedTexture()
local highlightTexture = button:GetHightlightTexture()
local disabledTexture = button:GetDisabledTexture()
normalTexture:SetVertexColor(r, g, b, a)
pushedTexture:SetVertexColor(r, g, b, a)
highlightTexture:SetVertexColor(r, g, b, a)
disabledTexture:SetVertexColor(r, g, b, a)
end
+4 -2
View File
@@ -28,6 +28,8 @@ function DF:CreateCoolTip()
return
end
local maxStatusBarValue = 100000000
local defaultBackdrop = {bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1,
tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}
local defaultBackdropColor = {0.1215, 0.1176, 0.1294, 0.8000}
@@ -1159,7 +1161,7 @@ function DF:CreateCoolTip()
function gameCooltip:StatusBar(menuButton, statusBarSettings)
if (statusBarSettings) then
menuButton.statusbar:SetValue(statusBarSettings[1])
menuButton.statusbar:SetValue(Clamp(statusBarSettings[1], 0, maxStatusBarValue))
menuButton.statusbar:SetStatusBarColor(statusBarSettings[2], statusBarSettings[3], statusBarSettings[4], statusBarSettings[5])
menuButton.statusbar:SetHeight(20 + (gameCooltip.OptionsTable.StatusBarHeightMod or 0))
@@ -1171,7 +1173,7 @@ function DF:CreateCoolTip()
end
if (statusBarSettings[7]) then
menuButton.statusbar2:SetValue(statusBarSettings[7].value)
menuButton.statusbar2:SetValue(Clamp(statusBarSettings[7].value, 0, maxStatusBarValue))
menuButton.statusbar2.texture:SetTexture(statusBarSettings[7].texture or [[Interface\RaidFrame\Raid-Bar-Hp-Fill]])
if (statusBarSettings[7].specialSpark) then
menuButton.spark2:Show()
+84 -20
View File
@@ -191,10 +191,10 @@ DF:Mixin(DropDownMetaFunctions, DF.ScriptHookMixin)
--menu width and height
function DropDownMetaFunctions:SetMenuSize(width, height)
if (width) then
return rawset(self, "realsizeW", width)
rawset(self, "realsizeW", width)
end
if (height) then
return rawset(self, "realsizeH", height)
rawset(self, "realsizeH", height)
end
end
@@ -515,6 +515,18 @@ function DropDownMetaFunctions:Selected(thisOption)
self.label:SetPoint("left", self.label:GetParent(), "left", 4, 0)
end
if (thisOption.centerTexture) then
self.dropdown.centerTexture:SetTexture(thisOption.centerTexture)
else
self.dropdown.centerTexture:SetTexture("")
end
if (thisOption.rightTexture) then
self.dropdown.rightTexture:SetTexture(thisOption.rightTexture)
else
self.dropdown.rightTexture:SetTexture("")
end
if (thisOption.statusbar) then
self.statusbar:SetTexture(thisOption.statusbar)
if (thisOption.statusbarcolor) then
@@ -540,6 +552,7 @@ function DropDownMetaFunctions:Selected(thisOption)
self:SetValue(thisOption.value)
end
--on click on any option in the dropdown
function DetailsFrameworkDropDownOptionClick(button)
--update name and icon on main frame
button.object:Selected(button.table)
@@ -555,9 +568,11 @@ function DetailsFrameworkDropDownOptionClick(button)
button.object.myvaluelabel = button.table.label
end
--on click on the dropdown show the menu frame with the options to select
function DropDownMetaFunctions:Open()
self.dropdown.dropdownframe:Show()
self.dropdown.dropdownborder:Show()
self.opened = true
if (lastOpened) then
lastOpened:Close()
@@ -565,6 +580,7 @@ function DropDownMetaFunctions:Open()
lastOpened = self
end
--close the menu showing the options
function DropDownMetaFunctions:Close()
--when menu is being close, just hide the border and the script will call back this again
if (self.dropdown.dropdownborder:IsShown()) then
@@ -585,6 +601,7 @@ function DetailsFrameworkDropDownOptionsFrameOnHide(self)
self:GetParent().MyObject:Close()
end
--on enter an option in the menu dropdown
function DetailsFrameworkDropDownOptionOnEnter(self)
if (self.table.desc) then
GameCooltip2:Preset(2)
@@ -603,10 +620,22 @@ function DetailsFrameworkDropDownOptionOnEnter(self)
self.tooltip = true
end
if (self.table.audiocue) then
if (DF.CurrentSoundHandle) then
StopSound(DF.CurrentSoundHandle, 0.1)
end
local willPlay, soundHandle = PlaySoundFile(self.table.audiocue, "Master")
if (willPlay) then
DF.CurrentSoundHandle = soundHandle
end
end
self:GetParent().mouseover:SetPoint("left", self)
self:GetParent().mouseover:Show()
end
--on leave an option on the menu dropdown
function DetailsFrameworkDropDownOptionOnLeave(frame)
if (frame.table.desc) then
GameCooltip2:ShowMe(false)
@@ -615,6 +644,7 @@ function DetailsFrameworkDropDownOptionOnLeave(frame)
end
--@button is the raw button frame, object is the button capsule
--click on the main dropdown frame (not the menu options popup)
function DetailsFrameworkDropDownOnMouseDown(button, buttontype)
local object = button.MyObject
@@ -645,9 +675,9 @@ function DetailsFrameworkDropDownOnMouseDown(button, buttontype)
end
for tindex, thisOption in ipairs(optionsTable) do
local show = isOptionVisible(button, thisOption)
local bIsOptionVisible = isOptionVisible(button, thisOption)
if (show) then
if (bIsOptionVisible) then
local thisOptionFrame = object.menus[i]
showing = showing + 1
@@ -657,14 +687,26 @@ function DetailsFrameworkDropDownOnMouseDown(button, buttontype)
thisOptionFrame = DF:CreateDropdownButton(parent, name)
local optionIndex = i - 1
thisOptionFrame:SetPoint("topleft", parent, "topleft", 1, (-optionIndex*20)-0)
thisOptionFrame:SetPoint("topright", parent, "topright", 0, (-optionIndex*20)-0)
thisOptionFrame:SetPoint("topleft", parent, "topleft", 1, (-optionIndex * 20))
thisOptionFrame:SetPoint("topright", parent, "topright", 0, (-optionIndex * 20))
thisOptionFrame.object = object
object.menus[i] = thisOptionFrame
end
thisOptionFrame:SetFrameStrata(thisOptionFrame:GetParent():GetFrameStrata())
thisOptionFrame:SetFrameLevel(thisOptionFrame:GetParent():GetFrameLevel()+10)
thisOptionFrame:SetFrameLevel(thisOptionFrame:GetParent():GetFrameLevel() + 10)
if (thisOption.rightTexture) then
thisOptionFrame.rightTexture:SetTexture(thisOption.rightTexture)
else
thisOptionFrame.rightTexture:SetTexture("")
end
if (thisOption.centerTexture) then
thisOptionFrame.centerTexture:SetTexture(thisOption.centerTexture)
else
thisOptionFrame.centerTexture:SetTexture("")
end
thisOptionFrame.icon:SetTexture(thisOption.icon)
if (thisOption.icon) then
@@ -742,8 +784,8 @@ function DetailsFrameworkDropDownOnMouseDown(button, buttontype)
thisOptionFrame.table = thisOption
local labelwitdh = thisOptionFrame.label:GetStringWidth()
if (labelwitdh+40 > frameWitdh) then
frameWitdh = labelwitdh+40
if (labelwitdh + 40 > frameWitdh) then
frameWitdh = labelwitdh + 40
end
thisOptionFrame:Show()
@@ -763,7 +805,7 @@ function DetailsFrameworkDropDownOnMouseDown(button, buttontype)
local size = object.realsizeH
if (showing*20 > size) then
if (showing * 20 > size) then
--show scrollbar and setup scroll
object:ShowScroll()
scrollFrame:EnableMouseWheel(true)
@@ -817,6 +859,10 @@ function DetailsFrameworkDropDownOnMouseDown(button, buttontype)
end
object:Open()
--scrollFrame:SetHeight(300)
--scrollChild:SetHeight(300)
--scrollBorder:SetHeight(300)
else
--clear menu
end
@@ -1050,8 +1096,8 @@ function DF:NewDropDown(parent, container, name, member, width, height, func, de
end
dropDownObject.func = func
dropDownObject.realsizeW = 150
dropDownObject.realsizeH = 150
dropDownObject.realsizeW = 165
dropDownObject.realsizeH = 300
dropDownObject.FixedValue = nil
dropDownObject.opened = false
dropDownObject.menus = {}
@@ -1138,6 +1184,16 @@ function DF:CreateNewDropdownFrame(parent, name)
icon:SetVertexColor(1, 1, 1, 0.4)
newDropdownFrame.icon = icon
local rightTexture = newDropdownFrame:CreateTexture("$parent_RightTexture", "OVERLAY")
rightTexture:SetPoint("right", newDropdownFrame, "right", -2, 0)
rightTexture:SetSize(20, 20)
newDropdownFrame.rightTexture = rightTexture
local centerTexture = newDropdownFrame:CreateTexture("$parent_CenterTexture", "OVERLAY")
centerTexture:SetPoint("center", newDropdownFrame, "center", 0, 0)
centerTexture:SetSize(20, 20)
newDropdownFrame.centerTexture = centerTexture
local text = newDropdownFrame:CreateFontString("$parent_Text", "ARTWORK", "GameFontHighlightSmall")
text:SetPoint("left", icon, "right", 5, 0)
text:SetJustifyH("left")
@@ -1168,33 +1224,31 @@ function DF:CreateNewDropdownFrame(parent, name)
local border = CreateFrame("frame", "$Parent_Border", newDropdownFrame, "BackdropTemplate")
border:Hide()
border:SetFrameStrata("FULLSCREEN")
border:SetSize(150, 150)
border:SetSize(150, 300)
border:SetPoint("topleft", newDropdownFrame, "bottomleft", 0, 0)
border:SetBackdrop(borderBackdrop)
border:SetScript("OnHide", DetailsFrameworkDropDownOptionsFrameOnHide)
border:SetBackdropColor(0, 0, 0, 0.92)
border:SetBackdropBorderColor(0, 0, 0, 1)
border:SetBackdropBorderColor(.2, .2, .2, 0.8)
newDropdownFrame.dropdownborder = border
local scroll = CreateFrame("ScrollFrame", "$Parent_ScrollFrame", newDropdownFrame, "BackdropTemplate")
scroll:SetFrameStrata("FULLSCREEN")
scroll:SetSize(150, 150)
scroll:SetSize(150, 300)
scroll:SetPoint("topleft", newDropdownFrame, "bottomleft", 0, 0)
scroll:Hide()
newDropdownFrame.dropdownframe = scroll
local child = CreateFrame("frame", "$Parent_ScrollChild", scroll, "BackdropTemplate")
child:SetSize(150, 150)
--child:SetAllPoints()
child:SetSize(150, 300)
child:SetPoint("topleft", scroll, "topleft", 0, 0)
child:SetBackdrop(childBackdrop)
child:SetBackdropColor(0, 0, 0, 1)
DF:ApplyStandardBackdrop(child)
local backgroundTexture = child:CreateTexture(nil, "background")
backgroundTexture:SetAllPoints()
backgroundTexture:SetColorTexture(0, 0, 0, 1)
DF:ApplyStandardBackdrop(child)
local selected = child:CreateTexture("$parent_SelectedTexture", "BACKGROUND")
selected:SetSize(150, 16)
selected:SetPoint("left", child, "left", 2, 0)
@@ -1243,6 +1297,16 @@ function DF:CreateDropdownButton(parent, name)
rightButton:SetPoint("right", newButton, "right", -2, 0)
rightButton:Hide()
local rightTexture = newButton:CreateTexture("$parent_RightTexture", "OVERLAY")
rightTexture:SetPoint("right", newButton, "right", -2, 0)
rightTexture:SetSize(20, 20)
newButton.rightTexture = rightTexture
local centerTexture = newButton:CreateTexture("$parent_CenterTexture", "OVERLAY")
centerTexture:SetPoint("center", newButton, "center", 0, 0)
centerTexture:SetSize(20, 20)
newButton.centerTexture = centerTexture
newButton:SetScript("OnMouseDown", DetailsFrameworkDropDownOptionClick)
newButton:SetScript("OnEnter", DetailsFrameworkDropDownOptionOnEnter)
newButton:SetScript("OnLeave", DetailsFrameworkDropDownOptionOnLeave)
+9 -3
View File
@@ -1,6 +1,6 @@
local dversion = 387
local dversion = 393
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary(major, minor)
@@ -694,7 +694,7 @@ function DF:GroupIterator(callback, ...)
end
end
function DF:IntegerToTimer(value)
function DF:IntegerToTimer(value) --~formattime
return "" .. floor(value/60) .. ":" .. format("%02.f", value%60)
end
@@ -3372,7 +3372,12 @@ end
--this is most copied from the wow client code, few changes applied to customize it
function DF:CreateGlowOverlay (parent, antsColor, glowColor)
local glowFrame = CreateFrame("frame", parent:GetName() and "$parentGlow2" or "OverlayActionGlow" .. math.random(1, 10000000), parent, "ActionBarButtonSpellActivationAlert")
local pName = parent:GetName()
local fName = pName and (pName.."Glow2") or "OverlayActionGlow" .. math.random(1, 10000000)
if fName and string.len(fName) > 50 then -- shorten to work around too long names
fName = strsub(fName, string.len(fName)-49)
end
local glowFrame = CreateFrame("frame", fName, parent, "ActionBarButtonSpellActivationAlert")
glowFrame:HookScript ("OnShow", glow_overlay_onshow)
glowFrame:HookScript ("OnHide", glow_overlay_onhide)
@@ -4827,6 +4832,7 @@ end
["getglobal"] = true,
["setmetatable"] = true,
["DevTools_DumpCommand"] = true,
["ChatEdit_SendText"] = true,
--avoid creating macros
["SetBindingMacro"] = true,
+93 -48
View File
@@ -1971,48 +1971,64 @@ function detailsFramework:CreateScaleBar(frame, config) --~scale
end
local no_options = {}
function detailsFramework:CreateSimplePanel(parent, w, h, title, name, panel_options, db)
if (db and name and not db [name]) then
db [name] = {scale = 1}
--[=[
options available to panel_options:
NoScripts = false, --if true, won't set OnMouseDown and OnMouseUp (won't be movable)
NoTUISpecialFrame = false, --if true, won't add the frame to 'UISpecialFrames'
DontRightClickClose = false, --if true, won't make the frame close when clicked with the right mouse button
UseScaleBar = false, --if true, will create a scale bar in the top left corner (require a table on 'db' to save the scale)
UseStatusBar = false, --if true, creates a status bar at the bottom of the frame (frame.StatusBar)
NoCloseButton = false, --if true, won't show the close button
NoTitleBar = false, --if true, don't create the title bar
]=]
function detailsFramework:CreateSimplePanel(parent, width, height, title, frameName, panelOptions, savedVariableTable)
if (savedVariableTable and frameName and not savedVariableTable[frameName]) then
savedVariableTable[frameName] = {
scale = 1
}
end
if (not name) then
name = "DetailsFrameworkSimplePanel" .. detailsFramework.SimplePanelCounter
if (not frameName) then
frameName = "DetailsFrameworkSimplePanel" .. detailsFramework.SimplePanelCounter
detailsFramework.SimplePanelCounter = detailsFramework.SimplePanelCounter + 1
end
if (not parent) then
parent = UIParent
end
panel_options = panel_options or no_options
panelOptions = panelOptions or no_options
local f = CreateFrame("frame", name, UIParent,"BackdropTemplate")
f:SetSize(w or 400, h or 250)
f:SetPoint("center", UIParent, "center", 0, 0)
f:SetFrameStrata("FULLSCREEN")
f:EnableMouse()
f:SetMovable(true)
f:SetBackdrop(SimplePanel_frame_backdrop)
f:SetBackdropColor(unpack(SimplePanel_frame_backdrop_color))
f:SetBackdropBorderColor(unpack(SimplePanel_frame_backdrop_border_color))
local simplePanel = CreateFrame("frame", frameName, UIParent,"BackdropTemplate")
simplePanel:SetSize(width or 400, height or 250)
simplePanel:SetPoint("center", UIParent, "center", 0, 0)
simplePanel:SetFrameStrata("FULLSCREEN")
simplePanel:EnableMouse()
simplePanel:SetMovable(true)
simplePanel:SetBackdrop(SimplePanel_frame_backdrop)
simplePanel:SetBackdropColor(unpack(SimplePanel_frame_backdrop_color))
simplePanel:SetBackdropBorderColor(unpack(SimplePanel_frame_backdrop_border_color))
f.DontRightClickClose = panel_options.DontRightClickClose
simplePanel.DontRightClickClose = panelOptions.DontRightClickClose
if (not panel_options.NoTUISpecialFrame) then
tinsert(UISpecialFrames, name)
if (not panelOptions.NoTUISpecialFrame) then
tinsert(UISpecialFrames, frameName)
end
local title_bar = CreateFrame("frame", name .. "TitleBar", f,"BackdropTemplate")
title_bar:SetPoint("topleft", f, "topleft", 2, -3)
title_bar:SetPoint("topright", f, "topright", -2, -3)
title_bar:SetHeight(20)
title_bar:SetBackdrop(SimplePanel_frame_backdrop)
title_bar:SetBackdropColor(.2, .2, .2, 1)
title_bar:SetBackdropBorderColor(0, 0, 0, 1)
f.TitleBar = title_bar
if (panelOptions.UseStatusBar) then
local statusBar = detailsFramework:CreateStatusBar(simplePanel)
simplePanel.StatusBar = statusBar
end
local close = CreateFrame("button", name and name .. "CloseButton", title_bar)
local titleBar = CreateFrame("frame", frameName .. "TitleBar", simplePanel,"BackdropTemplate")
titleBar:SetPoint("topleft", simplePanel, "topleft", 2, -3)
titleBar:SetPoint("topright", simplePanel, "topright", -2, -3)
titleBar:SetHeight(20)
titleBar:SetBackdrop(SimplePanel_frame_backdrop)
titleBar:SetBackdropColor(.2, .2, .2, 1)
titleBar:SetBackdropBorderColor(0, 0, 0, 1)
simplePanel.TitleBar = titleBar
local close = CreateFrame("button", frameName and frameName .. "CloseButton", titleBar)
close:SetFrameLevel(detailsFramework.FRAMELEVEL_OVERLAY)
close:SetSize(16, 16)
@@ -2025,31 +2041,37 @@ function detailsFramework:CreateSimplePanel(parent, w, h, title, name, panel_opt
close:SetAlpha(0.7)
close:SetScript("OnClick", simple_panel_close_click)
f.Close = close
simplePanel.Close = close
local title_string = title_bar:CreateFontString(name and name .. "Title", "overlay", "GameFontNormal")
title_string:SetTextColor(.8, .8, .8, 1)
title_string:SetText(title or "")
f.Title = title_string
local titleText = titleBar:CreateFontString(frameName and frameName .. "Title", "overlay", "GameFontNormal")
titleText:SetTextColor(.8, .8, .8, 1)
titleText:SetText(title or "")
simplePanel.Title = titleText
if (panel_options.UseScaleBar and db [name]) then
detailsFramework:CreateScaleBar (f, db [name])
f:SetScale(db [name].scale)
if (panelOptions.UseScaleBar and savedVariableTable [frameName]) then
detailsFramework:CreateScaleBar (simplePanel, savedVariableTable [frameName])
simplePanel:SetScale(savedVariableTable [frameName].scale)
end
f.Title:SetPoint("center", title_bar, "center")
f.Close:SetPoint("right", title_bar, "right", -2, 0)
simplePanel.Title:SetPoint("center", titleBar, "center")
simplePanel.Close:SetPoint("right", titleBar, "right", -2, 0)
if (panel_options.NoCloseButton) then
f.Close:Hide()
if (panelOptions.NoCloseButton) then
simplePanel.Close:Hide()
end
f:SetScript("OnMouseDown", simple_panel_mouse_down)
f:SetScript("OnMouseUp", simple_panel_mouse_up)
if (panelOptions.NoTitleBar) then
simplePanel.TitleBar:Hide()
end
f.SetTitle = simple_panel_settitle
if (not panelOptions.NoScripts) then
simplePanel:SetScript("OnMouseDown", simple_panel_mouse_down)
simplePanel:SetScript("OnMouseUp", simple_panel_mouse_up)
end
return f
simplePanel.SetTitle = simple_panel_settitle
return simplePanel
end
local Panel1PxBackdrop = {bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 64,
@@ -7622,6 +7644,9 @@ detailsFramework.CastFrameFunctions = {
CanLazyTick = true, --if true, it'll execute the lazy tick function, it ticks in a much slower pace comparece with the regular tick
LazyUpdateCooldown = 0.2, --amount of time to wait for the next lazy update, this updates non critical things like the cast timer
FillOnInterrupt = true,
HideSparkOnInterrupt = true,
--default size
Width = 100,
Height = 20,
@@ -8268,12 +8293,26 @@ detailsFramework.CastFrameFunctions = {
UNIT_SPELLCAST_STOP = function(self, unit, ...)
local unitID, castID, spellID = ...
if (self.castID == castID) then
self.Spark:Hide()
if (self.interrupted) then
if (self.Settings.HideSparkOnInterrupt) then
self.Spark:Hide()
end
else
self.Spark:Hide()
end
self.percentText:Hide()
local value = self:GetValue()
local _, maxValue = self:GetMinMaxValues()
self:SetValue(self.maxValue or maxValue or 1)
if (self.interrupted) then
if (self.Settings.FillOnInterrupt) then
self:SetValue(self.maxValue or maxValue or 1)
end
else
self:SetValue(self.maxValue or maxValue or 1)
end
self.casting = nil
self.finished = true
@@ -8357,12 +8396,18 @@ detailsFramework.CastFrameFunctions = {
self.channeling = nil
self.interrupted = true
self.finished = true
self:SetValue(self.maxValue or select(2, self:GetMinMaxValues()) or 1)
if (self.Settings.FillOnInterrupt) then
self:SetValue(self.maxValue or select(2, self:GetMinMaxValues()) or 1)
end
if (self.Settings.HideSparkOnInterrupt) then
self.Spark:Hide()
end
local castColor = self:GetCastColor()
self:SetColor (castColor) --SetColor handles with ParseColors()
self.Spark:Hide()
self.percentText:Hide()
self.Text:SetText(INTERRUPTED) --auto locale within the global namespace
+129 -28
View File
@@ -19,6 +19,10 @@ local CONST_COOLDOWN_TYPE_DEFENSIVE_RAID = 4
local CONST_COOLDOWN_TYPE_UTILITY = 5
local CONST_COOLDOWN_TYPE_INTERRUPT = 6
--hold spellIds and which custom caches the spell is in
--map[spellId] = map[filterName] = true
local spellsWithCustomFiltersCache = {}
--simple non recursive table copy
function openRaidLib.TCopy(tableToReceive, tableToCopy)
if (not tableToCopy) then
@@ -137,8 +141,9 @@ function openRaidLib.GetUnitID(playerName)
return openRaidLib.UnitIDCache[playerName] or playerName
end
local filterStringToCooldownType = { --report: "filterStringToCooldownType doesn't include the new filters."
--report: "filterStringToCooldownType doesn't include the new filters."
--answer: custom filter does not have a cooldown type, it is a mesh of spells
local filterStringToCooldownType = {
["defensive-raid"] = CONST_COOLDOWN_TYPE_DEFENSIVE_RAID,
["defensive-target"] = CONST_COOLDOWN_TYPE_DEFENSIVE_TARGET,
["defensive-personal"] = CONST_COOLDOWN_TYPE_DEFENSIVE_PERSONAL,
@@ -147,34 +152,116 @@ local filterStringToCooldownType = { --report: "filterStringToCooldownType doesn
["interrupt"] = CONST_COOLDOWN_TYPE_INTERRUPT,
}
function openRaidLib.CooldownManager.DoesSpellPassFilters(spellId, filters)
local allCooldownsData = LIB_OPEN_RAID_COOLDOWNS_INFO
local cooldownData = allCooldownsData[spellId]
if (cooldownData) then
for filter in filters:gmatch("([^,%s]+)") do
local cooldownType = filterStringToCooldownType[filter]
if (cooldownData.type == cooldownType) then
return true
elseif (cooldownData[filter]) then --custom filter
return true
end
end
else
return false
local filterStringToCooldownTypeReverse = {
[CONST_COOLDOWN_TYPE_DEFENSIVE_RAID] = "defensive-raid",
[CONST_COOLDOWN_TYPE_DEFENSIVE_TARGET] = "defensive-target",
[CONST_COOLDOWN_TYPE_DEFENSIVE_PERSONAL] = "defensive-personal",
[CONST_COOLDOWN_TYPE_OFFENSIVE] = "ofensive",
[CONST_COOLDOWN_TYPE_UTILITY] = "utility",
[CONST_COOLDOWN_TYPE_INTERRUPT] = "interrupt",
}
local removeSpellFromCustomFilterCache = function(spellId, filterName)
local spellFilterCache = spellsWithCustomFiltersCache[spellId]
if (spellFilterCache) then
spellFilterCache[filterName] = nil
end
end
local addSpellToCustomFilterCache = function(spellId, filterName)
local spellFilterCache = spellsWithCustomFiltersCache[spellId]
if (not spellFilterCache) then
spellFilterCache = {}
spellsWithCustomFiltersCache[spellId] = spellFilterCache
end
spellFilterCache[filterName] = true
end
local getSpellCustomFiltersFromCache = function(spellId)
local spellFilterCache = spellsWithCustomFiltersCache[spellId]
local result = {}
if (spellFilterCache) then
for filterName in pairs(spellFilterCache) do
result[filterName] = true
end
end
return result
end
--LIB_OPEN_RAID_COOLDOWNS_INFO store all registered cooldowns in the file ThingsToMantain_<game version>
function openRaidLib.CooldownManager.GetAllRegisteredCooldowns()
return LIB_OPEN_RAID_COOLDOWNS_INFO
end
function openRaidLib.CooldownManager.GetCooldownInfo(spellId)
return openRaidLib.CooldownManager.GetAllRegisteredCooldowns()[spellId]
end
--return a map of filter names which the spell is in, map: {[filterName] = true}
--API Call documented in the docs.txt as openRaidLib.GetSpellFilters() the declaration is on the main file of the lib
function openRaidLib.CooldownManager.GetSpellFilters(spellId, defaultFilterOnly, customFiltersOnly)
local result = {}
if (not customFiltersOnly) then
local thisCooldownInfo = openRaidLib.CooldownManager.GetCooldownInfo(spellId)
local cooldownTypeFilter = filterStringToCooldownTypeReverse[thisCooldownInfo.type]
if (cooldownTypeFilter) then
result[cooldownTypeFilter] = true
end
end
if (defaultFilterOnly) then
return result
end
local customFilters = getSpellCustomFiltersFromCache(spellId)
for filterName in pairs(customFilters) do
result[filterName] = true
end
return result
end
function openRaidLib.CooldownManager.DoesSpellPassFilters(spellId, filters)
--table with information about a single cooldown
local thisCooldownInfo = openRaidLib.CooldownManager.GetCooldownInfo(spellId)
--check if this spell is registered as a cooldown
if (thisCooldownInfo) then
for filter in filters:gmatch("([^,%s]+)") do
--filterStringToCooldownType is a map where the key is the filter name and value is the cooldown type
local cooldownType = filterStringToCooldownType[filter]
--cooldown type is a number from 1 to 8 telling its type
if (cooldownType == thisCooldownInfo.type) then
return true
--check for custom filter, the custom filter name is set as a key in the cooldownInfo: cooldownInfo[filterName] = true
elseif (thisCooldownInfo[filter]) then
return true
end
end
end
return false
end
local getCooldownsForFilter = function(unitName, allCooldowns, unitDataFilteredCache, filter)
local allCooldownsData = LIB_OPEN_RAID_COOLDOWNS_INFO
local allCooldownsData = openRaidLib.CooldownManager.GetAllRegisteredCooldowns()
local filterTable = unitDataFilteredCache[filter]
--if the unit already sent its full list of cooldowns, the cache can be built
--when NeedRebuildFilters is true, HasFullCooldownList is always true
--bug: filterTable is nil and HasFullCooldownList is also nil, happening after leaving a grou´p internal callback
if ((not filterTable and openRaidLib.CooldownManager.HasFullCooldownList[unitName]) or openRaidLib.CooldownManager.NeedRebuildFilters[unitName]) then
--bug: filterTable is nil and HasFullCooldownList is also nil, happening after leaving a group internal callback
--November 06, 2022 note: is this bug still happening?
local doesNotHaveFilterYet = not filterTable and openRaidLib.CooldownManager.HasFullCooldownList[unitName]
local isDirty = openRaidLib.CooldownManager.NeedRebuildFilters[unitName]
if (doesNotHaveFilterYet or isDirty) then
--reset the filterTable
filterTable = {}
unitDataFilteredCache[filter] = filterTable
--
for spellId, cooldownInfo in pairs(allCooldowns) do
local cooldownData = allCooldownsData[spellId]
if (cooldownData) then
@@ -190,27 +277,41 @@ local getCooldownsForFilter = function(unitName, allCooldowns, unitDataFilteredC
return filterTable
end
--API Call
--@filterName: a string representing a name of the filter
--@spells: an array of spellIds
--important: a spell can be part of any amount of custom filters,
--declaring a spell on a new filter does NOT remove it from other filters where it was previously added
function openRaidLib.AddCooldownFilter(filterName, spells)
--integrity check
if (type(filterName) ~= "string") then
openRaidLib.DiagnosticError("Usage: openRaidLib.AddFilter(string: filterName, table: spells)", debugstack())
return false
end
if (type(spells) ~= "table") then
elseif (type(spells) ~= "table") then
openRaidLib.DiagnosticError("Usage: openRaidLib.AddFilter(string: filterName, table: spells)", debugstack())
return false
end
--clear previous filter spell table of the same name
for spellId, cooldownData in pairs(LIB_OPEN_RAID_COOLDOWNS_INFO) do
local allCooldownsData = openRaidLib.CooldownManager.GetAllRegisteredCooldowns()
--iterate among the all cooldowns table and erase the filterName from all spells
for spellId, cooldownData in pairs(allCooldownsData) do
cooldownData[filterName] = nil
removeSpellFromCustomFilterCache(spellId, filterName)
end
local allCooldownsData = LIB_OPEN_RAID_COOLDOWNS_INFO
--iterate among spells passed within the spells table and set the new filter on them
--problem: the filter is set directly into the global cooldown table
--this could in rare cases make an addon to override settings of another addon
for spellIndex, spellId in ipairs(spells) do
local cooldownData = allCooldownsData[spellId]
cooldownData[filterName] = true
if (cooldownData) then
cooldownData[filterName] = true
addSpellToCustomFilterCache(spellId, filterName)
else
openRaidLib.DiagnosticError("A spellId on your spell list for openRaidLib.AddFilter isn't registered as cooldown:", spellId, debugstack())
end
end
--tag all cache filters as dirt
@@ -222,8 +323,9 @@ function openRaidLib.AddCooldownFilter(filterName, spells)
return true
end
--@allCooldowns: all cooldowns sent by an unit, {[spellId] = cooldownInfo}
--@filters: string with filters, "defensive-raid, "defensive-personal"
--API Call
--@allCooldowns: all cooldowns sent by a unit, map{[spellId] = cooldownInfo}
--@filters: string with filter names: array{"defensive-raid, "defensive-personal"}
function openRaidLib.FilterCooldowns(unitName, allCooldowns, filters)
local allDataFiltered = openRaidLib.CooldownManager.UnitDataFilterCache --["unitName"] = {defensive-raid = {[spellId = cooldownInfo]}}
local unitDataFilteredCache = allDataFiltered[unitName]
@@ -238,7 +340,6 @@ function openRaidLib.FilterCooldowns(unitName, allCooldowns, filters)
return filterAlreadyInCache
end
local allCooldownsData = LIB_OPEN_RAID_COOLDOWNS_INFO
local resultFilters = {}
--break the string into pieces and filter cooldowns
+74 -10
View File
@@ -18,6 +18,7 @@ local CONST_TALENT_VERSION_DRAGONFLIGHT = 5
local CONST_BTALENT_VERSION_COVENANTS = 9
local CONST_SPELLBOOK_CLASSSPELLS_TABID = 2
local CONST_SPELLBOOK_GENERAL_TABID = 1
local isTimewalkWoW = function()
local _, _, _, buildInfo = GetBuildInfo()
@@ -418,6 +419,23 @@ local getSpellListAsHashTableFromSpellBook = function()
--this line might not be compatible with classic
local specId, specName, _, specIconTexture = GetSpecializationInfo(GetSpecialization())
local classNameLoc, className, classId = UnitClass("player")
local locPlayerRace, playerRace, playerRaceId = UnitRace("player")
--get racials from the general tab
local tabName, tabTexture, offset, numSpells, isGuild, offspecId = GetSpellTabInfo(CONST_SPELLBOOK_GENERAL_TABID)
offset = offset + 1
local tabEnd = offset + numSpells
for entryOffset = offset, tabEnd - 1 do
local spellType, spellId = GetSpellBookItemInfo(entryOffset, "player")
if (spellId and LIB_OPEN_RAID_COOLDOWNS_INFO[spellId] and LIB_OPEN_RAID_COOLDOWNS_INFO[spellId].raceid == playerRaceId) then
spellId = C_SpellBook.GetOverrideSpell(spellId)
local spellName = GetSpellInfo(spellId)
local isPassive = IsPassiveSpell(entryOffset, "player")
if (spellName and not isPassive) then
completeListOfSpells[spellId] = true
end
end
end
--get spells from the Spec spellbook
for i = 1, GetNumSpellTabs() do
@@ -464,13 +482,13 @@ end
local updateCooldownAvailableList = function()
table.wipe(LIB_OPEN_RAID_PLAYERCOOLDOWNS)
local _, playerClass = UnitClass("player")
local locPlayerRace, playerRace, playerRaceId = UnitRace("player")
local spellBookSpellList = getSpellListAsHashTableFromSpellBook()
--build a list of all spells assigned as cooldowns for the player class
for spellID, spellData in pairs(LIB_OPEN_RAID_COOLDOWNS_INFO) do
if (spellData.class == playerClass) then
if (spellData.class == playerClass or spellData.raceid == playerRaceId) then --need to implement here to get the racial as racial cooldowns does not carry a class
if (spellBookSpellList[spellID]) then
LIB_OPEN_RAID_PLAYERCOOLDOWNS[spellID] = spellData
end
@@ -538,32 +556,78 @@ function openRaidLib.CooldownManager.GetPlayerCooldownList()
return {}
end
--aura frame handles only UNIT_AURA events to grab the duration of the buff placed by the aura
local IS_NEW_UNIT_AURA_AVAILABLE = C_UnitAuras and C_UnitAuras.GetAuraDataBySlot and true
local auraSpellID
local foundAuraDuration
local handleBuffAura = function(aura)
local auraInfo = C_UnitAuras.GetAuraDataByAuraInstanceID("player", aura.auraInstanceID)
if (auraInfo) then
local spellId = auraInfo.spellId
if (auraSpellID == spellId) then
auraSpellID = nil
foundAuraDuration = auraInfo.duration
return true
end
end
end
local getAuraDuration = function(spellId)
--some auras does not have the same spellId of the cast as the spell for its aura duration
--in these cases, it's necessary to declare the buff spellId which tells the duration of the effect by adding 'durationSpellId = spellId' within the cooldown data
local customBuffDuration = LIB_OPEN_RAID_PLAYERCOOLDOWNS[spellId].durationSpellId
--spellId = customBuffDuration or spellId --can't replace the spellId by customBuffDurationSpellId has it wount be found in LIB_OPEN_RAID_PLAYERCOOLDOWNS
if (IS_NEW_UNIT_AURA_AVAILABLE) then
local batchCount = nil
local usePackedAura = true
auraSpellID = customBuffDuration or spellId
foundAuraDuration = 0 --reset duration
AuraUtil.ForEachAura("player", "HELPFUL", batchCount, handleBuffAura, usePackedAura) --check auras to find a buff for the spellId
if (foundAuraDuration == 0) then --if the buff wasn't found, attempt to get the duration from the file
local spellName = GetSpellInfo(spellId)
return LIB_OPEN_RAID_PLAYERCOOLDOWNS[spellId].duration or 0
end
return foundAuraDuration
else
end
end
function openRaidLib.CooldownManager.GetSpellBuffDuration(spellId)
return getAuraDuration(spellId)
end
--check if a player cooldown is ready or if is in cooldown
--@spellId: the spellId to check for cooldown
--return timeLeft, charges, startTimeOffset, duration, buffDuration
function openRaidLib.CooldownManager.GetPlayerCooldownStatus(spellId)
--check if is a charge spell
local cooldownInfo = LIB_OPEN_RAID_COOLDOWNS_INFO[spellId]
if (cooldownInfo) then
if (cooldownInfo.charges and cooldownInfo.charges > 1) then
local chargesAvailable, chargesTotal, start, duration = GetSpellCharges(spellId)
local buffDuration = getAuraDuration(spellId)
local chargesAvailable, chargesTotal, start, duration = GetSpellCharges(spellId)
if chargesAvailable then
if (chargesAvailable == chargesTotal) then
return 0, chargesTotal, 0, 0 --all charges are ready to use
return 0, chargesTotal, 0, 0, 0 --all charges are ready to use
else
--return the time to the next charge
local timeLeft = start + duration - GetTime()
local startTimeOffset = start - GetTime()
return ceil(timeLeft), chargesAvailable, startTimeOffset, duration --time left, charges, startTime
return ceil(timeLeft), chargesAvailable, startTimeOffset, duration, buffDuration --time left, charges, startTime, duration, buffDuration
end
else
local start, duration = GetSpellCooldown(spellId)
if (start == 0) then --cooldown is ready
return 0, 1, 0, 0 --time left, charges, startTime
return 0, 1, 0, 0, 0 --time left, charges, startTime
else
local timeLeft = start + duration - GetTime()
local startTimeOffset = start - GetTime()
return ceil(timeLeft), 0, ceil(startTimeOffset), duration --time left, charges, startTime, duration
return ceil(timeLeft), 0, ceil(startTimeOffset), duration, buffDuration --time left, charges, startTime, duration, buffDuration
end
end
else
+85 -73
View File
@@ -14,7 +14,18 @@ Code Rules:
- Internal callbacks are the internal communication of the library, e.g. when an event triggers it send to all modules that registered that event.
- Public callbacks are callbacks registered by an external addon.
Change Log:
Change Log (most recent on 2022 Nov 18):
- added racials with cooldown type 9
- added buff duration in the index 6 of the cooldownInfo table returned on any cooldown event
- added 'durationSpellId' for cooldowns where the duration effect is another spell other than the casted cooldown spellId, add this member on cooldown table at LIB_OPEN_RAID_COOLDOWNS_INFO
------- Nov 07 and older
- added:
* added openRaidLib.GetSpellFilters(spellId, defaultFilterOnly, customFiltersOnly) (see docs)
- passing a spellId of a non registered cooldown on LIB_OPEN_RAID_COOLDOWNS_INFO will trigger a diagnostic error if diagnostic errors are enabled.
- player cast doesn't check anymore for cooldowns in the player spec, now it check towards the cache LIB_OPEN_RAID_PLAYERCOOLDOWNS.
LIB_OPEN_RAID_PLAYERCOOLDOWNS is a cache built with cooldowns present in the player spellbook.
- things to maintain now has 1 file per expansion
- player conduits, covenant internally renamed to playerInfo1 and playerInfo2 to make the lib more future proof
- player conduits tree is now Borrowed Talents Tree, for future proof
@@ -25,29 +36,14 @@ Change Log:
* openRaidLib.GetFlaskTierFromAura(auraInfo)
* openRaidLib.GetFoodInfoBySpellId(spellId)
* openRaidLib.GetFoodTierFromAura(auraInfo)
- added dragonflight talents support
* added dragonflight talents support
* added openRaidLib.RequestCooldownInfo(spellId)
* added openRaidLib.AddCooldownFilter(filterName, spells)
- ensure to register events after 'PLAYER_ENTERING_WORLD' has triggered
- added openRaidLib.RequestCooldownInfo(spellId)
- added openRaidLib.AddCooldownFilter(filterName, spells)
- if Ace Comm is installed, use it
- added "KeystoneWipe" callback
- finished keystone info, see docs
- added interrupts to cooldown tracker, new filter: "interrupt"
- after encounter_end cooldowns now check for cooldowns reset.
- each module now controls what to do with regen_enabled.
- filter cooldowns done.
- move portions of the code to other files to make this one smaller.
- major function and variables rename.
- implemented pvp talents.
- player information is always available even when not in a group.
- added cooldown check to se which cooldown has removed or added into the list.
- added two new callbacks: "CooldownAdded" and "CooldownRemoved", see documents.
TODO:
- make talents changes also send only cooldowns added or changed
- add into gear info how many tier set parts the player has
- raid lockouts normal-heroic-mythic
- soulbind character (covenant choise) - probably not used in 10.0
BUGS:
- after a /reload, it is not starting new tickers for spells under cooldown
@@ -68,7 +64,7 @@ if (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE and not isExpansion_Dragonflight()) t
end
local major = "LibOpenRaid-1.0"
local CONST_LIB_VERSION = 69
local CONST_LIB_VERSION = 72
LIB_OPEN_RAID_CAN_LOAD = false
local unpack = table.unpack or _G.unpack
@@ -133,6 +129,7 @@ local unpack = table.unpack or _G.unpack
local CONST_COOLDOWN_INDEX_TIMEOFFSET = 3
local CONST_COOLDOWN_INDEX_DURATION = 4
local CONST_COOLDOWN_INDEX_UPDATETIME = 5
local CONST_COOLDOWN_INDEX_AURA_DURATION = 6
local GetContainerNumSlots = GetContainerNumSlots or C_Container.GetContainerNumSlots
local GetContainerItemID = GetContainerItemID or C_Container.GetContainerItemID
@@ -1632,14 +1629,14 @@ local cooldownTimeLeftCheck_Ticker = function(tickerObject)
end
tickerObject.cooldownTimeLeft = tickerObject.cooldownTimeLeft - CONST_COOLDOWN_CHECK_INTERVAL
local timeLeft, charges, startTimeOffset, duration = openRaidLib.CooldownManager.GetPlayerCooldownStatus(spellId)
local timeLeft, charges, startTimeOffset, duration, auraDuration = openRaidLib.CooldownManager.GetPlayerCooldownStatus(spellId)
local bUpdateLocally = false
--is the spell ready to use?
if (timeLeft == 0) then
--it's ready
openRaidLib.CooldownManager.SendPlayerCooldownUpdate(spellId, 0, charges, 0, 0)
openRaidLib.CooldownManager.SendPlayerCooldownUpdate(spellId, 0, charges, 0, 0, 0)
openRaidLib.CooldownManager.CooldownTickers[spellId] = nil
tickerObject:Cancel()
bUpdateLocally = true
@@ -1647,7 +1644,7 @@ local cooldownTimeLeftCheck_Ticker = function(tickerObject)
--check if the time left has changed, this check if the cooldown got its time reduced and if the cooldown time has been slow down by modRate
if (not openRaidLib.isNearlyEqual(tickerObject.cooldownTimeLeft, timeLeft, CONST_COOLDOWN_TIMELEFT_HAS_CHANGED)) then
--there's a deviation, send a comm to communicate the change in the time left
openRaidLib.CooldownManager.SendPlayerCooldownUpdate(spellId, timeLeft, charges, startTimeOffset, duration)
openRaidLib.CooldownManager.SendPlayerCooldownUpdate(spellId, timeLeft, charges, startTimeOffset, duration, auraDuration)
tickerObject.cooldownTimeLeft = timeLeft
bUpdateLocally = true
end
@@ -1655,9 +1652,9 @@ local cooldownTimeLeftCheck_Ticker = function(tickerObject)
if (bUpdateLocally) then
--get the cooldown time for this spell
local timeLeft, charges, startTimeOffset, duration = openRaidLib.CooldownManager.GetPlayerCooldownStatus(spellId)
local timeLeft, charges, startTimeOffset, duration, auraDuration = openRaidLib.CooldownManager.GetPlayerCooldownStatus(spellId) --return 5 values
--update the cooldown
openRaidLib.CooldownManager.CooldownSpellUpdate(playerName, spellId, timeLeft, charges, startTimeOffset, duration)
openRaidLib.CooldownManager.CooldownSpellUpdate(playerName, spellId, timeLeft, charges, startTimeOffset, duration, auraDuration) --need 7 values
local playerCooldownTable = openRaidLib.GetUnitCooldowns(playerName)
local cooldownInfo = openRaidLib.GetUnitCooldownInfo(playerName, spellId)
@@ -1696,7 +1693,7 @@ end
function openRaidLib.CooldownManager.CleanupCooldownTickers()
for spellId, tickerObject in pairs(openRaidLib.CooldownManager.CooldownTickers) do
local timeLeft, charges, startTimeOffset, duration = openRaidLib.CooldownManager.GetPlayerCooldownStatus(spellId)
local timeLeft, charges, startTimeOffset, duration, auraDuration = openRaidLib.CooldownManager.GetPlayerCooldownStatus(spellId)
if (timeLeft == 0) then
tickerObject:Cancel()
openRaidLib.CooldownManager.CooldownTickers[spellId] = nil
@@ -1722,22 +1719,26 @@ end
local cooldownGetSpellInfo = function(unitName, spellId)
local unitCooldownTable = cooldownGetUnitTable(unitName)
local spellIdTable = unitCooldownTable[spellId]
return spellIdTable
local cooldownInfo = unitCooldownTable[spellId]
return cooldownInfo
end
--update a single cooldown timer
--called when the player casted a cooldown and when received a cooldown update from another player
--only update the db, no other action is taken
function openRaidLib.CooldownManager.CooldownSpellUpdate(unitName, spellId, newTimeLeft, newCharges, startTimeOffset, duration)
--cooldownInfo: [1] timeLeft [2] charges [3] startOffset [4] duration [5] updateTime [6] auraDuration
function openRaidLib.CooldownManager.CooldownSpellUpdate(unitName, spellId, newTimeLeft, newCharges, startTimeOffset, duration, auraDuration)
--get the cooldown table where all cooldowns are stored for this unit
local unitCooldownTable = cooldownGetUnitTable(unitName)
local spellIdTable = unitCooldownTable[spellId] or {}
spellIdTable[CONST_COOLDOWN_INDEX_TIMELEFT] = newTimeLeft
spellIdTable[CONST_COOLDOWN_INDEX_CHARGES] = newCharges
spellIdTable[CONST_COOLDOWN_INDEX_TIMEOFFSET] = startTimeOffset
spellIdTable[CONST_COOLDOWN_INDEX_DURATION] = duration
spellIdTable[CONST_COOLDOWN_INDEX_UPDATETIME] = GetTime()
unitCooldownTable[spellId] = spellIdTable
--is this a cooldown info?
local cooldownInfo = unitCooldownTable[spellId] or {}
cooldownInfo[CONST_COOLDOWN_INDEX_TIMELEFT] = newTimeLeft
cooldownInfo[CONST_COOLDOWN_INDEX_CHARGES] = newCharges
cooldownInfo[CONST_COOLDOWN_INDEX_TIMEOFFSET] = startTimeOffset
cooldownInfo[CONST_COOLDOWN_INDEX_DURATION] = duration
cooldownInfo[CONST_COOLDOWN_INDEX_UPDATETIME] = GetTime()
cooldownInfo[CONST_COOLDOWN_INDEX_AURA_DURATION] = auraDuration
unitCooldownTable[spellId] = cooldownInfo
end
--API Calls
@@ -1774,6 +1775,10 @@ end
return openRaidLib.CooldownManager.DoesSpellPassFilters(spellId, filter)
end
function openRaidLib.GetSpellFilters(spellId, defaultFilterOnly, customFiltersOnly)
return openRaidLib.CooldownManager.GetSpellFilters(spellId, defaultFilterOnly, customFiltersOnly)
end
--return values about the cooldown time
--values returned: timeLeft, charges, timeOffset, duration, updateTime
function openRaidLib.GetCooldownTimeFromUnitSpellID(unitId, spellId)
@@ -1781,7 +1786,7 @@ end
if (unitCooldownsTable) then
local cooldownInfo = unitCooldownsTable[spellId]
if (cooldownInfo) then
return unpack(cooldownInfo)
return openRaidLib.CooldownManager.GetCooldownInfoValues(cooldownInfo)
end
end
end
@@ -1790,7 +1795,7 @@ end
--values returned: timeLeft, charges, timeOffset, duration, updateTime
function openRaidLib.GetCooldownTimeFromCooldownInfo(cooldownInfo)
if (cooldownInfo) then
return unpack(cooldownInfo)
return openRaidLib.CooldownManager.GetCooldownInfoValues(cooldownInfo)
end
end
@@ -1833,12 +1838,12 @@ end
--values returned: isReady, timeLeft, charges, normalized percent, minValue, maxValue, currentValue
--values are in the GetTime() format
function openRaidLib.GetCooldownStatusFromUnitSpellID(unitId, spellId)
local timeLeft, charges, timeOffset, duration, updateTime
local timeLeft, charges, timeOffset, duration, updateTime, auraDuration
local unitCooldownsTable = openRaidLib.GetUnitCooldowns(unitId)
if (unitCooldownsTable) then
local cooldownInfo = unitCooldownsTable[spellId]
if (cooldownInfo) then
timeLeft, charges, timeOffset, duration, updateTime = unpack(cooldownInfo)
timeLeft, charges, timeOffset, duration, updateTime, auraDuration = openRaidLib.CooldownManager.GetCooldownInfoValues(cooldownInfo)
end
end
@@ -1851,39 +1856,40 @@ end
--values are in the GetTime() format
--GetPercentFromCooldownInfo
function openRaidLib.GetCooldownStatusFromCooldownInfo(cooldownInfo)
local timeLeft, charges, timeOffset, duration, updateTime = unpack(cooldownInfo)
local timeLeft, charges, timeOffset, duration, updateTime, auraDuration = openRaidLib.CooldownManager.GetCooldownInfoValues(cooldownInfo)
return calculatePercent(timeOffset, duration, updateTime, charges)
end
--internals
function openRaidLib.CooldownManager.GetCooldownInfoValues(cooldownInfo)
local timeLeft, charges, timeOffset, duration, updateTime, auraDuration = unpack(cooldownInfo)
return timeLeft, charges, timeOffset, duration, updateTime, auraDuration
end
function openRaidLib.CooldownManager.OnPlayerCast(event, spellId, isPlayerPet) --~cast
--player casted a spell, check if the spell is registered as cooldown
--local playerSpec = openRaidLib.GetPlayerSpecId() --should be deprecated with cooldowns from spellbook
--if (playerSpec) then
--if (LIB_OPEN_RAID_COOLDOWNS_BY_SPEC[playerSpec] and LIB_OPEN_RAID_COOLDOWNS_BY_SPEC[playerSpec][spellId]) then --kinda deprecated with the new spell from spellbook
--issue: pet spells isn't in this table yet, might mess with pet interrupts
if (LIB_OPEN_RAID_PLAYERCOOLDOWNS[spellId]) then --check if the casted spell is a cooldown the player has available
local playerName = UnitName("player")
--issue: pet spells isn't in this table yet, might mess with pet interrupts
if (LIB_OPEN_RAID_PLAYERCOOLDOWNS[spellId]) then --check if the casted spell is a cooldown the player has available
local playerName = UnitName("player")
--get the cooldown time for this spell
local timeLeft, charges, startTimeOffset, duration = openRaidLib.CooldownManager.GetPlayerCooldownStatus(spellId)
--get the cooldown time for this spell
local timeLeft, charges, startTimeOffset, duration, auraDuration = openRaidLib.CooldownManager.GetPlayerCooldownStatus(spellId) --return 5 values
--update the cooldown
openRaidLib.CooldownManager.CooldownSpellUpdate(playerName, spellId, timeLeft, charges, startTimeOffset, duration)
local cooldownInfo = cooldownGetSpellInfo(playerName, spellId)
--update the cooldown
openRaidLib.CooldownManager.CooldownSpellUpdate(playerName, spellId, timeLeft, charges, startTimeOffset, duration, auraDuration) --receive 7 values
local cooldownInfo = cooldownGetSpellInfo(playerName, spellId)
--trigger a public callback
local playerCooldownTable = openRaidLib.GetUnitCooldowns(playerName)
openRaidLib.publicCallback.TriggerCallback("CooldownUpdate", "player", spellId, cooldownInfo, playerCooldownTable, openRaidLib.CooldownManager.UnitData)
--trigger a public callback
local playerCooldownTable = openRaidLib.GetUnitCooldowns(playerName)
openRaidLib.publicCallback.TriggerCallback("CooldownUpdate", "player", spellId, cooldownInfo, playerCooldownTable, openRaidLib.CooldownManager.UnitData)
--send to comm
openRaidLib.CooldownManager.SendPlayerCooldownUpdate(spellId, timeLeft, charges, startTimeOffset, duration)
--send to comm
openRaidLib.CooldownManager.SendPlayerCooldownUpdate(spellId, timeLeft, charges, startTimeOffset, duration, auraDuration)
--create a timer to monitor the time of this cooldown
--as there's just a few of them to monitor, there's no issue on creating one timer per spell
cooldownStartTicker(spellId, timeLeft)
end
--end
--create a timer to monitor the time of this cooldown
--as there's just a few of them to monitor, there's no issue on creating one timer per spell
cooldownStartTicker(spellId, timeLeft)
end
end
--when the player is ressed while in a group, send the cooldown list
@@ -2015,8 +2021,8 @@ function openRaidLib.CooldownManager.OnReceiveUnitCooldownChanges(data, unitName
local cooldownsAddedUnpacked = openRaidLib.UnpackTable(addedCooldowns, 1, true, true, 5)
for spellId, cooldownInfo in pairs(cooldownsAddedUnpacked) do
--add the spell into the list of cooldowns of this unit
local timeLeft, charges, timeOffset, duration = unpack(cooldownInfo)
openRaidLib.CooldownManager.CooldownSpellUpdate(unitName, spellId, timeLeft, charges, timeOffset, duration)
local timeLeft, charges, timeOffset, duration, updateTime, auraDuration = openRaidLib.CooldownManager.GetCooldownInfoValues(cooldownInfo)
openRaidLib.CooldownManager.CooldownSpellUpdate(unitName, spellId, timeLeft, charges, timeOffset, duration, auraDuration)
--mark the filter cache of this unit as dirt
openRaidLib.CooldownManager.NeedRebuildFilters[unitName] = true
@@ -2054,15 +2060,16 @@ function openRaidLib.CooldownManager.CheckForSpellsAdeedOrRemoved()
for spellId, cooldownInfo in pairs(newCooldownList) do
if (not currentCooldowns[spellId]) then
--a spell has been added
local timeLeft, charges, timeOffset, duration = unpack(cooldownInfo)
openRaidLib.CooldownManager.CooldownSpellUpdate(playerName, spellId, timeLeft, charges, timeOffset, duration)
local timeLeft, charges, timeOffset, duration, updateTime, auraDuration = openRaidLib.CooldownManager.GetCooldownInfoValues(cooldownInfo)
openRaidLib.CooldownManager.CooldownSpellUpdate(playerName, spellId, timeLeft, charges, timeOffset, duration, auraDuration)
local timeLeft, charges, startTimeOffset, duration = openRaidLib.CooldownManager.GetPlayerCooldownStatus(spellId)
local timeLeft, charges, startTimeOffset, duration, auraDuration = openRaidLib.CooldownManager.GetPlayerCooldownStatus(spellId) --return 5 values
spellsAdded[#spellsAdded+1] = spellId
spellsAdded[#spellsAdded+1] = timeLeft
spellsAdded[#spellsAdded+1] = charges
spellsAdded[#spellsAdded+1] = startTimeOffset
spellsAdded[#spellsAdded+1] = duration
spellsAdded[#spellsAdded+1] = auraDuration
--mark the filter cache of this unit as dirt
openRaidLib.CooldownManager.NeedRebuildFilters[playerName] = true
@@ -2126,6 +2133,7 @@ openRaidLib.commHandler.RegisterComm(CONST_COMM_COOLDOWNUPDATE_PREFIX, function(
local charges = tonumber(dataAsArray[3])
local startTime = tonumber(dataAsArray[4])
local duration = tonumber(dataAsArray[5])
local auraDuration = tonumber(dataAsArray[6])
--check integrity
if (not spellId or spellId == 0) then
@@ -2142,10 +2150,14 @@ openRaidLib.commHandler.RegisterComm(CONST_COMM_COOLDOWNUPDATE_PREFIX, function(
elseif (not duration) then
return openRaidLib.DiagnosticError("CooldownManager|comm received|duration is invalid")
elseif (not auraDuration) then
return openRaidLib.DiagnosticError("CooldownManager|comm received|auraDuration is invalid")
end
--update
openRaidLib.CooldownManager.CooldownSpellUpdate(unitName, spellId, cooldownTimer, charges, startTime, duration)
--unitName, spellId, cooldownTimer, charges, startTime, duration, auraDuration
openRaidLib.CooldownManager.CooldownSpellUpdate(unitName, spellId, cooldownTimer, charges, startTime, duration, auraDuration)
local cooldownInfo = cooldownGetSpellInfo(unitName, spellId)
local unitCooldownTable = openRaidLib.GetUnitCooldowns(unitName)
@@ -2180,8 +2192,8 @@ function openRaidLib.CooldownManager.SendAllPlayerCooldowns()
end
--send to comm a specific cooldown that was just used, a charge got available or its cooldown is over (ready to use)
function openRaidLib.CooldownManager.SendPlayerCooldownUpdate(spellId, cooldownTimeLeft, charges, startTimeOffset, duration)
local dataToSend = "" .. CONST_COMM_COOLDOWNUPDATE_PREFIX .. "," .. spellId .. "," .. cooldownTimeLeft .. "," .. charges .. "," .. startTimeOffset .. "," .. duration
function openRaidLib.CooldownManager.SendPlayerCooldownUpdate(spellId, cooldownTimeLeft, charges, startTimeOffset, duration, auraDuration)
local dataToSend = "" .. CONST_COMM_COOLDOWNUPDATE_PREFIX .. "," .. spellId .. "," .. cooldownTimeLeft .. "," .. charges .. "," .. startTimeOffset .. "," .. duration .. "," .. auraDuration
openRaidLib.commHandler.SendCommData(dataToSend)
diagnosticComm("SendPlayerCooldownUpdate| " .. dataToSend) --debug
end
@@ -2219,8 +2231,8 @@ function openRaidLib.CooldownManager.OnReceiveRequestForCooldownInfoUpdate(data,
end
--get the cooldown time for this spell
local timeLeft, charges, startTimeOffset, duration = openRaidLib.CooldownManager.GetPlayerCooldownStatus(spellId)
openRaidLib.CooldownManager.SendPlayerCooldownUpdate(spellId, timeLeft, charges, startTimeOffset, duration)
local timeLeft, charges, startTimeOffset, duration, auraDuration = openRaidLib.CooldownManager.GetPlayerCooldownStatus(spellId)
openRaidLib.CooldownManager.SendPlayerCooldownUpdate(spellId, timeLeft, charges, startTimeOffset, duration, auraDuration)
end
openRaidLib.commHandler.RegisterComm(CONST_COMM_COOLDOWNREQUEST_PREFIX, openRaidLib.CooldownManager.OnReceiveRequestForCooldownInfoUpdate)
@@ -2533,7 +2545,7 @@ C_Timer.After(0.1, function()
--trigger a cooldown usage
local duration = cooldownInfo.duration
--time left, charges, startTimeOffset, duration
openRaidLib.CooldownManager.CooldownSpellUpdate(unitName, spellId, duration, 0, 0, duration)
openRaidLib.CooldownManager.CooldownSpellUpdate(unitName, spellId, duration, 0, 0, duration, 0)
local cooldownInfo = cooldownGetSpellInfo(unitName, spellId)
local unitCooldownsTable = openRaidLib.GetUnitCooldowns(unitName)
@@ -260,6 +260,10 @@ LIB_OPEN_RAID_MELEE_SPECS = {
--/dump GetTalentInfo (talentTier, talentColumn, 1)
--example: to get the second talent of the last talent line, use: /dump GetTalentInfo (7, 2, 1)
--todo:
--get cooldown duration from the buff placed on the player or target player
--spell scanner not getting the spell from the pet spellbook
LIB_OPEN_RAID_COOLDOWNS_INFO = {
-- Filter Types:
@@ -269,7 +273,53 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
-- 4 raid defensive cooldown
-- 5 personal utility cooldown
-- 6 interrupt
-- 7 dispel
-- 8 crowd control
-- 9 racials
--racials
--maintanance: login into the new race and type /run Details.GenerateRacialSpellList()
--this command give a formated line to paste here
[312411] = {cooldown = 90, duration = 0, specs = {}, talent = false, charges = 1, raceid = 35, race = "Vulpera", class = "", type = 9}, --Bag of Tricks (Vulpera)
--[312370] = {cooldown = 600, duration = 0, specs = {}, talent = false, charges = 1, raceid = 35, race = "Vulpera", class = "", type = 9}, --Make Camp (Vulpera)
--[312372] = {cooldown = 3600, duration = 0, specs = {}, talent = false, charges = 1, raceid = 35, race = "Vulpera", class = "", type = 9}, --Return to Camp (Vulpera)
--[312425] = {cooldown = 300, duration = 0, specs = {}, talent = false, charges = 1, raceid = 35, race = "Vulpera", class = "", type = 9}, --Rummage Your Bag (Vulpera)
[274738] = {cooldown = 120, duration = 0, specs = {}, talent = false, charges = 1, raceid = 36, race = "MagharOrc", class = "", type = 9}, --Ancestral Call (MagharOrc)
--[292752] = {cooldown = 432000, duration = 0, specs = {}, talent = false, charges = 1, raceid = 31, race = "ZandalariTroll", class = "", type = 9}, --Embrace of the Loa (ZandalariTroll)
--[281954] = {cooldown = 900, duration = 0, specs = {}, talent = false, charges = 1, raceid = 31, race = "ZandalariTroll", class = "", type = 9}, --Pterrordax Swoop (ZandalariTroll)
[291944] = {cooldown = 150, duration = 0, specs = {}, talent = false, charges = 1, raceid = 31, race = "ZandalariTroll", class = "", type = 9}, --Regeneratin' (ZandalariTroll)
[255654] = {cooldown = 120, duration = 0, specs = {}, talent = false, charges = 1, raceid = 28, race = "HighmountainTauren", class = "", type = 9}, --Bull Rush (HighmountainTauren)
[260364] = {cooldown = 180, duration = 0, specs = {}, talent = false, charges = 1, raceid = 27, race = "Nightborne", class = "", type = 9}, --Arcane Pulse (Nightborne)
--[255661] = {cooldown = 600, duration = 0, specs = {}, talent = false, charges = 1, raceid = 27, race = "Nightborne", class = "", type = 9}, --Cantrips (Nightborne)
--[69046] = {cooldown = 1800, duration = 0, specs = {}, talent = false, charges = 1, raceid = 9, race = "Goblin", class = "", type = 9}, --Pack Hobgoblin (Goblin)
[69041] = {cooldown = 90, duration = 0, specs = {}, talent = false, charges = 1, raceid = 9, race = "Goblin", class = "", type = 9}, --Rocket Barrage (Goblin)
[69070] = {cooldown = 90, duration = 0, specs = {}, talent = false, charges = 1, raceid = 9, race = "Goblin", class = "", type = 9}, --Rocket Jump (Goblin)
[20549] = {cooldown = 90, duration = 0, specs = {}, talent = false, charges = 1, raceid = 6, race = "Tauren", class = "", type = 9}, --War Stomp (Tauren)
--[20577] = {cooldown = 120, duration = 0, specs = {}, talent = false, charges = 1, raceid = 5, race = "Scourge", class = "", type = 9}, --Cannibalize (Scourge)
[7744] = {cooldown = 120, duration = 0, specs = {}, talent = false, charges = 1, raceid = 5, race = "Scourge", class = "", type = 9}, --Will of the Forsaken (Scourge)
[20572] = {cooldown = 120, duration = 0, specs = {}, talent = false, charges = 1, raceid = 2, race = "Orc", class = "", type = 9}, --Blood Fury (Orc)
[312924] = {cooldown = 180, duration = 0, specs = {}, talent = false, charges = 1, raceid = 37, race = "Mechagnome", class = "", type = 9}, --Hyper Organic Light Originator (Mechagnome)
--[312890] = {cooldown = 0, duration = 0, specs = {}, talent = false, charges = 1, raceid = 37, race = "Mechagnome", class = "", type = 9}, --Skeleton Pinkie (Mechagnome)
[287712] = {cooldown = 150, duration = 0, specs = {}, talent = false, charges = 1, raceid = 32, race = "KulTiran", class = "", type = 9}, --Haymaker (KulTiran)
[265221] = {cooldown = 120, duration = 0, specs = {}, talent = false, charges = 1, raceid = 34, race = "DarkIronDwarf", class = "", type = 9}, --Fireblood (DarkIronDwarf)
--[265225] = {cooldown = 1800, duration = 0, specs = {}, talent = false, charges = 1, raceid = 34, race = "DarkIronDwarf", class = "", type = 9}, --Mole Machine (DarkIronDwarf)
--[259930] = {cooldown = 900, duration = 0, specs = {}, talent = false, charges = 1, raceid = 30, race = "LightforgedDraenei", class = "", type = 9}, --Forge of Light (LightforgedDraenei)
[255647] = {cooldown = 150, duration = 0, specs = {}, talent = false, charges = 1, raceid = 30, race = "LightforgedDraenei", class = "", type = 9}, --Light's Judgment (LightforgedDraenei)
[256948] = {cooldown = 180, duration = 0, specs = {}, talent = false, charges = 1, raceid = 29, race = "VoidElf", class = "", type = 9}, --Spatial Rift (VoidElf)
--[358733] = {cooldown = 1, duration = 0, specs = {}, talent = false, charges = 1, raceid = 52, race = "Dracthyr", class = "", type = 9}, --Glide (Dracthyr)
[368970] = {cooldown = 90, duration = 0, specs = {}, talent = false, charges = 1, raceid = 52, race = "Dracthyr", class = "", type = 9}, --Tail Swipe (Dracthyr)
[357214] = {cooldown = 90, duration = 0, specs = {}, talent = false, charges = 1, raceid = 52, race = "Dracthyr", class = "", type = 9}, --Wing Buffet (Dracthyr)
[107079] = {cooldown = 120, duration = 0, specs = {}, talent = false, charges = 1, raceid = 25, race = "Pandaren", class = "", type = 9}, --Quaking Palm (Pandaren)
[68992] = {cooldown = 120, duration = 0, specs = {}, talent = false, charges = 1, raceid = 22, race = "Worgen", class = "", type = 9}, --Darkflight (Worgen)
--[68996] = {cooldown = 1, duration = 0, specs = {}, talent = false, charges = 1, raceid = 22, race = "Worgen", class = "", type = 9}, --Two Forms (Worgen)
[26297] = {cooldown = 180, duration = 0, specs = {}, talent = false, charges = 1, raceid = 8, race = "Troll", class = "", type = 9}, --Berserking (Troll)
[20589] = {cooldown = 60, duration = 0, specs = {}, talent = false, charges = 1, raceid = 7, race = "Gnome", class = "", type = 9}, --Escape Artist (Gnome)
[232633] = {cooldown = 120, duration = 0, specs = {}, talent = false, charges = 1, raceid = 10, race = "BloodElf", class = "", type = 9}, --Arcane Torrent (BloodElf)
[59752] = {cooldown = 180, duration = 0, specs = {}, talent = false, charges = 1, raceid = 1, race = "Human", class = "", type = 9}, --Will to Survive (Human)
[20594] = {cooldown = 120, duration = 0, specs = {}, talent = false, charges = 1, raceid = 3, race = "Dwarf", class = "", type = 9}, --Stoneform (Dwarf)
[58984] = {cooldown = 120, duration = 0, specs = {}, talent = false, charges = 1, raceid = 4, race = "NightElf", class = "", type = 9}, --Shadowmeld (NightElf)
[59542] = {cooldown = 180, duration = 0, specs = {}, talent = false, charges = 1, raceid = 11, race = "Draenei", class = "", type = 9}, --Gift of the Naaru (Draenei)
--interrupts
[6552] = {class = "WARRIOR", specs = {71, 72, 73}, cooldown = 15, silence = 4, talent = false, cooldownWithTalent = false, cooldownTalentId = false, type = 6, charges = 1}, --Pummel
@@ -319,6 +369,7 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
--[343527] = {cooldown = 1 min cooldown, duration = 0, specs = {}, talent = false, charges = 1, class = "PALADIN", type = 1}, --Execution Sentence
--[343721] = {cooldown = 1 min cooldown, duration = 0, specs = {}, talent = false, charges = 1, class = "PALADIN", type = 1}, --Final Reckoning
--[391054] = {cooldown = 10 min cooldown, duration = 0, specs = {}, talent = false, charges = 1, class = "PALADIN", type = 5}, --Intercession (battle ress)
[20066] = {cooldown = 15, duration = 0, specs = {}, talent = false, charges = 1, class = "PALADIN", type = 8}, --Repentance
--warrior
-- 71 - Arms
@@ -342,6 +393,8 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
[376079] = {cooldown = 90, duration = 4, specs = {}, talent = false, charges = 1, class = "WARRIOR", type = 1}, --Spear of Bastion
[392966] = {cooldown = 90, duration = 20, specs = {73}, talent = false, charges = 1, class = "WARRIOR", type = 2}, --Spell Block
[384318] = {cooldown = 90, duration = 0, specs = {71, 72, 73}, talent = false, charges = 1, class = "WARRIOR", type = 1}, --Thunderous Roar
[46968] = {cooldown = 40, duration = 0, specs = {}, talent = false, charges = 1, class = "WARRIOR", type = 8}, --Shockwave
[23920] = {cooldown = 25, duration = 5, specs = {}, talent = false, charges = 1, class = "WARRIOR", type = 5}, --Shockwave
--warlock
-- 265 - Affliction
@@ -383,6 +436,10 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
[192077] = {cooldown = 120, duration = 15, specs = {262, 263, 264}, talent = false, charges = 1, class = "SHAMAN", type = 5}, --Wind Rush Totem
--[198838] = {cooldown = 60, duration = 15, specs = {264}, talent = false, charges = 1, class = "SHAMAN", type = 4}, --Earthen Wall Totem
[51485] = {cooldown = 60, duration = 20, specs = {262, 263, 264}, talent = false, charges = 1, class = "SHAMAN", type = 8}, --Earthgrab Totem
--[383017] = {cooldown = 30, duration = 0, specs = {}, talent = false, charges = 1, class = "SHAMAN", type = 4}, --Stoneskin Totem
[51514] = {cooldown = 30, duration = 0, specs = {}, talent = false, charges = 1, class = "SHAMAN", type = 8}, --Hex
[108968] = {cooldown = 5*60, duration = 0, specs = {}, talent = false, charges = 1, class = "PRIEST", type = 3}, --Void Shift
--monk
-- 268 - Brewmaster
@@ -408,6 +465,7 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
[115176] = {cooldown = 300, duration = 8, specs = {268}, talent = false, charges = 1, class = "MONK", type = 2}, --Zen Meditation
[388686] = {cooldown = 120, duration = 30, specs = {268, 269, 270}, talent = false, charges = 1, class = "MONK", type = 1}, --Summon White Tiger Statue
--[322109] = {cooldown = 180, duration = 0, specs = {268, 269, 270}, talent = false, charges = 1, class = "MONK", type = 1}, --Touch of Death
[116841] = {cooldown = 30, duration = 0, specs = {}, talent = false, charges = 1, class = "MONK", type = 5}, --Tiger's Lust
--hunter
@@ -422,13 +480,14 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
[109248] = {cooldown = 45, duration = 10, specs = {253, 254, 255}, talent = false, charges = 1, class = "HUNTER", type = 8}, --Binding Shot
[199483] = {cooldown = 60, duration = 60, specs = {253, 254, 255}, talent = false, charges = 1, class = "HUNTER", type = 2}, --Camouflage
[266779] = {cooldown = 120, duration = 20, specs = {255}, talent = false, charges = 1, class = "HUNTER", type = 1}, --Coordinated Assault
[109304] = {cooldown = 120, duration = 0, specs = {253, 254, 255}, talent = false, charges = 1, class = "HUNTER", type = 2}, --Exhilaration
[109304] = {cooldown = 120, duration = 8, durationSpellId = 385540, specs = {253, 254, 255}, talent = false, charges = 1, class = "HUNTER", type = 2}, --Exhilaration
[187650] = {cooldown = 25, duration = 60, specs = {253, 254, 255}, talent = false, charges = 1, class = "HUNTER", type = 8}, --Freezing Trap
[19577] = {cooldown = 60, duration = 5, specs = {253, 255}, talent = false, charges = 1, class = "HUNTER", type = 8}, --Intimidation
[201430] = {cooldown = 180, duration = 12, specs = {253}, talent = false, charges = 1, class = "HUNTER", type = 1}, --Stampede
[281195] = {cooldown = 180, duration = 6, specs = {253, 254, 255}, talent = false, charges = 1, class = "HUNTER", type = 2}, --Survival of the Fittest
--[281195] = {cooldown = 180, duration = 6, specs = {253, 254, 255}, talent = false, charges = 1, class = "HUNTER", type = 2}, --Survival of the Fittest
[288613] = {cooldown = 180, duration = 15, specs = {254}, talent = false, charges = 1, class = "HUNTER", type = 1}, --Trueshot
[264735] = {cooldown = 180, duration = 0, specs = {253, 254, 255}, talent = false, charges = 1, class = "HUNTER", type = 2}, --Survival of the Fittest
[187698] = {cooldown = 30, duration = 0, specs = {}, talent = false, charges = 1, class = "HUNTER", type = 8}, --Tar Trap
--druid
-- 102 - Balance
@@ -458,6 +517,7 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
[102793] = {cooldown = 60, duration = 10, specs = {102, 103, 104, 105}, talent = false, charges = 1, class = "DRUID", type = 8}, --Ursol's Vortex
[124974] = {cooldown = 90, duration = 0, specs = {102, 103, 104, 105}, talent = false, charges = 1, class = "DRUID", type = 3}, --Nature's Vigil
[106898] = {cooldown = 120, duration = 8, specs = {102, 103, 104, 105}, talent = false, charges = 1, class = "DRUID", type = 5}, --Stampeding Roar
[5211] = {cooldown = 60, duration = 0, specs = {}, talent = false, charges = 1, class = "DRUID", type = 8}, --Mighty Bash
--death knight
-- 252 - Unholy
@@ -484,7 +544,7 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
[207289] = {cooldown = 78, duration = 12, specs = {252}, talent = false, charges = 1, class = "DEATHKNIGHT", type = 1}, --Unholy Assault
[55233] = {cooldown = 90, duration = 10, specs = {250}, talent = false, charges = 1, class = "DEATHKNIGHT", type = 2}, --Vampiric Blood
[212552] = {cooldown = 60, duration = 4, specs = {250, 251, 252}, talent = false, charges = 1, class = "DEATHKNIGHT", type = 2}, --Wraith Walk
[49576] = {cooldown = 25, duration = 0, specs = {}, talent = false, charges = 1, class = "DEATHKNIGHT", type = 8}, --Death Grip
--demon hunter
-- 577 - Havoc
@@ -510,6 +570,7 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
-- 62 - Arcane
-- 63 - Fire
-- 64 - Frost
[365350] = {cooldown = 90, duration = 15, specs = {62}, talent = false, charges = 1, class = "MAGE", type = 1}, --Arcane Surge
[12042] = {cooldown = 90, duration = 10, specs = {62}, talent = false, charges = 1, class = "MAGE", type = 1}, --Arcane Power
[235313] = {cooldown = 25, duration = 60, specs = {63}, talent = false, charges = 1, class = "MAGE", type = 5}, --Blazing Barrier
[235219] = {cooldown = 300, duration = 0, specs = {64}, talent = false, charges = 1, class = "MAGE", type = 2}, --Cold Snap
@@ -525,6 +586,7 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
[235450] = {cooldown = 25, duration = 60, specs = {62}, talent = false, charges = 1, class = "MAGE", type = 5}, --Prismatic Barrier
[205021] = {cooldown = 78, duration = 5, specs = {64}, talent = false, charges = 1, class = "MAGE", type = 1}, --Ray of Frost
[113724] = {cooldown = 45, duration = 10, specs = {62, 63, 64}, talent = false, charges = 1, class = "MAGE", type = 8}, --Ring of Frost
[31661] = {cooldown = 45, duration = 0, specs = {}, talent = false, charges = 1, class = "MAGE", type = 8}, --Dragon's Breath
--priest
-- 256 - Discipline
@@ -571,11 +633,14 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
[114018] = {cooldown = 360, duration = 15, specs = {259, 260, 261}, talent = false, charges = 1, class = "ROGUE", type = 5}, --Shroud of Concealment
[1856] = {cooldown = 120, duration = 3, specs = {259, 260, 261}, talent = false, charges = 1, class = "ROGUE", type = 1}, --Vanish
[79140] = {cooldown = 120, duration = 20, specs = {259}, talent = false, charges = 1, class = "ROGUE", type = 1}, --Vendetta
[1776] = {cooldown = 20, duration = 0, specs = {}, talent = false, charges = 1, class = "ROGUE", type = 8}, --Gouge
[408] = {cooldown = 20, duration = 0, specs = {}, talent = false, charges = 1, class = "ROGUE", type = 8}, --Kidney Shot
[1966] = {cooldown = 15, duration = 0, specs = {}, talent = false, charges = 1, class = "ROGUE", type = 2}, --Feint
--evoker
-- 1467 - Devastation
-- 1468 - Preservation
--[374251] = {cooldown = 60, duration = 0, specs = {1467, 1468}, talent = false, charges = 1, class = "EVOKER", type = 7}, --Cauterizing Flame
[374251] = {cooldown = 60, duration = 0, specs = {1467, 1468}, talent = false, charges = 1, class = "EVOKER", type = 7}, --Cauterizing Flame
--[365585] = {cooldown = 8, duration = 0, specs = {1467, 1468}, talent = false, charges = 1, class = "EVOKER", type = 7}, --Expunge
--[360823] = {cooldown = 8, duration = 0, specs = {1468}, talent = false, charges = 1, class = "EVOKER", type = 7}, --Naturalize
[357210] = {cooldown = 120, duration = 0, specs = {1467, 1468}, talent = false, charges = 1, class = "EVOKER", type = 1}, --Deep Breath
+6
View File
@@ -55,6 +55,12 @@ local isReady, normalizedPercent, timeLeft, charges, minValue, maxValue, current
@spells: a table containing spellIds {spellId, spellId, spellId, ...}
openRaidLib.AddCooldownFilter(filterName, spells)
--get a list of filters which a spell has, returns a table in map format: {[filterName] = true}
--@spellId: the ID of a spell
--@defaultFilterOnly (bool): if true only return built-in filters, example: "defensive-raid", "ofensive".
--@customFiltersOnly (bool): if true onlt return a list of custom filters where the spell was added.
local filterListArray = openRaidLib.GetSpellFilters(spellId, defaultFilterOnly, customFiltersOnly)
--request information about a spell for all units in the raid, units which has this cooldown will report back with a "CooldownUpdate" event
openRaidLib.RequestCooldownInfo(spellId)