- added back the localizations on ToC file.

- API: added actor:Pets() > return a numeric table with pet names formated with the owner name.
- added pets to the damage tooltip.
This commit is contained in:
Tercio
2017-04-27 16:23:29 -03:00
parent 85c9d90c13
commit fad3f1fd28
6 changed files with 142 additions and 38 deletions
+10
View File
@@ -9,6 +9,16 @@ Libs\libs.xml
#@end-no-lib-strip@
locales\Details-enUS.lua
locales\Details-deDE.lua
locales\Details-esES.lua
locales\Details-esMX.lua
locales\Details-frFR.lua
locales\Details-itIT.lua
locales\Details-koKR.lua
locales\Details-ptBR.lua
locales\Details-ruRU.lua
locales\Details-zhCN.lua
locales\Details-zhTW.lua
boot.lua
indent.lua
+7 -4
View File
File diff suppressed because one or more lines are too long
+29 -6
View File
@@ -2825,7 +2825,8 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown)
--> TOP HABILIDADES
--get variables
local ActorDamage = self.total_without_pet
local ActorDamage = self.total_without_pet --mostrando os pets no tooltip
local ActorDamage = self.total
local ActorDamageWithPet = self.total
if (ActorDamage == 0) then
ActorDamage = 0.00000001
@@ -2843,20 +2844,31 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown)
--print ("time:", meu_tempo)
--add and sort
--add actor spells
for _spellid, _skill in _pairs (ActorSkillsContainer) do
ActorSkillsSortTable [#ActorSkillsSortTable+1] = {_spellid, _skill.total, _skill.total/meu_tempo}
end
--add actor pets
for petIndex, petName in _ipairs (self:Pets()) do
local petActor = instancia.showing[class_type]:PegarCombatente (nil, petName)
if (petActor) then
for _spellid, _skill in _pairs (petActor:GetActorSpells()) do
ActorSkillsSortTable [#ActorSkillsSortTable+1] = {_spellid, _skill.total, _skill.total/meu_tempo, petName:gsub ((" <.*"), "")}
end
end
end
--sort
_table_sort (ActorSkillsSortTable, _detalhes.Sort2)
--> TOP INIMIGOS
--get variables
local ActorTargetsSortTable = {}
--add and sort
--add
for target_name, amount in _pairs (self.targets) do
ActorTargetsSortTable [#ActorTargetsSortTable+1] = {target_name, amount}
end
--sort
_table_sort (ActorTargetsSortTable, _detalhes.Sort2)
--tooltip stuff
@@ -2889,12 +2901,23 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown)
if (#ActorSkillsSortTable > 0) then
for i = 1, _math_min (tooltip_max_abilities, #ActorSkillsSortTable) do
local SkillTable = ActorSkillsSortTable [i]
local nome_magia, _, icone_magia = _GetSpellInfo (SkillTable [1])
local spellID = SkillTable [1]
local totalDamage = SkillTable [2]
local totalDPS = SkillTable [3]
local petName = SkillTable [4]
local nome_magia, _, icone_magia = _GetSpellInfo (spellID)
if (petName) then
nome_magia = nome_magia .. " (|cFFCCBBBB" .. petName .. "|r)"
end
if (instancia.sub_atributo == 1 or instancia.sub_atributo == 6) then
GameCooltip:AddLine (nome_magia..": ", FormatTooltipNumber (_, SkillTable [2]) .." (".._cstr("%.1f", SkillTable [2]/ActorDamage*100).."%)")
GameCooltip:AddLine (nome_magia..": ", FormatTooltipNumber (_, totalDamage) .." (".._cstr("%.1f", totalDamage/ActorDamage*100).."%)")
else
GameCooltip:AddLine (nome_magia..": ", FormatTooltipNumber (_, _math_floor (SkillTable [3])) .." (".._cstr("%.1f", SkillTable [2]/ActorDamage*100).."%)")
GameCooltip:AddLine (nome_magia..": ", FormatTooltipNumber (_, _math_floor (totalDPS)) .." (".._cstr("%.1f", totalDamage/ActorDamage*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)
+10 -4
View File
@@ -2035,10 +2035,10 @@ SPELL_POWER_OBSOLETE2 = 15;
[SPELL_POWER_SOUL_SHARDS] = true, --warlock affliction
[SPELL_POWER_COMBO_POINTS] = true, --combo points
[SPELL_POWER_MAELSTROM] = true, --shamans
[SPELL_POWER_PAIN] = true, --demonhuinter
[SPELL_POWER_PAIN] = true, --demonhunter tank
[SPELL_POWER_RUNES] = true, --dk
[SPELL_POWER_ARCANE_CHARGES] = true, --mage
[SPELL_POWER_FURY] = true, --warrior
[SPELL_POWER_FURY] = true, --warrior demonhunter dps
}
local resource_power_type = {
@@ -2052,7 +2052,7 @@ SPELL_POWER_OBSOLETE2 = 15;
[SPELL_POWER_PAIN] = SPELL_POWER_ENERGY, --demonhuinter
[SPELL_POWER_RUNES] = SPELL_POWER_RUNIC_POWER, --dk
[SPELL_POWER_ARCANE_CHARGES] = SPELL_POWER_MANA, --mage
[SPELL_POWER_FURY] = SPELL_POWER_RAGE, --warrioor
[SPELL_POWER_FURY] = SPELL_POWER_RAGE, --warrior
}
_detalhes.resource_strings = {
@@ -2084,7 +2084,7 @@ SPELL_POWER_OBSOLETE2 = 15;
}
function parser:energize (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, amount, powertype, p6, p7)
------------------------------------------------------------------------------------------------
--> early checks and fixes
@@ -2111,6 +2111,12 @@ SPELL_POWER_OBSOLETE2 = 15;
--[[statistics]]-- _detalhes.statistics.energy_calls = _detalhes.statistics.energy_calls + 1
_current_energy_container.need_refresh = true
--print (who_name, spellid, spellname, spelltype, amount, powertype, p6, p7) powertype = 0 p6 = 17
--4/27 13:45:54.903 SPELL_ENERGIZE,
--Player-3208-0A085522,"Licelystiri-Nemesis",0x511,0x0,
--Player-3208-0A085522,"Licelystiri-Nemesis",0x511,0x0,
--162243,"Demon's Bite",0x1,Player-3208-0A085522,0000000000000000,233158,242700,3555,662,17,70,100,0,1030.46,3134.93,660,28,0,17,100
------------------------------------------------------------------------------------------------
--> get actors
+3
View File
@@ -142,6 +142,9 @@ do
function _detalhes:GetSpell (spellid)
return self.spells._ActorTable [spellid]
end
function _detalhes:Pets()
return self.pets
end
--> inherits to all actors without placing it on _detalhes namespace.
_detalhes.container_combatentes.guid = _detalhes.GetGUID
+83 -24
View File
@@ -2630,17 +2630,22 @@ function gump:CriaJanelaInfo()
local fill_compare_actors = function (self, player, other_players)
--primeiro preenche a nossa barra
--main player skills
local spells_sorted = {}
for spellid, spelltable in _pairs (player.spells._ActorTable) do
spells_sorted [#spells_sorted+1] = {spelltable, spelltable.total}
end
table.sort (spells_sorted, _detalhes.Sort2)
--precisa pegar os pets do jogador aqui
--for petGUID, _ in pairs ({}) do
--
--end
--main player pets
for petIndex, petName in _ipairs (player:Pets()) do
local petActor = info.instancia.showing [player.tipo]:PegarCombatente (nil, petName)
if (petActor) then
for _spellid, _skill in _pairs (petActor:GetActorSpells()) do
spells_sorted [#spells_sorted+1] = {_skill, _skill.total, petName}
end
end
end
table.sort (spells_sorted, _detalhes.Sort2)
self.player = player:Name()
@@ -2661,9 +2666,21 @@ function gump:CriaJanelaInfo()
frame2.player = other_players [1]:Name()
player_2_total = other_players [1].total_without_pet
player_2_spells_sorted = {}
--player 2 spells
for spellid, spelltable in _pairs (other_players [1].spells._ActorTable) do
player_2_spells_sorted [#player_2_spells_sorted+1] = {spelltable, spelltable.total}
end
--player 2 pets
for petIndex, petName in _ipairs (other_players [1]:Pets()) do
local petActor = info.instancia.showing [player.tipo]:PegarCombatente (nil, petName)
if (petActor) then
for _spellid, _skill in _pairs (petActor:GetActorSpells()) do
player_2_spells_sorted [#player_2_spells_sorted+1] = {_skill, _skill.total, petName}
end
end
end
table.sort (player_2_spells_sorted, _detalhes.Sort2)
player_2_top = player_2_spells_sorted [1] [2]
player_2_spell_info = {}
@@ -2690,9 +2707,20 @@ function gump:CriaJanelaInfo()
player_3_spell_info = {}
if (other_players [2]) then
--player 3 spells
for spellid, spelltable in _pairs (other_players [2].spells._ActorTable) do
player_3_spells_sorted [#player_3_spells_sorted+1] = {spelltable, spelltable.total}
end
--player 3 pets
for petIndex, petName in _ipairs (other_players [2]:Pets()) do
local petActor = info.instancia.showing [player.tipo]:PegarCombatente (nil, petName)
if (petActor) then
for _spellid, _skill in _pairs (petActor:GetActorSpells()) do
player_3_spells_sorted [#player_3_spells_sorted+1] = {_skill, _skill.total, petName}
end
end
end
table.sort (player_3_spells_sorted, _detalhes.Sort2)
player_3_top = player_3_spells_sorted [1] [2]
for index, spelltable in _ipairs (player_3_spells_sorted) do
@@ -2705,27 +2733,47 @@ function gump:CriaJanelaInfo()
local bar = self.bars [i]
local index = i + offset
--main player spells
local data = spells_sorted [index]
if (data) then
--seta no box principal
local spellid = data [1].id
local name, _, icon = _GetSpellInfo (spellid)
bar [1]:SetTexture (icon) --bar[1] = spellicon bar[2] = statusbar
bar [1]:SetTexCoord (unpack (IconTexCoord)) --bar[1] = spellicon bar[2] = statusbar
bar [2].lefttext:SetText (index .. ". " .. name)
bar [2].lefttext:SetTextColor (1, 1, 1, 1)
bar [2].righttext:SetText (_detalhes:ToK2Min (data [2])) -- .. " (" .. _math_floor (data [2] / total * 100) .. "%)"
bar [2]:SetValue (data [2] / top * 100)
--bar [2]:SetValue (100)
bar [3][1] = data [1].counter --tooltip hits
bar [3][2] = data [2] / data [1].counter --tooltip average
bar [3][3] = _math_floor (data [1].c_amt / data [1].counter * 100) --tooltip critical
bar [3][4] = spellid
--seta no segundo box
if (data) then --if exists
--main player - seta no primeiro box
local spellid = data [1].id
local name, _, icon = _GetSpellInfo (spellid)
local petName = data [3]
bar [1]:SetTexture (icon) --bar[1] = spellicon bar[2] = statusbar
bar [1]:SetTexCoord (unpack (IconTexCoord)) --bar[1] = spellicon bar[2] = statusbar
if (petName) then
bar [2].lefttext:SetText (index .. ". " .. name .. " (|cFFCCBBBB" .. petName:gsub (" <.*", "") .. "|r)")
else
bar [2].lefttext:SetText (index .. ". " .. name)
end
bar [2].lefttext:SetTextColor (1, 1, 1, 1)
bar [2].righttext:SetText (_detalhes:ToK2Min (data [2])) -- .. " (" .. _math_floor (data [2] / total * 100) .. "%)"
bar [2]:SetValue (data [2] / top * 100)
--bar [2]:SetValue (100)
bar [3][1] = data [1].counter --tooltip hits
bar [3][2] = data [2] / data [1].counter --tooltip average
bar [3][3] = _math_floor (data [1].c_amt / data [1].counter * 100) --tooltip critical
bar [3][4] = spellid
--player 2
local player_2 = other_players [1]
local spell = player_2 and player_2.spells._ActorTable [spellid]
if (not spell and petName) then
for _petIndex, _petName in _ipairs (player_2:Pets()) do
if (_petName:gsub (" <.*", "") == petName:gsub (" <.*", "")) then
local petActor = info.instancia.showing [player.tipo]:PegarCombatente (nil, _petName)
spell = petActor and petActor.spells._ActorTable [spellid]
name = name .. " (|cFFCCBBBB" .. _petName:gsub (" <.*", "") .. "|r)"
end
end
end
local bar_2 = frame2 and frame2.bars [i]
-- ~compare
@@ -2785,13 +2833,24 @@ function gump:CriaJanelaInfo()
bar_2 [2]:SetValue (0)
end
--seta o terceiro box
--player 3
local bar_3 = frame3 and frame3.bars [i]
if (player_3_total) then
local player_3 = other_players [2]
local spell = player_3 and player_3.spells._ActorTable [spellid]
if (not spell and petName) then
for _petIndex, _petName in _ipairs (player_3:Pets()) do
if (_petName:gsub (" <.*", "") == petName:gsub (" <.*", "")) then
local petActor = info.instancia.showing [player.tipo]:PegarCombatente (nil, _petName)
spell = petActor and petActor.spells._ActorTable [spellid]
local name, _, icon = _GetSpellInfo (spellid)
name = name .. " (|cFFCCBBBB" .. _petName:gsub (" <.*", "") .. "|r)"
end
end
end
if (spell) then
bar_3 [1]:SetTexture (icon)
bar_3 [1]:SetTexCoord (unpack (IconTexCoord)) --bar[1] = spellicon bar[2] = statusbar