From 2fb29a497da23e86ec1872d4689b1d68386bf5ac Mon Sep 17 00:00:00 2001 From: Tercio Date: Tue, 7 Aug 2018 15:55:19 -0300 Subject: [PATCH] - Death Knight: Epidemic, Scourge Strike and Howling Blast now has a better description on the spell name. - Fixed snap button showing when 'Hide Resize Buttons' are enabled. - Fixed title bar icons not hiding when 'Auto Hide Buttons' is enabled. - Several improvements to overall data, it should be more consistent now. - Details! now passes to identify the tank role of the player even when out of a party or raid. - Debug helper Details:DumpTable(table) now correctly shows the key name when it isn't a string. - Improvements done on the Bookmark config frame accessed by the options panel > display section. - New slash command: '/details spells'. - Statistics for Legion has been closed! You can access statistics from the orange gear > statistics. --- Libs/DF/button.lua | 13 +- Libs/DF/dropdown.lua | 12 +- Libs/DF/fw.lua | 272 ++++++++++++++++-- Libs/DF/panel.lua | 70 +++-- Libs/DF/slider.lua | 11 +- Libs/DF/spells.lua | 190 +++++++++++- Libs/libs.xml | 2 +- boot.lua | 22 +- classes/classe_instancia.lua | 6 +- classes/container_historico.lua | 5 +- core/control.lua | 22 +- core/parser.lua | 164 +++-------- core/plugins.lua | 19 +- core/util.lua | 8 +- core/windows.lua | 72 ++++- functions/dungeon.lua | 2 +- functions/profiles.lua | 3 +- functions/raidinfo.lua | 102 ++++++- functions/slash.lua | 6 +- functions/spellcache.lua | 25 +- gumps/fw_mods.lua | 2 +- gumps/janela_info.lua | 2 +- gumps/janela_news.lua | 4 +- gumps/janela_options.lua | 2 +- gumps/janela_principal.lua | 71 +++-- images/raid/UldirRaid_BossFaces.tga | Bin 0 -> 116512 bytes images/raid/UldirRaid_Icon256x128.tga | Bin 0 -> 130550 bytes .../Details_RaidInfo-EmeraldNightmare.lua | 93 ------ .../Details_RaidInfo-EmeraldNightmare.toc | 6 - .../boss_faces.tga | Bin 110918 -> 0 bytes .../icon256x128.tga | Bin 127657 -> 0 bytes .../Details_RaidInfo-Nighthold.lua | 102 ------- .../Details_RaidInfo-Nighthold.toc | 6 - .../Details_RaidInfo-Nighthold/boss_faces.tga | Bin 146746 -> 0 bytes .../icon256x128.tga | Bin 123991 -> 0 bytes .../Details_RaidInfo-TombOfSargeras.lua | 100 ------- .../Details_RaidInfo-TombOfSargeras.toc | 6 - .../boss_faces.tga | Bin 123483 -> 0 bytes .../icon256x128.tga | Bin 130568 -> 0 bytes .../Details_RaidInfo-TrialOfValor.lua | 81 ------ .../Details_RaidInfo-TrialOfValor.toc | 6 - .../boss_faces.tga | Bin 53294 -> 0 bytes .../icon256x128.tga | Bin 127529 -> 0 bytes plugins/Details_Streamer/Details_Streamer.lua | 10 +- startup.lua | 10 +- 45 files changed, 848 insertions(+), 679 deletions(-) create mode 100644 images/raid/UldirRaid_BossFaces.tga create mode 100644 images/raid/UldirRaid_Icon256x128.tga delete mode 100644 plugins/Details_RaidInfo-EmeraldNightmare/Details_RaidInfo-EmeraldNightmare.lua delete mode 100644 plugins/Details_RaidInfo-EmeraldNightmare/Details_RaidInfo-EmeraldNightmare.toc delete mode 100644 plugins/Details_RaidInfo-EmeraldNightmare/boss_faces.tga delete mode 100644 plugins/Details_RaidInfo-EmeraldNightmare/icon256x128.tga delete mode 100644 plugins/Details_RaidInfo-Nighthold/Details_RaidInfo-Nighthold.lua delete mode 100644 plugins/Details_RaidInfo-Nighthold/Details_RaidInfo-Nighthold.toc delete mode 100644 plugins/Details_RaidInfo-Nighthold/boss_faces.tga delete mode 100644 plugins/Details_RaidInfo-Nighthold/icon256x128.tga delete mode 100644 plugins/Details_RaidInfo-TombOfSargeras/Details_RaidInfo-TombOfSargeras.lua delete mode 100644 plugins/Details_RaidInfo-TombOfSargeras/Details_RaidInfo-TombOfSargeras.toc delete mode 100644 plugins/Details_RaidInfo-TombOfSargeras/boss_faces.tga delete mode 100644 plugins/Details_RaidInfo-TombOfSargeras/icon256x128.tga delete mode 100644 plugins/Details_RaidInfo-TrialOfValor/Details_RaidInfo-TrialOfValor.lua delete mode 100644 plugins/Details_RaidInfo-TrialOfValor/Details_RaidInfo-TrialOfValor.toc delete mode 100644 plugins/Details_RaidInfo-TrialOfValor/boss_faces.tga delete mode 100644 plugins/Details_RaidInfo-TrialOfValor/icon256x128.tga diff --git a/Libs/DF/button.lua b/Libs/DF/button.lua index 6355082e..f73340d3 100644 --- a/Libs/DF/button.lua +++ b/Libs/DF/button.lua @@ -1149,8 +1149,17 @@ end local pickcolor_callback = function (self, r, g, b, a, button) a = abs (a-1) button.MyObject.color_texture:SetVertexColor (r, g, b, a) - button.MyObject:color_callback (r, g, b, a) + + --> safecall + --button.MyObject:color_callback (r, g, b, a) + local success, errorText = pcall (button.MyObject.color_callback, button.MyObject, r, g, b, a) + if (not success) then + error ("Details! Framework: colorpick " .. (self:GetName() or "-NONAME-") .. " error: " .. errorText) + end + + button.MyObject:RunHooksForWidget ("OnColorChanged", button.MyObject, r, g, b, a) end + local pickcolor = function (self, alpha, param2) local r, g, b, a = self.MyObject.color_texture:GetVertexColor() a = abs (a-1) @@ -1181,6 +1190,8 @@ function DF:NewColorPickButton (parent, name, member, callback, alpha, button_te button.Cancel = colorpick_cancel button.SetColor = set_colorpick_color + button.HookList.OnColorChanged = {} + if (not button_template) then button:InstallCustomTexture() button:SetBackdrop ({edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]], edgeSize = 6, diff --git a/Libs/DF/dropdown.lua b/Libs/DF/dropdown.lua index c6dec67f..4c2e2eee 100644 --- a/Libs/DF/dropdown.lua +++ b/Libs/DF/dropdown.lua @@ -490,7 +490,7 @@ function DetailsFrameworkDropDownOptionClick (button) error ("Details! Framework: dropdown " .. button:GetParent():GetParent():GetParent().MyObject:GetName() .. " error: " .. errorText) end - --button.table.onclick (button:GetParent():GetParent():GetParent().MyObject, button.object.FixedValue, button.table.value) + button:GetParent():GetParent():GetParent().MyObject:RunHooksForWidget ("OnOptionSelected", button:GetParent():GetParent():GetParent().MyObject, button.object.FixedValue, button.table.value) end --> set the value of selected option in main object @@ -987,7 +987,8 @@ function DF:NewDropDown (parent, container, name, member, w, h, func, default, t local scroll = _G [DropDownObject.dropdown:GetName() .. "_ScrollFrame"] - DropDownObject.scroll = DF:NewScrollBar (scroll, _G [DropDownObject.dropdown:GetName() .. "_ScrollFrame".."_ScrollChild"], -25, -18) + DropDownObject.scroll = DF:NewScrollBar (scroll, _G [DropDownObject.dropdown:GetName() .. "_ScrollFrame".."_ScrollChild"], -18, -18) + DF:ReskinSlider (scroll) function DropDownObject:HideScroll() scroll.baixo:Hide() @@ -1000,8 +1001,6 @@ function DF:NewDropDown (parent, container, name, member, w, h, func, default, t scroll.slider:Show() end - --button_down_scripts (DropDownObject, scroll.slider, scroll.baixo) - DropDownObject:HideScroll() DropDownObject.label:SetSize (DropDownObject.dropdown:GetWidth()-40, 10) @@ -1010,6 +1009,7 @@ function DF:NewDropDown (parent, container, name, member, w, h, func, default, t OnLeave = {}, OnHide = {}, OnShow = {}, + OnOptionSelected = {}, } DropDownObject.dropdown:SetScript ("OnShow", DetailsFrameworkDropDownOnShow) @@ -1110,13 +1110,15 @@ function DF:CreateNewDropdownFrame (parent, name) scroll:SetSize (150, 150) scroll:SetPoint ("topleft", f, "bottomleft", 0, 0) f.dropdownframe = scroll - + local child = CreateFrame ("frame", "$Parent_ScrollChild", scroll) child:SetSize (150, 150) child:SetPoint ("topleft", scroll, "topleft", 0, 0) child:SetBackdrop (child_backdrop) child:SetBackdropColor (0, 0, 0, 1) + DF:ApplyStandardBackdrop (child) + local selected = child:CreateTexture ("$parent_SelectedTexture", "BACKGROUND") selected:SetSize (150, 16) selected:Hide() diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua index c621ff33..4f69d0e0 100644 --- a/Libs/DF/fw.lua +++ b/Libs/DF/fw.lua @@ -1,5 +1,5 @@ -local dversion = 87 +local dversion = 94 local major, minor = "DetailsFramework-1.0", dversion local DF, oldminor = LibStub:NewLibrary (major, minor) @@ -122,10 +122,12 @@ local embed_functions = { "FormatNumber", "IntegerToTimer", "QuickDispatch", + "Dispatch", "CommaValue", "RemoveRealmName", "Trim", "CreateGlowOverlay", + "CreateAnts", "CreateFrameShake", } @@ -696,7 +698,7 @@ end local disable_on_combat = {} - function DF:BuildMenu (parent, menu, x_offset, y_offset, height, use_two_points, text_template, dropdown_template, switch_template, switch_is_box, slider_template, button_template) + function DF:BuildMenu (parent, menu, x_offset, y_offset, height, use_two_points, text_template, dropdown_template, switch_template, switch_is_box, slider_template, button_template, value_change_hook) if (not parent.widget_list) then DF:SetAsOptionsPanel (parent) @@ -734,6 +736,18 @@ end dropdown:SetPoint ("left", label, "right", 2) label:SetPoint (cur_x, cur_y) + --> global callback + if (value_change_hook) then + dropdown:SetHook ("OnOptionSelected", value_change_hook) + end + + --> hook list + if (widget_table.hooks) then + for hookName, hookFunc in pairs (widget_table.hooks) do + dropdown:SetHook (hookName, hookFunc) + end + end + local size = label.widget:GetStringWidth() + 140 + 4 if (size > max_x) then max_x = size @@ -754,6 +768,17 @@ end switch:SetAsCheckBox() end + if (value_change_hook) then + switch:SetHook ("OnSwitch", value_change_hook) + end + + --> hook list + if (widget_table.hooks) then + for hookName, hookFunc in pairs (widget_table.hooks) do + switch:SetHook (hookName, hookFunc) + end + end + local label = DF:NewLabel (parent, nil, "$parentLabel" .. index, nil, widget_table.name .. (use_two_points and ": " or ""), "GameFontNormal", widget_table.text_template or text_template or 12) switch:SetPoint ("left", label, "right", 2) label:SetPoint (cur_x, cur_y) @@ -777,6 +802,19 @@ end if (widget_table.thumbscale) then slider:SetThumbSize (slider.thumb:GetWidth()*widget_table.thumbscale, nil) + else + slider:SetThumbSize (slider.thumb:GetWidth()*1.3, nil) + end + + if (value_change_hook) then + slider:SetHook ("OnValueChanged", value_change_hook) + end + + --> hook list + if (widget_table.hooks) then + for hookName, hookFunc in pairs (widget_table.hooks) do + slider:SetHook (hookName, hookFunc) + end end local label = DF:NewLabel (parent, nil, "$parentLabel" .. index, nil, widget_table.name .. (use_two_points and ": " or ""), "GameFontNormal", widget_table.text_template or text_template or 12) @@ -805,6 +843,17 @@ end colorpick:SetColor (default_value, g, b, a) end + if (value_change_hook) then + colorpick:SetHook ("OnColorChanged", value_change_hook) + end + + --> hook list + if (widget_table.hooks) then + for hookName, hookFunc in pairs (widget_table.hooks) do + colorpick:SetHook (hookName, hookFunc) + end + end + local label = DF:NewLabel (parent, nil, "$parentLabel" .. index, nil, widget_table.name .. (use_two_points and ": " or ""), "GameFontNormal", widget_table.text_template or text_template or 12) colorpick:SetPoint ("left", label, "right", 2) label:SetPoint (cur_x, cur_y) @@ -829,6 +878,15 @@ end button.tooltip = widget_table.desc button.widget_type = "execute" + --> execute doesn't trigger global callback + + --> hook list + if (widget_table.hooks) then + for hookName, hookFunc in pairs (widget_table.hooks) do + button:SetHook (hookName, hookFunc) + end + end + local size = button:GetWidth() + 4 if (size > max_x) then max_x = size @@ -851,6 +909,15 @@ end textentry:SetPoint ("left", label, "right", 2) label:SetPoint (cur_x, cur_y) + --> text entry doesn't trigger global callback + + --> hook list + if (widget_table.hooks) then + for hookName, hookFunc in pairs (widget_table.hooks) do + textentry:SetHook (hookName, hookFunc) + end + end + local size = label.widget:GetStringWidth() + 60 + 4 if (size > max_x) then max_x = size @@ -1130,8 +1197,43 @@ end --fonts DF.font_templates = DF.font_templates or {} -DF.font_templates ["ORANGE_FONT_TEMPLATE"] = {color = "orange", size = 11, font = "Accidental Presidency"} -DF.font_templates ["OPTIONS_FONT_TEMPLATE"] = {color = "yellow", size = 12, font = "Accidental Presidency"} + +--> detect which language is the client and select the font accordingly +local clientLanguage = GetLocale() +if (clientLanguage == "enGB") then + clientLanguage = "enUS" +end + +DF.ClientLanguage = clientLanguage + +--> return the best font to use for the client language +function DF:GetBestFontForLanguage (language, western, cyrillic, china, korean, taiwan) + if (not language) then + language = DF.ClientLanguage + end + + if (language == "enUS" or language == "deDE" or language == "esES" or language == "esMX" or language == "frFR" or language == "itIT" or language == "ptBR") then + return western or "Accidental Presidency" + + elseif (language == "ruRU") then + return cyrillic or "Arial Narrow" + + elseif (language == "zhCN") then + return china or "AR CrystalzcuheiGBK Demibold" + + elseif (language == "koKR") then + return korean or "2002" + + elseif (language == "zhTW") then + return taiwan or "AR CrystalzcuheiGBK Demibold" + + end +end + +--DF.font_templates ["ORANGE_FONT_TEMPLATE"] = {color = "orange", size = 11, font = "Accidental Presidency"} +--DF.font_templates ["OPTIONS_FONT_TEMPLATE"] = {color = "yellow", size = 12, font = "Accidental Presidency"} +DF.font_templates ["ORANGE_FONT_TEMPLATE"] = {color = "orange", size = 11, font = DF:GetBestFontForLanguage()} +DF.font_templates ["OPTIONS_FONT_TEMPLATE"] = {color = "yellow", size = 12, font = DF:GetBestFontForLanguage()} -- dropdowns @@ -1212,6 +1314,14 @@ function DF:InstallTemplate (widget_type, template_name, template, parent_name) local template_table if (widget_type == "font") then template_table = DF.font_templates + + local font = template.font + if (font) then + --> fonts passed into the template has default to western + --> the framework will get the game client language and change the font if needed + font = DF:GetBestFontForLanguage (nil, font) + end + elseif (widget_type == "dropdown") then template_table = DF.dropdown_templates elseif (widget_type == "button") then @@ -1260,7 +1370,7 @@ function DF:RunHooksForWidget (event, ...) local hooks = self.HookList [event] if (not hooks) then - print (self.widget:GetName(), "sem hook para", event) + print (self.widget:GetName(), "no hooks for", event) return end @@ -1397,6 +1507,7 @@ function DF:CreateAnimationHub (parent, onPlay, onFinished) local newAnimation = parent:CreateAnimationGroup() newAnimation:SetScript ("OnPlay", onPlay) newAnimation:SetScript ("OnFinished", onFinished) + newAnimation:SetScript ("OnStop", onFinished) newAnimation.NextAnimation = 1 return newAnimation end @@ -1434,6 +1545,9 @@ end local frameshake_shake_finished = function (parent, shakeObject) if (shakeObject.IsPlaying) then shakeObject.IsPlaying = false + shakeObject.TimeLeft = 0 + shakeObject.IsFadingOut = false + shakeObject.IsFadingIn = false --> update the amount of shake running on this frame parent.__frameshakes.enabled = parent.__frameshakes.enabled - 1 @@ -1442,7 +1556,18 @@ local frameshake_shake_finished = function (parent, shakeObject) for i = 1, #shakeObject.Anchors do local anchor = shakeObject.Anchors [i] - if (#anchor == 3) then + --> automatic anchoring and reanching needs to the reviwed in the future + if (#anchor == 1) then + local anchorTo = unpack (anchor) + parent:ClearAllPoints() + parent:SetPoint (anchorTo) + + elseif (#anchor == 2) then + local anchorTo, point1 = unpack (anchor) + parent:ClearAllPoints() + parent:SetPoint (anchorTo, point1) + + elseif (#anchor == 3) then local anchorTo, point1, point2 = unpack (anchor) parent:SetPoint (anchorTo, point1, point2) @@ -1461,9 +1586,8 @@ local frameshake_do_update = function (parent, shakeObject, deltaTime) --> update time left shakeObject.TimeLeft = max (shakeObject.TimeLeft - deltaTime, 0) - + if (shakeObject.TimeLeft > 0) then - --> update fade in and out if (shakeObject.IsFadingIn) then shakeObject.IsFadingInTime = shakeObject.IsFadingInTime + deltaTime @@ -1485,7 +1609,7 @@ local frameshake_do_update = function (parent, shakeObject, deltaTime) --> update position local scaleShake = min (shakeObject.IsFadingIn and (shakeObject.IsFadingInTime / shakeObject.FadeInTime) or 1, shakeObject.IsFadingOut and (1 - shakeObject.IsFadingOutTime / shakeObject.FadeOutTime) or 1) - + if (scaleShake > 0) then --> delate the time by the frequency on both X and Y offsets @@ -1511,12 +1635,16 @@ local frameshake_do_update = function (parent, shakeObject, deltaTime) for i = 1, #shakeObject.Anchors do local anchor = shakeObject.Anchors [i] - if (#anchor == 3) then + if (#anchor == 1 or #anchor == 3) then local anchorTo, point1, point2 = unpack (anchor) + point1 = point1 or 0 + point2 = point2 or 0 parent:SetPoint (anchorTo, point1 + newX, point2 + newY) elseif (#anchor == 5) then local anchorName1, anchorTo, anchorName2, point1, point2 = unpack (anchor) + --parent:ClearAllPoints() + parent:SetPoint (anchorName1, anchorTo, anchorName2, point1 + newX, point2 + newY) end end @@ -1541,6 +1669,10 @@ local frameshake_update_all = function (parent, deltaTime) end end +local frameshake_stop = function (parent, shakeObject) + frameshake_shake_finished (parent, shakeObject) +end + --> scale direction scales the X and Y coordinates, scale strength scales the amplitude and frequency local frameshake_play = function (parent, shakeObject, scaleDirection, scaleAmplitude, scaleFrequency, scaleDuration) @@ -1563,7 +1695,6 @@ local frameshake_play = function (parent, shakeObject, scaleDirection, scaleAmpl shakeObject.IsFadingOut = false shakeObject.IsFadingOutTime = 0 end - else --> create a new random offset shakeObject.XSineOffset = math.pi * 2 * math.random() @@ -1605,6 +1736,10 @@ local frameshake_play = function (parent, shakeObject, scaleDirection, scaleAmpl --> update the amount of shake running on this frame parent.__frameshakes.enabled = parent.__frameshakes.enabled + 1 + + if (not parent:GetScript ("OnUpdate")) then + parent:SetScript ("OnUpdate", function()end) + end end shakeObject.IsPlaying = true @@ -1649,6 +1784,7 @@ function DF:CreateFrameShake (parent, duration, amplitude, frequency, absoluteSi enabled = 0, } parent.PlayFrameShake = frameshake_play + parent.StopFrameShake = frameshake_stop parent.UpdateFrameShake = frameshake_do_update parent.UpdateAllFrameShake = frameshake_update_all parent:HookScript ("OnUpdate", frameshake_update_all) @@ -1663,28 +1799,69 @@ end ----------------------------- --> glow overlay -local play_glow_overlay = function (self) - self:Show() +local glow_overlay_play = function (self) + if (not self:IsShown()) then + self:Show() + end if (self.animOut:IsPlaying()) then self.animOut:Stop() end - self.animIn:Play() + if (not self.animIn:IsPlaying()) then + self.animIn:Play() + end end -local stop_glow_overlay = function (self) - self.animOut:Stop() - self.animIn:Stop() - self:Hide() +local glow_overlay_stop = function (self) + if (self.animOut:IsPlaying()) then + self.animOut:Stop() + end + if (self.animIn:IsPlaying()) then + self.animIn:Stop() + end + if (self:IsShown()) then + self:Hide() + end end -local defaultColor = {1, 1, 1, 1} +local glow_overlay_setcolor = function (self, antsColor, glowColor) + if (antsColor) then + local r, g, b, a = DF:ParseColors (antsColor) + self.ants:SetVertexColor (r, g, b, a) + self.AntsColor.r = r + self.AntsColor.g = g + self.AntsColor.b = b + self.AntsColor.a = a + end + + if (glowColor) then + local r, g, b, a = DF:ParseColors (glowColor) + self.outerGlow:SetVertexColor (r, g, b, a) + self.GlowColor.r = r + self.GlowColor.g = g + self.GlowColor.b = b + self.GlowColor.a = a + end +end + +local glow_overlay_onshow = function (self) + glow_overlay_play (self) +end + +local glow_overlay_onhide = function (self) + glow_overlay_stop (self) +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") + glowFrame:HookScript ("OnShow", glow_overlay_onshow) + glowFrame:HookScript ("OnHide", glow_overlay_onhide) - glowFrame.Play = play_glow_overlay - glowFrame.Stop = stop_glow_overlay + glowFrame.Play = glow_overlay_play + glowFrame.Stop = glow_overlay_stop + glowFrame.SetColor = glow_overlay_setcolor + + glowFrame:Hide() parent.overlay = glowFrame local frameWidth, frameHeight = parent:GetSize() @@ -1693,20 +1870,67 @@ function DF:CreateGlowOverlay (parent, antsColor, glowColor) --Make the height/width available before the next frame: parent.overlay:SetSize(frameWidth * scale, frameHeight * scale) - parent.overlay:SetPoint("TOPLEFT", parent, "TOPLEFT", -frameWidth * 0.2, frameHeight * 0.2) - parent.overlay:SetPoint("BOTTOMRIGHT", parent, "BOTTOMRIGHT", frameWidth * 0.2, -frameHeight * 0.2) + parent.overlay:SetPoint("TOPLEFT", parent, "TOPLEFT", -frameWidth * 0.32, frameHeight * 0.36) + parent.overlay:SetPoint("BOTTOMRIGHT", parent, "BOTTOMRIGHT", frameWidth * 0.32, -frameHeight * 0.36) local r, g, b, a = DF:ParseColors (antsColor or defaultColor) glowFrame.ants:SetVertexColor (r, g, b, a) + glowFrame.AntsColor = {r, g, b, a} local r, g, b, a = DF:ParseColors (glowColor or defaultColor) glowFrame.outerGlow:SetVertexColor (r, g, b, a) + glowFrame.GlowColor = {r, g, b, a} glowFrame.outerGlow:SetScale (1.2) - return glowFrame end +--> custom glow with ants animation +local ants_set_texture_offset = function (self, leftOffset, rightOffset, topOffset, bottomOffset) + leftOffset = leftOffset or 0 + rightOffset = rightOffset or 0 + topOffset = topOffset or 0 + bottomOffset = bottomOffset or 0 + + self:ClearAllPoints() + self:SetPoint ("topleft", leftOffset, topOffset) + self:SetPoint ("bottomright", rightOffset, bottomOffset) +end + +function DF:CreateAnts (parent, antTable, leftOffset, rightOffset, topOffset, bottomOffset, antTexture) + leftOffset = leftOffset or 0 + rightOffset = rightOffset or 0 + topOffset = topOffset or 0 + bottomOffset = bottomOffset or 0 + + local f = CreateFrame ("frame", nil, parent) + f:SetPoint ("topleft", leftOffset, topOffset) + f:SetPoint ("bottomright", rightOffset, bottomOffset) + + f.SetOffset = ants_set_texture_offset + + local t = f:CreateTexture (nil, "overlay") + t:SetAllPoints() + t:SetTexture (antTable.Texture) + t:SetBlendMode (antTable.BlendMode or "ADD") + t:SetVertexColor (DF:ParseColors (antTable.Color or "white")) + f.Texture = t + + f.AntTable = antTable + + f:SetScript ("OnUpdate", function (self, deltaTime) + AnimateTexCoords (t, self.AntTable.TextureWidth, self.AntTable.TextureHeight, self.AntTable.TexturePartsWidth, self.AntTable.TexturePartsHeight, self.AntTable.AmountParts, deltaTime, self.AntTable.Throttle or 0.025) + end) + + return f +end + +--[=[ --test ants +do + local f = DF:CreateAnts (UIParent) +end +--]=] + ----------------------------- --> borders diff --git a/Libs/DF/panel.lua b/Libs/DF/panel.lua index d260e889..f550a48b 100644 --- a/Libs/DF/panel.lua +++ b/Libs/DF/panel.lua @@ -38,6 +38,10 @@ DF.OptionsFunctions = { self.options = {} self.options [optionName] = optionValue end + + if (self.OnOptionChanged) then + DF:Dispatch (self.OnOptionChanged, self, optionName, optionValue) + end end, GetOption = function (self, optionName) @@ -2067,34 +2071,42 @@ function DF:ShowTextPromptPanel (message, callback) if (not DF.text_prompt_panel) then local f = CreateFrame ("frame", "DetailsFrameworkPrompt", UIParent) - f:SetSize (400, 100) - f:SetFrameStrata ("DIALOG") - f:SetPoint ("center", UIParent, "center", 0, 300) - f:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - f:SetBackdropColor (0, 0, 0, 0.8) - f:SetBackdropBorderColor (0, 0, 0, 1) + f:SetSize (400, 120) + f:SetFrameStrata ("FULLSCREEN") + f:SetPoint ("center", UIParent, "center", 0, 100) + f:EnableMouse (true) + f:SetMovable (true) + f:RegisterForDrag ("LeftButton") + f:SetScript ("OnDragStart", function() f:StartMoving() end) + f:SetScript ("OnDragStop", function() f:StopMovingOrSizing() end) + f:SetScript ("OnMouseDown", function (self, button) if (button == "RightButton") then f.EntryBox:ClearFocus() f:Hide() end end) + tinsert (UISpecialFrames, "DetailsFrameworkPrompt") + + DF:CreateTitleBar (f, "Prompt!") + DF:ApplyStandardBackdrop (f) local prompt = f:CreateFontString (nil, "overlay", "GameFontNormal") - prompt:SetPoint ("top", f, "top", 0, -15) + prompt:SetPoint ("top", f, "top", 0, -25) prompt:SetJustifyH ("center") + prompt:SetSize (360, 36) f.prompt = prompt local button_text_template = DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE") local options_dropdown_template = DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") - local button_true = DF:CreateButton (f, nil, 60, 20, "Okey", nil, nil, nil, nil, nil, nil, options_dropdown_template, button_text_template) - button_true:SetPoint ("bottomleft", f, "bottomleft", 10, 5) - f.button_true = button_true - - local button_false = DF:CreateButton (f, function() f.textbox:ClearFocus(); f:Hide() end, 60, 20, "Cancel", nil, nil, nil, nil, nil, nil, options_dropdown_template, button_text_template) - button_false:SetPoint ("bottomright", f, "bottomright", -10, 5) - f.button_false = button_false - local textbox = DF:CreateTextEntry (f, function()end, 380, 20, "textbox", nil, nil, options_dropdown_template) - textbox:SetPoint ("topleft", f, "topleft", 10, -45) + textbox:SetPoint ("topleft", f, "topleft", 10, -60) f.EntryBox = textbox - button_true:SetClickFunction (function() + local button_true = DF:CreateButton (f, nil, 60, 20, "Okey", nil, nil, nil, nil, nil, nil, options_dropdown_template) + button_true:SetPoint ("bottomright", f, "bottomright", -10, 5) + f.button_true = button_true + + local button_false = DF:CreateButton (f, function() f.textbox:ClearFocus(); f:Hide() end, 60, 20, "Cancel", nil, nil, nil, nil, nil, nil, options_dropdown_template) + button_false:SetPoint ("bottomleft", f, "bottomleft", 10, 5) + f.button_false = button_false + + local executeCallback = function() local my_func = button_true.true_function if (my_func) then local okey, errormessage = pcall (my_func, textbox:GetText()) @@ -2104,6 +2116,14 @@ function DF:ShowTextPromptPanel (message, callback) end f:Hide() end + end + + button_true:SetClickFunction (function() + executeCallback() + end) + + textbox:SetHook ("OnEnterPressed", function() + executeCallback() end) f:Hide() @@ -2115,7 +2135,6 @@ function DF:ShowTextPromptPanel (message, callback) DetailsFrameworkPrompt.EntryBox:SetText ("") DF.text_prompt_panel.prompt:SetText (message) DF.text_prompt_panel.button_true.true_function = callback - DF.text_prompt_panel.textbox:SetFocus (true) end @@ -4853,10 +4872,12 @@ DF.IconRowFunctions = { iconFrame.Text:Hide() end + iconFrame:SetSize (self.options.icon_width, self.options.icon_height) iconFrame:Show() --> update the size of the frame self:SetWidth ((self.options.left_padding * 2) + (self.options.icon_padding * (self.NextIcon-2)) + (self.options.icon_width * (self.NextIcon - 1))) + self:SetHeight (self.options.icon_height + (self.options.top_padding * 2)) --> show the frame self:Show() @@ -4903,7 +4924,12 @@ DF.IconRowFunctions = { elseif (side == 13) then return 1 end - end + end, + + OnOptionChanged = function (self, optionName) + self:SetBackdropColor (unpack (self.options.backdrop_color)) + self:SetBackdropBorderColor (unpack (self.options.backdrop_border_color)) + end, } local default_icon_row_options = { @@ -4912,9 +4938,9 @@ local default_icon_row_options = { texcoord = {.1, .9, .1, .9}, show_text = true, text_color = {1, 1, 1, 1}, - left_padding = 2, --distance between right and left - top_padding = 2, --distance between top and bottom - icon_padding = 2, --distance between each icon + left_padding = 1, --distance between right and left + top_padding = 1, --distance between top and bottom + icon_padding = 1, --distance between each icon backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}, backdrop_color = {0, 0, 0, 0.5}, backdrop_border_color = {0, 0, 0, 1}, diff --git a/Libs/DF/slider.lua b/Libs/DF/slider.lua index 737a1668..14d69e6e 100644 --- a/Libs/DF/slider.lua +++ b/Libs/DF/slider.lua @@ -806,7 +806,15 @@ local SwitchOnClick = function (self, button, forced_value, value) if (slider.return_func) then value = slider:return_func (value) end - slider.OnSwitch (slider, slider.FixedValue, value) + + --> safe call + local success, errorText = pcall (slider.OnSwitch, slider, slider.FixedValue, value) + if (not success) then + error ("Details! Framework: OnSwitch() " .. (button:GetName() or "-NONAME-") .. " error: " .. (errorText or "")) + end + + --> trigger hooks + slider:RunHooksForWidget ("OnSwitch", slider, slider.FixedValue, value) end end @@ -935,6 +943,7 @@ function DF:NewSwitch (parent, container, name, member, w, h, ltext, rtext, defa h = h or 20 local slider = DF:NewButton (parent, container, name, member, w, h) + slider.HookList.OnSwitch = {} slider.switch_func = switch_func slider.return_func = return_func diff --git a/Libs/DF/spells.lua b/Libs/DF/spells.lua index 2a7ac61d..2e0a966b 100644 --- a/Libs/DF/spells.lua +++ b/Libs/DF/spells.lua @@ -4,6 +4,9 @@ if (not DF or not DetailsFrameworkCanLoad) then return end +DF_COOLDOWN_RAID = 4 +DF_COOLDOWN_EXTERNAL = 3 + DF.CooldownsBySpec = { -- 1 attack cooldown -- 2 personal defensive cooldown @@ -107,10 +110,10 @@ DF.CooldownsBySpec = { --affliction [265] = { [205180] = 1, --Summon Darkglare - [113860] = 1, --Dark Soul: Misery + [113860] = 1, --Dark Soul: Misery (talent) [104773] = 2, --Unending Resolve - [108416] = 2, --Dark Pact + [108416] = 2, --Dark Pact (talent) [30283] = 5, --Shadowfury [6789] = 5, --Mortal Coil @@ -118,11 +121,11 @@ DF.CooldownsBySpec = { --demo [266] = { [265187] = 1, --Summon Demonic Tyrant - [111898] = 1, --Grimoire: Felguard - [267217] = 1, --Nether Portal + [111898] = 1, --Grimoire: Felguard (talent) + [267217] = 1, --Nether Portal (talent) [104773] = 2, --Unending Resolve - [108416] = 2, --Dark Pact + [108416] = 2, --Dark Pact (talent) [30283] = 5, --Shadowfury [6789] = 5, --Mortal Coil @@ -130,10 +133,10 @@ DF.CooldownsBySpec = { --destro [267] = { [1122] = 1, --Summon Infernal - [113858] = 1, --Dark Soul: Instability + [113858] = 1, --Dark Soul: Instability (talent) [104773] = 2, --Unending Resolve - [108416] = 2, --Dark Pact + [108416] = 2, --Dark Pact (talent) [6789] = 5, --Mortal Coil [30283] = 5, --Shadowfury @@ -387,12 +390,13 @@ DF.CooldownsBySpec = { --mistweaver [270] = { [122278] = 2, --Dampen Harm (talent) - [198664] = 2, --Invoke Chi-Ji, the Red Crane (talent) [243435] = 2, --Fortifying Brew [122783] = 2, --Diffuse Magic (talent) [116849] = 3, --Life Cocoon + [198664] = 4, --Invoke Chi-Ji, the Red Crane (talent) + [115310] = 4, --Revival }, @@ -424,6 +428,171 @@ DF.CooldownsBySpec = { }, } +--> tells the duration, requirements and cooldown of a cooldown +DF.CooldownsInfo = { + --> paladin + [31884] = {cooldown = 120, duration = 20, talent = false, charges = 1, class = "PALADIN", type = 1}, --Avenging Wrath + [216331] = {cooldown = 120, duration = 20, talent = 22190, charges = 1, class = "PALADIN", type = 1}, --Avenging Crusader (talent) + [498] = {cooldown = 60, duration = 8, talent = false, charges = 1, class = "PALADIN", type = 2}, --Divine Protection + [642] = {cooldown = 300, duration = 8, talent = false, charges = 1, class = "PALADIN", type = 2}, --Divine Shield + [105809] = {cooldown = 90, duration = 20, talent = 22164, charges = 1, class = "PALADIN", type = 2}, --Holy Avenger (talent) + [1022] = {cooldown = 300, duration = 10, talent = false, charges = 1, class = "PALADIN", type = 3}, --Blessing of Protection + [633] = {cooldown = 600, duration = false, talent = false, charges = 1, class = "PALADIN", type = 3}, --Lay on Hands + [31821] = {cooldown = 180, duration = 8, talent = false, charges = 1, class = "PALADIN", type = 4}, --Aura Mastery + [1044] = {cooldown = 25, duration = 8, talent = false, charges = 1, class = "PALADIN", type = 5}, --Blessing of Freedom + [31850] = {cooldown = 120, duration = 8, talent = false, charges = 1, class = "PALADIN", type = 2}, --Ardent Defender + [86659] = {cooldown = 300, duration = 8, talent = false, charges = 1, class = "PALADIN", type = 2}, --Guardian of Ancient Kings + [204018] = {cooldown = 180, duration = 10, talent = 22435, charges = 1, class = "PALADIN", type = 3}, --Blessing of Spellwarding (talent) + [6940] = {cooldown = 120, duration = 12, talent = false, charges = 1, class = "PALADIN", type = 3}, --Blessing of Sacrifice + [204150] = {cooldown = 180, duration = 6, talent = 23087, charges = 1, class = "PALADIN", type = 4}, --Aegis of Light (talent) + [231895] = {cooldown = 120, duration = 25, talent = 22215, charges = 1, class = "PALADIN", type = 1}, --Crusade (talent) + [184662] = {cooldown = 120, duration = 15, talent = false, charges = 1, class = "PALADIN", type = 2}, --Shield of Vengeance + + --> warrior + [107574] = {cooldown = 90, duration = 20, talent = 22397, charges = 1, class = "WARRIOR", type = 1}, --Avatar + [227847] = {cooldown = 90, duration = 5, talent = false, charges = 1, class = "WARRIOR", type = 1}, --Bladestorm + [152277] = {cooldown = 60, duration = 6, talent = 21667, charges = 1, class = "WARRIOR", type = 1}, --Ravager (talent) + [118038] = {cooldown = 180, duration = 8, talent = false, charges = 1, class = "WARRIOR", type = 2}, --Die by the Sword + [97462] = {cooldown = 180, duration = 10, talent = false, charges = 1, class = "WARRIOR", type = 4}, --Rallying Cry + [1719] = {cooldown = 90, duration = 10, talent = false, charges = 1, class = "WARRIOR", type = 1}, --Recklessness + [46924] = {cooldown = 60, duration = 4, talent = 22400, charges = 1, class = "WARRIOR", type = 1}, --Bladestorm (talent) + [184364] = {cooldown = 120, duration = 8, talent = false, charges = 1, class = "WARRIOR", type = 2}, --Enraged Regeneration + [228920] = {cooldown = 60, duration = 6, talent = 23099, charges = 1, class = "WARRIOR", type = 1}, --Ravager (talent) + [12975] = {cooldown = 180, duration = 15, talent = false, charges = 1, class = "WARRIOR", type = 2}, --Last Stand + [871] = {cooldown = 8, duration = 240, talent = false, charges = 1, class = "WARRIOR", type = 2}, --Shield Wall + + --> warlock + [205180] = {cooldown = 180, duration = 20, talent = false, charges = 1, class = "WARLOCK", type = 1}, --Summon Darkglare + [113860] = {cooldown = 120, duration = 20, talent = 19293, charges = 1, class = "WARLOCK", type = 1}, --Dark Soul: Misery (talent) + [104773] = {cooldown = 180, duration = 8, talent = false, charges = 1, class = "WARLOCK", type = 2}, --Unending Resolve + [108416] = {cooldown = 60, duration = 20, talent = 19286, charges = 1, class = "WARLOCK", type = 2}, --Dark Pact (talent) + [265187] = {cooldown = 90, duration = 15, talent = false, charges = 1, class = "WARLOCK", type = 1}, --Summon Demonic Tyrant + [111898] = {cooldown = 120, duration = 15, talent = 21717, charges = 1, class = "WARLOCK", type = 1}, --Grimoire: Felguard + [267217] = {cooldown = 180, duration = 20, talent = 23091, charges = 1, class = "WARLOCK", type = 1}, --Nether Portal + [1122] = {cooldown = 180, duration = 30, talent = false, charges = 1, class = "WARLOCK", type = 1}, --Summon Infernal + [113858] = {cooldown = 120, duration = 20, talent = 23092, charges = 1, class = "WARLOCK", type = 1}, --Dark Soul: Instability (talent) + + --> shaman + [198067] = {cooldown = 150, duration = 30, talent = false, charges = 1, class = "SHAMAN", type = 1}, --Fire Elemental + [192249] = {cooldown = 150, duration = 30, talent = 19272, charges = 1, class = "SHAMAN", type = 1}, --Storm Elemental (talent) + [114050] = {cooldown = 180, duration = 15, talent = 21675, charges = 1, class = "SHAMAN", type = 1}, --Ascendance (talent) + [108271] = {cooldown = 90, duration = 8, talent = false, charges = 1, class = "SHAMAN", type = 2}, --Astral Shift + [108281] = {cooldown = 120, duration = 10, talent = 22172, charges = 1, class = "SHAMAN", type = 4}, --Ancestral Guidance (talent) + [51533] = {cooldown = 120, duration = 15, talent = false, charges = 1, class = "SHAMAN", type = 1}, --Feral Spirit + [114051] = {cooldown = 180, duration = 15, talent = 21972, charges = 1, class = "SHAMAN", type = 1}, --Ascendance (talent) + [114052] = {cooldown = 180, duration = 15, talent = 22359, charges = 1, class = "SHAMAN", type = 2}, --Ascendance (talent) + [98008] = {cooldown = 180, duration = 6, talent = false, charges = 1, class = "SHAMAN", type = 4}, --Spirit Link Totem + [108280] = {cooldown = 180, duration = 10, talent = false, charges = 1, class = "SHAMAN", type = 4}, --Healing Tide Totem + [207399] = {cooldown = 240, duration = 30, talent = 22323, charges = 1, class = "SHAMAN", type = 4}, --Ancestral Protection Totem (talent) + + --> monk + [115203] = {cooldown = 420, duration = 15, talent = false, charges = 1, class = "MONK", type = 2}, --Fortifying Brew + [115176] = {cooldown = 300, duration = 8, talent = false, charges = 1, class = "MONK", type = 2}, --Zen Meditation + [122278] = {cooldown = 120, duration = 10, talent = 20175, charges = 1, class = "MONK", type = 2}, --Dampen Harm (talent) + [137639] = {cooldown = 90, duration = 15, talent = false, charges = 1, class = "MONK", type = 1}, --Storm, Earth, and Fire + [123904] = {cooldown = 120, duration = 20, talent = 22102, charges = 1, class = "MONK", type = 1}, --Invoke Xuen, the White Tiger (talent) + [152173] = {cooldown = 90, duration = 12, talent = 21191, charges = 1, class = "MONK", type = 1}, --Serenity (talent) + [122470] = {cooldown = 90, duration = 6, talent = false, charges = 1, class = "MONK", type = 2}, --Touch of Karma + [198664] = {cooldown = 180, duration = 25, talent = 22214, charges = 1, class = "MONK", type = 4}, --Invoke Chi-Ji, the Red Crane (talent) + [243435] = {cooldown = 90, duration = 15, talent = false, charges = 1, class = "MONK", type = 2}, --Fortifying Brew + [122783] = {cooldown = 90, duration = 6, talent = 20173, charges = 1, class = "MONK", type = 2}, --Diffuse Magic (talent) + [116849] = {cooldown = 120, duration = 12, talent = false, charges = 1, class = "MONK", type = 3}, --Life Cocoon + [115310] = {cooldown = 180, duration = false, talent = false, charges = 1, class = "MONK", type = 4}, --Revival + + --> hunter + [193530] = {cooldown = 120, duration = 20, talent = false, charges = 1, class = "HUNTER", type = 1}, --Aspect of the Wild + [19574] = {cooldown = 90, duration = 12, talent = false, charges = 1, class = "HUNTER", type = 1}, --Bestial Wrath + [201430] = {cooldown = 180, duration = 12, talent = 23044, charges = 1, class = "HUNTER", type = 1}, --Stampede (talent) + [194407] = {cooldown = 90, duration = 20, talent = 22295, charges = 1, class = "HUNTER", type = 1}, --Spitting Cobra (talent) + [193526] = {cooldown = 180, duration = 15, talent = false, charges = 1, class = "HUNTER", type = 1}, --Trueshot + [281195] = {cooldown = 180, duration = 6, talent = false, charges = 1, class = "HUNTER", type = 2}, --Survival of the Fittest + [266779] = {cooldown = 120, duration = 20, talent = false, charges = 1, class = "HUNTER", type = 1}, --Coordinated Assault + [186265] = {cooldown = 180, duration = 8, talent = false, charges = 1, class = "HUNTER", type = 2}, --Aspect of the Turtle + [109304] = {cooldown = 120, duration = false, talent = false, charges = 1, class = "HUNTER", type = 2}, --Exhilaration + + --> druid + [194223] = {cooldown = 180, duration = 20, talent = false, charges = 1, class = "DRUID", type = 1}, --Celestial Alignment + [102560] = {cooldown = 180, duration = 30, talent = 21702, charges = 1, class = "DRUID", type = 1}, --Incarnation: Chosen of Elune (talent) + [22812] = {cooldown = 60, duration = 12, talent = false, charges = 1, class = "DRUID", type = 2}, --Barkskin + [108238] = {cooldown = 90, duration = false, talent = 18570, charges = 1, class = "DRUID", type = 2}, --Renewal (talent) + [29166] = {cooldown = 180, duration = 12, talent = false, charges = 1, class = "DRUID", type = 3}, --Innervate + [78675] = {cooldown = 60, duration = 8, talent = false, charges = 1, class = "DRUID", type = 5}, --Solar Beam + [106951] = {cooldown = 180, duration = 15, talent = false, charges = 1, class = "DRUID", type = 1}, --Berserk + [102543] = {cooldown = 30, duration = 180, talent = 21704, charges = 1, class = "DRUID", type = 1}, --Incarnation: King of the Jungle (talent) + [61336] = {cooldown = 120, duration = 6, talent = false, charges = 2, class = "DRUID", type = 2}, --Survival Instincts (2min feral 4min guardian, same spellid) + [77764] = {cooldown = 120, duration = 8, talent = false, charges = 1, class = "DRUID", type = 4}, --Stampeding Roar (utility) + [102558] = {cooldown = 180, duration = 30, talent = 22388, charges = 1, class = "DRUID", type = 2}, --Incarnation: Guardian of Ursoc (talent) + [33891] = {cooldown = 180, duration = 30, talent = 22421, charges = 1, class = "DRUID", type = 2}, --Incarnation: Tree of Life (talent) + [102342] = {cooldown = 60, duration = 12, talent = false, charges = 1, class = "DRUID", type = 3}, --Ironbark + [740] = {cooldown = 180, duration = 8, talent = false, charges = 1, class = "DRUID", type = 4}, --Tranquility + [197721] = {cooldown = 90, duration = 8, talent = 22404, charges = 1, class = "DRUID", type = 4}, --Flourish (talent) + + --> death knight + [275699] = {cooldown = 90, duration = 15, talent = false, charges = 1, class = "DEATHKNIGHT", type = 1}, --Apocalypse + [42650] = {cooldown = 480, duration = 30, talent = false, charges = 1, class = "DEATHKNIGHT", type = 1}, --Army of the Dead + [49206] = {cooldown = 180, duration = 30, talent = 22538, charges = 1, class = "DEATHKNIGHT", type = 1}, --Summon Gargoyle (talent) + [48743] = {cooldown = 120, duration = 15, talent = 23373, charges = 1, class = "DEATHKNIGHT", type = 2}, --Death Pact (talent) + [152279] = {cooldown = 120, duration = 5, talent = 22537, charges = 1, class = "DEATHKNIGHT", type = 1}, --Breath of Sindragosa (talent) + [47568] = {cooldown = 120, duration = 20, talent = false, charges = 1, class = "DEATHKNIGHT", type = 1}, --Empower Rune Weapon + [279302] = {cooldown = 120, duration = 10, talent = 22535, charges = 1, class = "DEATHKNIGHT", type = 1}, --Frostwyrm's Fury (talent) + [49028] = {cooldown = 120, duration = 8, talent = false, charges = 1, class = "DEATHKNIGHT", type = 1}, --Dancing Rune Weapon + [55233] = {cooldown = 90, duration = 10, talent = false, charges = 1, class = "DEATHKNIGHT", type = 2}, --Vampiric Blood + [48792] = {cooldown = 120, duration = 8, talent = false, charges = 1, class = "DEATHKNIGHT", type = 2}, --Icebound Fortitude + [108199] = {cooldown = 120, duration = false, talent = false, charges = 1, class = "DEATHKNIGHT", type = 5}, --Gorefiend's Grasp (utility) + + --> demon hunter + [200166] = {cooldown = 240, duration = 30, talent = false, charges = 1, class = "DEMONHUNTER", type = 1}, --Metamorphosis + [206491] = {cooldown = 120, duration = 60, talent = 22547, charges = 1, class = "DEMONHUNTER", type = 1}, --Nemesis (talent) + [196555] = {cooldown = 120, duration = 5, talent = 21865, charges = 1, class = "DEMONHUNTER", type = 2}, --Netherwalk (talent) + [196718] = {cooldown = 180, duration = 8, talent = false, charges = 1, class = "DEMONHUNTER", type = 4}, --Darkness + [187827] = {cooldown = 180, duration = 15, talent = false, charges = 1, class = "DEMONHUNTER", type = 2}, --Metamorphosis + + --> mage + [12042] = {cooldown = 90, duration = 10, talent = false, charges = 1, class = "MAGE", type = 1}, --Arcane Power + [12051] = {cooldown = 90, duration = 6, talent = false, charges = 1, class = "MAGE", type = 1}, --Evocation + [110960] = {cooldown = 120, duration = 20, talent = false, charges = 1, class = "MAGE", type = 2}, --Greater Invisibility + [190319] = {cooldown = 120, duration = 10, talent = false, charges = 1, class = "MAGE", type = 1}, --Combustion + [55342] = {cooldown = 120, duration = 40, talent = 22445, charges = 1, class = "MAGE", type = 1}, --Mirror Image (talent) + [66] = {cooldown = 300, duration = 20, talent = false, charges = 1, class = "MAGE", type = 2}, --Invisibility + [12472] = {cooldown = 180, duration = 20, talent = false, charges = 1, class = "MAGE", type = 1}, --Icy Veins + [205021] = {cooldown = 78, duration = 5, talent = 22309, charges = 1, class = "MAGE", type = 1}, --Ray of Frost (talent) + [45438] = {cooldown = 240, duration = 10, talent = false, charges = 1, class = "MAGE", type = 2}, --Ice Block + [235219] = {cooldown = 300, duration = false, talent = false, charges = 1, class = "MAGE", type = 5}, --Cold Snap + + --> priest + [34433] = {cooldown = 180, duration = 15, talent = false, charges = 1, class = "PRIEST", type = 1}, --Shadowfiend + [123040] = {cooldown = 60, duration = 12, talent = 22094, charges = 1, class = "PRIEST", type = 1}, --Mindbender (talent) + [33206] = {cooldown = 180, duration = 8, talent = false, charges = 1, class = "PRIEST", type = 3}, --Pain Suppression + [62618] = {cooldown = 180, duration = 10, talent = false, charges = 1, class = "PRIEST", type = 4}, --Power Word: Barrier + [271466] = {cooldown = 180, duration = 10, talent = 21184, charges = 1, class = "PRIEST", type = 4}, --Luminous Barrier (talent) + [47536] = {cooldown = 90, duration = 10, talent = false, charges = 1, class = "PRIEST", type = 5}, --Rapture + [19236] = {cooldown = 90, duration = 10, talent = false, charges = 1, class = "PRIEST", type = 5}, --Desperate Prayer + [200183] = {cooldown = 120, duration = 20, talent = 21644, charges = 1, class = "PRIEST", type = 2}, --Apotheosis (talent) + [47788] = {cooldown = 180, duration = 10, talent = false, charges = 1, class = "PRIEST", type = 3}, --Guardian Spirit + [64844] = {cooldown = 180, duration = 8, talent = false, charges = 1, class = "PRIEST", type = 4}, --Divine Hymn + [64901] = {cooldown = 300, duration = 6, talent = false, charges = 1, class = "PRIEST", type = 4}, --Symbol of Hope + [265202] = {cooldown = 720, duration = false, talent = 23145, charges = 1, class = "PRIEST", type = 4}, --Holy Word: Salvation (talent) + [8122] = {cooldown = 60, duration = 8, talent = false, charges = 1, class = "PRIEST", type = 5}, --Psychic Scream + [200174] = {cooldown = 60, duration = 15, talent = 21719, charges = 1, class = "PRIEST", type = 1}, --Mindbender (talent) + [193223] = {cooldown = 240, duration = 60, talent = 21979, charges = 1, class = "PRIEST", type = 1}, --Surrender to Madness (talent) + [47585] = {cooldown = 120, duration = 6, talent = false, charges = 1, class = "PRIEST", type = 2}, --Dispersion + [15286] = {cooldown = 120, duration = 15, talent = false, charges = 1, class = "PRIEST", type = 4}, --Vampiric Embrace + + --> rogue + [79140] = {cooldown = 120, duration = 20, talent = false, charges = 1, class = "ROGUE", type = 1}, --Vendetta + [1856] = {cooldown = 120, duration = 3, talent = false, charges = 1, class = "ROGUE", type = 2}, --Vanish + [5277] = {cooldown = 120, duration = 10, talent = false, charges = 1, class = "ROGUE", type = 2}, --Evasion + [31224] = {cooldown = 120, duration = 5, talent = false, charges = 1, class = "ROGUE", type = 2}, --Cloak of Shadows + [2094] = {cooldown = 120, duration = 60, talent = false, charges = 1, class = "ROGUE", type = 5}, --Blind + [114018] = {cooldown = 360, duration = 15, talent = false, charges = 1, class = "ROGUE", type = 5}, --Shroud of Concealment + [13750] = {cooldown = 180, duration = 20, talent = false, charges = 1, class = "ROGUE", type = 1}, --Adrenaline Rush + [51690] = {cooldown = 120, duration = 2, talent = 23175, charges = 1, class = "ROGUE", type = 1}, --Killing Spree (talent) + [199754] = {cooldown = 120, duration = 10, talent = false, charges = 1, class = "ROGUE", type = 2}, --Riposte + [121471] = {cooldown = 180, duration = 20, talent = false, charges = 1, class = "ROGUE", type = 1}, --Shadow Blades +} + +-- {cooldown = , duration = , talent = false, charges = 1} + DF.CrowdControlSpells = { [5246] = "WARRIOR", --Intimidating Shout [132168] = "WARRIOR", --Shockwave (debuff spellid) @@ -584,7 +753,6 @@ for specId, cooldownTable in pairs (DF.CooldownsBySpec) do end - function DF:FindClassForCooldown (spellId) for specId, cooldownTable in pairs (DF.CooldownsBySpec) do local hasCooldown = cooldownTable [spellId] @@ -594,3 +762,7 @@ function DF:FindClassForCooldown (spellId) end end +function DF:GetCooldownInfo (spellId) + return DF.CooldownsInfo [spellId] +end + diff --git a/Libs/libs.xml b/Libs/libs.xml index 6e966da3..78ce5ee6 100644 --- a/Libs/libs.xml +++ b/Libs/libs.xml @@ -15,6 +15,6 @@