- Enemies display now shows damage taken instead of damage done.

- Tooltip for enemies display now also show damage and healing done by the enemy.
- Added an option under miscellaneous to show neutral and hostile creatures on damage taken display.
This commit is contained in:
Tercio
2015-02-05 16:19:27 -02:00
parent 31145e54b5
commit 43996cf0d7
6 changed files with 172 additions and 78 deletions
+8 -4
View File
File diff suppressed because one or more lines are too long
+98 -61
View File
@@ -201,13 +201,13 @@
local npcid2 = _detalhes:GetNpcIdFromGuid (t2.serial)
if (not ignored_enemy_npcs [npcid1] and not ignored_enemy_npcs [npcid2]) then
return t1.total > t2.total
return t1.damage_taken > t2.damage_taken
elseif (ignored_enemy_npcs [npcid1] and not ignored_enemy_npcs [npcid2]) then
return false
elseif (not ignored_enemy_npcs [npcid1] and ignored_enemy_npcs [npcid2]) then
return true
else
return t1.total > t2.total
return t1.damage_taken > t2.damage_taken
end
elseif (a ~= 0 and b == 0) then
@@ -853,6 +853,9 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex
keyName = "last_dps"
elseif (sub_atributo == 3) then --> TAMAGE TAKEN
keyName = "damage_taken"
if (_detalhes.damage_taken_everything) then
modo = modo_ALL
end
elseif (sub_atributo == 4) then --> FRIENDLY FIRE
keyName = "friendlyfire_total"
elseif (sub_atributo == 5) then --> FRAGS
@@ -1050,7 +1053,8 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex
if (keyName == "enemies") then
amount, total = _detalhes:ContainerSortEnemies (conteudo, amount, "total")
--amount, total = _detalhes:ContainerSortEnemies (conteudo, amount, "total")
amount, total = _detalhes:ContainerSortEnemies (conteudo, amount, "damage_taken")
--keyName = "enemies"
--> grava o total
instancia.top = conteudo[1][keyName]
@@ -1549,6 +1553,32 @@ function atributo_damage:AtualizaBarra (instancia, barras_container, qual_barra,
elseif (sub_atributo == 6) then --> mostrando enemies
local dtps = self.damage_taken / combat_time
local formated_damage_taken = SelectedToKFunction (_, self.damage_taken)
local formated_dtps = SelectedToKFunction (_, dtps)
esta_barra.ps_text = formated_dtps
if (UsingCustomRightText) then
esta_barra.texto_direita:SetText (_string_replace (instancia.row_info.textR_custom_text, formated_damage_taken, formated_dtps, porcentagem, self, instancia.showing))
else
if (not bars_show_data [1]) then
formated_damage_taken = ""
end
if (not bars_show_data [2]) then
formated_dtps = ""
end
if (not bars_show_data [3]) then
porcentagem = ""
else
porcentagem = porcentagem .. "%"
end
esta_barra.texto_direita:SetText (formated_damage_taken .. bars_brackets[1] .. formated_dtps .. bars_separator .. porcentagem .. bars_brackets[2])
end
esta_porcentagem = _math_floor ((self.damage_taken/instancia.top) * 100)
--[[
dps = _math_floor (dps)
local formated_damage = SelectedToKFunction (_, damage_total)
local formated_dps = SelectedToKFunction (_, dps)
@@ -1573,7 +1603,7 @@ function atributo_damage:AtualizaBarra (instancia, barras_container, qual_barra,
end
esta_porcentagem = _math_floor ((damage_total/instancia.top) * 100)
--]]
end
if (esta_barra.mouse_over and not instancia.baseframe.isMoving) then --> precisa atualizar o tooltip
@@ -2068,49 +2098,15 @@ function atributo_damage:ToolTip_DamageTaken (instancia, numero, barra, keydown)
local meus_agressores = {}
if (instancia.sub_atributo == 6) then
for nome, _ in _pairs (agressores) do --> agressores seria a lista de nomes
local este_agressor = showing._ActorTable [showing._NameIndexTable [nome]]
if (este_agressor) then --> checagem por causa do total e do garbage collector que não limpa os nomes que deram dano
for nome, _ in _pairs (agressores) do --> lista de nomes
local este_agressor = showing._ActorTable [showing._NameIndexTable [nome]]
if (este_agressor) then --> checagem por causa do total e do garbage collector que não limpa os nomes que deram dano
local name = nome
local damage_amount = este_agressor.targets [self.nome]
local name = nome
local damage_amount = este_agressor.targets [self.nome]
if (damage_amount) then
if (este_agressor:IsPlayer()) then
meus_agressores [#meus_agressores+1] = {name, damage_amount, este_agressor.classe}
end
--[[
if (not este_agressor:IsPlayer()) then
name = Loc ["STRING_TARGETS_OTHER1"]
local got
for i, t in _ipairs (meus_agressores) do
if (t[1] == name) then
t[2] = t[2] + damage_amount
got = true
break
end
end
if (not got) then
meus_agressores [#meus_agressores+1] = {name, damage_amount, este_agressor.classe}
end
else
meus_agressores [#meus_agressores+1] = {name, damage_amount, este_agressor.classe}
end
--]]
end
end
end
else
for nome, _ in _pairs (agressores) do --> agressores seria a lista de nomes
local este_agressor = showing._ActorTable [showing._NameIndexTable [nome]]
if (este_agressor) then --> checagem por causa do total e do garbage collector que não limpa os nomes que deram dano
local alvos = este_agressor.targets
local este_alvo = alvos [self.nome]
if (este_alvo) then
meus_agressores [#meus_agressores+1] = {nome, este_alvo, este_agressor.classe}
if (damage_amount) then
if (este_agressor:IsPlayer() or este_agressor:IsNeutralOrEnemy()) then
meus_agressores [#meus_agressores+1] = {name, damage_amount, este_agressor.classe, este_agressor}
end
end
end
@@ -2119,12 +2115,12 @@ function atributo_damage:ToolTip_DamageTaken (instancia, numero, barra, keydown)
_table_sort (meus_agressores, _detalhes.Sort2)
local max = #meus_agressores
if (max > 6) then
max = 6
if (max > 10) then
max = 10
end
local ismaximized = false
if (keydown == "shift" or TooltipMaximizedMethod == 2 or TooltipMaximizedMethod == 3 or instancia.sub_atributo == 6) then
if (keydown == "shift" or TooltipMaximizedMethod == 2 or TooltipMaximizedMethod == 3 or instancia.sub_atributo == 6 or _detalhes.damage_taken_everything) then
max = #meus_agressores
ismaximized = true
end
@@ -2155,23 +2151,64 @@ function atributo_damage:ToolTip_DamageTaken (instancia, numero, barra, keydown)
end
for i = 1, max do
if (ismaximized and meus_agressores[i][1]:find (_detalhes.playername)) then
GameCooltip:AddLine (meus_agressores[i][1]..": ", FormatTooltipNumber (_, meus_agressores[i][2]).." (".._cstr("%.1f", (meus_agressores[i][2]/damage_taken) * 100).."%)", nil, "yellow")
else
GameCooltip:AddLine (meus_agressores[i][1]..": ", FormatTooltipNumber (_, meus_agressores[i][2]).." (".._cstr("%.1f", (meus_agressores[i][2]/damage_taken) * 100).."%)")
end
local classe = meus_agressores[i][3]
local aggressor = meus_agressores[i][4]
if (aggressor:IsNeutralOrEnemy()) then
if (not classe) then
classe = "UNKNOW"
end
local all_spells = {}
if (classe == "UNKNOW") then
GameCooltip:AddIcon ("Interface\\LFGFRAME\\LFGROLE_BW", nil, nil, 14, 14, .25, .5, 0, 1)
for spellid, spell in _pairs (aggressor.spells._ActorTable) do
local on_target = spell.targets [self.nome]
if (on_target) then
tinsert (all_spells, {spellid, on_target, aggressor.nome})
end
end
for _, spell in _ipairs (all_spells) do
local spellname, _, spellicon = _GetSpellInfo (spell [1])
GameCooltip:AddLine (spellname .. " (|cFFFFFF00" .. spell [3] .. "|r): ", FormatTooltipNumber (_, spell [2]).." (" .. _cstr ("%.1f", (spell [2] / damage_taken) * 100).."%)")
GameCooltip:AddIcon (spellicon, 1, 1, 14, 14)
_detalhes:AddTooltipBackgroundStatusbar()
end
else
GameCooltip:AddIcon (instancia.row_info.icon_file, nil, nil, 14, 14, _unpack (_detalhes.class_coords [classe]))
if (ismaximized and meus_agressores[i][1]:find (_detalhes.playername)) then
GameCooltip:AddLine (meus_agressores[i][1]..": ", FormatTooltipNumber (_, meus_agressores[i][2]).." (".._cstr("%.1f", (meus_agressores[i][2]/damage_taken) * 100).."%)", nil, "yellow")
else
GameCooltip:AddLine (meus_agressores[i][1]..": ", FormatTooltipNumber (_, meus_agressores[i][2]).." (".._cstr("%.1f", (meus_agressores[i][2]/damage_taken) * 100).."%)")
end
local classe = meus_agressores[i][3]
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)
else
GameCooltip:AddIcon (instancia.row_info.icon_file, nil, nil, 14, 14, _unpack (_detalhes.class_coords [classe]))
end
_detalhes:AddTooltipBackgroundStatusbar()
end
end
if (instancia.sub_atributo == 6) then
GameCooltip:AddLine (" ")
GameCooltip:AddLine (Loc ["STRING_ATTRIBUTE_DAMAGE_DONE"], FormatTooltipNumber (_, _math_floor (self.total)))
local half = 0.00048828125
GameCooltip:AddIcon (instancia:GetSkinTexture(), 1, 1, 14, 14, 0.005859375 + half, 0.025390625 - half, 0.3623046875, 0.3818359375)
_detalhes:AddTooltipBackgroundStatusbar()
local heal_actor = instancia.showing (2, self.nome)
if (heal_actor) then
GameCooltip:AddLine (Loc ["STRING_ATTRIBUTE_HEAL_DONE"], FormatTooltipNumber (_, _math_floor (heal_actor.heal_enemy_amt)))
else
GameCooltip:AddLine (Loc ["STRING_ATTRIBUTE_HEAL_DONE"], 0)
end
GameCooltip:AddIcon (instancia:GetSkinTexture(), 1, 1, 14, 14, 0.037109375 + half, 0.056640625 - half, 0.3623046875, 0.3818359375)
_detalhes:AddTooltipBackgroundStatusbar()
end
--> enemies
+8
View File
@@ -259,6 +259,14 @@ function _detalhes:GetRow (index)
return self.barras [index]
end
function _detalhes:GetSkin()
return _detalhes.skins [self.skin]
end
function _detalhes:GetSkinTexture()
return _detalhes.skins [self.skin] and _detalhes.skins [self.skin].file
end
------------------------------------------------------------------------------------------------------------------------
--> retorna se a instância esta ou não ativa
+2 -1
View File
@@ -835,12 +835,13 @@ local default_profile = {
--> PvP
only_pvp_frags = false,
--> window size
--> window settings
max_window_size = {width = 480, height = 450},
new_window_size = {width = 320, height = 130},
window_clamp = {-8, 0, 21, -14},
disable_window_groups = false,
disable_reset_button = false,
damage_taken_everything = false,
--> segments
segments_amount = 12,
+14
View File
@@ -200,6 +200,20 @@ function _detalhes:AbreJanelaInfo (jogador, from_att_change)
info.classe_iconePlus:SetTexture()
end
if (jogador.grupo and IsInRaid() and not avatar) then
for i = 1, GetNumGroupMembers() do
local playerName, realmName = UnitName ("raid" .. i)
if (realmName and realmName ~= "") then
playerName = playerName .. "-" .. realmName
end
if (playerName == jogador.nome) then
SetPortraitTexture (info.classe_icone, "raid" .. i)
info.classe_icone:SetTexCoord (0, 1, 0, 1)
break
end
end
end
info:ShowTabs()
gump:Fade (info, 0)
+42 -12
View File
@@ -2201,6 +2201,18 @@ function window:CreateFrame18()
end
window:CreateLineBackground2 (frame18, "DisableResetSlider", "DisableResetLabel", Loc ["STRING_OPTIONS_DISABLE_RESET_DESC"])
--> damage taken always on everything
g:NewLabel (frame18, _, "$parentDamageTakenEverythingLabel", "DamageTakenEverythingLabel", Loc ["STRING_OPTIONS_DTAKEN_EVERYTHING"], "GameFontHighlightLeft")
g:NewSwitch (frame18, _, "$parentDamageTakenEverythingSlider", "DamageTakenEverythingSlider", 60, 20, _, _, _detalhes.damage_taken_everything)
frame18.DamageTakenEverythingSlider:SetPoint ("left", frame18.DamageTakenEverythingLabel, "right", 2)
frame18.DamageTakenEverythingSlider.OnSwitch = function (_, _, value)
_detalhes.damage_taken_everything = value
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
end
window:CreateLineBackground2 (frame18, "DamageTakenEverythingSlider", "DamageTakenEverythingLabel", Loc ["STRING_OPTIONS_DTAKEN_EVERYTHING_DESC"])
--> Use Scroll Bar
g:NewLabel (frame18, _, "$parentUseScrollLabel", "scrollLabel", Loc ["STRING_OPTIONS_SCROLLBAR"], "GameFontHighlightLeft")
@@ -2313,7 +2325,8 @@ function window:CreateFrame18()
{"fontLabel", 4},
{"DisableGroupsLabel", 5, true},
{"DisableResetLabel", 6},
{"scrollLabel", 7},
{"DamageTakenEverythingLabel", 7},
{"scrollLabel", 8, true},
}
@@ -4121,22 +4134,31 @@ function window:CreateFrame2()
g:NewSwitch (frame2, _, "$parentOverallDataAllSlider", "OverallDataAllSlider", 60, 20, _, _, false)
frame2.OverallDataAllSlider:SetPoint ("left", frame2.OverallDataAllLabel, "right", 2, 0)
--
function frame2:OverallSliderEnabled()
frame2.OverallDataRaidBossSlider:Disable()
frame2.OverallDataRaidCleaupSlider:Disable()
frame2.OverallDataDungeonBossSlider:Disable()
frame2.OverallDataDungeonCleaupSlider:Disable()
end
function frame2:OverallSliderDisabled()
frame2.OverallDataRaidBossSlider:Enable()
frame2.OverallDataRaidCleaupSlider:Enable()
frame2.OverallDataDungeonBossSlider:Enable()
frame2.OverallDataDungeonCleaupSlider:Enable()
end
frame2.OverallDataAllSlider.OnSwitch = function (self, _, value)
if (value and bit.band (_detalhes.overall_flag, 0x10) == 0) then
_detalhes.overall_flag = _detalhes.overall_flag + 0x10
frame2.OverallDataRaidBossSlider:Disable()
frame2.OverallDataRaidCleaupSlider:Disable()
frame2.OverallDataDungeonBossSlider:Disable()
frame2.OverallDataDungeonCleaupSlider:Disable()
frame2:OverallSliderEnabled()
elseif (not value and bit.band (_detalhes.overall_flag, 0x10) ~= 0) then
_detalhes.overall_flag = _detalhes.overall_flag - 0x10
frame2.OverallDataRaidBossSlider:Enable()
frame2.OverallDataRaidCleaupSlider:Enable()
frame2.OverallDataDungeonBossSlider:Enable()
frame2.OverallDataDungeonCleaupSlider:Enable()
frame2:OverallSliderDisabled()
end
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
@@ -9917,7 +9939,14 @@ end --> if not window
_G.DetailsOptionsWindow2OverallDataRaidCleaupSlider.MyObject:SetValue (bit.band (_detalhes.overall_flag, 0x2) ~= 0)
_G.DetailsOptionsWindow2OverallDataDungeonBossSlider.MyObject:SetValue (bit.band (_detalhes.overall_flag, 0x4) ~= 0)
_G.DetailsOptionsWindow2OverallDataDungeonCleaupSlider.MyObject:SetValue (bit.band (_detalhes.overall_flag, 0x8) ~= 0)
_G.DetailsOptionsWindow2OverallDataAllSlider.MyObject:SetValue (bit.band (_detalhes.overall_flag, 0x10) ~= 0)
local overall_state = bit.band (_detalhes.overall_flag, 0x10) ~= 0
_G.DetailsOptionsWindow2OverallDataAllSlider.MyObject:SetValue (overall_state)
if (overall_state) then
_G.DetailsOptionsWindow2:OverallSliderEnabled()
else
_G.DetailsOptionsWindow2:OverallSliderDisabled()
end
_G.DetailsOptionsWindow2OverallNewBossSlider.MyObject:SetValue (_detalhes.overall_clear_newboss)
_G.DetailsOptionsWindow2OverallNewChallengeSlider.MyObject:SetValue (_detalhes.overall_clear_newchallenge)
@@ -10187,6 +10216,7 @@ end --> if not window
--disable reset
_G.DetailsOptionsWindow18DisableResetSlider.MyObject:SetValue (_detalhes.disable_reset_button)
_G.DetailsOptionsWindow18UseScrollSlider.MyObject:SetValue (_detalhes.use_scroll)
_G.DetailsOptionsWindow18DamageTakenEverythingSlider.MyObject:SetValue (_detalhes.damage_taken_everything)
--auto switch
local switch_tank_in_combat = editing_instance.switch_tank_in_combat