From 58c1ab2417e0e0c6a9c43a44bb4262b78941fcff Mon Sep 17 00:00:00 2001 From: Tercio Date: Wed, 9 Nov 2016 14:31:00 -0200 Subject: [PATCH] - Fixed Friendly Fire tooltip where it was showing one entry for each spell on each target. - Fixed an issue with Auras & Void Zone where wasn't possible to report when the aura has zero damage. --- boot.lua | 9 ++++----- classes/classe_damage.lua | 22 ++++++++++++++++------ 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/boot.lua b/boot.lua index 68ee3783..bec58252 100644 --- a/boot.lua +++ b/boot.lua @@ -3,7 +3,7 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") - _detalhes.build_counter = 3202 + _detalhes.build_counter = 3212 _detalhes.userversion = "v7.1.0." .. _detalhes.build_counter _detalhes.realversion = 115 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" @@ -21,10 +21,9 @@ do local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) --[[ -|cFFFFFF00v7.0.3.3202.115 (|cFFFFCC00November 08th, 2016|r|cFFFFFF00)|r:\n\n -|cFFFFFF00-|r Weakauras creator shall now work correctly with Trials of Valor.\n\n -|cFFFFFF00-|r Raid history should now be recording your Trials of Valor kills.\n\n -|cFFFFFF00-|r Added Trials of Valor raid info, good luck and have fun!.\n\n +|cFFFFFF00v7.0.3.3212.115 (|cFFFFCC00November 09th, 2016|r|cFFFFFF00)|r:\n\n +|cFFFFFF00-|r Fixed Friendly Fire tooltip where it was showing one entry for each spell on each target.\n\n +|cFFFFFF00-|r Fixed an issue with Auras & Void Zone where wasn't possible to report when the aura has zero damage.\n\n --]] -- diff --git a/classes/classe_damage.lua b/classes/classe_damage.lua index c1c5caa0..799c2448 100644 --- a/classes/classe_damage.lua +++ b/classes/classe_damage.lua @@ -1303,7 +1303,10 @@ local t = {} for index, void_table in ipairs (tooltip_void_zone_temp) do - if (void_table[2] > 0) then + --irá reportar dano zero também + if (void_table[1] and type (void_table[1]) == "string" and void_table[2] and void_table[3] and type (void_table[3]) == "table") then + print (void_table[1], void_table[2], void_table[3]) + local actor_table = {_detalhes:GetOnlyName (void_table[1])} local m, s = _math_floor (void_table[3].uptime / 60), _math_floor (void_table[3].uptime % 60) if (m > 0) then @@ -3435,13 +3438,13 @@ function atributo_damage:ToolTip_FriendlyFire (instancia, numero, barra, keydown if (actor) then DamagedPlayers [#DamagedPlayers+1] = {target_name, ff_table.total, actor.classe} for spellid, amount in _pairs (ff_table.spells) do - Skills [#Skills+1] = {spellid, amount} + Skills [spellid] = (Skills [spellid] or 0) + amount + --Skills [#Skills+1] = {spellid, amount} end end end _table_sort (DamagedPlayers, _detalhes.Sort2) - _table_sort (Skills, _detalhes.Sort2) _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_TARGETS"], headerColor, #DamagedPlayers, [[Interface\Addons\Details\images\icons]], 0.126953125, 0.224609375, 0.056640625, 0.140625) @@ -3500,9 +3503,16 @@ function atributo_damage:ToolTip_FriendlyFire (instancia, numero, barra, keydown local icon_size = _detalhes.tooltip.icon_size local icon_border = _detalhes.tooltip.icon_border_texcoord - for i = 1, _math_min (max_abilities2, #Skills) do - local nome, _, icone = _GetSpellInfo (Skills[i][1]) - GameCooltip:AddLine (nome .. ": ", FormatTooltipNumber (_, Skills[i][2]).." (".._cstr("%.1f", Skills[i][2]/FriendlyFireTotal*100).."%)") + --spells usadas no friendly fire + local SpellsInOrder = {} + for spellID, amount in _pairs (Skills) do + SpellsInOrder [#SpellsInOrder+1] = {spellID, amount} + end + _table_sort (SpellsInOrder, _detalhes.Sort2) + + for i = 1, _math_min (max_abilities2, #SpellsInOrder) do + local nome, _, icone = _GetSpellInfo (SpellsInOrder[i][1]) + GameCooltip:AddLine (nome .. ": ", FormatTooltipNumber (_, SpellsInOrder[i][2]).." (".._cstr("%.1f", SpellsInOrder[i][2]/FriendlyFireTotal*100).."%)") GameCooltip:AddIcon (icone, nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) _detalhes:AddTooltipBackgroundStatusbar() end