1.15.0 Test Version
- Implemented a early support for Dungeons: the addon is now capable of distinguishing dungeon boss and trash mobs. not all bosses are implemented yet, atm is: *Mogu'Shan Palace *Temple of the Jade Serpent *Stormstout Brewery - Implemented Overall Data: Options for it are under combat tab. - Implemented spell targets on Player Details Window. Also, fixed lots of small issues like showing damage done where clicking on a Dps bar.
This commit is contained in:
+160
-37
@@ -1,3 +1,5 @@
|
||||
local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
|
||||
|
||||
--lua api
|
||||
local _table_remove = table.remove
|
||||
local _table_insert = table.insert
|
||||
@@ -19,6 +21,29 @@ function historico:NovoHistorico()
|
||||
return esta_tabela
|
||||
end
|
||||
|
||||
function historico:adicionar_overall (tabela)
|
||||
if (_detalhes.overall_clear_newboss) then
|
||||
if (tabela.instance_type == "raid" and tabela.is_boss) then
|
||||
if (_detalhes.last_encounter ~= _detalhes.last_encounter2) then
|
||||
for index, combat in ipairs (_detalhes.tabela_historico.tabelas) do
|
||||
combat.overall_added = false
|
||||
end
|
||||
historico:resetar_overall()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
_detalhes.tabela_overall = _detalhes.tabela_overall + tabela
|
||||
tabela.overall_added = true
|
||||
|
||||
if (_detalhes.tabela_overall.start_time == 0) then
|
||||
_detalhes.tabela_overall.start_time = tabela.start_time
|
||||
_detalhes.tabela_overall.end_time = tabela.end_time
|
||||
end
|
||||
|
||||
_detalhes:ClockPluginTickOnSegment()
|
||||
end
|
||||
|
||||
--> sai do combate, chamou adicionar a tabela ao histórico
|
||||
function historico:adicionar (tabela)
|
||||
|
||||
@@ -37,12 +62,60 @@ function historico:adicionar (tabela)
|
||||
--> adiciona no index #1
|
||||
_table_insert (self.tabelas, 1, tabela)
|
||||
|
||||
local overall_added = false
|
||||
|
||||
if (not overall_added and bit.band (_detalhes.overall_flag, 0x1) ~= 0) then --> raid boss - flag 0x1
|
||||
if (tabela.is_boss and tabela.instance_type == "raid" and not tabela.is_pvp) then
|
||||
overall_added = true
|
||||
end
|
||||
--print ("0x1")
|
||||
end
|
||||
|
||||
if (not overall_added and bit.band (_detalhes.overall_flag, 0x2) ~= 0) then --> raid trash - flag 0x2
|
||||
if (tabela.is_trash and tabela.instance_type == "raid") then --check if the player is in a raid
|
||||
overall_added = true
|
||||
end
|
||||
--print ("0x2")
|
||||
end
|
||||
|
||||
if (not overall_added and bit.band (_detalhes.overall_flag, 0x4) ~= 0) then --> dungeon boss - flag 0x4
|
||||
if (tabela.is_boss and tabela.instance_type == "party" and not tabela.is_pvp) then --check if this is a dungeon boss
|
||||
overall_added = true
|
||||
end
|
||||
--print ("0x4")
|
||||
end
|
||||
|
||||
if (not overall_added and bit.band (_detalhes.overall_flag, 0x8) ~= 0) then --> dungeon trash - flag 0x8
|
||||
if (tabela.is_trash and tabela.instance_type == "party") then --check if the player is in a raid
|
||||
overall_added = true
|
||||
end
|
||||
--print ("0x8")
|
||||
end
|
||||
|
||||
if (not overall_added and bit.band (_detalhes.overall_flag, 0x10) ~= 0) then --> any combat
|
||||
overall_added = true
|
||||
--print ("0x10")
|
||||
end
|
||||
|
||||
if (overall_added) then
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg ("(debug) overall data flag match with the current combat.")
|
||||
end
|
||||
if (InCombatLockdown()) then
|
||||
_detalhes.schedule_add_to_overall = true
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg ("(debug) player is in combat, scheduling overall addition.")
|
||||
end
|
||||
else
|
||||
historico:adicionar_overall (tabela)
|
||||
end
|
||||
end
|
||||
|
||||
if (self.tabelas[2]) then
|
||||
|
||||
--> fazer limpeza na tabela
|
||||
|
||||
local _segundo_combate = self.tabelas[2]
|
||||
local _terceiro_combate = self.tabelas[3]
|
||||
|
||||
local container_damage = _segundo_combate [1]
|
||||
local container_heal = _segundo_combate [2]
|
||||
@@ -65,9 +138,16 @@ function historico:adicionar (tabela)
|
||||
end
|
||||
|
||||
if (_detalhes.trash_auto_remove) then
|
||||
|
||||
local _terceiro_combate = self.tabelas[3]
|
||||
|
||||
if (_terceiro_combate) then
|
||||
|
||||
if (_terceiro_combate.is_trash and not _terceiro_combate.is_boss) then
|
||||
_detalhes.tabela_overall = _detalhes.tabela_overall - _terceiro_combate
|
||||
--if (_terceiro_combate.overall_added) then
|
||||
-- _detalhes.tabela_overall = _detalhes.tabela_overall - _terceiro_combate
|
||||
-- print ("removendo combate 1")
|
||||
--end
|
||||
--> verificar novamente a time machine
|
||||
for _, jogador in ipairs (_terceiro_combate [1]._ActorTable) do --> damage
|
||||
if (jogador.timeMachine) then
|
||||
@@ -83,53 +163,23 @@ function historico:adicionar (tabela)
|
||||
_table_remove (self.tabelas, 3)
|
||||
_detalhes:SendEvent ("DETAILS_DATA_SEGMENTREMOVED", nil, nil)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
elseif (_detalhes.trash_concatenate) then
|
||||
|
||||
if (_terceiro_combate) then
|
||||
if (_terceiro_combate.is_trash and _segundo_combate.is_trash and not _terceiro_combate.is_boss and not _segundo_combate.is_boss) then
|
||||
--> tabela 2 deve ser deletada e somada a tabela 1
|
||||
if (_detalhes.debug) then
|
||||
detalhes:Msg ("(debug) concatenating two trash segments.")
|
||||
end
|
||||
|
||||
_segundo_combate = _segundo_combate + _terceiro_combate
|
||||
_detalhes.tabela_overall = _detalhes.tabela_overall - _terceiro_combate
|
||||
|
||||
_segundo_combate.is_trash = true
|
||||
|
||||
--> verificar novamente a time machine
|
||||
for _, jogador in ipairs (_terceiro_combate [1]._ActorTable) do --> damage
|
||||
if (jogador.timeMachine) then
|
||||
jogador:DesregistrarNaTimeMachine()
|
||||
end
|
||||
end
|
||||
for _, jogador in ipairs (_terceiro_combate [2]._ActorTable) do --> heal
|
||||
if (jogador.timeMachine) then
|
||||
jogador:DesregistrarNaTimeMachine()
|
||||
end
|
||||
end
|
||||
--> remover
|
||||
_table_remove (self.tabelas, 3)
|
||||
_detalhes:SendEvent ("DETAILS_DATA_SEGMENTREMOVED", nil, nil)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--> chama a função que irá atualizar as instâncias com segmentos no histórico
|
||||
_detalhes:InstanciaCallFunction (_detalhes.AtualizaSegmentos_AfterCombat, self)
|
||||
|
||||
--> verifica se precisa apagar a última tabela do histórico
|
||||
if (#self.tabelas > _detalhes.segments_amount) then
|
||||
|
||||
local combat_removed = self.tabelas [#self.tabelas]
|
||||
|
||||
--> diminuir quantidades no overall
|
||||
_detalhes.tabela_overall = _detalhes.tabela_overall - combat_removed
|
||||
--_detalhes.tabela_overall.start_time = _detalhes.tabela_overall.start_time + (combat_removed.end_time-combat_removed.start_time)
|
||||
--if (combat_removed.overall_added) then
|
||||
-- _detalhes.tabela_overall = _detalhes.tabela_overall - combat_removed
|
||||
-- print ("removendo combate 2")
|
||||
--end
|
||||
|
||||
--> verificar novamente a time machine
|
||||
for _, jogador in ipairs (combat_removed [1]._ActorTable) do --> damage
|
||||
@@ -149,6 +199,9 @@ function historico:adicionar (tabela)
|
||||
|
||||
end
|
||||
|
||||
--> chama a função que irá atualizar as instâncias com segmentos no histórico
|
||||
_detalhes:InstanciaCallFunction (_detalhes.AtualizaSegmentos_AfterCombat, self)
|
||||
|
||||
_detalhes:InstanciaCallFunction (_detalhes.AtualizarJanela)
|
||||
end
|
||||
|
||||
@@ -162,6 +215,39 @@ function _detalhes:CheckFreeze (instancia, index_liberado, tabela)
|
||||
end
|
||||
end
|
||||
|
||||
function _detalhes:OverallOptions (reset_new_boss, reset_new_challenge)
|
||||
if (reset_new_boss == nil) then
|
||||
reset_new_boss = _detalhes.overall_clear_newboss
|
||||
end
|
||||
if (reset_new_challenge == nil) then
|
||||
reset_new_challenge = _detalhes.overall_clear_newchallenge
|
||||
end
|
||||
|
||||
_detalhes.overall_clear_newboss = reset_new_boss
|
||||
_detalhes.overall_clear_newchallenge = reset_new_challenge
|
||||
end
|
||||
|
||||
function historico:resetar_overall()
|
||||
if (InCombatLockdown()) then
|
||||
_detalhes:Msg (Loc ["STRING_ERASE_IN_COMBAT"])
|
||||
_detalhes.schedule_remove_overall = true
|
||||
else
|
||||
--> fecha a janela de informações do jogador
|
||||
_detalhes:FechaJanelaInfo()
|
||||
|
||||
_detalhes.tabela_overall = combate:NovaTabela()
|
||||
|
||||
for index, instancia in ipairs (_detalhes.tabela_instancias) do
|
||||
if (instancia.ativa and instancia.segmento == -1) then
|
||||
instancia:InstanceReset()
|
||||
instancia:ReajustaGump()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
_detalhes:ClockPluginTickOnSegment()
|
||||
end
|
||||
|
||||
function historico:resetar()
|
||||
|
||||
if (_detalhes.bosswindow) then
|
||||
@@ -228,3 +314,40 @@ function _detalhes.refresh:r_historico (este_historico)
|
||||
_setmetatable (este_historico, historico)
|
||||
--este_historico.__index = historico
|
||||
end
|
||||
|
||||
--[[
|
||||
elseif (_detalhes.trash_concatenate) then
|
||||
|
||||
if (true) then
|
||||
return
|
||||
end
|
||||
|
||||
if (_terceiro_combate) then
|
||||
if (_terceiro_combate.is_trash and _segundo_combate.is_trash and not _terceiro_combate.is_boss and not _segundo_combate.is_boss) then
|
||||
--> tabela 2 deve ser deletada e somada a tabela 1
|
||||
if (_detalhes.debug) then
|
||||
detalhes:Msg ("(debug) concatenating two trash segments.")
|
||||
end
|
||||
|
||||
_segundo_combate = _segundo_combate + _terceiro_combate
|
||||
_detalhes.tabela_overall = _detalhes.tabela_overall - _terceiro_combate
|
||||
|
||||
_segundo_combate.is_trash = true
|
||||
|
||||
--> verificar novamente a time machine
|
||||
for _, jogador in ipairs (_terceiro_combate [1]._ActorTable) do --> damage
|
||||
if (jogador.timeMachine) then
|
||||
jogador:DesregistrarNaTimeMachine()
|
||||
end
|
||||
end
|
||||
for _, jogador in ipairs (_terceiro_combate [2]._ActorTable) do --> heal
|
||||
if (jogador.timeMachine) then
|
||||
jogador:DesregistrarNaTimeMachine()
|
||||
end
|
||||
end
|
||||
--> remover
|
||||
_table_remove (self.tabelas, 3)
|
||||
_detalhes:SendEvent ("DETAILS_DATA_SEGMENTREMOVED", nil, nil)
|
||||
end
|
||||
end
|
||||
--]]
|
||||
Reference in New Issue
Block a user