- Implemented a sync for encounter with phases.

- Shout button on custom panel is now working.
- New API function GetAllActors (combat, actorname) return all the 4 types.
- New API widget _detalhes:Ask (askWhat, callback, ...)
- Added some information for know bugs.
This commit is contained in:
Tercio
2013-08-15 23:26:31 -03:00
parent 04dfb1c73f
commit 34c53c1a2c
12 changed files with 300 additions and 26 deletions
+132 -14
View File
@@ -220,19 +220,31 @@
end
end
_detalhes.tabela_vigente.enemy = inimigo
else
_detalhes.tabela_vigente.enemy = _detalhes.tabela_vigente.is_boss.encounter
_detalhes:CaptureSet (false, "damage", false, 30)
_detalhes:CaptureSet (false, "heal", false, 30)
if (_detalhes.debug) then
print ("Details found a boss on last fight, freezing parser for 30 seconds.")
_detalhes:EqualizeActors()
end
local bossFunction, bossFunctionType = _detalhes:GetBossFunction (_detalhes.tabela_vigente.is_boss.mapid, _detalhes.tabela_vigente.is_boss.index)
if (bossFunction) then
if (_bit_band (bossFunctionType, 0x2) ~= 0) then --end of combat
bossFunction()
else
if (_detalhes:GetBossDetails (_detalhes.tabela_vigente.is_boss.mapid, _detalhes.tabela_vigente.is_boss.index)) then
_detalhes.tabela_vigente.enemy = _detalhes.tabela_vigente.is_boss.encounter
_detalhes:CaptureSet (false, "damage", false, 30)
_detalhes:CaptureSet (false, "heal", false, 30)
if (_detalhes.debug) then
print ("Details found a boss on last fight, freezing parser for 30 seconds.")
end
local bossFunction, bossFunctionType = _detalhes:GetBossFunction (_detalhes.tabela_vigente.is_boss.mapid, _detalhes.tabela_vigente.is_boss.index)
if (bossFunction) then
if (_bit_band (bossFunctionType, 0x2) ~= 0) then --end of combat
bossFunction()
end
end
_detalhes:EqualizeActors()
else
if (_detalhes.debug) then
_detalhes:EqualizeActors()
end
end
end
@@ -256,14 +268,15 @@
_detalhes.tabela_vigente:seta_tempo_decorrido() --> salva o end_time
_detalhes.tabela_overall:seta_tempo_decorrido() --seta o end_time
local tempo_do_combate = _detalhes.tabela_vigente.end_time - _detalhes.tabela_vigente.start_time
if (_detalhes.solo) then
--> debuffs need a checkup, not well functional right now
_detalhes.CloseSoloDebuffs()
end
if ( tempo_do_combate >= _detalhes.minimum_combat_time) then --> tempo minimo precisa ser 5 segundos pra acrecentar a tabela ao historico
local tempo_do_combate = _detalhes.tabela_vigente.end_time - _detalhes.tabela_vigente.start_time
--if ( tempo_do_combate >= _detalhes.minimum_combat_time) then --> tempo minimo precisa ser 5 segundos pra acrecentar a tabela ao historico
if ( tempo_do_combate >= 10) then --> tempo minimo precisa ser 5 segundos pra acrecentar a tabela ao historico
_detalhes.tabela_historico:adicionar (_detalhes.tabela_vigente) --move a tabela atual para dentro do histórico
else
--> this is a little bit complicated, need a specific function for combat cancellation
@@ -282,6 +295,13 @@
_detalhes.tabela_vigente = _detalhes.combate:NovaTabela (false, _detalhes.tabela_overall) --cria uma nova tabela de combate caso não tenha nenhuma no historico
end
if (_detalhes.tabela_vigente.start_time == 0) then
_detalhes.tabela_vigente.start_time = _detalhes._tempo
_detalhes.tabela_vigente.end_time = _detalhes._tempo
end
_detalhes.tabela_vigente.resincked = true
--> tabela foi descartada, precisa atualizar os baseframes // precisa atualizer todos ou apenas o overall?
_detalhes:InstanciaCallFunction (_detalhes.AtualizarJanela)
@@ -311,6 +331,104 @@
_detalhes:SendEvent ("COMBAT_PLAYER_LEAVE", nil, _detalhes.tabela_vigente)
end
function _detalhes:MakeEqualizeOnActor (player, realm, receivedActor)
local damage, heal, energy, misc = _detalhes:GetAllActors ("current", player)
if (not damage and not heal) then
--> add server name
damage, heal, energy, misc = _detalhes:GetAllActors ("current", player.."-"..realm)
end
local combat = _detalhes:GetCombat ("current")
combat[1].need_refresh = true
combat[2].need_refresh = true
combat[3].need_refresh = true
combat[4].need_refresh = true
if (damage) then
if (damage.total < receivedActor [1][1]) then
damage.total = receivedActor [1][1]
end
if (damage.damage_taken < receivedActor [1][2]) then
damage.damage_taken = receivedActor [1][2]
end
if (damage.friendlyfire_total < receivedActor [1][3]) then
damage.friendlyfire_total = receivedActor [1][3]
end
end
if (heal) then
if (heal.total < receivedActor [2][1]) then
heal.total = receivedActor [2][1]
end
if (heal.totalover < receivedActor [2][2]) then
heal.totalover = receivedActor [2][2]
end
if (heal.healing_taken < receivedActor [2][3]) then
heal.healing_taken = receivedActor [2][3]
end
end
if (energy) then
if (energy.mana and (receivedActor [3][1] > 0 and energy.mana < receivedActor [3][1])) then
energy.mana = receivedActor [3][1]
end
if (energy.e_rage and (receivedActor [3][2] > 0 and energy.e_rage < receivedActor [3][2])) then
energy.e_rage = receivedActor [3][2]
end
if (energy.e_energy and (receivedActor [3][3] > 0 and energy.e_energy < receivedActor [3][3])) then
energy.e_energy = receivedActor [3][3]
end
if (energy.runepower and (receivedActor [3][4] > 0 and energy.runepower < receivedActor [3][4])) then
energy.runepower = receivedActor [3][4]
end
end
if (misc) then
if (misc.interrupt and (receivedActor [4][1] > 0 and misc.interrupt < receivedActor [4][1])) then
misc.interrupt = receivedActor [4][1]
end
if (misc.dispell and (receivedActor [4][2] > 0 and misc.dispell < receivedActor [4][2])) then
misc.dispell = receivedActor [4][2]
end
end
end
function _detalhes:EqualizeActors()
local damage, heal, energy, misc = _detalhes:GetAllActors ("current", UnitName ("player"))
if (damage) then
damage = {damage.total, damage.damage_taken, damage.friendlyfire_total}
else
damage = {0, 0, 0}
end
if (heal) then
heal = {heal.total, heal.totalover, heal.healing_taken}
else
heal = {0, 0, 0}
end
if (energy) then
energy = {energy.mana or 0, energy.e_rage or 0, energy.e_energy or 0, energy.runepower or 0}
else
energy = {0, 0, 0, 0}
end
if (misc) then
misc = {misc.interrupt or 0, misc.dispell or 0}
else
misc = {0, 0}
end
local data = {damage, heal, energy, misc}
_detalhes:SendRaidData ("equalize_actors", data)
end
function _detalhes:FlagActorsOnBossFight()
for class_type, container in _ipairs (_detalhes.tabela_vigente) do
for _, actor in _ipairs (container._ActorTable) do
+2
View File
@@ -141,6 +141,8 @@
if (#tabelas_de_combate > 0) then
for index, combate in _ipairs (tabelas_de_combate) do
combate.hasSaved = true
if (combate.end_time and combate.start_time) then
tabela_overall.start_time = tabela_overall.start_time - (combate.end_time - combate.start_time)
end
+47
View File
@@ -0,0 +1,47 @@
--File Revision: 1
--Last Modification: 27/07/2013
-- Change Log:
-- 27/07/2013: Finished alpha version.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
local _detalhes = _G._detalhes
local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> local pointers
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> api
function _detalhes:RaidComm (_, data, _, source)
local type = select (2, _detalhes:Deserialize (data))
if (_detalhes.debug) then
print ("comm received", type)
end
if (type == "custom_broadcast") then
_detalhes:OnReceiveCustom (select (3, _detalhes:Deserialize (data)))
elseif (type == "equalize_actors") then
if (not _detalhes.in_combat) then
local player, realm, dversion, receivedActor = select (3, _detalhes:Deserialize (data))
if (dversion ~= _detalhes.realversion) then
return
end
_detalhes:MakeEqualizeOnActor (player, realm, receivedActor)
end
end
end
_detalhes:RegisterComm ("details_comm", "RaidComm")
function _detalhes:SendRaidData (type, ...)
_detalhes:SendCommMessage ("details_comm", _detalhes:Serialize (type, UnitName ("player"), GetRealmName(), _detalhes.realversion, ...), "RAID")
end
+38 -1
View File
@@ -192,6 +192,39 @@
--> record death log
local t = jogador_alvo.last_events_table
local i = t.n
if (not i) then
local isOriginal = jogador_alvo.last_events_table.original
if (isOriginal) then
isOriginal = "IsOriginal = TRUE"
else
isOriginal = "IsOriginal = FALSE"
end
local indexes = #jogador_alvo.last_events_table
if (not indexes) then
indexes = "Indexes = NIL"
else
indexes = "Indexes = "..indexes
end
local resync = _detalhes.tabela_vigente.resincked
if (resync) then
resync = "resync = TRUE"
else
resync = "resync = FALSE"
end
local saved = _detalhes.tabela_vigente.hasSaved
if (saved) then
saved = "saved = TRUE"
else
saved = "saved = FALSE"
end
print ("Report the lines shown, click on reset button and type /reload")
print ("We are investigation this issue, this information is important to us.")
assert (false, "Please Report This Error on the Blue Button: Parser 194: " .. isOriginal .. " " .. indexes .. " " .. resync .. " " .. saved)
end
t.n = i + 1
t = t [i]
@@ -605,7 +638,7 @@
-----------------------------------------------------------------------------------------------------------------------------------------
--> BUFFS & DEBUFFS serach key: ~buff |
--> BUFFS & DEBUFFS serach key: ~buff ~aura ~shield |
-----------------------------------------------------------------------------------------------------------------------------------------
function parser:buff (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, _, tipo, amount)
@@ -1953,6 +1986,10 @@
return nil
end
function _detalhes:GetAllActors (_combat, _actorname)
return _detalhes:GetActor (_combat, 1, _actorname), _detalhes:GetActor (_combat, 2, _actorname), _detalhes:GetActor (_combat, 3, _actorname), _detalhes:GetActor (_combat, 4, _actorname)
end
--> get an actor
function _detalhes:GetActor (_combat, _attribute, _actorname)