Added support for Combat Log Event Recording (in game)

Further versions will support ingame time line analysis using the combat log event records, at the moment it is available for early adopters.
To enable, edit the line '_is_storing_cleu' to true in Parser.lua.

Also on this version: added early implementation of damage chart in the Player Detail Breakdown window, it is disabled by default for users.
This commit is contained in:
Tercioo
2019-04-16 13:20:28 -03:00
parent d18fa8c138
commit be966f7436
6 changed files with 196 additions and 30 deletions
+45 -6
View File
File diff suppressed because one or more lines are too long
+6
View File
@@ -378,6 +378,7 @@
--> start/end time (duration)
esta_tabela.data_fim = 0
esta_tabela.data_inicio = 0
esta_tabela.tempo_start = _tempo
--> record deaths
esta_tabela.last_events_tables = {}
@@ -404,6 +405,11 @@
esta_tabela.aura_timeline = {}
esta_tabela.cleu_timeline = {}
--> cleu events
esta_tabela.cleu_events = {
n = 1 --event counter
}
--> Skill cache (not used)
esta_tabela.CombatSkillCache = {}
+111 -21
View File
@@ -4709,30 +4709,37 @@ function atributo_damage:MontaDetalhesDamageDone (spellid, barra, instancia)
end
--> multistrike
if (esta_magia.m_amt > 0) then
local normal_hits = esta_magia.m_amt
local normal_dmg = esta_magia.m_dmg
--[=[
if (esta_magia.m_amt > 0) then
local media_normal = normal_dmg/normal_hits
local T = (meu_tempo*normal_dmg)/esta_magia.total
local P = media/media_normal*100
T = P*T/100
data[#data+1] = t4
multistrike_table.p = esta_magia.m_amt/total_hits*100
local normal_hits = esta_magia.m_amt
local normal_dmg = esta_magia.m_dmg
local media_normal = normal_dmg/normal_hits
local T = (meu_tempo*normal_dmg)/esta_magia.total
local P = media/media_normal*100
T = P*T/100
data[#data+1] = t4
multistrike_table.p = esta_magia.m_amt/total_hits*100
t4[1] = esta_magia.m_amt
t4[2] = multistrike_table
t4[3] = Loc ["STRING_MULTISTRIKE_HITS"]
t4[4] = "On Critical: " .. esta_magia.m_crit
t4[5] = "On Normals: " .. (esta_magia.m_amt - esta_magia.m_crit)
t4[6] = Loc ["STRING_AVERAGE"] .. ": " .. _detalhes:comma_value (esta_magia.m_dmg/esta_magia.m_amt)
t4[7] = Loc ["STRING_DPS"] .. ": " .. _detalhes:comma_value (esta_magia.m_dmg/T)
t4[8] = esta_magia.m_amt .. " / " .. _cstr ("%.1f", esta_magia.m_amt/total_hits*100) .. "%"
t4[1] = esta_magia.m_amt
t4[2] = multistrike_table
t4[3] = Loc ["STRING_MULTISTRIKE_HITS"]
t4[4] = "On Critical: " .. esta_magia.m_crit
t4[5] = "On Normals: " .. (esta_magia.m_amt - esta_magia.m_crit)
t4[6] = Loc ["STRING_AVERAGE"] .. ": " .. _detalhes:comma_value (esta_magia.m_dmg/esta_magia.m_amt)
t4[7] = Loc ["STRING_DPS"] .. ": " .. _detalhes:comma_value (esta_magia.m_dmg/T)
t4[8] = esta_magia.m_amt .. " / " .. _cstr ("%.1f", esta_magia.m_amt/total_hits*100) .. "%"
end
end
--]=]
--_detalhes:BuildPlayerDetailsSpellChart()
--DetailsPlayerDetailSmallChart.ShowChart (_detalhes.janela_info.grupos_detalhes [5].bg, info.instancia.showing, info.instancia.showing.cleu_events, self.nome, false, spellid, 1, 2, 3, 4, 5, 6, 7, 8, 15)
--> spell damage chart
--events: 1 2 3 4 5 6 7 8 15
_table_sort (data, _detalhes.Sort1)
@@ -4747,6 +4754,89 @@ function atributo_damage:MontaDetalhesDamageDone (spellid, barra, instancia)
end
function _detalhes:BuildPlayerDetailsSpellChart()
local playerDetailSmallChart = DetailsPlayerDetailSmallChart
if (not playerDetailSmallChart) then
playerDetailSmallChart = CreateFrame ("frame", "DetailsPlayerDetailSmallChart", info)
DetailsFramework:ApplyStandardBackdrop (playerDetailSmallChart)
playerDetailSmallChart.Lines = {}
for i = 1, 200 do
local texture = playerDetailSmallChart:CreateTexture (nil, "artwork")
texture:SetColorTexture (1, 1, 1, 1)
tinsert (playerDetailSmallChart.Lines, texture)
end
--_detalhes.janela_info.grupos_detalhes [index]
function playerDetailSmallChart.ShowChart (parent, combatObject, cleuData, playerName, targetName, spellId, ...)
local tokenIdList = {}
local eventList = {}
--build the list of tokens
for i = 1, select ("#", ... ) do
local tokenId = select (i, ...)
tokenIdList [tokenId] = true
end
--check which lines can be added
local index = 1
local peakValue = 0
for i = 1, cleuData.n -1 do
local event = cleuData [i]
if (event [2]) then --index 2 = token
local playerNameFilter = playerName and playerName == event [3]
local targetNameFilter = targetName and targetName == event [4]
local spellIdFilter = spellId and spellId == event [5]
if (playerNameFilter or targetNameFilter or spellIdFilter) then
eventList [index] = cleuData [i]
if (peakValue < cleuData [i] [6]) then
peakValue = cleuData [i] [6]
end
index = index + 1
end
end
end
--200 lines, adjust the mini chart
playerDetailSmallChart:SetPoint ("topleft", parent, "topleft")
playerDetailSmallChart:SetPoint ("bottomright", parent, "bottomright")
--update lines
local width = playerDetailSmallChart:GetWidth()
local combatTime = combatObject:GetCombatTime()
local secondsPerBar = combatTime / 200
local barWidth = width / 200
local barHeight = playerDetailSmallChart:GetHeight()
local currentTime = eventList [1][1]
local currentIndex = 1
local eventAmount = #eventList
for i = 1, #playerDetailSmallChart.Lines do
playerDetailSmallChart.Lines [i]:SetWidth (width / 200)
playerDetailSmallChart.Lines [i]:SetHeight (1)
for o = currentIndex, eventAmount do
if (eventList [o][1] <= currentTime + secondsPerBar or eventList [o][1] >= currentTime) then
playerDetailSmallChart.Lines [i]:SetPoint ("bottomleft", playerDetailSmallChart, "bottomleft", barWidth * (i - 1), 0)
playerDetailSmallChart.Lines [i]:SetWidth (barWidth)
playerDetailSmallChart.Lines [i]:SetHeight (eventList [o][6] / peakValue * barHeight)
else
currentIndex = o
break
end
end
currentTime = currentTime + secondsPerBar
end
end
end
end
function atributo_damage:MontaTooltipDamageTaken (esta_barra, index)
local aggressor = info.instancia.showing [1]:PegarCombatente (_, esta_barra.nome_inimigo)
+19 -2
View File
@@ -62,6 +62,8 @@
--> current combat and overall pointers
local _current_combat = _detalhes.tabela_vigente or {} --> placeholder table
local _current_combat_cleu_events = {n = 1} --> placeholder
--> total container pointers
local _current_total = _current_combat.totals
local _current_gtotal = _current_combat.totals_grupo
@@ -109,6 +111,8 @@
local container_misc = _detalhes.container_type.CONTAINER_MISC_CLASS
local duel_candidates = _detalhes.duel_candidates
local _token_ids = _detalhes.TokenID
local OBJECT_TYPE_ENEMY = 0x00000040
local OBJECT_TYPE_PLAYER = 0x00000400
local OBJECT_TYPE_PETS = 0x00003000
@@ -142,6 +146,7 @@
[201363] = 218617, --warrior rampage
[85384] = 96103, --warrior raging blow
[85288] = 96103, --warrior raging blow
[280849] = 5308, --warrior execute
[163558] = 5308, --warrior execute
[217955] = 5308, --warrior execute
[217956] = 5308, --warrior execute
@@ -237,6 +242,7 @@
--> in combat flag
local _in_combat = false
local _current_encounter_id
local _is_storing_cleu = false
--> deathlog
local _death_event_amt = 16
@@ -923,6 +929,11 @@
end
end
if (_is_storing_cleu) then
_current_combat_cleu_events [_current_combat_cleu_events.n] = {_tempo, _token_ids [token] or 0, who_name, alvo_name or "", spellid, amount}
_current_combat_cleu_events.n = _current_combat_cleu_events.n + 1
end
return spell_damage_func (spell, alvo_serial, alvo_name, alvo_flags, amount, who_name, resisted, blocked, absorbed, critical, glacing, token, isoffhand)
end
@@ -1788,6 +1799,11 @@
end
end
if (_is_storing_cleu) then
_current_combat_cleu_events [_current_combat_cleu_events.n] = {_tempo, _token_ids [token] or 0, who_name, alvo_name or "", spellid, amount}
_current_combat_cleu_events.n = _current_combat_cleu_events.n + 1
end
if (is_shield) then
--return spell:Add (alvo_serial, alvo_name, alvo_flags, cura_efetiva, who_name, 0, nil, overhealing, true)
return spell_heal_func (spell, alvo_serial, alvo_name, alvo_flags, cura_efetiva, who_name, 0, nil, overhealing, true)
@@ -5139,14 +5155,15 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
--serach key: ~cache
function _detalhes:UpdateParserGears()
--> refresh combat tables
_current_combat = _detalhes.tabela_vigente
_current_combat_cleu_events = _current_combat and _current_combat.cleu_events
--> last events pointer
last_events_cache = _current_combat.player_last_events
_death_event_amt = _detalhes.deadlog_events
--> refresh total containers
_current_total = _current_combat.totals
_current_gtotal = _current_combat.totals_grupo
+1 -1
View File
@@ -6,7 +6,7 @@ do
--> data for Crucible of Storms (BFA tier 1)
local INSTANCE_EJID = 1177
local INSTANCE_MAPID = 0 --TBD
local INSTANCE_MAPID = 2096
local HDIMAGESPATH = "Details\\images\\raid"
local HDFILEPREFIX = "CrucibleRaid"
local LOADINGSCREEN_FILE, LOADINGSCREEN_COORDS = "LoadingScreen_Seapriestraid_wide_BattleforAzeroth", {0, 1, 285/1024, 875/1024}
+14
View File
@@ -1083,6 +1083,20 @@ function _G._detalhes:Start()
--nothing
elseif (event == "COMBAT_MYTHICDUNGEON_START") then
local lower_instance = _detalhes:GetLowerInstanceNumber()
if (lower_instance) then
lower_instance = _detalhes:GetInstance (lower_instance)
if (lower_instance) then
C_Timer.After (3, function()
if (lower_instance:IsEnabled()) then
--todo, need localization
lower_instance:InstanceAlert ("Details!" .. " " .. "Damage" .. " " .. "Meter", {[[Interface\AddOns\Details\images\minimap]], 16, 16, false}, 3, {function() end}, false, true)
end
end)
end
end
--> ignore the event if ignoring mythic dungeon special treatment
if (_detalhes.streamer_config.disable_mythic_dungeon) then
return