diff --git a/Libs/DF/buildmenu.lua b/Libs/DF/buildmenu.lua index 35a32e35..7aa67a75 100644 --- a/Libs/DF/buildmenu.lua +++ b/Libs/DF/buildmenu.lua @@ -141,11 +141,17 @@ local onLeaveHighlight = function(self) end end -local createOptionHighlightTexture = function(frame, label, widgetWidth) +---create a button and a texture to highlight the button when the mouse is over it +---the button has the dimentions of the label and the widget +---@param frame frame +---@param label fontstring +---@param widgetWidth nunmber +---@return unknown +local createOptionHighlightFrame = function(frame, label, widgetWidth) frame = frame.widget or frame label = label.widget or label - local highlightFrame = CreateFrame("frame", nil, frame) + local highlightFrame = CreateFrame("button", nil, frame) highlightFrame:EnableMouse(true) highlightFrame:SetFrameLevel(frame:GetFrameLevel()-1) @@ -170,7 +176,7 @@ local createOptionHighlightTexture = function(frame, label, widgetWidth) highlightFrame.highlightTexture = highlightTexture highlightFrame.parent = frame - return highlightTexture + return highlightFrame end local setLabelProperties = function(parent, widget, widgetTable, currentXOffset, currentYOffset, template) @@ -219,7 +225,7 @@ local setDropdownProperties = function(parent, widget, widgetTable, currentXOffs PixelUtil.SetPoint(widget.widget, "left", label, "left", nAlignAsPairsLength, 0) if (not widget.highlightFrame) then - local highlightFrame = createOptionHighlightTexture(widget, label, (widgetWidth or 140) + nAlignAsPairsLength + 5) + local highlightFrame = createOptionHighlightFrame(widget, label, (widgetWidth or 140) + nAlignAsPairsLength + 5) widget.highlightFrame = highlightFrame end else @@ -253,8 +259,27 @@ local setDropdownProperties = function(parent, widget, widgetTable, currentXOffs return maxColumnWidth, maxWidgetWidth end +local highlightFrameOnClickToggle = function(highlightFrame, mouseButton) + local parent = highlightFrame:GetParent() + local widget = parent.MyObject + + local bNewState = not widget._get() + widget.OnSwitch(widget, nil, bNewState) --widget.OnSwitch = widgetTable.set + + if (bNewState) then + widget:SetValue(true) + else + widget:SetValue(false) + end + + if (widget._valueChangeHook) then + widget._valueChangeHook() + end +end + local setToggleProperties = function(parent, widget, widgetTable, currentXOffset, currentYOffset, template, widgetWidth, widgetHeight, bAlignAsPairs, nAlignAsPairsLength, valueChangeHook, maxColumnWidth, switchIsCheckbox, bUseBoxFirstOnAllWidgets, menuOptions, index, maxWidgetWidth) widget._get = widgetTable.get + widget._set = widgetTable.set widget.widget_type = "toggle" widget.OnSwitch = widgetTable.set @@ -263,14 +288,17 @@ local setToggleProperties = function(parent, widget, widgetTable, currentXOffset end if (widgetTable.children_follow_enabled) then - widget.SetValueOriginal = widget.SetValue + widget.SetValueOriginal = widget.SetValue --perhaps widgetTable.set() --perhaps setscrip OnClick + widget._name = widgetTable.name - local newSetFunc = function(widget, value) + local newSetFunc = function(thisWidget, value) --look for children ids local childrenids = widgetTable.childrenids + --print(childrenids, type(childrenids)) if (type(childrenids) == "table") then for i, childId in ipairs(childrenids) do local childWidget = parent:GetWidgetById(childId) + --print("childWidget", childWidget) if (childWidget) then --if the children_follow_reverse is true, then the children will be enabled when the toogle is disabeld --this is used when the main toggle is a kind of "Do This Automatically", if is not doing it automatically @@ -292,7 +320,7 @@ local setToggleProperties = function(parent, widget, widgetTable, currentXOffset end end - widget.SetValueOriginal(widget, value) + thisWidget.SetValueOriginal(thisWidget, value) return value end @@ -325,13 +353,15 @@ local setToggleProperties = function(parent, widget, widgetTable, currentXOffset local extraPaddingY = 0 if (bAlignAsPairs) then - PixelUtil.SetPoint(label, "topleft", widget:GetParent(), "topleft", currentXOffset, currentYOffset) - PixelUtil.SetPoint(widget.widget, "left", label, "left", nAlignAsPairsLength, 0) - if (not widget.highlightFrame) then - local highlightFrame = createOptionHighlightTexture(widget, label, (widgetWidth or 140) + nAlignAsPairsLength + 5) + local highlightFrame = createOptionHighlightFrame(widget, label, (widgetWidth or 140) + nAlignAsPairsLength + 5) widget.highlightFrame = highlightFrame end + + widget._valueChangeHook = valueChangeHook + widget.highlightFrame:SetScript("OnClick", highlightFrameOnClickToggle) + PixelUtil.SetPoint(label, "topleft", widget:GetParent(), "topleft", currentXOffset, currentYOffset) + PixelUtil.SetPoint(widget.widget, "right", widget.highlightFrame, "right", -3, 0) else if (widgetTable.boxfirst or bUseBoxFirstOnAllWidgets) then label:SetPoint("left", widget.widget or widget, "right", 2, 0) @@ -434,9 +464,11 @@ local setRangeProperties = function(parent, widget, widgetTable, currentXOffset, PixelUtil.SetPoint(widget.widget, "left", label, "left", nAlignAsPairsLength, 0) if (not widget.highlightFrame) then - local highlightFrame = createOptionHighlightTexture(widget, label, (widgetWidth or 140) + nAlignAsPairsLength + 5) + local highlightFrame = createOptionHighlightFrame(widget, label, (widgetWidth or 140) + nAlignAsPairsLength + 5) widget.highlightFrame = highlightFrame end + + widget.bAttachButtonsToLeft = true else widget:SetPoint("left", label, "right", 2, 0) label:SetPoint("topleft", parent, "topleft", currentXOffset, currentYOffset) @@ -508,7 +540,7 @@ local setColorProperties = function(parent, widget, widgetTable, currentXOffset, PixelUtil.SetPoint(widget.widget, "left", label, "left", nAlignAsPairsLength, 0) if (not widget.highlightFrame) then - local highlightFrame = createOptionHighlightTexture(widget, label, (widgetWidth or 140) + nAlignAsPairsLength + 5) + local highlightFrame = createOptionHighlightFrame(widget, label, (widgetWidth or 140) + nAlignAsPairsLength + 5) widget.highlightFrame = highlightFrame end else @@ -573,7 +605,7 @@ local setExecuteProperties = function(parent, widget, widgetTable, currentXOffse PixelUtil.SetPoint(widget.widget, "left", label, "left", nAlignAsPairsLength, 0) if (not widget.highlightFrame) then - local highlightFrame = createOptionHighlightTexture(widget, label, (widgetWidth or 140) + nAlignAsPairsLength + 5) + local highlightFrame = createOptionHighlightFrame(widget, label, (widgetWidth or 140) + nAlignAsPairsLength + 5) widget.highlightFrame = highlightFrame end else @@ -652,7 +684,7 @@ local setTextEntryProperties = function(parent, widget, widgetTable, currentXOff PixelUtil.SetPoint(widget.widget, "left", label, "left", nAlignAsPairsLength, 0) if (not widget.highlightFrame) then - local highlightFrame = createOptionHighlightTexture(widget, label, (widgetWidth or 140) + nAlignAsPairsLength + 5) + local highlightFrame = createOptionHighlightFrame(widget, label, (widgetWidth or 140) + nAlignAsPairsLength + 5) widget.highlightFrame = highlightFrame end else diff --git a/Libs/DF/definitions.lua b/Libs/DF/definitions.lua index 9187d505..b9cb19bd 100644 --- a/Libs/DF/definitions.lua +++ b/Libs/DF/definitions.lua @@ -220,7 +220,13 @@ ---@field CreateColorDropDown fun(self:table, parent:frame, func:function, default:any, width:number?, height:number?, member:string?, name:string?, template:table?) : df_dropdown ---@field CreateOutlineDropDown fun(self:table, parent:frame, func:function, default:any, width:number?, height:number?, member:string?, name:string?, template:table?) : df_dropdown ---@field CreateAnchorPointDropDown fun(self:table, parent:frame, func:function, default:any, width:number?, height:number?, member:string?, name:string?, template:table?) : df_dropdown +---@field CreateAudioDropDown fun(self:table, parent:frame, func:function, default:any, width:number?, height:number?, member:string?, name:string?, template:table?) : df_dropdown ---@field CreateFontListGenerator fun(self:table, callback:function) : function return a function which when called returns a table filled with all fonts available and ready to be used on dropdowns +---@field CreateAnchorPointListGenerator fun(self:table, callback:function) : function return a function which when called returns a table filled with all anchor points available and ready to be used on dropdowns +---@field CreateColorListGenerator fun(self:table, callback:function) : function return a function which when called returns a table filled with all colors available and ready to be used on dropdowns +---@field CreateOutlineListGenerator fun(self:table, callback:function) : function return a function which when called returns a table filled with all outline options available and ready to be used on dropdowns +---@field CreateAudioListGenerator fun(self:table, callback:function) : function return a function which when called returns a table filled with all audio options available and ready to be used on dropdowns +---@field BuildDropDownFontList fun(self:table, onClick:function, icon:atlasname|texturepath|textureid|nil, iconTexcoord:table?, iconSize:number?, bIncludeDefault:boolean?) : table build a list of fonts to be used as optionsTable for a dropdown ---@field CreateTextEntry fun(self:table, parent:frame, textChangedCallback:function, width:number, height:number, member:string?, name:string?, labelText:string?, textentryTemplate:table?, labelTemplate:table?) : df_textentry ---@field ReskinSlider fun(self:table, slider:frame) ---@field GetAvailableSpells fun(self:table) : table diff --git a/Libs/DF/dropdown.lua b/Libs/DF/dropdown.lua index 298ed401..4993b429 100644 --- a/Libs/DF/dropdown.lua +++ b/Libs/DF/dropdown.lua @@ -1012,15 +1012,21 @@ local iconSizeTable = {16, 16} function DF:BuildDropDownFontList(onClick, icon, iconTexcoord, iconSize, bIncludeDefault) local fontTable = {} + if (not iconSize) then + iconSize = iconSizeTable + else + iconSize = {iconSize, iconSize} + end + local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0") for name, fontPath in pairs(SharedMedia:HashTable("font")) do - fontTable[#fontTable+1] = {value = name, label = name, onclick = onClick, icon = icon, iconsize = iconSizeTable, texcoord = iconTexcoord, font = fontPath, descfont = "abcdefg ABCDEFG"} + fontTable[#fontTable+1] = {value = name, label = name, onclick = onClick, icon = icon, iconsize = iconSize, texcoord = iconTexcoord, font = fontPath, descfont = "abcdefg ABCDEFG"} end table.sort(fontTable, function(t1, t2) return t1.label < t2.label end) if (bIncludeDefault) then - table.insert(fontTable, 1, {value = "DEFAULT", label = "DEFAULT", onclick = onClick, icon = icon, iconsize = iconSizeTable, texcoord = iconTexcoord, font = "", descfont = "abcdefg ABCDEFG"}) + table.insert(fontTable, 1, {value = "DEFAULT", label = "DEFAULT", onclick = onClick, icon = icon, iconsize = iconSize, texcoord = iconTexcoord, font = "", descfont = "abcdefg ABCDEFG"}) end return fontTable diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua index 8e0f83f4..bc6d2d2d 100644 --- a/Libs/DF/fw.lua +++ b/Libs/DF/fw.lua @@ -1,6 +1,6 @@ -local dversion = 547 +local dversion = 550 local major, minor = "DetailsFramework-1.0", dversion local DF, oldminor = LibStub:NewLibrary(major, minor) diff --git a/boot.lua b/boot.lua index 80ee733a..661c55b4 100644 --- a/boot.lua +++ b/boot.lua @@ -121,6 +121,7 @@ Details222.Debug = { DebugPets = false, DebugPlayerPets = false, + DebugBuff = false, } Details222.Tvs = tvs @@ -1563,9 +1564,11 @@ end Details222.UnitIdCache.Raid = {} Details222.UnitIdCache.RaidPet = {} +Details222.UnitIdCache.RaidTargets = {} for i = 1, 40 do Details222.UnitIdCache.Raid[i] = "raid" .. i Details222.UnitIdCache.RaidPet[i] = "raidpet" .. i + Details222.UnitIdCache.RaidTargets[i] = "raidtarget" .. i end Details222.UnitIdCache.Boss = {} diff --git a/classes/class_utility.lua b/classes/class_utility.lua index b3511941..27be2d0f 100644 --- a/classes/class_utility.lua +++ b/classes/class_utility.lua @@ -15,7 +15,6 @@ local GameTooltip = GameTooltip local IsInRaid = IsInRaid local IsInGroup = IsInGroup local GetNumGroupMembers = GetNumGroupMembers -local _UnitAura = UnitAura local UnitGUID = UnitGUID local _UnitName = UnitName local format = _G.format @@ -28,7 +27,9 @@ local _string_replace = Details.string.replace --details api local _detalhes = _G.Details local Details = _detalhes local AceLocale = LibStub("AceLocale-3.0") -local Loc = AceLocale:GetLocale ( "Details" ) +local Loc = AceLocale:GetLocale( "Details" ) + +---@type detailsframework local detailsFramework = DetailsFramework local addonName, Details222 = ... @@ -232,8 +233,8 @@ function Details.ShowDeathTooltip(instance, lineFrame, combatObject, deathTable) if (evType) then --bool true --damage local overkill = event[10] or 0 - local critical = event[11] and (" " .. TEXT_MODE_A_STRING_RESULT_CRITICAL) or "" -- (Critical) - local crushing = event[12] and (" " .. TEXT_MODE_A_STRING_RESULT_CRUSHING) or "" -- (Crushing) + local critical = event[11] and (" " .. TEXT_MODE_A_STRING_RESULT_CRITICAL) or "" --(Critical) + local crushing = event[12] and (" " .. TEXT_MODE_A_STRING_RESULT_CRUSHING) or "" --(Crushing) local critOrCrush = critical .. crushing if (overkill > 0) then @@ -247,7 +248,7 @@ function Details.ShowDeathTooltip(instance, lineFrame, combatObject, deathTable) --end overkill = " (" .. Details:ToK(overkill) .. " |cFFFF8800overkill|r)" - gameCooltip:AddLine("" .. format("%.1f", eventTime - timeOfDeath) .. "s |cFFFFFF00" .. spellName .. "|r (|c" .. damageSourceColor .. source .. "|r)", "|c" .. damageAmountColor .. "-" .. Details:ToK(amount) .. critOrCrush .. overkill .. " (" .. healthPercent .. "%)", 1, "white", "white") + gameCooltip:AddLine("" .. format("%.1f", eventTime - timeOfDeath) .. "s |cFFFFFF00" .. spellName .. "|r(|c" .. damageSourceColor .. source .. "|r)", "|c" .. damageAmountColor .. "-" .. Details:ToK(amount) .. critOrCrush .. overkill .. " (" .. healthPercent .. "%)", 1, "white", "white") else overkill = "" gameCooltip:AddLine("" .. format("%.1f", eventTime - timeOfDeath) .. "s " .. spellName .. " (|c" .. damageSourceColor .. source .. "|r)", "|c" .. damageAmountColor .. "-" .. Details:ToK(amount) .. critOrCrush .. overkill .. " (" .. healthPercent .. "%)", 1, "white", "white") @@ -272,7 +273,7 @@ function Details.ShowDeathTooltip(instance, lineFrame, combatObject, deathTable) gameCooltip:AddStatusBar(healthPercent, 1, barTypeColors.heal, showSpark, statusBarBackgroundTable_ForDeathTooltip) end else - gameCooltip:AddLine("" .. format("%.1f", eventTime - timeOfDeath) .. "s " .. spellName .. " (|c" .. healingSourceColor .. source .. "|r)", (event[11] and ("x" .. event[11] .. " ") or "") .. "|c" .. healingAmountColor .. "+" .. Details:ToK(amount) .. " (" .. healthPercent .. "%)", 1, "white", "white") + gameCooltip:AddLine("" .. format("%.1f", eventTime - timeOfDeath) .. "s " .. spellName .. " (|c" .. healingSourceColor .. source .. "|r)",(event[11] and ("x" .. event[11] .. " ") or "") .. "|c" .. healingAmountColor .. "+" .. Details:ToK(amount) .. " (" .. healthPercent .. "%)", 1, "white", "white") gameCooltip:AddIcon(spellIcon, nil, nil, lineHeight, lineHeight, .1, .9, .1, .9) gameCooltip:AddStatusBar(healthPercent, 1, barTypeColors.heal, showSpark, statusBarBackgroundTable_ForDeathTooltip) end @@ -282,7 +283,7 @@ function Details.ShowDeathTooltip(instance, lineFrame, combatObject, deathTable) elseif (type(evType) == "number") then if (evType == 1) then --cooldown - gameCooltip:AddLine("" .. format("%.1f", eventTime - timeOfDeath) .. "s " .. spellName .. " (" .. source .. ")", "cooldown (" .. healthPercent .. "%)", 1, "white", "white") + gameCooltip:AddLine("" .. format("%.1f", eventTime - timeOfDeath) .. "s " .. spellName .. " (" .. source .. ")", "cooldown(" .. healthPercent .. "%)", 1, "white", "white") gameCooltip:AddIcon(spellIcon, nil, nil, lineHeight, lineHeight, .1, .9, .1, .9) gameCooltip:AddStatusBar(100, 1, barTypeColors.cooldown, showSpark) @@ -352,11 +353,11 @@ function Details.ShowDeathTooltip(instance, lineFrame, combatObject, deathTable) --space between each line, positive values make the lines be closer gameCooltip:SetOption("LinePadding", -2) - --move each line in the Y axis (vertical offsett) + --move each line in the Y axis(vertical offsett) gameCooltip:SetOption("LineYOffset", 0) --tooltip width - gameCooltip:SetOption("FixedWidth", (type(tooltipWidth) == "number" and tooltipWidth) or 300) + gameCooltip:SetOption("FixedWidth",(type(tooltipWidth) == "number" and tooltipWidth) or 300) --progress bar texture gameCooltip:SetOption("StatusBarTexture", statusbarTexture) @@ -384,32 +385,32 @@ function Details:ToolTipDead(instance, deathTable, barFrame) end end -local function RefreshBarraMorte (morte, barra, instancia) - atributo_misc:UpdateDeathRow (morte, morte.minha_barra, barra.colocacao, instancia) +local function RefreshBarraMorte(morte, barra, instancia) + atributo_misc:UpdateDeathRow(morte, morte.minha_barra, barra.colocacao, instancia) end --object death: --[1] tabela [2] time [3] nome [4] classe [5] maxhealth [6] time of death --[1] true damage/ false heal [2] spellid [3] amount [4] time [5] current health [6] source -local report_table = {} +local reportTable = {} local ReportSingleDeathFunc = function(IsCurrent, IsReverse, AmtLines) AmtLines = AmtLines + 1 local t = {} - for i = 1, min (#report_table, AmtLines) do - local table = report_table [i] + for i = 1, min(#reportTable, AmtLines) do + local table = reportTable [i] t [#t+1] = table [1] .. table [4] .. table [2] .. table [3] end local title = tremove(t, 1) - t = _detalhes.table.reverse (t) + t = _detalhes.table.reverse(t) tinsert(t, 1, title) - _detalhes:SendReportLines (t) + _detalhes:SendReportLines(t) end -function atributo_misc:ReportSingleDeadLine (morte, instancia) +function atributo_misc:ReportSingleDeadLine(morte, instancia) local barra = instancia.barras [morte.minha_barra] local max_health = morte [5] @@ -419,7 +420,7 @@ function atributo_misc:ReportSingleDeadLine (morte, instancia) if (not _detalhes.fontstring_len) then _detalhes.fontstring_len = _detalhes.listener:CreateFontString(nil, "background", "GameFontNormal") end - local _, fontSize = FCF_GetChatWindowInfo (1) + local _, fontSize = FCF_GetChatWindowInfo(1) if (fontSize < 1) then fontSize = 10 end @@ -429,14 +430,14 @@ function atributo_misc:ReportSingleDeadLine (morte, instancia) end local default_len = _detalhes.fontstring_len:GetStringWidth() - Details:Destroy(report_table) - local report_array = report_table + Details:Destroy(reportTable) + local report_array = reportTable report_array[1] = {"Details! " .. Loc ["STRING_REPORT_SINGLE_DEATH"] .. " " .. morte [3] .. " " .. Loc ["STRING_ACTORFRAME_REPORTAT"] .. " " .. morte [6], "", "", ""} - for index, evento in ipairs(_detalhes.table.reverse (morte [1])) do + for index, evento in ipairs(_detalhes.table.reverse(morte [1])) do if (evento [1] and type(evento [1]) == "boolean") then --damage if (evento [3]) then - local elapsed = _cstr ("%.1f", evento [4] - time_of_death) .."s" + local elapsed = _cstr("%.1f", evento [4] - time_of_death) .."s" local spellname, _, spellicon = _GetSpellInfo(evento [2]) local spelllink @@ -455,7 +456,7 @@ function atributo_misc:ReportSingleDeadLine (morte, instancia) hp = 100 end - tinsert(report_array, {elapsed .. " ", spelllink, " (" .. source .. ")", "-" .. _detalhes:ToK (amount) .. " (" .. hp .. "%) "}) + tinsert(report_array, {elapsed .. " ", spelllink, " (" .. source .. ")", "-" .. _detalhes:ToK(amount) .. " (" .. hp .. "%) "}) end elseif (not evento [1] and type(evento [1]) == "boolean") then --heal @@ -463,7 +464,7 @@ function atributo_misc:ReportSingleDeadLine (morte, instancia) local amount = evento [3] if (amount > _detalhes.deathlog_healingdone_min) then - local elapsed = _cstr ("%.1f", evento [4] - time_of_death) .."s" + local elapsed = _cstr("%.1f", evento [4] - time_of_death) .."s" local spelllink = GetSpellLink(evento [2]) local source = _detalhes:GetOnlyName(evento [6]) local spellname, _, spellicon = _GetSpellInfo(evento [2]) @@ -474,15 +475,15 @@ function atributo_misc:ReportSingleDeadLine (morte, instancia) end if (_detalhes.report_heal_links) then - tinsert(report_array, {elapsed .. " ", spelllink, " (" .. source .. ")", "+" .. _detalhes:ToK (amount) .. " (" .. hp .. "%) "}) + tinsert(report_array, {elapsed .. " ", spelllink, " (" .. source .. ")", "+" .. _detalhes:ToK(amount) .. " (" .. hp .. "%) "}) else - tinsert(report_array, {elapsed .. " ", spellname, " (" .. source .. ")", "+" .. _detalhes:ToK (amount) .. " (" .. hp .. "%) "}) + tinsert(report_array, {elapsed .. " ", spellname, " (" .. source .. ")", "+" .. _detalhes:ToK(amount) .. " (" .. hp .. "%) "}) end end elseif (type(evento [1]) == "number" and evento [1] == 4) then --debuff - local elapsed = _cstr ("%.1f", evento [4] - time_of_death) .."s" + local elapsed = _cstr("%.1f", evento [4] - time_of_death) .."s" local spelllink = GetSpellLink(evento [2]) local source = _detalhes:GetOnlyName(evento [6]) local spellname, _, spellicon = _GetSpellInfo(evento [2]) @@ -492,14 +493,14 @@ function atributo_misc:ReportSingleDeadLine (morte, instancia) hp = 100 end - tinsert(report_array, {elapsed .. " ", "x" .. stacks .. "" .. spelllink, " (" .. source .. ")", "(" .. hp .. "%) "}) + tinsert(report_array, {elapsed .. " ", "x" .. stacks .. "" .. spelllink, " (" .. source .. ")", " (" .. hp .. "%) "}) end end - _detalhes:SendReportWindow (ReportSingleDeathFunc, nil, nil, true) + _detalhes:SendReportWindow(ReportSingleDeathFunc, nil, nil, true) end -function atributo_misc:ReportSingleCooldownLine (misc_actor, instancia) +function atributo_misc:ReportSingleCooldownLine(misc_actor, instancia) local reportar if (instancia.segmento == -1) then --overall @@ -515,7 +516,7 @@ function atributo_misc:ReportSingleCooldownLine (misc_actor, instancia) for spellid, spell in pairs(cooldowns) do cooldowns_used [#cooldowns_used+1] = {spellid, spell.counter, spell} end - table.sort (cooldowns_used, _detalhes.Sort2) + table.sort(cooldowns_used, _detalhes.Sort2) for i, spell in ipairs(cooldowns_used) do @@ -529,7 +530,7 @@ function atributo_misc:ReportSingleCooldownLine (misc_actor, instancia) end end - return _detalhes:Reportar (reportar, {_no_current = true, _no_inverse = true, _custom = true}) + return _detalhes:Reportar(reportar, {_no_current = true, _no_inverse = true, _custom = true}) end local buff_format_name = function(spellid) @@ -542,14 +543,14 @@ end local buff_format_amount = function(t) local total, percent = unpack(t) local m, s = _math_floor(total / 60), _math_floor(total % 60) - return _cstr ("%.1f", percent) .. "% (" .. m .. "m " .. s .. "s)" + return _cstr("%.1f", percent) .. "%(" .. m .. "m " .. s .. "s)" end local sort_buff_report = function(t1, t2) return t1[2][1] > t2[2][1] end -function atributo_misc:ReportSingleBuffUptimeLine (misc_actor, instance) +function atributo_misc:ReportSingleBuffUptimeLine(misc_actor, instance) local report_table = {"Details!: " .. misc_actor.nome .. " - " .. Loc ["STRING_ATTRIBUTE_MISC_BUFF_UPTIME"]} local buffs = {} @@ -562,12 +563,12 @@ function atributo_misc:ReportSingleBuffUptimeLine (misc_actor, instance) end end - table.sort (buffs, sort_buff_report) - _detalhes:FormatReportLines (report_table, buffs, buff_format_name, buff_format_amount) - return _detalhes:Reportar (report_table, {_no_current = true, _no_inverse = true, _custom = true}) + table.sort(buffs, sort_buff_report) + _detalhes:FormatReportLines(report_table, buffs, buff_format_name, buff_format_amount) + return _detalhes:Reportar(report_table, {_no_current = true, _no_inverse = true, _custom = true}) end -function atributo_misc:ReportSingleDebuffUptimeLine (misc_actor, instance) +function atributo_misc:ReportSingleDebuffUptimeLine(misc_actor, instance) local report_table = {"Details!: " .. misc_actor.nome .. " - " .. Loc ["STRING_ATTRIBUTE_MISC_DEBUFF_UPTIME"]} local debuffs = {} @@ -578,10 +579,10 @@ function atributo_misc:ReportSingleDebuffUptimeLine (misc_actor, instance) debuffs [#debuffs+1] = {spellid, {spell.uptime, percent}} end - table.sort (debuffs, sort_buff_report) - _detalhes:FormatReportLines (report_table, debuffs, buff_format_name, buff_format_amount) + table.sort(debuffs, sort_buff_report) + _detalhes:FormatReportLines(report_table, debuffs, buff_format_name, buff_format_amount) - return _detalhes:Reportar (report_table, {_no_current = true, _no_inverse = true, _custom = true}) + return _detalhes:Reportar(report_table, {_no_current = true, _no_inverse = true, _custom = true}) end ---index[1] is the death log @@ -595,7 +596,7 @@ end ---@field dead_at number --combat time when the player died ---@field spec number ----update a row in an instance (window) showing death logs +---update a row in an instance(window) showing death logs ---@param deathTable table ---@param whichRowLine number ---@param rankPosition number @@ -655,7 +656,7 @@ function atributo_misc:UpdateDeathRow(deathTable, whichRowLine, rankPosition, in if (instanceObject.row_info.use_spec_icons) then local nome = deathTable[3] - local spec = instanceObject.showing (1, nome) and instanceObject.showing (1, nome).spec or (instanceObject.showing (2, nome) and instanceObject.showing (2, nome).spec) + local spec = instanceObject.showing(1, nome) and instanceObject.showing(1, nome).spec or(instanceObject.showing(2, nome) and instanceObject.showing(2, nome).spec) if (spec and spec ~= 0) then thisRow.icone_classe:SetTexture(instanceObject.row_info.spec_file) thisRow.icone_classe:SetTexCoord(unpack(_detalhes.class_specs_coords[spec])) @@ -683,7 +684,7 @@ function atributo_misc:UpdateDeathRow(deathTable, whichRowLine, rankPosition, in thisRow.icone_classe:SetVertexColor(1, 1, 1) if (thisRow.mouse_over and not instanceObject.baseframe.isMoving) then --precisa atualizar o tooltip - gump:UpdateTooltip (whichRowLine, thisRow, instanceObject) + gump:UpdateTooltip(whichRowLine, thisRow, instanceObject) end thisRow.lineText1:SetSize(thisRow:GetWidth() - thisRow.lineText4:GetStringWidth() - 20, 15) @@ -700,7 +701,7 @@ function atributo_misc:RefreshWindow(instance, combatObject, bIsForceRefresh, bI local total = 0 instance.top = 0 - --the main attribute is utility, the sub attribute is the type of utility (cc break, ress, etc) + --the main attribute is utility, the sub attribute is the type of utility(cc break, ress, etc) local subAttribute = instance.sub_atributo local conteudo = utilityActorContainer._ActorTable local amount = #conteudo @@ -940,7 +941,7 @@ function atributo_misc:RefreshWindow(instance, combatObject, bIsForceRefresh, bI end end - return _detalhes:EndRefresh (instance, total, combatObject, utilityActorContainer) --retorna a tabela que precisa ganhar o refresh + return _detalhes:EndRefresh(instance, total, combatObject, utilityActorContainer) --retorna a tabela que precisa ganhar o refresh end @@ -971,9 +972,9 @@ function atributo_misc:RefreshLine(instancia, barras_container, whichRowLine, lu --local porcentagem = meu_total / total * 100 local porcentagem = "" if (not percentage_type or percentage_type == 1) then - porcentagem = _cstr ("%.1f", meu_total / total * 100) + porcentagem = _cstr("%.1f", meu_total / total * 100) elseif (percentage_type == 2) then - porcentagem = _cstr ("%.1f", meu_total / instancia.top * 100) + porcentagem = _cstr("%.1f", meu_total / instancia.top * 100) end local esta_porcentagem = _math_floor((meu_total/instancia.top) * 100) @@ -989,7 +990,7 @@ function atributo_misc:RefreshLine(instancia, barras_container, whichRowLine, lu local rightText = meu_total .. bars_brackets[1] .. porcentagem .. bars_brackets[2] if (UsingCustomRightText) then - esta_barra.lineText4:SetText(_string_replace (instancia.row_info.textR_custom_text, meu_total, "", porcentagem, self, instancia.showing, instancia, rightText)) + esta_barra.lineText4:SetText(_string_replace(instancia.row_info.textR_custom_text, meu_total, "", porcentagem, self, instancia.showing, instancia, rightText)) else if (instancia.use_multi_fontstrings) then instancia:SetInLineTexts(esta_barra, "", meu_total, porcentagem) @@ -999,15 +1000,15 @@ function atributo_misc:RefreshLine(instancia, barras_container, whichRowLine, lu end if (esta_barra.mouse_over and not instancia.baseframe.isMoving) then --precisa atualizar o tooltip - gump:UpdateTooltip (whichRowLine, esta_barra, instancia) + gump:UpdateTooltip(whichRowLine, esta_barra, instancia) end actor_class_color_r, actor_class_color_g, actor_class_color_b = self:GetBarColor() - return self:RefreshBarra2 (esta_barra, instancia, tabela_anterior, forcar, esta_porcentagem, whichRowLine, barras_container, use_animations) + return self:RefreshBarra2(esta_barra, instancia, tabela_anterior, forcar, esta_porcentagem, whichRowLine, barras_container, use_animations) end -function atributo_misc:RefreshBarra2 (esta_barra, instancia, tabela_anterior, forcar, esta_porcentagem, whichRowLine, barras_container, use_animations) +function atributo_misc:RefreshBarra2(esta_barra, instancia, tabela_anterior, forcar, esta_porcentagem, whichRowLine, barras_container, use_animations) --primeiro colocado if (esta_barra.colocacao == 1) then @@ -1084,9 +1085,9 @@ function atributo_misc:RefreshBarra(esta_barra, instancia, from_resize) end --icon - self:SetClassIcon (esta_barra.icone_classe, instancia, class) + self:SetClassIcon(esta_barra.icone_classe, instancia, class) - if(esta_barra.mouse_over) then + if (esta_barra.mouse_over) then local classIcon = esta_barra:GetClassIcon() esta_barra.iconHighlight:SetTexture(classIcon:GetTexture()) esta_barra.iconHighlight:SetTexCoord(classIcon:GetTexCoord()) @@ -1095,7 +1096,7 @@ function atributo_misc:RefreshBarra(esta_barra, instancia, from_resize) --texture color self:SetBarColors(esta_barra, instancia, actor_class_color_r, actor_class_color_g, actor_class_color_b) --left text - self:SetBarLeftText (esta_barra, instancia, enemy, arena_enemy, arena_ally, UsingCustomLeftText) + self:SetBarLeftText(esta_barra, instancia, enemy, arena_enemy, arena_ally, UsingCustomLeftText) esta_barra.lineText1:SetSize(esta_barra:GetWidth() - esta_barra.lineText4:GetStringWidth() - 20, 15) end @@ -1143,7 +1144,7 @@ function atributo_misc:ToolTipDead(instancia, numero, barra) Details:Msg("utility class called ToolTipDead, a deprecated function.") end -function atributo_misc:ToolTipCC (instancia, numero, barra) +function atributo_misc:ToolTipCC(instancia, numero, barra) local owner = self.owner if (owner and owner.classe) then @@ -1165,18 +1166,18 @@ function atributo_misc:ToolTipCC (instancia, numero, barra) --quantidade local nome_magia, _, icone_magia = _GetSpellInfo(_spellid) - GameCooltip:AddLine(nome_magia, _tabela.cc_break .. " (" .. _cstr ("%.1f", _tabela.cc_break / meu_total * 100) .. "%)") - GameCooltip:AddIcon (icone_magia, nil, nil, lineHeight, lineHeight, icon_border.L, icon_border.R, icon_border.T, icon_border.B) - _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) + GameCooltip:AddLine(nome_magia, _tabela.cc_break .. " (" .. _cstr("%.1f", _tabela.cc_break / meu_total * 100) .. "%)") + GameCooltip:AddIcon(icone_magia, nil, nil, lineHeight, lineHeight, icon_border.L, icon_border.R, icon_border.T, icon_border.B) + _detalhes:AddTooltipHeaderStatusbar(r, g, b, barAlha) --o que quebrou local quebrou_oque = _tabela.cc_break_oque for spellid_quebrada, amt_quebrada in pairs(_tabela.cc_break_oque) do local nome_magia, _, icone_magia = _GetSpellInfo(spellid_quebrada) GameCooltip:AddLine(nome_magia, amt_quebrada .. " ") - GameCooltip:AddIcon ([[Interface\Buttons\UI-GroupLoot-Pass-Down]], nil, 1, 14, 14) - GameCooltip:AddIcon (icone_magia, nil, 2, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) - GameCooltip:AddStatusBar (100, 1, 1, 0, 0, .2) + GameCooltip:AddIcon([[Interface\Buttons\UI-GroupLoot-Pass-Down]], nil, 1, 14, 14) + GameCooltip:AddIcon(icone_magia, nil, 2, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) + GameCooltip:AddStatusBar(100, 1, 1, 0, 0, .2) end --em quem quebrou @@ -1184,11 +1185,11 @@ function atributo_misc:ToolTipCC (instancia, numero, barra) GameCooltip:AddLine(target_name .. ": ", amount .. " ") local classe = _detalhes:GetClass(target_name) - GameCooltip:AddIcon ([[Interface\AddOns\Details\images\espadas]], nil, 1, lineHeight, lineHeight) + GameCooltip:AddIcon([[Interface\AddOns\Details\images\espadas]], nil, 1, lineHeight, lineHeight) if (classe) then - GameCooltip:AddIcon ([[Interface\AddOns\Details\images\classes_small]], nil, 2, lineHeight, lineHeight, unpack(_detalhes.class_coords [classe])) + GameCooltip:AddIcon([[Interface\AddOns\Details\images\classes_small]], nil, 2, lineHeight, lineHeight, unpack(_detalhes.class_coords [classe])) else - GameCooltip:AddIcon ("Interface\\LFGFRAME\\LFGROLE_BW", nil, 2, lineHeight, lineHeight, .25, .5, 0, 1) + GameCooltip:AddIcon("Interface\\LFGFRAME\\LFGROLE_BW", nil, 2, lineHeight, lineHeight, .25, .5, 0, 1) end _detalhes:AddTooltipBackgroundStatusbar() @@ -1221,7 +1222,7 @@ function atributo_misc:ToolTipDispell(instancia, numero, barra) spellsUsedToDispel[#spellsUsedToDispel+1] = {spellId, math.floor(-1)} end end - table.sort (spellsUsedToDispel, _detalhes.Sort2) + table.sort(spellsUsedToDispel, _detalhes.Sort2) _detalhes:AddTooltipSpellHeaderText(Loc ["STRING_SPELLS"], headerColor, #spellsUsedToDispel, [[Interface\ICONS\Spell_Arcane_ArcaneTorrent]], 0.078125, 0.9375, 0.078125, 0.953125) _detalhes:AddTooltipHeaderStatusbar(r, g, b, barAlha) @@ -1266,7 +1267,7 @@ function atributo_misc:ToolTipDispell(instancia, numero, barra) local amountDispels = spellInfo[2] local spellName, _, spellIcon = _GetSpellInfo(spellId) GameCooltip:AddLine(spellName, amountDispels .. " (" .. string.format("%.1f", amountDispels / totalDispels * 100) .. "%)") - GameCooltip:AddIcon (spellIcon, nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) + GameCooltip:AddIcon(spellIcon, nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) _detalhes:AddTooltipBackgroundStatusbar() end end @@ -1277,20 +1278,20 @@ function atributo_misc:ToolTipDispell(instancia, numero, barra) for target_name, amount in pairs(self.dispell_targets) do alvos_dispelados [#alvos_dispelados + 1] = {target_name, _math_floor(amount), amount / totalDispels * 100} end - table.sort (alvos_dispelados, _detalhes.Sort2) + table.sort(alvos_dispelados, _detalhes.Sort2) - _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_TARGETS"], headerColor, #alvos_dispelados, [[Interface\ICONS\ACHIEVEMENT_GUILDPERK_EVERYONES A HERO_RANK2]], 0.078125, 0.9375, 0.078125, 0.953125) - _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) + _detalhes:AddTooltipSpellHeaderText(Loc ["STRING_TARGETS"], headerColor, #alvos_dispelados, [[Interface\ICONS\ACHIEVEMENT_GUILDPERK_EVERYONES A HERO_RANK2]], 0.078125, 0.9375, 0.078125, 0.953125) + _detalhes:AddTooltipHeaderStatusbar(r, g, b, barAlha) - for i = 1, min (25, #alvos_dispelados) do + for i = 1, min(25, #alvos_dispelados) do if (alvos_dispelados[i][2] < 1) then break end - GameCooltip:AddLine(alvos_dispelados[i][1], _detalhes:comma_value (alvos_dispelados[i][2]) .." (".._cstr ("%.1f", alvos_dispelados[i][3]).."%)") + GameCooltip:AddLine(alvos_dispelados[i][1], _detalhes:comma_value(alvos_dispelados[i][2]) .." (".._cstr("%.1f", alvos_dispelados[i][3]).."%)") _detalhes:AddTooltipBackgroundStatusbar() - local targetActor = instancia.showing[4]:PegarCombatente (_, alvos_dispelados[i][1]) + local targetActor = instancia.showing[4]:PegarCombatente(_, alvos_dispelados[i][1]) if (targetActor) then local classe = targetActor.classe @@ -1298,9 +1299,9 @@ function atributo_misc:ToolTipDispell(instancia, numero, barra) classe = "UNKNOW" end if (classe == "UNKNOW") then - GameCooltip:AddIcon ("Interface\\LFGFRAME\\LFGROLE_BW", nil, nil, 14, 14, .25, .5, 0, 1) + GameCooltip:AddIcon("Interface\\LFGFRAME\\LFGROLE_BW", nil, nil, 14, 14, .25, .5, 0, 1) else - GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small", nil, nil, 14, 14, unpack(_detalhes.class_coords [classe])) + GameCooltip:AddIcon("Interface\\AddOns\\Details\\images\\classes_small", nil, nil, 14, 14, unpack(_detalhes.class_coords [classe])) end end end @@ -1318,7 +1319,7 @@ function atributo_misc:ToolTipDispell(instancia, numero, barra) if (not quantidade [nome]) then quantidade [nome] = 1 - local my_self = instancia.showing[class_type]:PegarCombatente (nil, nome) + local my_self = instancia.showing[class_type]:PegarCombatente(nil, nome) if (my_self and my_self.dispell) then totais [#totais+1] = {nome, my_self.dispell} end @@ -1330,7 +1331,7 @@ function atributo_misc:ToolTipDispell(instancia, numero, barra) local _quantidade = 0 local added_logo = false - table.sort (totais, _detalhes.Sort2) + table.sort(totais, _detalhes.Sort2) local ismaximized = false if (keydown == "alt" or TooltipMaximizedMethod == 2 or TooltipMaximizedMethod == 5) then @@ -1344,14 +1345,14 @@ function atributo_misc:ToolTipDispell(instancia, numero, barra) if (not added_logo) then added_logo = true - _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_PETS"], headerColor, #totais, [[Interface\COMMON\friendship-heart]], 0.21875, 0.78125, 0.09375, 0.6875) - _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) + _detalhes:AddTooltipSpellHeaderText(Loc ["STRING_PETS"], headerColor, #totais, [[Interface\COMMON\friendship-heart]], 0.21875, 0.78125, 0.09375, 0.6875) + _detalhes:AddTooltipHeaderStatusbar(r, g, b, barAlha) end local n = _table [1]:gsub(("%s%<.*"), "") GameCooltip:AddLine(n, _table [2] .. " (" .. _math_floor(_table [2]/self.dispell*100) .. "%)") _detalhes:AddTooltipBackgroundStatusbar() - GameCooltip:AddIcon ([[Interface\AddOns\Details\images\classes_small]], 1, 1, 14, 14, 0.25, 0.49609375, 0.75, 1) + GameCooltip:AddIcon([[Interface\AddOns\Details\images\classes_small]], 1, 1, 14, 14, 0.25, 0.49609375, 0.75, 1) end end @@ -1390,7 +1391,9 @@ function _detalhes:CatchRaidDebuffUptime(sOperationType) -- "DEBUFF_UPTIME_IN" for _, actorObject in utilityContainer:ListActors() do if (actorObject.debuff_uptime) then - for spellId, spellTable in pairs(actorObject.debuff_uptime_spells._ActorTable) do + ---@type spellcontainer + local debuffUptimeSpellContainer = actorObject.debuff_uptime_spells + for spellId, spellTable in debuffUptimeSpellContainer:ListSpells() do if (spellTable.actived and spellTable.actived_at) then spellTable.uptime = spellTable.uptime + _detalhes._tempo - spellTable.actived_at actorObject.debuff_uptime = actorObject.debuff_uptime + _detalhes._tempo - spellTable.actived_at @@ -1404,21 +1407,18 @@ function _detalhes:CatchRaidDebuffUptime(sOperationType) -- "DEBUFF_UPTIME_IN" elseif (sOperationType == "DEBUFF_UPTIME_IN") then local cacheGetTime = GetTime() - if (IsInRaid()) then - local checked = {} + local unitIdCache = Details222.UnitIdCache.RaidTargets for raidIndex = 1, GetNumGroupMembers() do - - local target = "raid"..raidIndex.."target" - local his_target = UnitGUID(target) - - if (his_target and not checked [his_target]) then - local rect = UnitReaction (target, "player") + local target = unitIdCache[raidIndex] + local targetGUID = UnitGUID(target) + if (targetGUID and not checked[targetGUID]) then + local rect = UnitReaction(target, "player") if (rect and rect <= 4) then - checked [his_target] = true + checked [targetGUID] = true for debuffIndex = 1, 41 do local name, _, _, _, _, _, _, unitCaster, _, _, spellid = UnitAura (target, debuffIndex, 'HARMFUL') @@ -1426,13 +1426,16 @@ function _detalhes:CatchRaidDebuffUptime(sOperationType) -- "DEBUFF_UPTIME_IN" local playerGUID = UnitGUID(unitCaster) if (playerGUID) then - local playerName, realmName = _UnitName (unitCaster) - if (realmName and realmName ~= "") then - playerName = playerName .. "-" .. realmName - end + local playerName, realmName = _UnitName(unitCaster) + if (realmName and realmName ~= "") then + playerName = playerName .. "-" .. realmName + end - _detalhes.parser:add_debuff_uptime (nil, cacheGetTime, playerGUID, playerName, 0x00000417, his_target, _UnitName (target), 0x842, nil, spellid, name, sOperationType) + _detalhes.parser:add_debuff_uptime(nil, cacheGetTime, playerGUID, playerName, 0x00000417, targetGUID, _UnitName(target), 0x842, nil, spellId, auraName, sOperationType) + end end + else + break end end end @@ -1440,16 +1443,13 @@ function _detalhes:CatchRaidDebuffUptime(sOperationType) -- "DEBUFF_UPTIME_IN" end elseif (IsInGroup()) then - local checked = {} for raidIndex = 1, GetNumGroupMembers()-1 do local his_target = UnitGUID("party"..raidIndex.."target") - local rect = UnitReaction ("party"..raidIndex.."target", "player") - if (his_target and not checked [his_target] and rect and rect <= 4) then - + local rect = UnitReaction("party"..raidIndex.."target", "player") + if (his_target and not checked[his_target] and rect and rect <= 4) then checked [his_target] = true - for debuffIndex = 1, 40 do local name, _, _, _, _, _, _, unitCaster, _, _, spellid = UnitAura ("party"..raidIndex.."target", debuffIndex, 'HARMFUL') if (name and unitCaster) then @@ -1468,7 +1468,7 @@ function _detalhes:CatchRaidDebuffUptime(sOperationType) -- "DEBUFF_UPTIME_IN" end local his_target = UnitGUID("playertarget") - local rect = UnitReaction ("playertarget", "player") + local rect = UnitReaction("playertarget", "player") if (his_target and not checked [his_target] and rect and rect <= 4) then for debuffIndex = 1, 40 do local name, _, _, _, _, _, _, unitCaster, _, _, spellid = UnitAura ("playertarget", debuffIndex, 'HARMFUL') @@ -1488,7 +1488,7 @@ function _detalhes:CatchRaidDebuffUptime(sOperationType) -- "DEBUFF_UPTIME_IN" else local his_target = UnitGUID("playertarget") if (his_target) then - local reaction = UnitReaction ("playertarget", "player") + local reaction = UnitReaction("playertarget", "player") if (reaction and reaction <= 4) then for debuffIndex = 1, 40 do local name, _, _, _, _, _, _, unitCaster, _, _, spellid = UnitAura ("playertarget", debuffIndex, 'HARMFUL') @@ -1524,8 +1524,10 @@ function _detalhes:CatchRaidBuffUptime(sOperationType) --raid groups local cacheGetTime = GetTime() + local unitIdCache = Details222.UnitIdCache.Raid + for raidIndex = 1, GetNumGroupMembers() do - local unitId = "raid" .. raidIndex + local unitId = unitIdCache[raidIndex] local playerGUID = UnitGUID(unitId) if (playerGUID) then @@ -1543,10 +1545,13 @@ function _detalhes:CatchRaidBuffUptime(sOperationType) if (_detalhes.PotionList[spellId]) then potUsage[playerName] = spellId - elseif(runeIds[spellId]) then - focusAugmentation[playerName] = true + elseif (runeIds[spellId]) then + focusAugmentation[playerName] = true + end end end + else + break end end end @@ -1614,12 +1619,14 @@ function _detalhes:CatchRaidBuffUptime(sOperationType) end end end + else + break end end end end - --player it self (while in a party that isn't a raid group) + --player it self(while in a party that isn't a raid group) local unitId = "player" for buffIndex = 1, 41 do local auraName, _, _, _, _, _, _, unitCaster, _, _, spellId = UnitAura(unitId, buffIndex, 'HELPFUL') @@ -1655,6 +1662,8 @@ function _detalhes:CatchRaidBuffUptime(sOperationType) end end end + else + break end end @@ -1730,7 +1739,7 @@ local Sort2Reverse = function(a, b) return a[2] < b[2] end -function atributo_misc:ToolTipDebuffUptime (instancia, numero, barra) +function atributo_misc:ToolTipDebuffUptime(instancia, numero, barra) local owner = self.owner if (owner and owner.classe) then @@ -1750,16 +1759,16 @@ function atributo_misc:ToolTipDebuffUptime (instancia, numero, barra) for _spellid, _tabela in pairs(minha_tabela) do debuffs_usados [#debuffs_usados+1] = {_spellid, _tabela.uptime} end - table.sort (debuffs_usados, _detalhes.Sort2) + table.sort(debuffs_usados, _detalhes.Sort2) - _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_SPELLS"], headerColor, #debuffs_usados, _detalhes.tooltip_spell_icon.file, unpack(_detalhes.tooltip_spell_icon.coords)) - _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) + _detalhes:AddTooltipSpellHeaderText(Loc ["STRING_SPELLS"], headerColor, #debuffs_usados, _detalhes.tooltip_spell_icon.file, unpack(_detalhes.tooltip_spell_icon.coords)) + _detalhes:AddTooltipHeaderStatusbar(r, g, b, barAlha) local icon_size = _detalhes.tooltip.icon_size local icon_border = _detalhes.tooltip.icon_border_texcoord if (#debuffs_usados > 0) then - for i = 1, min (30, #debuffs_usados) do + for i = 1, min(30, #debuffs_usados) do local esta_habilidade = debuffs_usados[i] if (esta_habilidade[2] > 0) then @@ -1767,17 +1776,17 @@ function atributo_misc:ToolTipDebuffUptime (instancia, numero, barra) local minutos, segundos = _math_floor(esta_habilidade[2]/60), _math_floor(esta_habilidade[2]%60) if (esta_habilidade[2] >= _combat_time) then - --GameCooltip:AddLine(nome_magia, minutos .. "m " .. segundos .. "s" .. " (" .. _cstr ("%.1f", esta_habilidade[2] / _combat_time * 100) .. "%)", nil, "gray", "gray") - --GameCooltip:AddStatusBar (100, nil, 1, 0, 1, .3, false) + --GameCooltip:AddLine(nome_magia, minutos .. "m " .. segundos .. "s" .. " (" .. _cstr("%.1f", esta_habilidade[2] / _combat_time * 100) .. "%)", nil, "gray", "gray") + --GameCooltip:AddStatusBar(100, nil, 1, 0, 1, .3, false) elseif (minutos > 0) then - GameCooltip:AddLine(nome_magia, minutos .. "m " .. segundos .. "s" .. " (" .. _cstr ("%.1f", esta_habilidade[2] / _combat_time * 100) .. "%)") - _detalhes:AddTooltipBackgroundStatusbar (false, esta_habilidade[2] / _combat_time * 100) + GameCooltip:AddLine(nome_magia, minutos .. "m " .. segundos .. "s" .. " (" .. _cstr("%.1f", esta_habilidade[2] / _combat_time * 100) .. "%)") + _detalhes:AddTooltipBackgroundStatusbar(false, esta_habilidade[2] / _combat_time * 100) else - GameCooltip:AddLine(nome_magia, segundos .. "s" .. " (" .. _cstr ("%.1f", esta_habilidade[2] / _combat_time * 100) .. "%)") - _detalhes:AddTooltipBackgroundStatusbar (false, esta_habilidade[2] / _combat_time * 100) + GameCooltip:AddLine(nome_magia, segundos .. "s" .. " (" .. _cstr("%.1f", esta_habilidade[2] / _combat_time * 100) .. "%)") + _detalhes:AddTooltipBackgroundStatusbar(false, esta_habilidade[2] / _combat_time * 100) end - GameCooltip:AddIcon (icone_magia, nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) + GameCooltip:AddIcon(icone_magia, nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) end end else @@ -1862,7 +1871,7 @@ function atributo_misc:ToolTipBuffUptime(instance, barFrame) return true end -function atributo_misc:ToolTipDefensiveCooldowns (instancia, numero, barra) +function atributo_misc:ToolTipDefensiveCooldowns(instancia, numero, barra) local owner = self.owner if (owner and owner.classe) then @@ -1880,21 +1889,21 @@ function atributo_misc:ToolTipDefensiveCooldowns (instancia, numero, barra) for _spellid, _tabela in pairs(minha_tabela) do cooldowns_usados [#cooldowns_usados+1] = {_spellid, _tabela.counter} end - table.sort (cooldowns_usados, _detalhes.Sort2) + table.sort(cooldowns_usados, _detalhes.Sort2) - _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_SPELLS"], headerColor, #cooldowns_usados, _detalhes.tooltip_spell_icon.file, unpack(_detalhes.tooltip_spell_icon.coords)) - _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) + _detalhes:AddTooltipSpellHeaderText(Loc ["STRING_SPELLS"], headerColor, #cooldowns_usados, _detalhes.tooltip_spell_icon.file, unpack(_detalhes.tooltip_spell_icon.coords)) + _detalhes:AddTooltipHeaderStatusbar(r, g, b, barAlha) local icon_size = _detalhes.tooltip.icon_size local icon_border = _detalhes.tooltip.icon_border_texcoord local lineHeight = _detalhes.tooltip.line_height if (#cooldowns_usados > 0) then - for i = 1, min (25, #cooldowns_usados) do + for i = 1, min(25, #cooldowns_usados) do local esta_habilidade = cooldowns_usados[i] local nome_magia, _, icone_magia = _GetSpellInfo(esta_habilidade[1]) GameCooltip:AddLine(nome_magia, esta_habilidade[2].." (".._cstr("%.1f", esta_habilidade[2]/meu_total*100).."%)") - GameCooltip:AddIcon (icone_magia, nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) + GameCooltip:AddIcon(icone_magia, nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) _detalhes:AddTooltipBackgroundStatusbar() end else @@ -1908,33 +1917,33 @@ function atributo_misc:ToolTipDefensiveCooldowns (instancia, numero, barra) for target_name, amount in pairs(meus_alvos) do alvos [#alvos+1] = {target_name, amount} end - table.sort (alvos, _detalhes.Sort2) + table.sort(alvos, _detalhes.Sort2) - _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_TARGETS"], headerColor, #alvos, _detalhes.tooltip_target_icon.file, unpack(_detalhes.tooltip_target_icon.coords)) - _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) + _detalhes:AddTooltipSpellHeaderText(Loc ["STRING_TARGETS"], headerColor, #alvos, _detalhes.tooltip_target_icon.file, unpack(_detalhes.tooltip_target_icon.coords)) + _detalhes:AddTooltipHeaderStatusbar(r, g, b, barAlha) if (#alvos > 0) then - for i = 1, min (25, #alvos) do + for i = 1, min(25, #alvos) do GameCooltip:AddLine(_detalhes:GetOnlyName(alvos[i][1]) .. ": ", alvos[i][2], 1, "white", "white") _detalhes:AddTooltipBackgroundStatusbar() - GameCooltip:AddIcon ("Interface\\Icons\\PALADIN_HOLY", nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) + GameCooltip:AddIcon("Interface\\Icons\\PALADIN_HOLY", nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) - local targetActor = instancia.showing[4]:PegarCombatente (_, alvos[i][1]) + local targetActor = instancia.showing[4]:PegarCombatente(_, alvos[i][1]) if (targetActor) then local classe = targetActor.classe if (not classe) then classe = "UNKNOW" end if (classe == "UNKNOW") then - GameCooltip:AddIcon ("Interface\\LFGFRAME\\LFGROLE_BW", nil, nil, 14, 14, .25, .5, 0, 1) + GameCooltip:AddIcon("Interface\\LFGFRAME\\LFGROLE_BW", nil, nil, 14, 14, .25, .5, 0, 1) else local specID = _detalhes:GetSpec(alvos[i][1]) if (specID) then - local texture, l, r, t, b = _detalhes:GetSpecIcon (specID, false) - GameCooltip:AddIcon (texture, 1, 1, lineHeight, lineHeight, l, r, t, b) + local texture, l, r, t, b = _detalhes:GetSpecIcon(specID, false) + GameCooltip:AddIcon(texture, 1, 1, lineHeight, lineHeight, l, r, t, b) else - GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small", nil, nil, 14, 14, unpack(_detalhes.class_coords [classe])) + GameCooltip:AddIcon("Interface\\AddOns\\Details\\images\\classes_small", nil, nil, 14, 14, unpack(_detalhes.class_coords [classe])) end end end @@ -1946,7 +1955,7 @@ function atributo_misc:ToolTipDefensiveCooldowns (instancia, numero, barra) end -function atributo_misc:ToolTipRess (instancia, numero, barra) +function atributo_misc:ToolTipRess(instancia, numero, barra) local owner = self.owner if (owner and owner.classe) then @@ -1966,17 +1975,17 @@ function atributo_misc:ToolTipRess (instancia, numero, barra) for _spellid, _tabela in pairs(minha_tabela) do meus_ress [#meus_ress+1] = {_spellid, _tabela.ress} end - table.sort (meus_ress, _detalhes.Sort2) + table.sort(meus_ress, _detalhes.Sort2) - _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_SPELLS"], headerColor, #meus_ress, _detalhes.tooltip_spell_icon.file, unpack(_detalhes.tooltip_spell_icon.coords)) - _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) + _detalhes:AddTooltipSpellHeaderText(Loc ["STRING_SPELLS"], headerColor, #meus_ress, _detalhes.tooltip_spell_icon.file, unpack(_detalhes.tooltip_spell_icon.coords)) + _detalhes:AddTooltipHeaderStatusbar(r, g, b, barAlha) if (#meus_ress > 0) then - for i = 1, min (3, #meus_ress) do + for i = 1, min(3, #meus_ress) do local esta_habilidade = meus_ress[i] local nome_magia, _, icone_magia = _GetSpellInfo(esta_habilidade[1]) - GameCooltip:AddLine(nome_magia, esta_habilidade[2] .. " (" .. _cstr ("%.1f", floor(esta_habilidade[2]) / floor(meu_total) * 100).."%)") - GameCooltip:AddIcon (icone_magia, nil, nil, lineHeight, lineHeight, icon_border.L, icon_border.R, icon_border.T, icon_border.B) + GameCooltip:AddLine(nome_magia, esta_habilidade[2] .. " (" .. _cstr("%.1f", floor(esta_habilidade[2]) / floor(meu_total) * 100).."%)") + GameCooltip:AddIcon(icone_magia, nil, nil, lineHeight, lineHeight, icon_border.L, icon_border.R, icon_border.T, icon_border.B) _detalhes:AddTooltipBackgroundStatusbar() end else @@ -1990,31 +1999,31 @@ function atributo_misc:ToolTipRess (instancia, numero, barra) for target_name, amount in pairs(meus_alvos) do alvos [#alvos+1] = {target_name, amount} end - table.sort (alvos, _detalhes.Sort2) + table.sort(alvos, _detalhes.Sort2) - _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_TARGETS"], headerColor, #alvos, _detalhes.tooltip_target_icon.file, unpack(_detalhes.tooltip_target_icon.coords)) - _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) + _detalhes:AddTooltipSpellHeaderText(Loc ["STRING_TARGETS"], headerColor, #alvos, _detalhes.tooltip_target_icon.file, unpack(_detalhes.tooltip_target_icon.coords)) + _detalhes:AddTooltipHeaderStatusbar(r, g, b, barAlha) if (#alvos > 0) then - for i = 1, min (3, #alvos) do + for i = 1, min(3, #alvos) do GameCooltip:AddLine(alvos[i][1], alvos[i][2]) _detalhes:AddTooltipBackgroundStatusbar() - local targetActor = instancia.showing[4]:PegarCombatente (_, alvos[i][1]) + local targetActor = instancia.showing[4]:PegarCombatente(_, alvos[i][1]) if (targetActor) then local classe = targetActor.classe if (not classe) then classe = "UNKNOW" end if (classe == "UNKNOW") then - GameCooltip:AddIcon ("Interface\\LFGFRAME\\LFGROLE_BW", nil, nil, lineHeight, lineHeight, .25, .5, 0, 1) + GameCooltip:AddIcon("Interface\\LFGFRAME\\LFGROLE_BW", nil, nil, lineHeight, lineHeight, .25, .5, 0, 1) else local specID = _detalhes:GetSpec(alvos[i][1]) if (specID) then - local texture, l, r, t, b = _detalhes:GetSpecIcon (specID, false) - GameCooltip:AddIcon (texture, 1, 1, lineHeight, lineHeight, l, r, t, b) + local texture, l, r, t, b = _detalhes:GetSpecIcon(specID, false) + GameCooltip:AddIcon(texture, 1, 1, lineHeight, lineHeight, l, r, t, b) else - GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small", nil, nil, lineHeight, lineHeight, unpack(_detalhes.class_coords [classe])) + GameCooltip:AddIcon("Interface\\AddOns\\Details\\images\\classes_small", nil, nil, lineHeight, lineHeight, unpack(_detalhes.class_coords [classe])) end end end @@ -2026,7 +2035,7 @@ function atributo_misc:ToolTipRess (instancia, numero, barra) end -function atributo_misc:ToolTipInterrupt (instancia, numero, barra) +function atributo_misc:ToolTipInterrupt(instancia, numero, barra) local owner = self.owner if (owner and owner.classe) then @@ -2043,22 +2052,22 @@ function atributo_misc:ToolTipInterrupt (instancia, numero, barra) local lineHeight = _detalhes.tooltip.line_height --habilidade usada para interromper - local meus_interrupts = {} + local actorInterrupts = {} for _spellid, _tabela in pairs(minha_tabela) do - meus_interrupts [#meus_interrupts+1] = {_spellid, _tabela.counter} + actorInterrupts [#actorInterrupts+1] = {_spellid, _tabela.counter} end - table.sort (meus_interrupts, _detalhes.Sort2) + table.sort(actorInterrupts, _detalhes.Sort2) - _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_SPELLS"], headerColor, #meus_interrupts, _detalhes.tooltip_spell_icon.file, unpack(_detalhes.tooltip_spell_icon.coords)) - _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) + _detalhes:AddTooltipSpellHeaderText(Loc ["STRING_SPELLS"], headerColor, #actorInterrupts, _detalhes.tooltip_spell_icon.file, unpack(_detalhes.tooltip_spell_icon.coords)) + _detalhes:AddTooltipHeaderStatusbar(r, g, b, barAlha) - if (#meus_interrupts > 0) then - for i = 1, min (25, #meus_interrupts) do - local esta_habilidade = meus_interrupts[i] + if (#actorInterrupts > 0) then + for i = 1, min(25, #actorInterrupts) do + local esta_habilidade = actorInterrupts[i] local nome_magia, _, icone_magia = _GetSpellInfo(esta_habilidade[1]) GameCooltip:AddLine(nome_magia, esta_habilidade[2].." (".._cstr("%.1f", floor(esta_habilidade[2])/floor(meu_total)*100).."%)") - GameCooltip:AddIcon (icone_magia, nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) + GameCooltip:AddIcon(icone_magia, nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) _detalhes:AddTooltipBackgroundStatusbar() end else @@ -2066,40 +2075,40 @@ function atributo_misc:ToolTipInterrupt (instancia, numero, barra) end --quais habilidades foram interrompidas - local habilidades_interrompidas = {} + local interruptedSpells = {} for _spellid, amt in pairs(self.interrompeu_oque) do - habilidades_interrompidas [#habilidades_interrompidas+1] = {_spellid, amt} + interruptedSpells [#interruptedSpells+1] = {_spellid, amt} end - table.sort (habilidades_interrompidas, _detalhes.Sort2) + table.sort(interruptedSpells, _detalhes.Sort2) - _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_SPELL_INTERRUPTED"] .. ":", headerColor, #habilidades_interrompidas, _detalhes.tooltip_target_icon.file, unpack(_detalhes.tooltip_target_icon.coords)) - _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) + _detalhes:AddTooltipSpellHeaderText(Loc ["STRING_SPELL_INTERRUPTED"] .. ":", headerColor, #interruptedSpells, _detalhes.tooltip_target_icon.file, unpack(_detalhes.tooltip_target_icon.coords)) + _detalhes:AddTooltipHeaderStatusbar(r, g, b, barAlha) - if (#habilidades_interrompidas > 0) then - for i = 1, min (25, #habilidades_interrompidas) do - local esta_habilidade = habilidades_interrompidas[i] + if (#interruptedSpells > 0) then + for i = 1, min(25, #interruptedSpells) do + local esta_habilidade = interruptedSpells[i] local nome_magia, _, icone_magia = _GetSpellInfo(esta_habilidade[1]) GameCooltip:AddLine(nome_magia, esta_habilidade[2].." (".._cstr("%.1f", floor(esta_habilidade[2])/floor(meu_total)*100).."%)") - GameCooltip:AddIcon (icone_magia, nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) + GameCooltip:AddIcon(icone_magia, nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) _detalhes:AddTooltipBackgroundStatusbar() end end --Pet - local meus_pets = self.pets - if (#meus_pets > 0) then --teve ajudantes + local allActorPets = self.pets + if (#allActorPets > 0) then --teve ajudantes local quantidade = {} --armazena a quantidade de pets iguais local interrupts = {} --armazena as habilidades local alvos = {} --armazena os alvos local totais = {} --armazena o dano total de cada objeto - for index, nome in ipairs(meus_pets) do + for index, nome in ipairs(allActorPets) do if (not quantidade [nome]) then quantidade [nome] = 1 - local my_self = instancia.showing[class_type]:PegarCombatente (nil, nome) + local my_self = instancia.showing[class_type]:PegarCombatente(nil, nome) if (my_self and my_self.interrupt) then totais [#totais+1] = {nome, my_self.interrupt} end @@ -2111,7 +2120,7 @@ function atributo_misc:ToolTipInterrupt (instancia, numero, barra) local _quantidade = 0 local added_logo = false - table.sort (totais, _detalhes.Sort2) + table.sort(totais, _detalhes.Sort2) local ismaximized = false if (keydown == "alt" or TooltipMaximizedMethod == 2 or TooltipMaximizedMethod == 5) then @@ -2125,14 +2134,14 @@ function atributo_misc:ToolTipInterrupt (instancia, numero, barra) if (not added_logo) then added_logo = true - _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_PETS"], headerColor, #totais, [[Interface\COMMON\friendship-heart]], 0.21875, 0.78125, 0.09375, 0.6875) - _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) + _detalhes:AddTooltipSpellHeaderText(Loc ["STRING_PETS"], headerColor, #totais, [[Interface\COMMON\friendship-heart]], 0.21875, 0.78125, 0.09375, 0.6875) + _detalhes:AddTooltipHeaderStatusbar(r, g, b, barAlha) end local n = _table [1]:gsub(("%s%<.*"), "") GameCooltip:AddLine(n, _table [2] .. " (" .. _math_floor(_table [2]/self.interrupt*100) .. "%)") _detalhes:AddTooltipBackgroundStatusbar() - GameCooltip:AddIcon ([[Interface\AddOns\Details\images\classes_small]], 1, 1, 14, 14, 0.25, 0.49609375, 0.75, 1) + GameCooltip:AddIcon([[Interface\AddOns\Details\images\classes_small]], 1, 1, 14, 14, 0.25, 0.49609375, 0.75, 1) end end @@ -2153,9 +2162,9 @@ function atributo_misc:MontaInfo() end ---------DETALHES bloco da direita BIFURCA��O -function atributo_misc:MontaDetalhes (spellid, barra) +function atributo_misc:MontaDetalhes(spellid, barra) if (breakdownWindowFrame.sub_atributo == 3) then --interrupt - return self:MontaDetalhesInterrupt (spellid, barra) + return self:MontaDetalhesInterrupt(spellid, barra) end end @@ -2184,7 +2193,7 @@ function atributo_misc:MontaInfoInterrupt() local ActorPets = self.pets local class_color = "FFDDDDDD" for _, PetName in ipairs(ActorPets) do - local PetActor = instancia.showing (class_type, PetName) + local PetActor = instancia.showing(class_type, PetName) if (PetActor and PetActor.interrupt and PetActor.interrupt > 0) then local PetSkillsContainer = PetActor.interrupt_spells._ActorTable for _spellid, _skill in pairs(PetSkillsContainer) do --da foreach em cada spellid do container @@ -2194,10 +2203,10 @@ function atributo_misc:MontaInfoInterrupt() end end - table.sort (meus_interrupts, _detalhes.Sort2) + table.sort(meus_interrupts, _detalhes.Sort2) local amt = #meus_interrupts - gump:JI_AtualizaContainerBarras (amt) + gump:JI_AtualizaContainerBarras(amt) local max_ = meus_interrupts [1][2] --dano que a primeiro magia vez @@ -2207,7 +2216,7 @@ function atributo_misc:MontaInfoInterrupt() barra = barras [index] if (not barra) then --se a barra n�o existir, criar ela ent�o - barra = gump:CriaNovaBarraInfo1 (instancia, index) + barra = gump:CriaNovaBarraInfo1(instancia, index) barra.textura:SetStatusBarColor(1, 1, 1, 1) --isso aqui � a parte da sele��o e descele��o barra.on_focus = false --isso aqui � a parte da sele��o e descele��o @@ -2249,7 +2258,7 @@ function atributo_misc:MontaInfoInterrupt() barra:Show() --mostra a barra if (self.detalhes and self.detalhes == barra.show) then - self:MontaDetalhes (self.detalhes, barra) --poderia deixar isso pro final e montar uma tail call?? + self:MontaDetalhes(self.detalhes, barra) --poderia deixar isso pro final e montar uma tail call?? end end @@ -2258,13 +2267,13 @@ function atributo_misc:MontaInfoInterrupt() for target_name, amount in pairs(self.interrupt_targets) do meus_alvos [#meus_alvos+1] = {target_name, amount} end - table.sort (meus_alvos, _detalhes.Sort2) + table.sort(meus_alvos, _detalhes.Sort2) local amt_alvos = #meus_alvos if (amt_alvos < 1) then return end - gump:JI_AtualizaContainerAlvos (amt_alvos) + gump:JI_AtualizaContainerAlvos(amt_alvos) local max_alvos = meus_alvos[1][2] @@ -2274,7 +2283,7 @@ function atributo_misc:MontaInfoInterrupt() barra = breakdownWindowFrame.barras2 [index] if (not barra) then - barra = gump:CriaNovaBarraInfo2 (instancia, index) + barra = gump:CriaNovaBarraInfo2(instancia, index) barra.textura:SetStatusBarColor(1, 1, 1, 1) end @@ -2291,7 +2300,7 @@ function atributo_misc:MontaInfoInterrupt() if (barra.isAlvo) then GameTooltip:Hide() GameTooltip:SetOwner(barra, "ANCHOR_TOPRIGHT") - if (not barra.minha_tabela:MontaTooltipAlvos (barra, index)) then + if (not barra.minha_tabela:MontaTooltipAlvos(barra, index)) then return end GameTooltip:Show() @@ -2308,7 +2317,7 @@ end ------ Detalhe Info Interrupt -function atributo_misc:MontaDetalhesInterrupt (spellid, barra) +function atributo_misc:MontaDetalhesInterrupt(spellid, barra) local esta_magia = self.interrupt_spells._ActorTable [spellid] if (not esta_magia) then @@ -2335,7 +2344,7 @@ function atributo_misc:MontaDetalhesInterrupt (spellid, barra) for spellid, amt in pairs(esta_magia.interrompeu_oque) do habilidades_alvos [#habilidades_alvos+1] = {spellid, amt} end - table.sort (habilidades_alvos, _detalhes.Sort2) + table.sort(habilidades_alvos, _detalhes.Sort2) local max_ = habilidades_alvos[1][2] local lastIndex = 1 @@ -2345,7 +2354,7 @@ function atributo_misc:MontaDetalhesInterrupt (spellid, barra) barra = barras [index] if (not barra) then --se a barra n�o existir, criar ela ent�o - barra = gump:CriaNovaBarraInfo3 (instancia, index) + barra = gump:CriaNovaBarraInfo3(instancia, index) barra.textura:SetStatusBarColor(1, 1, 1, 1) --isso aqui � a parte da sele��o e descele��o end @@ -2378,7 +2387,7 @@ function atributo_misc:MontaDetalhesInterrupt (spellid, barra) end -function atributo_misc:MontaTooltipAlvos (esta_barra, index) +function atributo_misc:MontaTooltipAlvos(esta_barra, index) local inimigo = esta_barra.nome_inimigo @@ -2401,7 +2410,7 @@ function atributo_misc:MontaTooltipAlvos (esta_barra, index) end end - table.sort (habilidades, _detalhes.Sort2) + table.sort(habilidades, _detalhes.Sort2) GameTooltip:AddLine(index..". "..inimigo) GameTooltip:AddLine(Loc ["STRING_SPELL_INTERRUPTED"] .. ":") @@ -2410,9 +2419,9 @@ function atributo_misc:MontaTooltipAlvos (esta_barra, index) for index, tabela in ipairs(habilidades) do local nome, rank, icone = _GetSpellInfo(tabela[1]) if (index < 8) then - GameTooltip:AddDoubleLine (index..". |T"..icone..":0|t "..nome, tabela[2].." (".._cstr("%.1f", tabela[2]/total*100).."%)", 1, 1, 1, 1, 1, 1) + GameTooltip:AddDoubleLine(index..". |T"..icone..":0|t "..nome, tabela[2].." (".._cstr("%.1f", tabela[2]/total*100).."%)", 1, 1, 1, 1, 1, 1) else - GameTooltip:AddDoubleLine (index..". "..nome, tabela[2].." (".._cstr("%.1f", tabela[2]/total*100).."%)", .65, .65, .65, .65, .65, .65) + GameTooltip:AddDoubleLine(index..". "..nome, tabela[2].." (".._cstr("%.1f", tabela[2]/total*100).."%)", .65, .65, .65, .65, .65, .65) end end @@ -2421,7 +2430,7 @@ function atributo_misc:MontaTooltipAlvos (esta_barra, index) end --controla se o dps do jogador esta travado ou destravado -function atributo_misc:GetOrChangeActivityStatus (iniciar) +function atributo_misc:GetOrChangeActivityStatus(iniciar) return false --retorna se o dps esta aberto ou fechado para este jogador end @@ -2440,7 +2449,7 @@ end local sub_list = {"cc_break", "ress", "interrupt", "cooldowns_defensive", "dispell", "dead"} --subtract total from a combat table - function atributo_misc:subtract_total (combat_table) + function atributo_misc:subtract_total(combat_table) for _, sub_attribute in ipairs(sub_list) do if (self [sub_attribute]) then combat_table.totals [class_type][sub_attribute] = combat_table.totals [class_type][sub_attribute] - self [sub_attribute] @@ -2450,7 +2459,7 @@ end end end end - function atributo_misc:add_total (combat_table) + function atributo_misc:add_total(combat_table) for _, sub_attribute in ipairs(sub_list) do if (self [sub_attribute]) then combat_table.totals [class_type][sub_attribute] = combat_table.totals [class_type][sub_attribute] + self [sub_attribute] @@ -2473,7 +2482,7 @@ local refresh_habilidades = function(container1, container2) end end -function atributo_misc:r_onlyrefresh_shadow (actor) +function atributo_misc:r_onlyrefresh_shadow(actor) local overall_misc = _detalhes.tabela_overall [4] local shadow = overall_misc._ActorTable [overall_misc._NameIndexTable [actor.nome]] @@ -2483,7 +2492,7 @@ function atributo_misc:r_onlyrefresh_shadow (actor) end if (not shadow) then - shadow = overall_misc:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true) + shadow = overall_misc:PegarCombatente(actor.serial, actor.nome, actor.flag_original, true) shadow.classe = actor.classe shadow:SetSpecId(actor.spec) @@ -2496,7 +2505,7 @@ function atributo_misc:r_onlyrefresh_shadow (actor) end - _detalhes.refresh:r_atributo_misc (actor, shadow) + _detalhes.refresh:r_atributo_misc(actor, shadow) --cc done if (actor.cc_done) then @@ -2506,14 +2515,14 @@ function atributo_misc:r_onlyrefresh_shadow (actor) --cooldowns if (actor.cooldowns_defensive) then - refresh_alvos (shadow.cooldowns_defensive_targets, actor.cooldowns_defensive_targets) - refresh_habilidades (shadow.cooldowns_defensive_spells, actor.cooldowns_defensive_spells) + refresh_alvos(shadow.cooldowns_defensive_targets, actor.cooldowns_defensive_targets) + refresh_habilidades(shadow.cooldowns_defensive_spells, actor.cooldowns_defensive_spells) end --buff uptime if (actor.buff_uptime) then - refresh_alvos (shadow.buff_uptime_targets, actor.buff_uptime_targets) - refresh_habilidades (shadow.buff_uptime_spells, actor.buff_uptime_spells) + refresh_alvos(shadow.buff_uptime_targets, actor.buff_uptime_targets) + refresh_habilidades(shadow.buff_uptime_spells, actor.buff_uptime_spells) if (actor.received_buffs_spells) then if (not shadow.received_buffs_spells) then @@ -2525,47 +2534,47 @@ function atributo_misc:r_onlyrefresh_shadow (actor) --debuff uptime if (actor.debuff_uptime) then - refresh_habilidades (shadow.debuff_uptime_spells, actor.debuff_uptime_spells) + refresh_habilidades(shadow.debuff_uptime_spells, actor.debuff_uptime_spells) if (actor.boss_debuff) then -- else - refresh_alvos (shadow.debuff_uptime_targets, actor.debuff_uptime_targets) + refresh_alvos(shadow.debuff_uptime_targets, actor.debuff_uptime_targets) end end --interrupt if (actor.interrupt) then - refresh_alvos (shadow.interrupt_targets, actor.interrupt_targets) - refresh_habilidades (shadow.interrupt_spells, actor.interrupt_spells) + refresh_alvos(shadow.interrupt_targets, actor.interrupt_targets) + refresh_habilidades(shadow.interrupt_spells, actor.interrupt_spells) for spellid, habilidade in pairs(actor.interrupt_spells._ActorTable) do - local habilidade_shadow = shadow.interrupt_spells:PegaHabilidade (spellid, true, nil, true) + local habilidade_shadow = shadow.interrupt_spells:PegaHabilidade(spellid, true, nil, true) habilidade_shadow.interrompeu_oque = habilidade_shadow.interrompeu_oque or {} end end --ress if (actor.ress) then - refresh_alvos (shadow.ress_targets, actor.ress_targets) - refresh_habilidades (shadow.ress_spells, actor.ress_spells) + refresh_alvos(shadow.ress_targets, actor.ress_targets) + refresh_habilidades(shadow.ress_spells, actor.ress_spells) end --dispell if (actor.dispell) then - refresh_alvos (shadow.dispell_targets, actor.dispell_targets) - refresh_habilidades (shadow.dispell_spells, actor.dispell_spells) + refresh_alvos(shadow.dispell_targets, actor.dispell_targets) + refresh_habilidades(shadow.dispell_spells, actor.dispell_spells) for spellid, habilidade in pairs(actor.dispell_spells._ActorTable) do - local habilidade_shadow = shadow.dispell_spells:PegaHabilidade (spellid, true, nil, true) + local habilidade_shadow = shadow.dispell_spells:PegaHabilidade(spellid, true, nil, true) habilidade_shadow.dispell_oque = habilidade_shadow.dispell_oque or {} end end --cc break if (actor.cc_break) then - refresh_alvos (shadow.cc_break_targets, actor.cc_break_targets) - refresh_habilidades (shadow.cc_break_spells, actor.cc_break_spells) + refresh_alvos(shadow.cc_break_targets, actor.cc_break_targets) + refresh_habilidades(shadow.cc_break_spells, actor.cc_break_spells) for spellid, habilidade in pairs(actor.cc_break_spells._ActorTable) do - local habilidade_shadow = shadow.cc_break_spells:PegaHabilidade (spellid, true, nil, true) + local habilidade_shadow = shadow.cc_break_spells:PegaHabilidade(spellid, true, nil, true) habilidade_shadow.cc_break_oque = habilidade_shadow.cc_break_oque or {} end end @@ -2626,7 +2635,7 @@ function atributo_misc:r_connect_shadow(actor, no_refresh, combat_object) _detalhes.refresh:r_atributo_misc(actor, shadow) end - --pets (add unique pet names) + --pets(add unique pet names) for _, petName in ipairs(actor.pets) do DetailsFramework.table.addunique(shadow.pets, petName) end @@ -2659,7 +2668,7 @@ function atributo_misc:r_connect_shadow(actor, no_refresh, combat_object) if (not shadow.cooldowns_defensive_targets) then shadow.cooldowns_defensive = _detalhes:GetOrderNumber(actor.nome) shadow.cooldowns_defensive_targets = {} - shadow.cooldowns_defensive_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) + shadow.cooldowns_defensive_spells = container_habilidades:NovoContainer(_detalhes.container_type.CONTAINER_MISC_CLASS) end shadow.cooldowns_defensive = shadow.cooldowns_defensive + actor.cooldowns_defensive @@ -2668,15 +2677,15 @@ function atributo_misc:r_connect_shadow(actor, no_refresh, combat_object) host_combat.totals_grupo[4].cooldowns_defensive = host_combat.totals_grupo[4].cooldowns_defensive + actor.cooldowns_defensive end - sumTargetValues (shadow.cooldowns_defensive_targets, actor.cooldowns_defensive_targets) - sumSpellTableKeyValues (shadow.cooldowns_defensive_spells, actor.cooldowns_defensive_spells) + sumTargetValues(shadow.cooldowns_defensive_targets, actor.cooldowns_defensive_targets) + sumSpellTableKeyValues(shadow.cooldowns_defensive_spells, actor.cooldowns_defensive_spells) end if (actor.buff_uptime) then if (not shadow.buff_uptime_targets) then shadow.buff_uptime = 0 shadow.buff_uptime_targets = {} - shadow.buff_uptime_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) + shadow.buff_uptime_spells = container_habilidades:NovoContainer(_detalhes.container_type.CONTAINER_MISC_CLASS) end if (actor.received_buffs_spells) then @@ -2687,8 +2696,8 @@ function atributo_misc:r_connect_shadow(actor, no_refresh, combat_object) end shadow.buff_uptime = shadow.buff_uptime + actor.buff_uptime - sumTargetValues (shadow.buff_uptime_targets, actor.buff_uptime_targets) - sumSpellTableKeyValues (shadow.buff_uptime_spells, actor.buff_uptime_spells) + sumTargetValues(shadow.buff_uptime_targets, actor.buff_uptime_targets) + sumSpellTableKeyValues(shadow.buff_uptime_spells, actor.buff_uptime_spells) end @@ -2705,7 +2714,7 @@ function atributo_misc:r_connect_shadow(actor, no_refresh, combat_object) else shadow.debuff_uptime_targets = {} end - shadow.debuff_uptime_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) + shadow.debuff_uptime_spells = container_habilidades:NovoContainer(_detalhes.container_type.CONTAINER_MISC_CLASS) end shadow.debuff_uptime = shadow.debuff_uptime + actor.debuff_uptime @@ -2726,7 +2735,7 @@ function atributo_misc:r_connect_shadow(actor, no_refresh, combat_object) end end - sumSpellTableKeyValues (shadow.debuff_uptime_spells, actor.debuff_uptime_spells) + sumSpellTableKeyValues(shadow.debuff_uptime_spells, actor.debuff_uptime_spells) end --interrupt @@ -2734,7 +2743,7 @@ function atributo_misc:r_connect_shadow(actor, no_refresh, combat_object) if (not shadow.interrupt_targets) then shadow.interrupt = 0 shadow.interrupt_targets = {} - shadow.interrupt_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) --cria o container das habilidades usadas para interromper + shadow.interrupt_spells = container_habilidades:NovoContainer(_detalhes.container_type.CONTAINER_MISC_CLASS) --cria o container das habilidades usadas para interromper shadow.interrompeu_oque = {} end @@ -2744,11 +2753,11 @@ function atributo_misc:r_connect_shadow(actor, no_refresh, combat_object) host_combat.totals_grupo[4].interrupt = host_combat.totals_grupo[4].interrupt + actor.interrupt end - sumTargetValues (shadow.interrupt_targets, actor.interrupt_targets) - sumSpellTableKeyValues (shadow.interrupt_spells, actor.interrupt_spells) + sumTargetValues(shadow.interrupt_targets, actor.interrupt_targets) + sumSpellTableKeyValues(shadow.interrupt_spells, actor.interrupt_spells) for spellid, habilidade in pairs(actor.interrupt_spells._ActorTable) do - local habilidade_shadow = shadow.interrupt_spells:PegaHabilidade (spellid, true, nil, true) + local habilidade_shadow = shadow.interrupt_spells:PegaHabilidade(spellid, true, nil, true) habilidade_shadow.interrompeu_oque = habilidade_shadow.interrompeu_oque or {} @@ -2766,7 +2775,7 @@ function atributo_misc:r_connect_shadow(actor, no_refresh, combat_object) if (not shadow.ress_targets) then shadow.ress = 0 shadow.ress_targets = {} - shadow.ress_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) + shadow.ress_spells = container_habilidades:NovoContainer(_detalhes.container_type.CONTAINER_MISC_CLASS) end shadow.ress = shadow.ress + actor.ress @@ -2775,8 +2784,8 @@ function atributo_misc:r_connect_shadow(actor, no_refresh, combat_object) host_combat.totals_grupo[4].ress = host_combat.totals_grupo[4].ress + actor.ress end - sumTargetValues (shadow.ress_targets, actor.ress_targets) - sumSpellTableKeyValues (shadow.ress_spells, actor.ress_spells) + sumTargetValues(shadow.ress_targets, actor.ress_targets) + sumSpellTableKeyValues(shadow.ress_spells, actor.ress_spells) end --dispell @@ -2784,7 +2793,7 @@ function atributo_misc:r_connect_shadow(actor, no_refresh, combat_object) if (not shadow.dispell_targets) then shadow.dispell = 0 shadow.dispell_targets = {} - shadow.dispell_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) + shadow.dispell_spells = container_habilidades:NovoContainer(_detalhes.container_type.CONTAINER_MISC_CLASS) shadow.dispell_oque = {} end @@ -2794,11 +2803,11 @@ function atributo_misc:r_connect_shadow(actor, no_refresh, combat_object) host_combat.totals_grupo[4].dispell = host_combat.totals_grupo[4].dispell + actor.dispell end - sumTargetValues (shadow.dispell_targets, actor.dispell_targets) - sumSpellTableKeyValues (shadow.dispell_spells, actor.dispell_spells) + sumTargetValues(shadow.dispell_targets, actor.dispell_targets) + sumSpellTableKeyValues(shadow.dispell_spells, actor.dispell_spells) for spellid, habilidade in pairs(actor.dispell_spells._ActorTable) do - local habilidade_shadow = shadow.dispell_spells:PegaHabilidade (spellid, true, nil, true) + local habilidade_shadow = shadow.dispell_spells:PegaHabilidade(spellid, true, nil, true) habilidade_shadow.dispell_oque = habilidade_shadow.dispell_oque or {} for _spellid, amount in pairs(habilidade.dispell_oque) do habilidade_shadow.dispell_oque [_spellid] = (habilidade_shadow.dispell_oque [_spellid] or 0) + amount @@ -2814,7 +2823,7 @@ function atributo_misc:r_connect_shadow(actor, no_refresh, combat_object) if (not shadow.cc_break) then shadow.cc_break = 0 shadow.cc_break_targets = {} - shadow.cc_break_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) --cria o container das habilidades usadas para interromper + shadow.cc_break_spells = container_habilidades:NovoContainer(_detalhes.container_type.CONTAINER_MISC_CLASS) --cria o container das habilidades usadas para interromper shadow.cc_break_oque = {} end @@ -2824,11 +2833,11 @@ function atributo_misc:r_connect_shadow(actor, no_refresh, combat_object) host_combat.totals_grupo[4].cc_break = host_combat.totals_grupo[4].cc_break + actor.cc_break end - sumTargetValues (shadow.cc_break_targets, actor.cc_break_targets) - sumSpellTableKeyValues (shadow.cc_break_spells, actor.cc_break_spells) + sumTargetValues(shadow.cc_break_targets, actor.cc_break_targets) + sumSpellTableKeyValues(shadow.cc_break_spells, actor.cc_break_spells) for spellid, habilidade in pairs(actor.cc_break_spells._ActorTable) do - local habilidade_shadow = shadow.cc_break_spells:PegaHabilidade (spellid, true, nil, true) + local habilidade_shadow = shadow.cc_break_spells:PegaHabilidade(spellid, true, nil, true) habilidade_shadow.cc_break_oque = habilidade_shadow.cc_break_oque or {} for _spellid, amount in pairs(habilidade.cc_break_oque) do habilidade_shadow.cc_break_oque [_spellid] = (habilidade_shadow.cc_break_oque [_spellid] or 0) + amount @@ -2854,9 +2863,9 @@ function _detalhes.refresh:r_atributo_misc(thisActor, shadow) if (shadow and not shadow.cc_done_targets) then shadow.cc_done = 0 shadow.cc_done_targets = {} - shadow.cc_done_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) + shadow.cc_done_spells = container_habilidades:NovoContainer(_detalhes.container_type.CONTAINER_MISC_CLASS) end - _detalhes.refresh:r_container_habilidades (thisActor.cc_done_spells, shadow and shadow.cc_done_spells) + _detalhes.refresh:r_container_habilidades(thisActor.cc_done_spells, shadow and shadow.cc_done_spells) end --refresh interrupts @@ -2864,10 +2873,10 @@ function _detalhes.refresh:r_atributo_misc(thisActor, shadow) if (shadow and not shadow.interrupt_targets) then shadow.interrupt = 0 shadow.interrupt_targets = {} - shadow.interrupt_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) + shadow.interrupt_spells = container_habilidades:NovoContainer(_detalhes.container_type.CONTAINER_MISC_CLASS) shadow.interrompeu_oque = {} end - _detalhes.refresh:r_container_habilidades (thisActor.interrupt_spells, shadow and shadow.interrupt_spells) + _detalhes.refresh:r_container_habilidades(thisActor.interrupt_spells, shadow and shadow.interrupt_spells) end --refresh buff uptime @@ -2903,9 +2912,9 @@ function _detalhes.refresh:r_atributo_misc(thisActor, shadow) else shadow.debuff_uptime_targets = {} end - shadow.debuff_uptime_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) + shadow.debuff_uptime_spells = container_habilidades:NovoContainer(_detalhes.container_type.CONTAINER_MISC_CLASS) end - _detalhes.refresh:r_container_habilidades (thisActor.debuff_uptime_spells, shadow and shadow.debuff_uptime_spells) + _detalhes.refresh:r_container_habilidades(thisActor.debuff_uptime_spells, shadow and shadow.debuff_uptime_spells) end --refresh cooldowns defensive @@ -2913,9 +2922,9 @@ function _detalhes.refresh:r_atributo_misc(thisActor, shadow) if (shadow and not shadow.cooldowns_defensive_targets) then shadow.cooldowns_defensive = 0 shadow.cooldowns_defensive_targets = {} - shadow.cooldowns_defensive_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) + shadow.cooldowns_defensive_spells = container_habilidades:NovoContainer(_detalhes.container_type.CONTAINER_MISC_CLASS) end - _detalhes.refresh:r_container_habilidades (thisActor.cooldowns_defensive_spells, shadow and shadow.cooldowns_defensive_spells) + _detalhes.refresh:r_container_habilidades(thisActor.cooldowns_defensive_spells, shadow and shadow.cooldowns_defensive_spells) end --refresh ressers @@ -2923,9 +2932,9 @@ function _detalhes.refresh:r_atributo_misc(thisActor, shadow) if (shadow and not shadow.ress_targets) then shadow.ress = 0 shadow.ress_targets = {} - shadow.ress_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) + shadow.ress_spells = container_habilidades:NovoContainer(_detalhes.container_type.CONTAINER_MISC_CLASS) end - _detalhes.refresh:r_container_habilidades (thisActor.ress_spells, shadow and shadow.ress_spells) + _detalhes.refresh:r_container_habilidades(thisActor.ress_spells, shadow and shadow.ress_spells) end --refresh dispells @@ -2933,10 +2942,10 @@ function _detalhes.refresh:r_atributo_misc(thisActor, shadow) if (shadow and not shadow.dispell_targets) then shadow.dispell = 0 shadow.dispell_targets = {} - shadow.dispell_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) --cria o container das habilidades usadas para interromper + shadow.dispell_spells = container_habilidades:NovoContainer(_detalhes.container_type.CONTAINER_MISC_CLASS) --cria o container das habilidades usadas para interromper shadow.dispell_oque = {} end - _detalhes.refresh:r_container_habilidades (thisActor.dispell_spells, shadow and shadow.dispell_spells) + _detalhes.refresh:r_container_habilidades(thisActor.dispell_spells, shadow and shadow.dispell_spells) end --refresh cc_breaks @@ -2944,28 +2953,28 @@ function _detalhes.refresh:r_atributo_misc(thisActor, shadow) if (shadow and not shadow.cc_break) then shadow.cc_break = 0 shadow.cc_break_targets = {} - shadow.cc_break_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) + shadow.cc_break_spells = container_habilidades:NovoContainer(_detalhes.container_type.CONTAINER_MISC_CLASS) shadow.cc_break_oque = {} end - _detalhes.refresh:r_container_habilidades (thisActor.cc_break_spells, shadow and shadow.cc_break_spells) + _detalhes.refresh:r_container_habilidades(thisActor.cc_break_spells, shadow and shadow.cc_break_spells) end end -function _detalhes.clear:c_atributo_misc (este_jogador) +function _detalhes.clear:c_atributo_misc(este_jogador) este_jogador.__index = nil este_jogador.links = nil este_jogador.minha_barra = nil if (este_jogador.cc_done_targets) then - _detalhes.clear:c_container_habilidades (este_jogador.cc_done_spells) + _detalhes.clear:c_container_habilidades(este_jogador.cc_done_spells) end if (este_jogador.interrupt_targets) then - _detalhes.clear:c_container_habilidades (este_jogador.interrupt_spells) + _detalhes.clear:c_container_habilidades(este_jogador.interrupt_spells) end if (este_jogador.cooldowns_defensive_targets) then - _detalhes.clear:c_container_habilidades (este_jogador.cooldowns_defensive_spells) + _detalhes.clear:c_container_habilidades(este_jogador.cooldowns_defensive_spells) end if (este_jogador.buff_uptime_targets) then @@ -2977,19 +2986,19 @@ function _detalhes.clear:c_atributo_misc (este_jogador) end if (este_jogador.debuff_uptime_targets) then - _detalhes.clear:c_container_habilidades (este_jogador.debuff_uptime_spells) + _detalhes.clear:c_container_habilidades(este_jogador.debuff_uptime_spells) end if (este_jogador.ress_targets) then - _detalhes.clear:c_container_habilidades (este_jogador.ress_spells) + _detalhes.clear:c_container_habilidades(este_jogador.ress_spells) end if (este_jogador.cc_break_targets) then - _detalhes.clear:c_container_habilidades (este_jogador.cc_break_spells) + _detalhes.clear:c_container_habilidades(este_jogador.cc_break_spells) end if (este_jogador.dispell_targets) then - _detalhes.clear:c_container_habilidades (este_jogador.dispell_spells) + _detalhes.clear:c_container_habilidades(este_jogador.dispell_spells) end end @@ -3058,7 +3067,7 @@ atributo_misc.__add = function(tabela1, tabela2) habilidade_tabela1.targets[target_name] = (habilidade_tabela1.targets[target_name] or 0) + amount end - sumKeyValues (habilidade, habilidade_tabela1) + sumKeyValues(habilidade, habilidade_tabela1) end end @@ -3116,7 +3125,7 @@ atributo_misc.__add = function(tabela1, tabela2) end tabela1.debuff_uptime = 0 - tabela1.debuff_uptime_spells = container_habilidades:NovoContainer (container_misc) + tabela1.debuff_uptime_spells = container_habilidades:NovoContainer(container_misc) end tabela1.debuff_uptime = tabela1.debuff_uptime + tabela2.debuff_uptime @@ -3138,13 +3147,13 @@ atributo_misc.__add = function(tabela1, tabela2) end for spellid, habilidade in pairs(tabela2.debuff_uptime_spells._ActorTable) do - local habilidade_tabela1 = tabela1.debuff_uptime_spells:PegaHabilidade (spellid, true, nil, false) + local habilidade_tabela1 = tabela1.debuff_uptime_spells:PegaHabilidade(spellid, true, nil, false) for target_name, amount in pairs(habilidade.targets) do habilidade_tabela1.targets[target_name] = (habilidade_tabela1.targets[target_name] or 0) + amount end - sumKeyValues (habilidade, habilidade_tabela1) + sumKeyValues(habilidade, habilidade_tabela1) end end @@ -3152,7 +3161,7 @@ atributo_misc.__add = function(tabela1, tabela2) if (not tabela1.cooldowns_defensive) then tabela1.cooldowns_defensive = 0 tabela1.cooldowns_defensive_targets = {} - tabela1.cooldowns_defensive_spells = container_habilidades:NovoContainer (container_misc) + tabela1.cooldowns_defensive_spells = container_habilidades:NovoContainer(container_misc) end tabela1.cooldowns_defensive = tabela1.cooldowns_defensive + tabela2.cooldowns_defensive @@ -3162,13 +3171,13 @@ atributo_misc.__add = function(tabela1, tabela2) end for spellid, habilidade in pairs(tabela2.cooldowns_defensive_spells._ActorTable) do - local habilidade_tabela1 = tabela1.cooldowns_defensive_spells:PegaHabilidade (spellid, true, nil, false) + local habilidade_tabela1 = tabela1.cooldowns_defensive_spells:PegaHabilidade(spellid, true, nil, false) for target_name, amount in pairs(habilidade.targets) do habilidade_tabela1.targets[target_name] = (habilidade_tabela1.targets[target_name] or 0) + amount end - sumKeyValues (habilidade, habilidade_tabela1) + sumKeyValues(habilidade, habilidade_tabela1) end end @@ -3176,7 +3185,7 @@ atributo_misc.__add = function(tabela1, tabela2) if (not tabela1.ress) then tabela1.ress = 0 tabela1.ress_targets = {} - tabela1.ress_spells = container_habilidades:NovoContainer (container_misc) + tabela1.ress_spells = container_habilidades:NovoContainer(container_misc) end tabela1.ress = tabela1.ress + tabela2.ress @@ -3186,13 +3195,13 @@ atributo_misc.__add = function(tabela1, tabela2) end for spellid, habilidade in pairs(tabela2.ress_spells._ActorTable) do - local habilidade_tabela1 = tabela1.ress_spells:PegaHabilidade (spellid, true, nil, false) + local habilidade_tabela1 = tabela1.ress_spells:PegaHabilidade(spellid, true, nil, false) for target_name, amount in pairs(habilidade.targets) do habilidade_tabela1.targets[target_name] = (habilidade_tabela1.targets[target_name] or 0) + amount end - sumKeyValues (habilidade, habilidade_tabela1) + sumKeyValues(habilidade, habilidade_tabela1) end end @@ -3201,7 +3210,7 @@ atributo_misc.__add = function(tabela1, tabela2) if (not tabela1.dispell) then tabela1.dispell = 0 tabela1.dispell_targets = {} - tabela1.dispell_spells = container_habilidades:NovoContainer (container_misc) + tabela1.dispell_spells = container_habilidades:NovoContainer(container_misc) tabela1.dispell_oque = {} end @@ -3212,7 +3221,7 @@ atributo_misc.__add = function(tabela1, tabela2) end for spellid, habilidade in pairs(tabela2.dispell_spells._ActorTable) do - local habilidade_tabela1 = tabela1.dispell_spells:PegaHabilidade (spellid, true, nil, false) + local habilidade_tabela1 = tabela1.dispell_spells:PegaHabilidade(spellid, true, nil, false) habilidade_tabela1.dispell_oque = habilidade_tabela1.dispell_oque or {} @@ -3224,7 +3233,7 @@ atributo_misc.__add = function(tabela1, tabela2) habilidade_tabela1.targets[target_name] = (habilidade_tabela1.targets[target_name] or 0) + amount end - sumKeyValues (habilidade, habilidade_tabela1) + sumKeyValues(habilidade, habilidade_tabela1) end for spellid, amount in pairs(tabela2.dispell_oque) do @@ -3237,7 +3246,7 @@ atributo_misc.__add = function(tabela1, tabela2) if (not tabela1.cc_break) then tabela1.cc_break = 0 tabela1.cc_break_targets = {} - tabela1.cc_break_spells = container_habilidades:NovoContainer (container_misc) + tabela1.cc_break_spells = container_habilidades:NovoContainer(container_misc) tabela1.cc_break_oque = {} end @@ -3248,7 +3257,7 @@ atributo_misc.__add = function(tabela1, tabela2) end for spellid, habilidade in pairs(tabela2.cc_break_spells._ActorTable) do - local habilidade_tabela1 = tabela1.cc_break_spells:PegaHabilidade (spellid, true, nil, false) + local habilidade_tabela1 = tabela1.cc_break_spells:PegaHabilidade(spellid, true, nil, false) habilidade_tabela1.cc_break_oque = habilidade_tabela1.cc_break_oque or {} for _spellid, amount in pairs(habilidade.cc_break_oque) do @@ -3259,7 +3268,7 @@ atributo_misc.__add = function(tabela1, tabela2) habilidade_tabela1.targets[target_name] = (habilidade_tabela1.targets[target_name] or 0) + amount end - sumKeyValues (habilidade, habilidade_tabela1) + sumKeyValues(habilidade, habilidade_tabela1) end for spellid, amount in pairs(tabela2.cc_break_oque) do @@ -3298,7 +3307,7 @@ atributo_misc.__sub = function(tabela1, tabela2) end for spellid, habilidade in pairs(tabela2.cc_done_spells._ActorTable) do - local habilidade_tabela1 = tabela1.cc_done_spells:PegaHabilidade (spellid, true, nil, false) + local habilidade_tabela1 = tabela1.cc_done_spells:PegaHabilidade(spellid, true, nil, false) for target_name, amount in pairs(habilidade.targets) do habilidade_tabela1.targets[target_name] = (habilidade_tabela1.targets[target_name] or 0) - amount @@ -3324,7 +3333,7 @@ atributo_misc.__sub = function(tabela1, tabela2) --soma o container de habilidades for spellid, habilidade in pairs(tabela2.interrupt_spells._ActorTable) do - local habilidade_tabela1 = tabela1.interrupt_spells:PegaHabilidade (spellid, true, nil, false) + local habilidade_tabela1 = tabela1.interrupt_spells:PegaHabilidade(spellid, true, nil, false) habilidade_tabela1.interrompeu_oque = habilidade_tabela1.interrompeu_oque or {} for _spellid, amount in pairs(habilidade.interrompeu_oque) do @@ -3384,7 +3393,7 @@ atributo_misc.__sub = function(tabela1, tabela2) end for spellid, habilidade in pairs(tabela2.debuff_uptime_spells._ActorTable) do - local habilidade_tabela1 = tabela1.debuff_uptime_spells:PegaHabilidade (spellid, true, nil, false) + local habilidade_tabela1 = tabela1.debuff_uptime_spells:PegaHabilidade(spellid, true, nil, false) for target_name, amount in pairs(habilidade.targets) do habilidade_tabela1.targets[target_name] = (habilidade_tabela1.targets[target_name] or 0) - amount @@ -3402,7 +3411,7 @@ atributo_misc.__sub = function(tabela1, tabela2) end for spellid, habilidade in pairs(tabela2.cooldowns_defensive_spells._ActorTable) do - local habilidade_tabela1 = tabela1.cooldowns_defensive_spells:PegaHabilidade (spellid, true, nil, false) + local habilidade_tabela1 = tabela1.cooldowns_defensive_spells:PegaHabilidade(spellid, true, nil, false) for target_name, amount in pairs(habilidade.targets) do habilidade_tabela1.targets[target_name] = (habilidade_tabela1.targets[target_name] or 0) - amount @@ -3420,7 +3429,7 @@ atributo_misc.__sub = function(tabela1, tabela2) end for spellid, habilidade in pairs(tabela2.ress_spells._ActorTable) do - local habilidade_tabela1 = tabela1.ress_spells:PegaHabilidade (spellid, true, nil, false) + local habilidade_tabela1 = tabela1.ress_spells:PegaHabilidade(spellid, true, nil, false) for target_name, amount in pairs(habilidade.targets) do habilidade_tabela1.targets[target_name] = (habilidade_tabela1.targets[target_name] or 0) - amount @@ -3438,7 +3447,7 @@ atributo_misc.__sub = function(tabela1, tabela2) end for spellid, habilidade in pairs(tabela2.dispell_spells._ActorTable) do - local habilidade_tabela1 = tabela1.dispell_spells:PegaHabilidade (spellid, true, nil, false) + local habilidade_tabela1 = tabela1.dispell_spells:PegaHabilidade(spellid, true, nil, false) habilidade_tabela1.dispell_oque = habilidade_tabela1.dispell_oque or {} @@ -3466,7 +3475,7 @@ atributo_misc.__sub = function(tabela1, tabela2) end for spellid, habilidade in pairs(tabela2.cc_break_spells._ActorTable) do - local habilidade_tabela1 = tabela1.cc_break_spells:PegaHabilidade (spellid, true, nil, false) + local habilidade_tabela1 = tabela1.cc_break_spells:PegaHabilidade(spellid, true, nil, false) habilidade_tabela1.cc_break_oque = habilidade_tabela1.cc_break_oque or {} for _spellid, amount in pairs(habilidade.cc_break_oque) do