- 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
+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)