From 7b34b88ca3693fa18efca2f1497378b69ffd25fa Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Sun, 25 Jun 2023 11:29:45 -0300 Subject: [PATCH] More code cleanup and framework update --- Libs/DF/cooltip.lua | 2 +- Libs/DF/fw.lua | 2 +- Libs/DF/panel.lua | 2 +- Libs/DF/picture.lua | 23 ++ Libs/LibLuaServer/LuaServerDefinitions.lua | 1 + classes/class_combat.lua | 11 +- core/plugins.lua | 18 ++ frames/window_rowtexteditor.lua | 136 ++++---- functions/events.lua | 183 +++++------ functions/spells.lua | 343 +++++++++++---------- 10 files changed, 383 insertions(+), 338 deletions(-) diff --git a/Libs/DF/cooltip.lua b/Libs/DF/cooltip.lua index 5ef63ef9..416d09f6 100644 --- a/Libs/DF/cooltip.lua +++ b/Libs/DF/cooltip.lua @@ -1841,7 +1841,7 @@ function DF:CreateCoolTip() end --~inicio ~start ~tooltip - function gameCooltip:BuildTooltip() + function gameCooltip:BuildTooltip() --~refresh --hide select bar gameCooltip:HideSelectedTexture(frame1) diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua index c883f5ba..cf23a630 100644 --- a/Libs/DF/fw.lua +++ b/Libs/DF/fw.lua @@ -1,6 +1,6 @@ -local dversion = 442 +local dversion = 443 local major, minor = "DetailsFramework-1.0", dversion local DF, oldminor = LibStub:NewLibrary(major, minor) diff --git a/Libs/DF/panel.lua b/Libs/DF/panel.lua index 793d415d..7dce2c15 100644 --- a/Libs/DF/panel.lua +++ b/Libs/DF/panel.lua @@ -4359,7 +4359,7 @@ function detailsFramework:ApplyStandardBackdrop(frame, bUseSolidColor, alphaScal end if (not frame.__background) then - frame.__background = frame:CreateTexture(nil, "background") + frame.__background = frame:CreateTexture(nil, "border", nil, -6) frame.__background:SetColorTexture(red, green, blue) frame.__background:SetAllPoints() end diff --git a/Libs/DF/picture.lua b/Libs/DF/picture.lua index 4bd6d28c..347cb545 100644 --- a/Libs/DF/picture.lua +++ b/Libs/DF/picture.lua @@ -235,10 +235,33 @@ detailsFramework:Mixin(ImageMetaFunctions, detailsFramework.ScriptHookMixin) ------------------------------------------------------------------------------------------------------------ --object constructor + ---@class df_image : texture + ---@field SetGradient fun(gradientType: "vertical"|"horizontal", fromColor: table, toColor: table) + + ---create an object that encapsulates a texture and add additional methods to it + ---@param parent frame + ---@param texture texturepath|textureid + ---@param width number + ---@param height number + ---@param layer drawlayer + ---@param coords {key1: number, key2: number, key3: number, key4: number} + ---@param member string + ---@param name string + ---@return table|nil function detailsFramework:CreateTexture(parent, texture, width, height, layer, coords, member, name) return detailsFramework:NewImage(parent, texture, width, height, layer, coords, member, name) end + ---create an object that encapsulates a texture and add additional methods to it + ---@param parent frame + ---@param texture texturepath|textureid + ---@param width number + ---@param height number + ---@param layer drawlayer + ---@param coords {key1: number, key2: number, key3: number, key4: number} + ---@param member string + ---@param name string + ---@return table|nil function detailsFramework:CreateImage(parent, texture, width, height, layer, coords, member, name) return detailsFramework:NewImage(parent, texture, width, height, layer, coords, member, name) end diff --git a/Libs/LibLuaServer/LuaServerDefinitions.lua b/Libs/LibLuaServer/LuaServerDefinitions.lua index d889245b..a1a75730 100644 --- a/Libs/LibLuaServer/LuaServerDefinitions.lua +++ b/Libs/LibLuaServer/LuaServerDefinitions.lua @@ -114,6 +114,7 @@ ---@alias textureid number each texture from the game client has an id. ---@alias texturepath string access textures from addons. ---@alias unixtime number +---@alias valueamount number used to represent a value, such as a damage amount, a healing amount, or a resource amount. ---@class _G ---@field RegisterAttributeDriver fun(statedriver: frame, attribute: string, conditional: string) diff --git a/classes/class_combat.lua b/classes/class_combat.lua index 0eacd8c4..4c7f85b7 100644 --- a/classes/class_combat.lua +++ b/classes/class_combat.lua @@ -21,6 +21,7 @@ --[[global]] DETAILS_SEGMENTTYPE_RAID_TRASH = 7 --[[global]] DETAILS_SEGMENTTYPE_RAID_BOSS = 8 +--[[global]] DETAILS_SEGMENTTYPE_MYTHICDUNGEON = 100 --[[global]] DETAILS_SEGMENTTYPE_MYTHICDUNGEON_GENERIC = 10 --[[global]] DETAILS_SEGMENTTYPE_MYTHICDUNGEON_TRASH = 11 --[[global]] DETAILS_SEGMENTTYPE_MYTHICDUNGEON_OVERALL = 12 @@ -295,22 +296,22 @@ if (isMythicDungeon) then local isMythicDungeonTrash = self.is_mythic_dungeon_trash if (isMythicDungeonTrash) then - return DETAILS_SEGMENTTYPE_MYTHICDUNGEON_TRASH + return DETAILS_SEGMENTTYPE_MYTHICDUNGEON_TRASH, DETAILS_SEGMENTTYPE_MYTHICDUNGEON else local isMythicDungeonOverall = self.is_mythic_dungeon and self.is_mythic_dungeon.OverallSegment local isMythicDungeonTrashOverall = self.is_mythic_dungeon and self.is_mythic_dungeon.TrashOverallSegment if (isMythicDungeonOverall) then - return DETAILS_SEGMENTTYPE_MYTHICDUNGEON_OVERALL + return DETAILS_SEGMENTTYPE_MYTHICDUNGEON_OVERALL, DETAILS_SEGMENTTYPE_MYTHICDUNGEON elseif (isMythicDungeonTrashOverall) then - return DETAILS_SEGMENTTYPE_MYTHICDUNGEON_TRASHOVERALL + return DETAILS_SEGMENTTYPE_MYTHICDUNGEON_TRASHOVERALL, DETAILS_SEGMENTTYPE_MYTHICDUNGEON end local bossEncounter = self.is_boss if (bossEncounter) then - return DETAILS_SEGMENTTYPE_MYTHICDUNGEON_BOSS + return DETAILS_SEGMENTTYPE_MYTHICDUNGEON_BOSS, DETAILS_SEGMENTTYPE_MYTHICDUNGEON end - return DETAILS_SEGMENTTYPE_MYTHICDUNGEON_GENERIC + return DETAILS_SEGMENTTYPE_MYTHICDUNGEON_GENERIC, DETAILS_SEGMENTTYPE_MYTHICDUNGEON end end diff --git a/core/plugins.lua b/core/plugins.lua index b9c93866..c69eb867 100644 --- a/core/plugins.lua +++ b/core/plugins.lua @@ -18,6 +18,24 @@ local CONST_PLUGINWINDOW_WIDTH = 925 local CONST_PLUGINWINDOW_HEIGHT = 600 + ---default cooltip appearance for plugin tooltips + function Details:SetCooltipForPlugins() + local gameCooltip = GameCooltip + gameCooltip:Preset(2) + gameCooltip:SetOption("TextSize", Details.font_sizes.menus) + gameCooltip:SetOption("TextFont", Details.font_faces.menus) + gameCooltip:SetOption("LineHeightSizeOffset", 0) + gameCooltip:SetOption("LineYOffset", 0) + gameCooltip:SetOption("LinePadding", -1) + gameCooltip:SetOption("FrameHeightSizeOffset", 0) + gameCooltip:SetOption("FixedWidth", 280) + gameCooltip:SetOption("StatusBarTexture", [[Interface\AddOns\Details\images\bar_serenity]]) + gameCooltip:SetOption("LeftTextWidth", 280 - 22 - 90) + gameCooltip:SetOption("LeftTextHeight", 14) + Details:SetTooltipMinWidth() + end + + ---comment ---@param pluginAbsoluteName string ---@return unknown diff --git a/frames/window_rowtexteditor.lua b/frames/window_rowtexteditor.lua index ac96093e..4d6feb87 100644 --- a/frames/window_rowtexteditor.lua +++ b/frames/window_rowtexteditor.lua @@ -1,27 +1,24 @@ - local Details = _G.Details -local DF = _G.DetailsFramework +local detailsFramework = _G.DetailsFramework local Loc = LibStub("AceLocale-3.0"):GetLocale("Details") ---row text editor - local windowWidth = 950 local scrollWidth = 825 -local panel = Details:CreateWelcomePanel ("DetailsWindowOptionsBarTextEditor", nil, windowWidth, 600, true) +local panel = Details:CreateWelcomePanel("DetailsWindowOptionsBarTextEditor", nil, windowWidth, 600, true) panel:SetPoint("center", UIParent, "center") panel:Hide() panel:SetFrameStrata("FULLSCREEN") -DF:ApplyStandardBackdrop(panel) -DF:CreateTitleBar (panel, "Details! Custom Line Text Editor") +detailsFramework:ApplyStandardBackdrop(panel) +detailsFramework:CreateTitleBar(panel, "Details! Custom Line Text Editor") -function panel:Open (text, callback, host, default) +function panel:Open(text, callback, host, default) if (host) then panel:ClearAllPoints() panel:SetPoint("center", host, "center") end - + text = text:gsub("||", "|") panel.default_text = text panel.editbox:SetText(text) @@ -31,47 +28,46 @@ function panel:Open (text, callback, host, default) end local y = -32 -local buttonTemplate = DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE") +local buttonTemplate = detailsFramework:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE") -local textentry = DF:NewSpecialLuaEditorEntry(panel, scrollWidth, 555, "editbox", "$parentEntry") -textentry:SetPoint("topleft", panel, "topleft", 10, y) -DF:ApplyStandardBackdrop(textentry) -DF:SetFontSize(textentry.editbox, 14) -DF:ReskinSlider(textentry.scroll) +local codeEditor = detailsFramework:NewSpecialLuaEditorEntry(panel, scrollWidth, 555, "editbox", "$parentEntry") +codeEditor:SetPoint("topleft", panel, "topleft", 10, y) +detailsFramework:ApplyStandardBackdrop(codeEditor) +detailsFramework:SetFontSize(codeEditor.editbox, 14) +detailsFramework:ReskinSlider(codeEditor.scroll) -local arg1_button = DF:NewButton(panel, nil, "$parentButton1", nil, 80, 20, function() textentry.editbox:Insert ("{data1}") end, nil, nil, nil, string.format(Loc ["STRING_OPTIONS_TEXTEDITOR_DATA"], "1"), 1) -local arg2_button = DF:NewButton(panel, nil, "$parentButton2", nil, 80, 20, function() textentry.editbox:Insert ("{data2}") end, nil, nil, nil, string.format(Loc ["STRING_OPTIONS_TEXTEDITOR_DATA"], "2"), 1) -local arg3_button = DF:NewButton(panel, nil, "$parentButton3", nil, 80, 20, function() textentry.editbox:Insert ("{data3}") end, nil, nil, nil, string.format(Loc ["STRING_OPTIONS_TEXTEDITOR_DATA"], "3"), 1) -arg1_button:SetPoint("topright", panel, "topright", -12, y) -arg2_button:SetPoint("topright", panel, "topright", -12, y - (20*1)) -arg3_button:SetPoint("topright", panel, "topright", -12, y - (20*2)) -arg1_button:SetTemplate(buttonTemplate) -arg2_button:SetTemplate(buttonTemplate) -arg3_button:SetTemplate(buttonTemplate) - -arg1_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_DATA_TOOLTIP"] -arg2_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_DATA_TOOLTIP"] -arg3_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_DATA_TOOLTIP"] +local arg1Button = detailsFramework:NewButton(panel, nil, "$parentButton1", nil, 80, 20, function() codeEditor.editbox:Insert("{data1}") end, nil, nil, nil, string.format(Loc ["STRING_OPTIONS_TEXTEDITOR_DATA"], "1"), 1) +local arg2Button = detailsFramework:NewButton(panel, nil, "$parentButton2", nil, 80, 20, function() codeEditor.editbox:Insert("{data2}") end, nil, nil, nil, string.format(Loc ["STRING_OPTIONS_TEXTEDITOR_DATA"], "2"), 1) +local arg3Button = detailsFramework:NewButton(panel, nil, "$parentButton3", nil, 80, 20, function() codeEditor.editbox:Insert("{data3}") end, nil, nil, nil, string.format(Loc ["STRING_OPTIONS_TEXTEDITOR_DATA"], "3"), 1) +arg1Button:SetPoint("topright", panel, "topright", -12, y) +arg2Button:SetPoint("topright", panel, "topright", -12, y -(20*1)) +arg3Button:SetPoint("topright", panel, "topright", -12, y -(20*2)) +arg1Button:SetTemplate(buttonTemplate) +arg2Button:SetTemplate(buttonTemplate) +arg3Button:SetTemplate(buttonTemplate) +arg1Button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_DATA_TOOLTIP"] +arg2Button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_DATA_TOOLTIP"] +arg3Button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_DATA_TOOLTIP"] -- code author Saiket from http://www.wowinterface.com/forums/showpost.php?p=245759&postcount=6 --- @return StartPos, EndPos of highlight in this editbox. -local function GetTextHighlight ( self ) +local function GetTextHighlight( self ) local Text, Cursor = self:GetText(), self:GetCursorPosition(); self:Insert( "" ); -- Delete selected text local TextNew, CursorNew = self:GetText(), self:GetCursorPosition(); -- Restore previous text self:SetText( Text ); self:SetCursorPosition( Cursor ); - local Start, End = CursorNew, #Text - ( #TextNew - CursorNew ); + local Start, End = CursorNew, #Text -( #TextNew - CursorNew ); self:HighlightText( Start, End ); return Start, End; end - + local StripColors; do local CursorPosition, CursorDelta; --- Callback for gsub to remove unescaped codes. - local function StripCodeGsub ( Escapes, Code, End ) + local function StripCodeGsub( Escapes, Code, End ) if ( #Escapes % 2 == 0 ) then -- Doesn't escape Code if ( CursorPosition and CursorPosition >= End - 1 ) then CursorDelta = CursorDelta - #Code; @@ -80,14 +76,14 @@ do end end --- Removes a single escape sequence. - local function StripCode ( Pattern, Text, OldCursor ) + local function StripCode( Pattern, Text, OldCursor ) CursorPosition, CursorDelta = OldCursor, 0; return Text:gsub( Pattern, StripCodeGsub ), OldCursor and CursorPosition + CursorDelta; end --- Strips Text of all color escape sequences. -- @param Cursor Optional cursor position to keep track of. -- @return Stripped text, and the updated cursor position if Cursor was given. - function StripColors ( Text, Cursor ) + function StripColors( Text, Cursor ) Text, Cursor = StripCode( "(|*)(|c%x%x%x%x%x%x%x%x)()", Text, Cursor ); return StripCode( "(|*)(|r)()", Text, Cursor ); end @@ -95,7 +91,7 @@ end local COLOR_END = "|r"; --- Wraps this editbox's selected text with the given color. -local function ColorSelection ( self, ColorCode ) +local function ColorSelection( self, ColorCode ) local Start, End = GetTextHighlight( self ); local Text, Cursor = self:GetText(), self:GetCursorPosition(); if ( Start == End ) then -- Nothing selected @@ -107,7 +103,7 @@ local function ColorSelection ( self, ColorCode ) if ( End < #Text ) then -- There is text to color after the selection local ActiveEnd; local CodeEnd, _, Escapes, Color = 0; - while ( true ) do + while( true ) do _, CodeEnd, Escapes, Color = Text:find( "(|*)(|c%x%x%x%x%x%x%x%x)", CodeEnd + 1 ); if ( not CodeEnd or CodeEnd > End ) then break; @@ -116,11 +112,11 @@ local function ColorSelection ( self, ColorCode ) ActiveColor, ActiveEnd = Color, CodeEnd; end end - + if ( ActiveColor ) then -- Check if color gets terminated before selection ends CodeEnd = 0; - while ( true ) do + while( true ) do _, CodeEnd, Escapes = Text:find( "(|*)|r", CodeEnd + 1 ); if ( not CodeEnd or CodeEnd > End ) then break; @@ -132,17 +128,17 @@ local function ColorSelection ( self, ColorCode ) end end end - + local Selection = Text:sub( Start + 1, End ); -- Remove color codes from the selection local Replacement, CursorReplacement = StripColors( Selection, Cursor - Start ); - - self:SetText( ( "" ):join( + + self:SetText(( "" ):join( Text:sub( 1, Start ), ColorCode, Replacement, COLOR_END, ActiveColor or "", Text:sub( End + 1 ) ) ); - + -- Restore cursor and highlight, adjusting for wrapper text Cursor = Start + CursorReplacement; if ( CursorReplacement > 0 ) then -- Cursor beyond start of color code @@ -151,48 +147,48 @@ local function ColorSelection ( self, ColorCode ) if ( CursorReplacement >= #Replacement ) then -- Cursor beyond end of color Cursor = Cursor + #COLOR_END; end - + self:SetCursorPosition( Cursor ); -- Highlight selection and wrapper self:HighlightText( Start, #ColorCode + ( #Replacement - #Selection ) + #COLOR_END + End ); end -local color_func = function(_, r, g, b, a) - local hex = Details:hex (a*255)..Details:hex (r*255)..Details:hex (g*255)..Details:hex (b*255) - ColorSelection ( textentry.editbox, "|c" .. hex) +local colorFunc = function(_, r, g, b, a) + local hex = Details:hex(a * 255) .. Details:hex(r * 255) .. Details:hex(g * 255) .. Details:hex(b * 255) + ColorSelection(codeEditor.editbox, "|c" .. hex) end -local func_button = DF:NewButton(panel, nil, "$parentButton4", nil, 80, 20, function() textentry.editbox:Insert ("{func local player, combat = ...; return 0;}") end, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_FUNC"], 1) -local color_button = DF:NewColorPickButton (panel, "$parentButton5", nil, color_func) -color_button:SetSize(80, 20) -color_button:SetTemplate(buttonTemplate) +local funcButton = detailsFramework:NewButton(panel, nil, "$parentButton4", nil, 80, 20, function() codeEditor.editbox:Insert("{func local player, combat = ...; return 0;}") end, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_FUNC"], 1) +local colorButton = detailsFramework:NewColorPickButton(panel, "$parentButton5", nil, colorFunc) +colorButton:SetSize(80, 20) +colorButton:SetTemplate(buttonTemplate) -func_button:SetPoint("topright", panel, "topright", -12, y - (20*3)) -func_button:SetTemplate(buttonTemplate) +funcButton:SetPoint("topright", panel, "topright", -12, y -(20*3)) +funcButton:SetTemplate(buttonTemplate) -color_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_COLOR_TOOLTIP"] -func_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_FUNC_TOOLTIP"] +colorButton.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_COLOR_TOOLTIP"] +funcButton.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_FUNC_TOOLTIP"] local done = function() local text = panel.editbox:GetText() - panel.callback (text) + panel.callback(text) panel:Hide() end -local apply_button = DF:NewButton(panel, nil, "$parentApply", nil, 80, 20, function() panel.callback(panel.editbox:GetText()) end, nil, nil, nil, "Apply", 1) --localize-me -apply_button:SetTemplate(buttonTemplate) -apply_button:SetPoint("topright", panel, "topright", -14, -128) +local applyButton = detailsFramework:NewButton(panel, nil, "$parentApply", nil, 80, 20, function() panel.callback(panel.editbox:GetText()) end, nil, nil, nil, "Apply", 1) --localize-me +applyButton:SetTemplate(buttonTemplate) +applyButton:SetPoint("topright", panel, "topright", -14, -128) -local ok_button = DF:NewButton(panel, nil, "$parentButtonOk", nil, 80, 20, done, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_DONE"], 1) -ok_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_DONE_TOOLTIP"] -ok_button:SetTemplate(buttonTemplate) -ok_button:SetPoint("topright", panel, "topright", -14, -194) +local okButton = detailsFramework:NewButton(panel, nil, "$parentButtonOk", nil, 80, 20, done, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_DONE"], 1) +okButton.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_DONE_TOOLTIP"] +okButton:SetTemplate(buttonTemplate) +okButton:SetPoint("topright", panel, "topright", -14, -194) -local reset_button = DF:NewButton(panel, nil, "$parentDefaultOk", nil, 80, 20, function() textentry.editbox:SetText(panel.default); panel.callback(panel.editbox:GetText()) end, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_RESET"], 1) -reset_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_RESET_TOOLTIP"] -reset_button:SetTemplate(buttonTemplate) -reset_button:SetPoint("topright", panel, "topright", -14, -150) +local resetButton = detailsFramework:NewButton(panel, nil, "$parentDefaultOk", nil, 80, 20, function() codeEditor.editbox:SetText(panel.default); panel.callback(panel.editbox:GetText()) end, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_RESET"], 1) +resetButton.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_RESET_TOOLTIP"] +resetButton:SetTemplate(buttonTemplate) +resetButton:SetPoint("topright", panel, "topright", -14, -150) -local cancel_button = DF:NewButton(panel, nil, "$parentDefaultCancel", nil, 80, 20, function() textentry.editbox:SetText(panel.default_text); done(); end, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_CANCEL"], 1) -cancel_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_CANCEL_TOOLTIP"] -cancel_button:SetTemplate(buttonTemplate) -cancel_button:SetPoint("topright", panel, "topright", -14, -172) \ No newline at end of file +local cancelButton = detailsFramework:NewButton(panel, nil, "$parentDefaultCancel", nil, 80, 20, function() codeEditor.editbox:SetText(panel.default_text); done(); end, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_CANCEL"], 1) +cancelButton.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_CANCEL_TOOLTIP"] +cancelButton:SetTemplate(buttonTemplate) +cancelButton:SetPoint("topright", panel, "topright", -14, -172) \ No newline at end of file diff --git a/functions/events.lua b/functions/events.lua index 31b7bcb1..7c26a1d7 100644 --- a/functions/events.lua +++ b/functions/events.lua @@ -1,13 +1,11 @@ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - - local _detalhes = _G.Details + local Details = _G.Details local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) local _ local addonName, Details222 = ... --Event types: - _detalhes.RegistredEvents = { + Details.RegistredEvents = { --instances ["DETAILS_INSTANCE_OPEN"] = {}, ["DETAILS_INSTANCE_CLOSE"] = {}, @@ -69,10 +67,10 @@ ["COMM_EVENT_SENT"] = {}, --added on core 129 } - local function AlreadyRegistred (_tables, _object) + local function isAlreadyRegistred(_tables, _object) for index, _this_object in ipairs(_tables) do if (_this_object.__eventtable) then - if (_this_object [1] == _object) then + if (_this_object[1] == _object) then return index end elseif (_this_object == _object) then @@ -131,23 +129,22 @@ local common_events = { ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --register a event - function _detalhes:RegisterEvent(object, event, func) - - if (not _detalhes.RegistredEvents [event]) then + function Details:RegisterEvent(object, event, func) + if (not Details.RegistredEvents[event]) then if (object.Msg) then - object:DelayMsg ("[debug] unknown event:", event, object.__name) + object:DelayMsg("[debug] unknown event:", event, object.__name) else - _detalhes:DelayMsg ("[debug] unknown event:", event, object.__name) + Details:DelayMsg("[debug] unknown event:", event, object.__name) end return end - if (common_events [event]) then - if (not AlreadyRegistred (_detalhes.RegistredEvents [event], object)) then + if (common_events[event]) then + if (not isAlreadyRegistred(Details.RegistredEvents[event], object)) then if (func) then - tinsert(_detalhes.RegistredEvents [event], {object, func, __eventtable = true}) + table.insert(Details.RegistredEvents[event], {object, func, __eventtable = true}) else - tinsert(_detalhes.RegistredEvents [event], object) + table.insert(Details.RegistredEvents[event], object) end return true else @@ -155,29 +152,29 @@ local common_events = { end else if (event == "BUFF_UPDATE") then - if (not AlreadyRegistred (_detalhes.RegistredEvents ["BUFF_UPDATE"], object)) then + if (not isAlreadyRegistred(Details.RegistredEvents["BUFF_UPDATE"], object)) then if (func) then - tinsert(_detalhes.RegistredEvents ["BUFF_UPDATE"], {object, func, __eventtable = true}) + table.insert(Details.RegistredEvents["BUFF_UPDATE"], {object, func, __eventtable = true}) else - tinsert(_detalhes.RegistredEvents ["BUFF_UPDATE"], object) + table.insert(Details.RegistredEvents["BUFF_UPDATE"], object) end - _detalhes.Buffs:CatchBuffs() - _detalhes.RecordPlayerSelfBuffs = true - _detalhes:UpdateParserGears() + Details.Buffs:CatchBuffs() + Details.RecordPlayerSelfBuffs = true + Details:UpdateParserGears() return true else return false end elseif (event == "BUFF_UPDATE_DEBUFFPOWER") then - if (not AlreadyRegistred (_detalhes.RegistredEvents ["BUFF_UPDATE_DEBUFFPOWER"], object)) then + if (not isAlreadyRegistred(Details.RegistredEvents["BUFF_UPDATE_DEBUFFPOWER"], object)) then if (func) then - tinsert(_detalhes.RegistredEvents ["BUFF_UPDATE_DEBUFFPOWER"], {object, func, __eventtable = true}) + table.insert(Details.RegistredEvents["BUFF_UPDATE_DEBUFFPOWER"], {object, func, __eventtable = true}) else - tinsert(_detalhes.RegistredEvents ["BUFF_UPDATE_DEBUFFPOWER"], object) + table.insert(Details.RegistredEvents["BUFF_UPDATE_DEBUFFPOWER"], object) end - _detalhes.RecordPlayerAbilityWithBuffs = true - _detalhes:UpdateParserGears() + Details.RecordPlayerAbilityWithBuffs = true + Details:UpdateParserGears() return true else return false @@ -189,33 +186,32 @@ local common_events = { ------------------------------------------------------------------------------------------------------------------------------------------------------------------ --Unregister a Event - function _detalhes:UnregisterEvent (object, event) - - if (not _detalhes.RegistredEvents [event]) then + function Details:UnregisterEvent(object, event) + if (not Details.RegistredEvents[event]) then if (object.Msg) then object:Msg("(debug) unknown event", event) else - _detalhes:Msg("(debug) unknown event", event) + Details:Msg("(debug) unknown event", event) end return end - if (common_events [event]) then - local index = AlreadyRegistred (_detalhes.RegistredEvents [event], object) + if (common_events[event]) then + local index = isAlreadyRegistred(Details.RegistredEvents[event], object) if (index) then - table.remove (_detalhes.RegistredEvents [event], index) + table.remove(Details.RegistredEvents[event], index) return true else return false end else if (event == "BUFF_UPDATE") then - local index = AlreadyRegistred (_detalhes.RegistredEvents ["BUFF_UPDATE"], object) + local index = isAlreadyRegistred(Details.RegistredEvents["BUFF_UPDATE"], object) if (index) then - table.remove (_detalhes.RegistredEvents ["BUFF_UPDATE"], index) - if (#_detalhes.RegistredEvents ["BUFF_UPDATE"] < 1) then - _detalhes.RecordPlayerSelfBuffs = true - _detalhes:UpdateParserGears() + table.remove(Details.RegistredEvents["BUFF_UPDATE"], index) + if (#Details.RegistredEvents["BUFF_UPDATE"] < 1) then + Details.RecordPlayerSelfBuffs = true + Details:UpdateParserGears() end return true else @@ -223,12 +219,12 @@ local common_events = { end elseif (event == "BUFF_UPDATE_DEBUFFPOWER") then - local index = AlreadyRegistred (_detalhes.RegistredEvents ["BUFF_UPDATE_DEBUFFPOWER"], object) + local index = isAlreadyRegistred(Details.RegistredEvents["BUFF_UPDATE_DEBUFFPOWER"], object) if (index) then - table.remove (_detalhes.RegistredEvents ["BUFF_UPDATE_DEBUFFPOWER"], index) - if (#_detalhes.RegistredEvents ["BUFF_UPDATE_DEBUFFPOWER"] < 1) then - _detalhes.RecordPlayerAbilityWithBuffs = false - _detalhes:UpdateParserGears() + table.remove(Details.RegistredEvents["BUFF_UPDATE_DEBUFFPOWER"], index) + if (#Details.RegistredEvents["BUFF_UPDATE_DEBUFFPOWER"] < 1) then + Details.RecordPlayerAbilityWithBuffs = false + Details:UpdateParserGears() end return true else @@ -242,11 +238,11 @@ local common_events = { --internal functions local dispatch_error = function(name, errortext) - _detalhes:Msg((name or ""), " |cFFFF9900error|r: ", errortext) + Details:Msg((name or ""), " |cFFFF9900error|r: ", errortext) end --safe call an external func with payload and without telling who is calling - function _detalhes:QuickDispatchEvent (func, event, ...) + function Details:QuickDispatchEvent(func, event, ...) if (type(func) ~= "function") then return elseif (type(event) ~= "string") then @@ -257,7 +253,7 @@ local common_events = { if (not okay) then --trigger an error msg - dispatch_error (_, errortext) + dispatch_error(_, errortext) return end @@ -266,11 +262,13 @@ local common_events = { end --quick dispatch with context, send the caller object within the payload - function _detalhes:QuickDispatchEventWithContext (context, func, event, ...) + function Details:QuickDispatchEventWithContext(context, func, event, ...) if (type(context) ~= "table") then return + elseif (type(func) ~= "function") then return + elseif (type(event) ~= "string") then return end @@ -281,8 +279,7 @@ local common_events = { --attempt to get the context name local objectName = context.__name or context._name or context.name or context.Name --trigger an error msg - dispatch_error (objectName, errortext) - + dispatch_error(objectName, errortext) return end @@ -290,119 +287,105 @@ local common_events = { end --Send Event - function _detalhes:SendEvent(event, object, ...) - + function Details:SendEvent(event, object, ...) --send event to all registred plugins - if (event == "PLUGIN_DISABLED" or event == "PLUGIN_ENABLED") then - return object:OnDetailsEvent (event, ...) + return object:OnDetailsEvent(event, ...) elseif (not object) then --iterate among all plugins which registered a function for this event - for _, PluginObject in ipairs(_detalhes.RegistredEvents[event]) do - + for _, PluginObject in ipairs(Details.RegistredEvents[event]) do --when __eventtable is true, the plugin registered a function or method name to callback --if is false, we call OnDetailsEvent method on the plugin if (PluginObject.__eventtable) then - local pluginTable = PluginObject [1] + local pluginTable = PluginObject[1] --check if the plugin is enabled if (pluginTable.Enabled and pluginTable.__enabled) then --check if fegistered a function - if (type(PluginObject [2]) == "function") then - local func = PluginObject [2] - _detalhes:QuickDispatchEvent (func, event, ...) - --PluginObject [2] (event, ...) - + if (type(PluginObject[2]) == "function") then + local func = PluginObject[2] + Details:QuickDispatchEvent(func, event, ...) --if not it must be a method name else - local methodName = PluginObject [2] - local func = pluginTable [methodName] - - _detalhes:QuickDispatchEventWithContext (pluginTable, func, event, ...) - --PluginObject [1] [PluginObject [2]] (PluginObject, event, ...) + local methodName = PluginObject[2] + local func = pluginTable[methodName] + Details:QuickDispatchEventWithContext(pluginTable, func, event, ...) end end --if no function(only registred the event) sent the event to OnDetailsEvent else if (PluginObject.Enabled and PluginObject.__enabled) then - _detalhes:QuickDispatchEventWithContext (PluginObject, PluginObject.OnDetailsEvent, event, ...) - --PluginObject:OnDetailsEvent (event, ...) + Details:QuickDispatchEventWithContext (PluginObject, PluginObject.OnDetailsEvent, event, ...) end end end --plugin notifications (does not send to listeners) elseif (type(object) == "string" and object == "SEND_TO_ALL") then - - for _, PluginObject in ipairs(_detalhes.RaidTables.Plugins) do + for _, PluginObject in ipairs(Details.RaidTables.Plugins) do if (PluginObject.__enabled) then - _detalhes:QuickDispatchEventWithContext (PluginObject, PluginObject.OnDetailsEvent, event) - --PluginObject:OnDetailsEvent (event) + Details:QuickDispatchEventWithContext(PluginObject, PluginObject.OnDetailsEvent, event) end end - for _, PluginObject in ipairs(_detalhes.SoloTables.Plugins) do + for _, PluginObject in ipairs(Details.SoloTables.Plugins) do if (PluginObject.__enabled) then - _detalhes:QuickDispatchEventWithContext (PluginObject, PluginObject.OnDetailsEvent, event) - --PluginObject:OnDetailsEvent (event) + Details:QuickDispatchEventWithContext(PluginObject, PluginObject.OnDetailsEvent, event) end end - for _, PluginObject in ipairs(_detalhes.ToolBar.Plugins) do + for _, PluginObject in ipairs(Details.ToolBar.Plugins) do if (PluginObject.__enabled) then - _detalhes:QuickDispatchEventWithContext (PluginObject, PluginObject.OnDetailsEvent, event) - --PluginObject:OnDetailsEvent (event) + Details:QuickDispatchEventWithContext(PluginObject, PluginObject.OnDetailsEvent, event) end end else --send the event only for requested plugin if (object.Enabled and object.__enabled) then - return _detalhes:QuickDispatchEventWithContext (object, object.OnDetailsEvent, event, ...) - --return object:OnDetailsEvent (event, ...) + return Details:QuickDispatchEventWithContext(object, object.OnDetailsEvent, event, ...) end end end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --special cases - function _detalhes:SendOptionsModifiedEvent (instance) - - _detalhes.last_options_modified = _detalhes.last_options_modified or (GetTime() - 5) - - if (_detalhes.last_options_modified + 0.3 < GetTime()) then - _detalhes:SendEvent("DETAILS_OPTIONS_MODIFIED", nil, instance) - _detalhes.last_options_modified = GetTime() - if (_detalhes.last_options_modified_schedule) then - _detalhes:CancelTimer(_detalhes.last_options_modified_schedule) - _detalhes.last_options_modified_schedule = nil + function Details:SendOptionsModifiedEvent(instance) + Details.last_options_modified = Details.last_options_modified or (GetTime() - 5) + if (Details.last_options_modified + 0.3 < GetTime()) then + Details:SendEvent("DETAILS_OPTIONS_MODIFIED", nil, instance) + Details.last_options_modified = GetTime() + if (Details.last_options_modified_schedule) then + Details:CancelTimer(Details.last_options_modified_schedule) + Details.last_options_modified_schedule = nil end else - if (_detalhes.last_options_modified_schedule) then - _detalhes:CancelTimer(_detalhes.last_options_modified_schedule) + if (Details.last_options_modified_schedule) then + Details:CancelTimer(Details.last_options_modified_schedule) end - _detalhes.last_options_modified_schedule = _detalhes:ScheduleTimer("SendOptionsModifiedEvent", 0.31, instance) + Details.last_options_modified_schedule = Details:ScheduleTimer("SendOptionsModifiedEvent", 0.31, instance) end end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --listeners - local listener_meta = setmetatable({}, _detalhes) + local listener_meta = setmetatable({}, Details) listener_meta.__index = listener_meta function listener_meta:RegisterEvent(event, func) - return _detalhes:RegisterEvent(self, event, func) - end - function listener_meta:UnregisterEvent (event) - return _detalhes:UnregisterEvent (self, event) + return Details:RegisterEvent(self, event, func) end - function _detalhes:CreateEventListener() + function listener_meta:UnregisterEvent(event) + return Details:UnregisterEvent(self, event) + end + + function Details:CreateEventListener() local new = {Enabled = true, __enabled = true} setmetatable(new, listener_meta) return new - end + end \ No newline at end of file diff --git a/functions/spells.lua b/functions/spells.lua index 2fc768f1..6b48d2aa 100644 --- a/functions/spells.lua +++ b/functions/spells.lua @@ -211,7 +211,7 @@ do [50464] = 105, --Nourish [33763] = 105, --Lifebloom [145205] = 105, --Efflorescence - [33891] = 105, --Incarnation: Tree of Life + [33891] = 105, --Incarnation: Tree of Life --Retribution Paladin: [383185] = 70, --Exorcism @@ -456,7 +456,7 @@ do [360823] = 1468, --Naturalize [373861] = 1468, --Temporal Anomaly [366155] = 1468, --Reversion - [364343] = 1468, --Echo + [364343] = 1468, --Echo --Protection Warrior: [12975] = 73, --Last Stand @@ -551,14 +551,14 @@ do [33983] = 103, -- Mangle Cat (rank 3) [48565] = 103, -- Mangle Cat (rank 4) [48566] = 103, -- Mangle Cat (rank 5) - + -- Feral Tank (Bear) / Guardian Druid: [33878] = 104, -- Mangle Bear (rank 1) [33986] = 104, -- Mangle Bear (rank 2) [33987] = 104, -- Mangle Bear (rank 3) [48563] = 104, -- Mangle Bear (rank 4) [48564] = 104, -- Mangle Bear (rank 5) - + -- Restoration Druid: [33891] = 105, -- Tree of Life [18562] = 105, -- Swiftmend @@ -570,12 +570,12 @@ do -- Beast Mastery Hunter: [19574] = 253, -- Bestial Wrath [53257] = 253, -- Cobra Strikes - + -- Marksmanship Hunter: [34490] = 254, -- Silecing Shot [19506] = 254, -- Trueshot Aura [53209] = 254, -- Chimera Shot - + -- Survival Hunter: [19386] = 255, -- Wyvern Sting (rank 1) [24132] = 255, -- Wyvern Sting (rank 2) @@ -600,7 +600,7 @@ do [31589] = 62, -- Slow [44425] = 62, -- Arcane Barrage (rank 1) [44780] = 62, -- Arcane Barrage (rank 2) - [44781] = 62, -- Arcane Barrage (rank 3) + [44781] = 62, -- Arcane Barrage (rank 3) -- Fire Mage: [28682] = 63, -- Combustion @@ -628,7 +628,7 @@ do [57761] = 64, -- Fireball! (Brain Freeze talent) [31687] = 64, -- Summon Water Elemental [44572] = 64, -- Deep Freeze - + -- Holy Paladin: [20473] = 65, -- Holy Shock (rank 1) [20929] = 65, -- Holy Shock (rank 2) @@ -653,7 +653,7 @@ do [48826] = 66, -- Avenger's Shield (rank 4) [48827] = 66, -- Avenger's Shield (rank 5) [53595] = 66, -- Hammer of the Righteous - + -- Retribution Paladin: [53489] = 70, -- The Art of War (rank 1) [59578] = 70, -- The Art of War (rank 2) @@ -669,7 +669,7 @@ do [53005] = 256, -- Penance (rank 2) [53006] = 256, -- Penance (rank 3) [53007] = 256, -- Penance (rank 4) - + -- Holy Priest: [20711] = 257, -- Spirit of Redemption [724] = 257, -- Lightwell (rank 1) @@ -686,7 +686,7 @@ do [48088] = 257, -- Circle of Healing (rank 6) [48089] = 257, -- Circle of Healing (rank 7) [47788] = 257, -- Guardian Spirit - + -- Shadow Priest: [15286] = 258, -- Vampiric Embrace [15473] = 258, -- Shadowform @@ -695,7 +695,7 @@ do [34917] = 258, -- Vampiric Touch (rank 3) [48159] = 258, -- Vampiric Touch (rank 4) [48160] = 258, -- Vampiric Touch (rank 5) - [47585] = 258, -- Dispersion + [47585] = 258, -- Dispersion -- Assassination Rogue: [58427] = 259, -- Overkill @@ -720,7 +720,7 @@ do [14183] = 261, -- Premeditation [36554] = 261, -- Shadowstep [51713] = 261, -- Shadow Dance - + -- Elemental Shaman: [16166] = 262, -- Elemental Mastery [30706] = 262, -- Totem of Wrath (rank 1) @@ -777,7 +777,7 @@ do [63165] = 266, -- Decimation (rank 1) [63167] = 266, -- Decimation (rank 2) [47241] = 266, -- Metamorphosis - + -- Destruction Warlock: [17962] = 267, -- Conflagrate [30283] = 267, -- Shadowfury (rank 1) @@ -805,9 +805,9 @@ do [46924] = 71, -- Bladestorm -- Fury Warrior: - [29801] = 72, -- Rampage + [29801] = 72, -- Rampage [23881] = 72, -- Bloodthirst - + -- Protection Warrior: [50720] = 73, -- Vigilance [20243] = 73, -- Devastate (rank 1) @@ -1037,7 +1037,7 @@ do [207289] = 252, -- Unholy Assault [115989] = 252, -- Unholy Blight [319230] = 252, -- Unholy Pact - + -- Frost Death Knight: [207142] = 251, -- Avalanche [207167] = 251, -- Blinding Sleet @@ -1075,7 +1075,7 @@ do [59057] = 251, -- Rime [207104] = 251, -- Runic Attenuation [81229] = 251, -- Runic Empowerment - + -- Blood Death Knight: [205727] = 250, -- Anti-Magic Barrier [316634] = 250, -- Blood Boil @@ -1113,7 +1113,7 @@ do [273953] = 250, -- Voracious [206967] = 250, -- Will of the Necropolis - + -- Balance Druid: [236168] = 102, -- Starfall [136060] = 102, -- Celestial Alignment @@ -1133,7 +1133,7 @@ do [1033490] = 104, -- Pulverize [132139] = 104, -- Blood Frenzy [571586] = 104, -- Incarnation: Guardian of Ursoc - + -- Restoration Druid: [740] = 105, -- Tranquility [102342] = 105, -- Ironbark @@ -1166,7 +1166,7 @@ do [199530] = 253, -- Stomp [257944] = 253, -- Thrill of the Hunt [185789] = 253, -- Wild Call - + -- Marksmanship Hunter: [19434] = 254, -- Aimed Shot [321468] = 254, -- Binding Shackles @@ -1189,7 +1189,7 @@ do [288613] = 254, -- Trueshot [260243] = 254, -- Volley [260247] = 254, -- Volley - + -- Survival Hunter: [269737] = 255, -- Alpha Predator [186289] = 255, -- Aspect of the Eagle @@ -1218,7 +1218,7 @@ do [271014] = 255, -- Wildfire Infusion [195645] = 255, -- Wing Clip [321026] = 255, -- Wing Clip - + -- Arcane Mage: [231564] = 62, -- Arcane Barrage [321526] = 62, -- Arcane Barrage @@ -1258,7 +1258,7 @@ do [210805] = 62, -- Time Anomaly [321507] = 62, -- Touch of the Magi [343215] = 62, -- Touch of the Magi - + -- Fire Mage: [235870] = 63, -- Alexstrasza's Fury [157981] = 63, -- Blast Wave @@ -1296,7 +1296,7 @@ do [205020] = 63, -- Pyromaniac [2948] = 63, -- Scorch [269644] = 63, -- Searing Touch - + -- Frost Mage: [190356] = 64, -- Blizzard [321696] = 64, -- Blizzard @@ -1387,7 +1387,7 @@ do [124280] = 269, -- Touch of Karma [152175] = 269, -- Whirling Dragon Punch [157411] = 269, -- Windwalking - + -- Mistweaver Monk: [343655] = 270, -- Enveloping Breath [124682] = 270, -- Enveloping Mist @@ -1415,7 +1415,7 @@ do [116680] = 270, -- Thunder Focus Tea [231876] = 270, -- Thunder Focus Tea [274963] = 270, -- Upwelling - + -- Holy Paladin: [212056] = 65, -- Absolution [31821] = 65, -- Aura Mastery @@ -1447,7 +1447,7 @@ do [214202] = 65, -- Rule of Law [157047] = 65, -- Saved by the Light - + -- Protection Paladin: [31850] = 66, -- Ardent Defender [66235] = 66, -- Ardent Defender @@ -1472,7 +1472,7 @@ do [161800] = 66, -- Riposte [321136] = 66, -- Shining Light - + -- Retribution Paladin: [267344] = 70, -- Art of War [317912] = 70, -- Art of War @@ -1513,7 +1513,7 @@ do [197045] = 256, -- Shield Discipline [280391] = 256, -- Sins of the Many [109964] = 256, -- Spirit Shell - + -- Holy Priest: [116092] = 257, -- Afterlife [196707] = 257, -- Afterlife @@ -1583,7 +1583,7 @@ do [263165] = 258, -- Void Torrent [185916] = 258, -- Voidform [228264] = 258, -- Voidform - + -- Assassination Rogue: [328085] = 259, -- Blindside [121411] = 259, -- Crimson Tempest @@ -1787,7 +1787,7 @@ do [334315] = 265, -- Unstable Affliction [278350] = 265, -- Vile Taint [196102] = 265, -- Writhe in Agony - + -- Demonology Warlock: [267211] = 266, -- Bilescourge Bombers [104316] = 266, -- Call Dreadstalkers @@ -1943,16 +1943,16 @@ do [252] = "DEATHKNIGHT", -- Unholy Death Knight [251] = "DEATHKNIGHT", -- Frost Death Knight [250] = "DEATHKNIGHT", -- Blood Death Knight - + [102] = "DRUID", -- Balance Druid [103] = "DRUID", -- Feral Druid [104] = "DRUID", -- Guardian Druid [105] = "DRUID", -- Restoration Druid - + [253] = "HUNTER", -- Beast Mastery Hunter [254] = "HUNTER", -- Marksmanship Hunter [255] = "HUNTER", -- Survival Hunter - + [62] = "MAGE", -- Arcane Mage [63] = "MAGE", -- Fire Mage [64] = "MAGE", -- Frost Mage @@ -1960,27 +1960,27 @@ do [268] = "MONK", -- Brewmaster Monk [269] = "MONK", -- Windwalker Monk [270] = "MONK", -- Mistweaver Monk - + [65] = "PALADIN", -- Holy Paladin [66] = "PALADIN", -- Protection Paladin [70] = "PALADIN", -- Retribution Paladin - + [256] = "PRIEST", -- Discipline Priest [257] = "PRIEST", -- Holy Priest [258] = "PRIEST", -- Shadow Priest - + [259] = "ROGUE", -- Assassination Rogue [260] = "ROGUE", -- Outlaw Rogue [261] = "ROGUE", -- Subtlety Rogue - + [262] = "SHAMAN", -- Elemental Shaman [263] = "SHAMAN", -- Enhancement Shaman [264] = "SHAMAN", -- Restoration Shaman - + [265] = "WARLOCK", -- Affliction Warlock [266] = "WARLOCK", -- Demonology Warlock [267] = "WARLOCK", -- Destruction Warlock - + [71] = "WARRIOR", -- Arms Warrior [72] = "WARRIOR", -- Fury Warrior [73] = "WARRIOR", -- Protection Warrior @@ -2059,7 +2059,7 @@ do [49998] = "DEATHKNIGHT", --death strike [55090] = "DEATHKNIGHT",--scourge strike [47632] = "DEATHKNIGHT",--death coil - + --demmon hunter [185123] = "DEMONHUNTER", -- "Throw Glaive" [196718] = "DEMONHUNTER", -- "Darkness" @@ -2094,11 +2094,11 @@ do [247455] = "DEMONHUNTER", -- spirit bomb [225921] = "DEMONHUNTER", -- fracture [225919] = "DEMONHUNTER", -- fracture - + --druid [155722] = "DRUID", -- rake [192090] = "DRUID", -- thrash - + [145110] = "DRUID", -- "Ysera's Gift" [155777] = "DRUID", -- "Rejuvenation (Germination)" [101024] = "DRUID", -- "Glyph of Ferocious Bite" @@ -2111,12 +2111,12 @@ do [20484] = "DRUID", -- "Rebirth" [106839] = "DRUID", -- "Skull Bash" [42231] = "DRUID", -- "Hurricane" - [164815] = "DRUID", -- "Sunfire" + [164815] = "DRUID", -- "Sunfire" [164812] = "DRUID", -- "Moonfire" [106785] = "DRUID", -- "Swipe" [50288] = "DRUID", -- "Starfall" - [152221] = "DRUID", -- "Stellar Flare" - [80313] = "DRUID", -- "Pulverize" + [152221] = "DRUID", -- "Stellar Flare" + [80313] = "DRUID", -- "Pulverize" [124991] = "DRUID", -- "Nature's Vigil" [33917] = "DRUID", -- "Mangle" [102417] = "DRUID", -- Wild Charge @@ -2139,7 +2139,7 @@ do [102359] = "DRUID", -- Mass Entanglement [108293] = "DRUID", -- Heart of the Wild [5211] = "DRUID", -- Mighty Bash - [108291] = "DRUID", -- Heart of the Wild + [108291] = "DRUID", -- Heart of the Wild [18562] = "DRUID", --Swiftmend [132158] = "DRUID", -- Nature's Swiftness [33763] = "DRUID", -- Lifebloom @@ -2161,7 +2161,7 @@ do [102543] = "DRUID", -- Incarnation: King of the Jungle [1850] = "DRUID", -- Dash [77764] = "DRUID", -- Stampeding Roar - [22568] = "DRUID", -- Ferocious Bite + [22568] = "DRUID", -- Ferocious Bite [147349] = "DRUID", -- Wild Mushroom [77758] = "DRUID", -- Thrash [108294] = "DRUID", -- Heart of the Wild @@ -2278,7 +2278,7 @@ do [83244] = "HUNTER",-- Call Pet 4 [5118] = "HUNTER",-- Aspect of the Cheetah [120360] = "HUNTER",-- Barrage - [19577] = "HUNTER",-- Intimidation + [19577] = "HUNTER",-- Intimidation [131900] = "HUNTER",--a murder of crows [118253] = "HUNTER",--serpent sting [77767] = "HUNTER",--cobra shot @@ -2286,7 +2286,7 @@ do [53301] = "HUNTER",--explosive shot [120361] = "HUNTER",--barrage [53351] = "HUNTER",--kill shot - + --mage [87023] = "MAGE", -- "Cauterize" [152087] = "MAGE", -- "Prismatic Crystal" @@ -2357,7 +2357,7 @@ do [2948] = "MAGE",--scorch [30451] = "MAGE",--arcane blase [12051] = "MAGE",--evocation - + --monk [116995] = "MONK", -- "Surging Mist" [162530] = "MONK", -- "Rushing Jade Wind" @@ -2380,12 +2380,12 @@ do [123586] = "MONK", -- "Flying Serpent Kick" [115176] = "MONK", -- Zen Meditation cooldown [115203] = "MONK", -- Fortifying Brew - + [124081] = "MONK", -- Zen Sphere [125355] = "MONK", -- Healing Sphere [122278] = "MONK", -- Dampen Harm [115450] = "MONK", -- Detox - + [121827] = "MONK", -- Roll [115315] = "MONK", -- Summon Black Ox Statue [115399] = "MONK", -- Chi Brew @@ -2395,19 +2395,19 @@ do [116680] = "MONK", -- Thunder Focus Tea [115070] = "MONK", -- Stance of the Wise Serpent [115069] = "MONK", -- Stance of the Sturdy Ox - + [119381] = "MONK", -- Leg Sweep [115695] = "MONK", -- Jab [137639] = "MONK", -- Storm, Earth, and Fire [115008] = "MONK", -- Chi Torpedo - [121828] = "MONK", -- --Chi Torpedo + [121828] = "MONK", -- --Chi Torpedo [115180] = "MONK", -- Dizzying Haze [123986] = "MONK", -- Chi Burst [130654] = "MONK", -- Chi Burst [148135] = "MONK", -- Chi Burst [119392] = "MONK", -- Charging Ox Wave [116095] = "MONK", -- Disable - [115687] = "MONK", -- Jab + [115687] = "MONK", -- Jab [117993] = "MONK", -- Chi Torpedo [100780] = "MONK", -- Jab [116740] = "MONK", -- Tigereye Brew @@ -2451,7 +2451,7 @@ do [116844] = "MONK", -- Ring of Peace [107428] = "MONK", --rising sun kick [100784] = "MONK", --blackout kick - [132467] = "MONK", --Chi wave + [132467] = "MONK", --Chi wave [107270] = "MONK", --spinning crane kick [100787] = "MONK", --tiger palm [123761] = "MONK", --mana tea @@ -2466,7 +2466,7 @@ do [117895] = "MONK", --eminence (statue) [115295] = "MONK", --guard [115072] = "MONK", --expel harm - + --paladin [121129] = "PALADIN", -- "Daybreak" [159375] = "PALADIN", -- "Shining Protector" @@ -2476,7 +2476,7 @@ do [152262] = "PALADIN", -- "Seraphim" [20164] = "PALADIN", -- "Seal of Justice" [20170] = "PALADIN", -- "Seal of Justice" - [157122] = "PALADIN", -- "Holy Shield" + [157122] = "PALADIN", -- "Holy Shield" [96172] = "PALADIN", -- "Hand of Light" [101423] = "PALADIN", -- "Seal of Righteousness" [42463] = "PALADIN", -- "Seal of Truth" @@ -2533,7 +2533,7 @@ do [31935] = "PALADIN",--avenger's shield [20271] = "PALADIN", --judgment [35395] = "PALADIN", --cruzader strike - [81297] = "PALADIN", --consacration + [81297] = "PALADIN", --consacration [31803] = "PALADIN", --censure [65148] = "PALADIN", --Sacred Shield [20167] = "PALADIN", --Seal of Insight @@ -2560,19 +2560,19 @@ do [155521] = "PRIEST", -- "Auspicious Spirits" [148859] = "PRIEST", -- "Shadowy Apparition" [120696] = "PRIEST", -- "Halo" - [122128] = "PRIEST", -- "Divine Star" + [122128] = "PRIEST", -- "Divine Star" [132157] = "PRIEST", -- "Holy Nova" [19236] = "PRIEST", -- Desperate Prayer [47788] = "PRIEST", -- Guardian Spirit [81206] = "PRIEST", -- Chakra: Sanctuary [62618] = "PRIEST", -- Power Word: Barrier [32375] = "PRIEST", -- Mass Dispel - [32546] = "PRIEST", -- Binding Heal + [32546] = "PRIEST", -- Binding Heal [126135] = "PRIEST", -- Lightwell [81209] = "PRIEST", -- Chakra: Chastise [81208] = "PRIEST", -- Chakra: Serenity [2006] = "PRIEST", -- Resurrection - [1706] = "PRIEST", -- Levitate + [1706] = "PRIEST", -- Levitate [73510] = "PRIEST", -- Mind Spike [127632] = "PRIEST", -- Cascade [88625] = "PRIEST", -- Holy Word: Chastise @@ -2636,7 +2636,7 @@ do [88686] = "PRIEST", --santuary [17] = "PRIEST", --power word: shield [129250] = "PRIEST", --power word: solace - + --rogue [112974] = "ROGUE", -- "Leeching Poison" [13877] = "ROGUE", -- "Blade Flurry" @@ -2658,7 +2658,7 @@ do [108211] = "ROGUE", -- Leeching Poison --[5761] = "ROGUE", -- Mind-numbing Poison [8679] = "ROGUE", -- Wound Poison - + [137584] = "ROGUE", -- Shuriken Toss [137585] = "ROGUE", -- Shuriken Toss Off-hand [1833] = "ROGUE", -- Cheap Shot @@ -2708,7 +2708,7 @@ do [35546] = "ROGUE", --combat potency (energy) [98440] = "ROGUE", --relentless strikes (energy) [51637] = "ROGUE", --venomous vim (energy) - + --shaman [55533] = "SHAMAN", -- "Glyph of Healing Wave" [157503] = "SHAMAN", -- "Cloudburst" @@ -2795,16 +2795,16 @@ do [61295] = "SHAMAN", --riptide [114083] = "SHAMAN", --restorative mists [8004] = "SHAMAN", --healing surge - + --warlock [104318] = "WARLOCK", -- fel firebolt [270481] = "WARLOCK", -- demonfire [271971] = "WARLOCK", -- dreadbite [264178] = "WARLOCK", -- demonbolt - + [233490] = "WARLOCK", -- unstable affliction [232670] = "WARLOCK", -- shadow bolt - + [108447] = "WARLOCK", -- "Soul Link" [108508] = "WARLOCK", -- "Mannoroth's Fury" [108482] = "WARLOCK", -- "Unbound Will" @@ -2824,7 +2824,7 @@ do [119914] = "WARLOCK", -- "Felstorm" [86121] = "WARLOCK", -- "Soul Swap" [86213] = "WARLOCK", -- "Soul Swap Exhale" - [157695] = "WARLOCK", -- "Demonbolt" + [157695] = "WARLOCK", -- "Demonbolt" [86040] = "WARLOCK", -- "Hand of Gul'dan" [124915] = "WARLOCK", -- "Chaos Wave" [22703] = "WARLOCK", -- "Infernal Awakening" @@ -2833,7 +2833,7 @@ do [152108] = "WARLOCK", -- "Cataclysm" [27285] = "WARLOCK", -- "Seed of Corruption" [131740] = "WARLOCK", -- "Corruption" - [131737] = "WARLOCK", -- "Agony" + [131737] = "WARLOCK", -- "Agony" [131736] = "WARLOCK", -- "Unstable Affliction" [80240] = "WARLOCK", -- Havoc [112921] = "WARLOCK", -- Summon Abyssal @@ -2892,8 +2892,8 @@ do [103103] = "WARLOCK", --malefic grasp [980] = "WARLOCK", --agony [30108] = "WARLOCK", --unstable affliction - [172] = "WARLOCK", --corruption - [48181] = "WARLOCK", --haunt + [172] = "WARLOCK", --corruption + [48181] = "WARLOCK", --haunt [29722] = "WARLOCK", --incenerate [348] = "WARLOCK", --Immolate [116858] = "WARLOCK", --Chaos Bolt @@ -2907,7 +2907,7 @@ do [104027] = "WARLOCK", --soul fire [603] = "WARLOCK", --doom [108371] = "WARLOCK", --Harvest life - + --warrior [117313] = "WARRIOR", -- "Bloodthirst Heal" [118779] = "WARRIOR", -- "Victory Rush" @@ -2997,7 +2997,7 @@ do [360823] = "EVOKER", --Naturalize [373861] = "EVOKER", --Temporal Anomaly [366155] = "EVOKER", --Reversion - [364343] = "EVOKER", --Echo + [364343] = "EVOKER", --Echo [356995] = "EVOKER", --Desintegrate [357209] = "EVOKER", --Fire Breath [359077] = "EVOKER", --Eternity Surge @@ -3014,14 +3014,14 @@ do [114908] = true, --Spirit Shell (discipline) [114214] = true, --Angelic Bulwark (talent) [152118] = true, --Clarity of Will (talent) - + --death knight [48707] = true, --Anti-Magic Shell [116888] = true, --Shroud of Purgatory (talent) [51052] = true, --Anti-Magic Zone (talent) [77535] = true, --Blood Shield [115635] = true, --death barrier - + --shaman [114893] = true, --Stone Bulwark (stone bulwark totem) [145379] = true, --Barreira da Natureza @@ -3030,16 +3030,16 @@ do --paladin [86273] = true, --Illuminated Healing (holy) [65148] = true, --Sacred Shield (talent) - + --monk [116849] = true, --Life Cocoon (mistweaver) [115295] = true, --Guard (brewmaster) --[118604] = true, --Guard (brewmaster) - [145051] = true, --Prote��o de Niuzao + [145051] = true, --Prote��o de Niuzao [145056] = true, -- [145441] = true, --2P T16 [145439] = true, --2P T16 - + --warlock --[6229] = true, --Twilight Ward [108366] = true, --Soul Leech (talent) @@ -3050,10 +3050,10 @@ do --mage [11426] = true, --Ice Barrier (talent) [1463] = true, --Incanter's Ward (talent) - + --warrior [112048] = true, -- Shield Barrier (protection) - + --others [116631] = true, -- enchant "Enchant Weapon - Colossus" [140380] = true, -- trinket "Inscribed Bag of Hydra-Spawn" @@ -3112,7 +3112,7 @@ do } _detalhes.HarmfulSpells = { - + --death knight [49020] = true, -- obliterate [49143] = true, -- frost strike @@ -3144,7 +3144,7 @@ do --[45902] = true, -- Blood Strike [108194] = true, -- Asphyxiate [77606] = true, -- Dark Simulacrum - + --druid --[80965] = true, -- Skull Bashs [78675] = true, -- Solar Beam @@ -3180,8 +3180,8 @@ do --[114236] = true, -- Shred! [48505] = true, -- Starfall [78674] = true, -- Starsurge - --[80964] = true, -- Skull Bash - + --[80964] = true, -- Skull Bash + --hunter --[19503] = true,-- Scatter Shot [109259] = true,-- Powershot @@ -3196,11 +3196,11 @@ do [3674] = true,-- Black Arrow [117050] = true,-- Glaive Toss --[1978] = true,-- Serpent Sting - [34026] = true,-- Kill Command + [34026] = true,-- Kill Command [2643] = true,-- Multi-Shot [109248] = true,-- Binding Shot [149365] = true,-- Dire Beast - [120679] = true,-- Dire Beast + [120679] = true,-- Dire Beast [3045] = true,-- Rapid Fire [19574] = true,-- Bestial Wrath [19386] = true,-- Wyvern Sting @@ -3214,7 +3214,7 @@ do [147362] = true,-- Counter Shot [19801] = true,-- Tranquilizing Shot --[82654] = true,-- Widow Venom - + --mage [116] = true, --frost bolt [30455] = true, --ice lance @@ -3242,11 +3242,11 @@ do [44572] = true,-- Deep Freeze [113724] = true,-- Ring of Frost [31661] = true,-- Dragon's Breath - + --monk [107428] = true, --rising sun kick [100784] = true, --blackout kick - [132467] = true, --Chi wave + [132467] = true, --Chi wave [107270] = true, --spinning crane kick [100787] = true, --tiger palm [132463] = true, -- shi wave @@ -3276,16 +3276,16 @@ do [137639] = true, -- Storm, Earth, and Fire --[115073] = true, -- Spinning Fire Blossom [115008] = true, -- Chi Torpedo - [121828] = true, -- --Chi Torpedo + [121828] = true, -- --Chi Torpedo [115180] = true, -- Dizzying Haze [123986] = true, -- Chi Burst [130654] = true, -- Chi Burst [148135] = true, -- Chi Burst [119392] = true, -- Charging Ox Wave [116095] = true, -- Disable - [115687] = true, -- Jab + [115687] = true, -- Jab [117993] = true, -- Chi Torpedo - + --paladin [35395] = true,--cruzade strike [879] = true,--exorcism @@ -3295,7 +3295,7 @@ do [35395] = true, --cruzader strike [81297] = true, --consacration [31803] = true, --censure - [20473] = true,-- Holy Shock + [20473] = true,-- Holy Shock [114158] = true,-- Light's Hammer [24275] = true,-- Hammer of Wrath [88263] = true,-- Hammer of the Righteous @@ -3311,7 +3311,7 @@ do [116467] = true, -- Consecration [31801] = true, -- Seal of Truth [20165] = true, -- Seal of Insight - + --priest [589] = true, --shadow word: pain [34914] = true, --vampiric touch @@ -3323,7 +3323,7 @@ do [47666] = true, --penance [14914] = true, --holy fire [48045] = true, -- Mind Sear - [49821] = true, -- Mind Sear + [49821] = true, -- Mind Sear [32379] = true, -- Shadow Word: Death [129176] = true, -- Shadow Word: Death [120517] = true, -- Halo @@ -3335,7 +3335,7 @@ do [127632] = true, -- Cascade --[108921] = true, -- Psyfiend [88625] = true, -- Holy Word: Chastise - + --rogue [53] = true, --backstab [2098] = true, --eviscerate @@ -3364,7 +3364,7 @@ do [137585] = true, -- Shuriken Toss Off-hand [1833] = true, -- Cheap Shot [121733] = true, -- Throw - [1776] = true, -- Gouge + [1776] = true, -- Gouge --shaman [51505] = true, --lava burst @@ -3393,8 +3393,8 @@ do [103103] = true, --malefic grasp [980] = true, --agony [30108] = true, --unstable affliction - [172] = true, --corruption - [48181] = true, --haunt + [172] = true, --corruption + [48181] = true, --haunt [29722] = true, --incenerate [348] = true, --Immolate [116858] = true, --Chaos Bolt @@ -3427,7 +3427,7 @@ do --[109466] = true, -- Curse of Enfeeblement --[112092] = true, -- Shadow Bolt --[103967] = true, -- Carrion Swarm - + --warrior [100130] = true, --wild strike [96103] = true, --raging blow @@ -3467,7 +3467,7 @@ do --[7386] = true, -- Sunder Armor [107566] = true, -- Staggering Shout } - + _detalhes.MiscClassSpells = { --death knight [49576] = true, -- Death Grip @@ -3485,8 +3485,8 @@ do [108199] = true, -- Gorefiend's Grasp [108201] = true, -- Desecrated Ground [48265] = true, -- Unholy Presence - [61999] = true, -- Raise Ally - + [61999] = true, -- Raise Ally + --druid --[16689] = true, -- Nature's Grasp [102417] = true, -- Wild Charge @@ -3519,7 +3519,7 @@ do [24858] = true, -- Moonkin Form --[81070] = true, --eclipse --[29166] = true, --innervate - + --hunter [781] = true,-- Disengage [82948] = true,-- Snake Trap @@ -3542,7 +3542,7 @@ do --[13165] = true,-- Aspect of the Hawk [53271] = true,-- Master's Call [1543] = true,-- Flare - + --mage [1953] = true,-- Blink [108843] = true,-- Blazing Speed @@ -3565,7 +3565,7 @@ do [53140] = true,-- Teleport: Dalaran [11417] = true,-- Portal: Orgrimmar [42955] = true,-- Conjure Refreshment - + --monk [109132] = true, -- Roll (neutral) [115313] = true, -- Summon Jade Serpent Statue @@ -3582,7 +3582,7 @@ do [116680] = true, -- Thunder Focus Tea [115070] = true, -- Stance of the Wise Serpent [115069] = true, -- Stance of the Sturdy Ox - + --paladin [85499] = true,-- Speed of Light --[84963] = true,-- Inquisition @@ -3595,7 +3595,7 @@ do [19740] = true,-- Blessing of Might --[54428] = true, -- Divine Plea --misc [7328] = true, -- Redemption - + --priest [8122] = true, -- Psychic Scream [81700] = true, -- Archangel @@ -3614,7 +3614,7 @@ do [81208] = true, -- Chakra: Serenity [2006] = true, -- Resurrection [1706] = true, -- Levitate - + --rogue [108212] = true, -- Burst of Speed (misc) [5171] = true, -- Slice and Dice @@ -3630,7 +3630,7 @@ do [108211] = true, -- Leeching Poison --[5761] = true, -- Mind-numbing Poison [8679] = true, -- Wound Poison - + --shaman [73680] = true, -- Unleash Elements (misc) [3599] = true, -- Searing Totem @@ -3649,7 +3649,7 @@ do [51514] = true, -- Hex --[73682] = true, -- Unleash Frost --[8033] = true, -- Frostbrand Weapon - + --warlock [697] = true, -- Summon Voidwalker [6201] = true, -- Create Healthstone @@ -3681,7 +3681,7 @@ do [688] = true, -- Summon Imp [112870] = true, -- Summon Wrathguard [104316] = true, -- Imp Swarm - + --warrior [18499] = true, -- Berserker Rage (class) [100] = true, -- Charge @@ -3691,9 +3691,9 @@ do [2457] = true, -- Battle Stance [12328] = true, -- Sweeping Strikes [114192] = true, -- Mocking Banner - + } - + _detalhes.AttackCooldownSpells = { --death knight --[49016] = true, -- Unholy Frenzy (attack cd) @@ -3701,7 +3701,7 @@ do [49028] = true, -- Dancing Rune Weapon (attack cd) [51271] = true, -- Pillar of Frost (attack cd) [63560] = true, -- Dark Transformation (pet) - + --druid [106951] = true, -- Berserk (attack cd) [124974] = true, -- Nature's Vigil (attack cd) @@ -3713,13 +3713,13 @@ do [127663] = true, -- Astral Communion [108293] = true, -- Heart of the Wild (attack cd) [108291] = true, -- Heart of the Wild - + --hunter [131894] = true,-- A Murder of Crows (attack cd) [121818] = true,-- Stampede (attack cd) [82692] = true,-- Focus Fire [120360] = true,-- Barrage - + --mage [80353] = true,-- Time Warp --[131078] = true,-- Icy Veins @@ -3728,22 +3728,22 @@ do [108978] = true,-- Alter Time [127140] = true,-- Alter Time [12042] = true,-- Arcane Power - + --monk [116740] = true, -- Tigereye Brew (attack cd?) [123904] = true, -- Invoke Xuen, the White Tiger [115288] = true, -- Energizing Brew - + --paladin [31884] = true,-- Avenging Wrath [105809] = true,-- Holy Avenger [31842] = true, -- Divine Favor - + --priest [34433] = true, -- Shadowfiend [123040] = true, -- Mindbender [10060] = true, -- Power Infusion - + --rogue [13750] = true, -- Adrenaline Rush (attack cd) --[121471] = true, -- Shadow Blades @@ -3752,7 +3752,7 @@ do [51690] = true, -- Killing Spree [51713] = true, -- Shadow Dance [152151] = true, -- "Shadow Reflection" - + --shaman --[120668] = true, --Stormlash Totem (attack cd) [2894] = true, -- Fire Elemental Totem @@ -3762,19 +3762,19 @@ do [51533] = true, -- Feral Spirit [16188] = true, -- Ancestral Swiftness [2062] = true, -- Earth Elemental Totem - + --warlock [113860] = true, -- Dark Soul: Misery (attack cd) [113858] = true, -- Dark Soul: Instability [113861] = true, -- Dark Soul: Knowledge - + --warrior [1719] = true, -- Recklessness (attack cd) --[114207] = true, -- Skull Banner [107574] = true, -- Avatar [12292] = true, -- Bloodbath } - + _detalhes.HelpfulSpells = { --death knight [45470] = true, -- Death Strike (heal) @@ -3784,7 +3784,7 @@ do [48982] = true, -- rune tap [119975] = true, -- Conversion (heal) [48743] = true, -- Death Pact (heal) - + --druid --[33878] = true, --mangle (energy gain) [17057] = true, --bear form (energy gain) @@ -3800,7 +3800,7 @@ do [8936] = true, --regrowth [33778] = true, --lifebloom [48503] = true, --living seed - --[50464] = true, --nourish + --[50464] = true, --nourish [18562] = true, --Swiftmend (heal) [145205] = true, -- Wild Mushroom (heal) [33763] = true, -- Lifebloom (heal) @@ -3809,19 +3809,19 @@ do [108238] = true, -- Renewal [102351] = true, -- Cenarion Ward - + --hunter [109304] = true,-- Exhilaration (heal) - + --mage [11426] = true, --Ice Barrier (heal) [115610] = true,-- Temporal Shield [111264] = true,-- Ice Ward - + --monk [124682] = true, -- Enveloping Mist (helpful) [115460] = true, -- Healing Sphere - --[115464] = true, -- Healing Sphere + --[115464] = true, -- Healing Sphere [115151] = true, -- Renewing Mist [122783] = true, -- Diffuse Magic [147489] = true, -- Expel Harm @@ -3849,7 +3849,7 @@ do [125355] = true, -- Healing Sphere [122278] = true, -- Dampen Harm [115450] = true, -- Detox - + --paladin [85673] = true,-- Word of Glory (heal) [20925] = true,-- Sacred Shield @@ -3875,7 +3875,7 @@ do [114039] = true, -- Hand of Purity [4987] = true, -- Cleanse [136494] = true, -- Word of Glory - + --priest [19236] = true, -- Desperate Prayer [47788] = true, -- Guardian Spirit @@ -3905,7 +3905,7 @@ do [15286] = true, -- Vampiric Embrace --[2050] = true, -- Heal [123259] = true, -- Prayer of Mending - + --rogue [73651] = true, --Recuperate (heal) [35546] = true, --combat potency (energy) @@ -3915,7 +3915,7 @@ do [1966] = true, -- Feint (helpful) [76577] = true, -- Smoke Bomb [5277] = true, -- Evasion - + --shaman --[88765] = true, --rolling thunder (mana) [51490] = true, --thunderstorm (mana) @@ -3942,7 +3942,7 @@ do [77130] = true, -- Purify Spirit [51886] = true, -- Cleanse Spirit [98008] = true, -- Spirit Link Totem - + --warlock [108359] = true, -- Dark Regeneration (helpful) [110913] = true, -- Dark Bargain @@ -3966,7 +3966,7 @@ do [12975] = true, -- Last Stand [2565] = true, -- Shield Block } - + local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) _detalhes.SpellOverwrite = { @@ -4002,7 +4002,7 @@ do [72] = {name = STRING_SCHOOL_SPELLSTORM, formated = "|cFFAFB9AF" .. STRING_SCHOOL_SPELLSTORM .. "|r", hex = "FFAFB9AF", rgb = {175, 175, 175}, decimals = {0.6863, 0.7255, 0.6863}}, --#AFB9AF [80] = {name = STRING_SCHOOL_SPELLFROST , formated = "|cFFC0C0FF" .. STRING_SCHOOL_SPELLFROST .. "|r", hex = "FFC0C0FF", rgb = {192, 255, 255}, decimals = {0.7529, 0.7529, 1.0000}},--#C0C0FF [96] = {name = STRING_SCHOOL_SPELLSHADOW, formated = "|cFFB980FF" .. STRING_SCHOOL_SPELLSHADOW .. "|r", hex = "FFB980FF", rgb = {185, 255, 255}, decimals = {0.7255, 0.5020, 1.0000}},--#B980FF - + [28] = {name = STRING_SCHOOL_ELEMENTAL, formated = "|cFF0070DE" .. STRING_SCHOOL_ELEMENTAL .. "|r", hex = "FF0070DE", rgb = {0, 222, 222}, decimals = {0.0000, 0.4392, 0.8706}}, [124] = {name = STRING_SCHOOL_CHROMATIC, formated = "|cFFC0C0C0" .. STRING_SCHOOL_CHROMATIC .. "|r", hex = "FFC0C0C0", rgb = {192, 192, 192}, decimals = {0.7529, 0.7529, 0.7529}}, [126] = {name = STRING_SCHOOL_MAGIC , formated = "|cFF1111FF" .. STRING_SCHOOL_MAGIC .. "|r", hex = "FF1111FF", rgb = {17, 255, 255}, decimals = {0.0667, 0.0667, 1.0000}}, @@ -4010,19 +4010,42 @@ do --[[custom]] [1024] = {name = "Reflection", formated = "|cFFFFFFFF" .. "Reflection" .. "|r", hex = "FFFFFFFF", rgb = {255, 255, 255}, decimals = {1, 1, 1}}, } - function _detalhes:GetSpellSchoolName (school) - return _detalhes.spells_school [school] and _detalhes.spells_school [school].name or "" + ---return the school of a spell, this value is gotten from a cache + ---@param spellID spellid|spellname + ---@return spellschool + function Details:GetSpellSchool(spellID) + if (spellID == "number") then + spellID = GetSpellInfo(spellID) + end + local school = Details.spell_school_cache[spellID] or 1 + return school end - function _detalhes:GetSpellSchoolFormatedName (school) - return _detalhes.spells_school [school] and _detalhes.spells_school [school].formated or "" + + ---return the name of a spell school + ---@param school spellschool + ---@return string + function Details:GetSpellSchoolName(school) + return Details.spells_school [school] and Details.spells_school [school].name or "" end + + ---return the name of a spell school containing the scape code to color the name by the school color + ---@param school spellschool + ---@return string + function Details:GetSpellSchoolFormatedName(school) + return Details.spells_school[school] and Details.spells_school[school].formated or "" + end + local default_school_color = {145/255, 180/255, 228/255} - function _detalhes:GetSpellSchoolColor(school) - return unpack(_detalhes.spells_school [school] and _detalhes.spells_school [school].decimals or default_school_color) + ---return the color of a spell school + ---@param school spellschool + ---@return red, green, blue + function Details:GetSpellSchoolColor(school) + return unpack(Details.spells_school[school] and Details.spells_school[school].decimals or default_school_color) end - function _detalhes:GetCooldownList (class) + + function Details:GetCooldownList(class) class = class or select(2, UnitClass("player")) - return _detalhes.DefensiveCooldownSpells [class] + return Details.DefensiveCooldownSpells[class] end end @@ -4050,19 +4073,19 @@ local SplitLoadFunc = function(self, deltaTime) SplitLoadFrame:SetScript("OnUpdate", nil) return end - + local inInstance = IsInInstance() local isEncounter = Details.tabela_vigente and Details.tabela_vigente.is_boss local encounterID = isEncounter and isEncounter.id - + --get the actor local actorToIndex = container [SplitLoadFrame.NextActorIndex] - + --no actor? go to the next container if (not actorToIndex) then SplitLoadFrame.NextActorIndex = 1 SplitLoadFrame.NextActorContainer = SplitLoadFrame.NextActorContainer + 1 - + --finished all the 4 container? kill the process if (SplitLoadFrame.NextActorContainer == 5) then SplitLoadFrame:SetScript("OnUpdate", nil) @@ -4074,7 +4097,7 @@ local SplitLoadFunc = function(self, deltaTime) else --++ SplitLoadFrame.NextActorIndex = SplitLoadFrame.NextActorIndex + 1 - + --get the class name or the actor name in case the actor isn't a player local source if (inInstance) then @@ -4082,7 +4105,7 @@ local SplitLoadFunc = function(self, deltaTime) else source = RAID_CLASS_COLORS [actorToIndex.classe] and Details.classstring_to_classid [actorToIndex.classe] end - + --if found a valid actor if (source) then --if is damage, heal or energy @@ -4090,10 +4113,10 @@ local SplitLoadFunc = function(self, deltaTime) --get the spell list in the spells container local spellList = actorToIndex.spells and actorToIndex.spells._ActorTable if (spellList) then - + local SpellPool = Details.spell_pool local EncounterSpellPool = Details.encounter_spell_pool - + for spellID, _ in pairs(spellList) do if (not SpellPool [spellID]) then SpellPool [spellID] = source @@ -4105,17 +4128,17 @@ local SplitLoadFunc = function(self, deltaTime) end end end - + --if is a misc container elseif (SplitLoadFrame.NextActorContainer == 4) then - for _, containerName in ipairs(MiscContainerNames) do + for _, containerName in ipairs(MiscContainerNames) do --check if the actor have this container if (actorToIndex [containerName]) then local spellList = actorToIndex [containerName]._ActorTable if (spellList) then local spellPool = Details.spell_pool local encounterSpellPool = Details.encounter_spell_pool - + for spellId, _ in pairs(spellList) do if (not spellPool[spellId]) then spellPool[spellId] = source