- Improvements on Encounter Details plugin.

This commit is contained in:
Tercio
2015-02-17 17:33:39 -02:00
parent e8027b6f22
commit 4619612c1c
30 changed files with 739 additions and 291 deletions
+7 -17
View File
File diff suppressed because one or more lines are too long
+1
View File
@@ -227,6 +227,7 @@
--> time data container
esta_tabela.TimeData = _detalhes:TimeDataCreateCombatTables()
esta_tabela.PhaseData = {{1, 1}, damage = {}, heal = {}, damage_section = {}, heal_section = {}} --[1] phase number [2] phase started
--> Skill cache (not used)
esta_tabela.CombatSkillCache = {}
+1 -1
View File
@@ -1272,7 +1272,7 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex
qual_barra = qual_barra+1
else
for i = instancia.barraS[1], instancia.barraS[2], 1 do --> vai atualizar só o range que esta sendo mostrado
conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator)
--[[ index nil value]] conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator)
qual_barra = qual_barra+1
end
end
+1 -1
View File
@@ -134,7 +134,7 @@ _detalhes.instance_defaults = {
--blackwhiite icons
desaturated_menu = false, --mode segment attribute report
--icons on menu
menu_icons = {true, true, true, true, true, true, space = -4, shadow = false}, --mode segment attribute report reset close
menu_icons = {true, true, true, true, true, false, space = -4, shadow = false}, --mode segment attribute report reset close
--menu icons size multiplicator factor
menu_icons_size = 1.0, --mode segment attribute report
--auto hide menu buttons
+4
View File
@@ -602,6 +602,10 @@
_detalhes.in_combat = false --sinaliza ao addon que não há combate no momento
_detalhes.leaving_combat = false --sinaliza que não esta mais saindo do combate
_detalhes:OnCombatPhaseChanged()
_table_wipe (_detalhes.tabela_vigente.PhaseData.damage_section)
_table_wipe (_detalhes.tabela_vigente.PhaseData.heal_section)
_table_wipe (_detalhes.cache_damage_group)
_table_wipe (_detalhes.cache_healing_group)
+2
View File
@@ -39,6 +39,7 @@
["COMBAT_PREPOTION_UPDATED"] = {},
["COMBAT_CHARTTABLES_CREATING"] = {},
["COMBAT_CHARTTABLES_CREATED"] = {},
["COMBAT_ENCOUNTER_PHASE_CHANGED"] = {},
--> area
["ZONE_TYPE_CHANGED"] = {},
@@ -88,6 +89,7 @@ local common_events = {
["COMBAT_PREPOTION_UPDATED"] = true,
["COMBAT_CHARTTABLES_CREATING"] = true,
["COMBAT_CHARTTABLES_CREATED"] = true,
["COMBAT_ENCOUNTER_PHASE_CHANGED"] = true,
["GROUP_ONENTER"] = true,
["GROUP_ONLEAVE"] = true,
["ZONE_TYPE_CHANGED"] = true,
+117 -2
View File
@@ -1,4 +1,3 @@
do
local _detalhes = _G._detalhes
--> default weaktable
@@ -311,4 +310,120 @@ do
DetailsAuraPanel:Show()
end
end
------------------------------------------------------------------------------------------------------------------
--> get the total of damage and healing of this phase
function _detalhes:OnCombatPhaseChanged()
local current_combat = _detalhes:GetCurrentCombat()
local current_phase = current_combat.PhaseData [#current_combat.PhaseData][1]
local phase_damage_container = current_combat.PhaseData.damage [current_phase]
local phase_healing_container = current_combat.PhaseData.heal [current_phase]
local phase_damage_section = current_combat.PhaseData.damage_section
local phase_healing_section = current_combat.PhaseData.heal_section
if (not phase_damage_container) then
phase_damage_container = {}
current_combat.PhaseData.damage [current_phase] = phase_damage_container
end
if (not phase_healing_container) then
phase_healing_container = {}
current_combat.PhaseData.heal [current_phase] = phase_healing_container
end
for index, damage_actor in ipairs (_detalhes.cache_damage_group) do
local phase_damage = damage_actor.total - (phase_damage_section [damage_actor.nome] or 0)
phase_damage_section [damage_actor.nome] = damage_actor.total
phase_damage_container [damage_actor.nome] = (phase_damage_container [damage_actor.nome] or 0) + phase_damage
end
for index, healing_actor in ipairs (_detalhes.cache_healing_group) do
local phase_heal = healing_actor.total - (phase_healing_section [healing_actor.nome] or 0)
phase_healing_section [healing_actor.nome] = healing_actor.total
phase_healing_container [healing_actor.nome] = (phase_healing_container [healing_actor.nome] or 0) + phase_heal
end
end
function _detalhes:BossModsLink()
if (_G.DBM) then
local dbm_callback_phase = function (event, msg)
local mod = _detalhes.encounter_table.DBM_Mod
if (not mod) then
local id = _detalhes:GetEncounterIdFromBossIndex (_detalhes.encounter_table.mapid, _detalhes.encounter_table.id)
if (id) then
for index, tmod in ipairs (DBM.Mods) do
if (tmod.id == id) then
_detalhes.encounter_table.DBM_Mod = tmod
mod = tmod
end
end
end
end
local phase = mod and mod.vb and mod.vb.phase
if (phase and _detalhes.encounter_table.phase ~= phase) then
--_detalhes:Msg ("Current phase:", phase)
_detalhes:OnCombatPhaseChanged()
_detalhes.encounter_table.phase = phase
local cur_combat = _detalhes:GetCurrentCombat()
local time = cur_combat:GetCombatTime()
if (time > 5) then
tinsert (cur_combat.PhaseData, {phase, time})
end
_detalhes:SendEvent ("COMBAT_ENCOUNTER_PHASE_CHANGED", nil, phase)
end
end
local dbm_callback_pull = function (event, mod, delay, synced, startHp)
_detalhes.encounter_table.DBM_Mod = mod
_detalhes.encounter_table.DBM_ModTime = time()
end
DBM:RegisterCallback ("DBM_Announce", dbm_callback_phase)
DBM:RegisterCallback ("pull", dbm_callback_pull)
end
LoadAddOn ("BigWigs_Core")
if (BigWigs and not _G.DBM) then
BigWigs:Enable()
function _detalhes:BigWigs_Message (event, module, key, text)
--print ("new bigwigs message...")
if (key == "stages") then
local phase = text:gsub (".*%s", "")
phase = tonumber (phase)
--print ("Phase Changed!", phase)
if (phase and type (phase) == "number" and _detalhes.encounter_table.phase ~= phase) then
--_detalhes:Msg ("Current phase:", phase)
_detalhes:OnCombatPhaseChanged()
_detalhes.encounter_table.phase = phase
local cur_combat = _detalhes:GetCurrentCombat()
local time = cur_combat:GetCombatTime()
if (time > 5) then
tinsert (cur_combat.PhaseData, {phase, time})
end
_detalhes:SendEvent ("COMBAT_ENCOUNTER_PHASE_CHANGED", nil, phase)
end
end
end
BigWigs.RegisterMessage (_detalhes, "BigWigs_Message")
end
end
+2 -2
View File
@@ -1143,7 +1143,7 @@ local _
true,
true,
true, -- [5]
true, -- [6]
false, -- [6]
["space"] = -4,
["shadow"] = true,
},
@@ -1763,7 +1763,7 @@ local _
["strata"] = "LOW",
["show_sidebars"] = true,
["hide_in_combat_alpha"] = 0,
["menu_icons"] = {true,true,true,true,true, true, ["space"] = -4, ["shadow"] = true},
["menu_icons"] = {true, true, true, true, true, false, ["space"] = -4, ["shadow"] = true},
["desaturated_menu"] = false,
["auto_hide_menu"] = {
["left"] = false,
+23
View File
@@ -884,6 +884,29 @@ function SlashCmdList.DETAILS (msg, editbox)
elseif (msg == "gs") then
_detalhes:teste_grayscale()
elseif (msg == "bwload") then
if not BigWigs then LoadAddOn("BigWigs_Core") end
BigWigs:Enable()
LoadAddOn ("BigWigs_Highmaul")
local mod = BigWigs:GetBossModule("Imperator Mar'gok")
mod:Enable()
elseif (msg == "bwsend") then
local mod = BigWigs:GetBossModule("Imperator Mar'gok")
mod:Message("stages", "Neutral", "Long", "Phase 2", false)
elseif (msg == "bwregister") then
local addon = {}
BigWigs.RegisterMessage(addon, "BigWigs_Message")
function addon:BigWigs_Message(event, module, key, text)
if module.journalId == 1197 and text:match("^Phase %d$") then -- 1197 = Margok
print ("Phase Changed!", event, module, key, text)
end
end
elseif (msg == "outline") then
local instancia = _detalhes.tabela_instancias [1]
@@ -197,6 +197,10 @@ local function CreatePluginFrames (data)
--drop last combat table
EncounterDetails.LastSegmentShown = nil
if (DetailsRaidDpsGraph) then
DetailsRaidDpsGraph.combat = nil
end
--wipe emotes
table.wipe (EncounterDetails.boss_emotes_table)
@@ -545,7 +549,6 @@ local function DamageTakenDetails (jogador, barra)
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 habilidades = este_agressor.spells._ActorTable
for id, habilidade in _pairs (habilidades) do
--print ("oi - " .. este_agressor.nome)
@@ -763,19 +766,28 @@ end
function EncounterDetails:OpenAndRefresh (_, segment)
local frame = EncounterDetailsFrame --alias
local _combat_object = _combat_object
if (not _combat_object) then
return
end
if (segment) then
--get combat segment, 1 more recently ...25 oldest
_combat_object = EncounterDetails:GetCombat (segment)
EncounterDetails._segment = segment
else
_G [frame:GetName().."SegmentsDropdown"].MyObject:Select (1, true)
EncounterDetails._segment = 1
local historico = _detalhes.tabela_historico.tabelas
for index, combate in ipairs (historico) do
if (combate.is_boss and combate.is_boss.index) then
_G [frame:GetName().."SegmentsDropdown"].MyObject:Select (index)
EncounterDetails._segment = index
_combat_object = combate
break
end
end
end
if (not _combat_object) then
EncounterDetails:Msg ("no combat found.")
return
end
local boss_id
@@ -826,6 +838,8 @@ function EncounterDetails:OpenAndRefresh (_, segment)
if (EncounterDetailsFrame.ShowType == "graph") then
EncounterDetails:BuildDpsGraphic()
elseif (EncounterDetailsFrame.ShowType == "spellsauras") then
--refresh spells and auras
end
EncounterDetails.LastSegmentShown = _combat_object
@@ -848,20 +862,15 @@ function EncounterDetails:OpenAndRefresh (_, segment)
if (file) then
EncounterDetailsFrame.raidbackground:SetTexture (file)
EncounterDetailsFrame.raidbackground:SetTexCoord (L, R, T, B)
EncounterDetailsFrame.raidbackground:SetAlpha (0.8)
else
EncounterDetailsFrame.raidbackground:SetTexture ([[Interface\Glues\LOADINGSCREENS\LoadScreenDungeon]])
EncounterDetailsFrame.raidbackground:SetTexCoord (0, 1, 120/512, 408/512)
EncounterDetailsFrame.raidbackground:SetAlpha (0.8)
end
-------------- set totals on down frame --------------
--[[ data mine:
_combat_object ["totals_grupo"] hold the total [1] damage // [2] heal // [3] [energy_name] energies // [4] [misc_name] miscs --]]
--EncounterDetailsFrame.StatusBar_totaldamage:SetText (Loc ["STRING_TOTAL_DAMAGE"]..": ".. _detalhes:comma_value (_combat_object.totals_grupo[1])) --> [1] total damage
--EncounterDetailsFrame.StatusBar_totalheal:SetText (Loc ["STRING_TOTAL_HEAL"]..": ".. _detalhes:comma_value (_combat_object.totals_grupo[2])) --> [2] total heal
--> Container Overall Damage Taken
--[[ data mine:
combat tables have 4 containers [1] damage [2] heal [3] energy [4] misc each container have 2 tables: ._NameIndexTable and ._ActorTable --]]
@@ -1416,7 +1425,7 @@ function EncounterDetails:OpenAndRefresh (_, segment)
local barra = container.barras [index]
if (not barra) then
barra = EncounterDetails:CreateRow (index, container, 3, 3, -6)
barra = EncounterDetails:CreateRow (index, container, 3, 0, -6)
barra.TTT = "total_interrupt" -- tool tip type
barra.report_text = "Details! ".. Loc ["STRING_INTERRUPT_BY"]
barra:SetBackdrop (backdrop_bar_onleave)
@@ -1590,13 +1599,13 @@ function EncounterDetails:OpenAndRefresh (_, segment)
--> {esta_morte, time, este_jogador.nome, este_jogador.classe, _UnitHealthMax (alvo_name), minutos.."m "..segundos.."s", ["dead"] = true}
local barra = container.barras [index]
if (not barra) then
barra = EncounterDetails:CreateRow (index, container, 3, 0, -4)
barra = EncounterDetails:CreateRow (index, container, 3, 0, 1)
barra.TTT = "morte" -- tool tip type
barra.report_text = "Details! " .. Loc ["STRING_DEAD_LOG"]
_detalhes:SetFontSize (barra.texto_esquerdo, 9)
_detalhes:SetFontSize (barra.texto_direita, 9)
_detalhes:SetFontFace (barra.texto_esquerdo, "Arial Narrow")
barra:SetWidth (160)
barra:SetWidth (169)
end
if (tabela [3]:find ("-")) then
+4 -2
View File
@@ -29,8 +29,10 @@ Loc ["STRING_ADDS"] = "Adds"
Loc ["STRING_INTERRUPTS"] = "Interrupts"
Loc ["STRING_DISPELLS"] = "Dispells"
Loc ["STRING_DEATH_LOG"] = "Death Log"
Loc ["STRING_FIGHT_SUMMARY"] = "fight details"
Loc ["STRING_FIGHT_GRAPHIC"] = "performance charts"
Loc ["STRING_FIGHT_SUMMARY"] = "Encounter Summary"
Loc ["STRING_FIGHT_GRAPHIC"] = "Encounter Charts and Phases"
Loc ["STRING_FIGHT_EMOTES"] = "Encounter Emotes"
Loc ["STRING_FIGHT_SPELLS"] = "Encounter Spells and Auras"
Loc ["STRING_TOOLTIP"] = "Show Encounter Details Window"
Loc ["STRING_LAST_COOLDOWN"] = "last cooldown used"
Loc ["STRING_NOLAST_COOLDOWN"] = "no cooldown used"
File diff suppressed because it is too large Load Diff
Binary file not shown.
@@ -63,6 +63,27 @@ local function CreatePluginFrames (data)
elseif (event == "SHOW") then --> plugin shown, enabled
if (not Vanguard.db.first_run) then
Vanguard.db.first_run = true
local welcome = CreateFrame ("frame", nil, UIParent)
welcome:SetFrameStrata ("TOOLTIP")
welcome:SetPoint ("center", UIParent, "center")
welcome:SetSize (400, 175)
welcome:SetBackdrop ({edgeFile = "Interface\\Buttons\\UI-SliderBar-Border", edgeSize = 8,
bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 130, insets = {left = 1, right = 1, top = 5, bottom = 5}})
local str = _detalhes.gump:CreateLabel (welcome, "Welcome to Vanguard!\n\n\n- The green-left bar represents the incoming healing plus absorbs on the tank.\n\n- The red-right tries to calculate the incoming damage taking the total damage suffered by the tank on the last 5 seconds.", nil, nil, "GameFontNormal")
str:SetPoint (15, -15)
str:SetWidth (375)
local close_button = _detalhes.gump:CreateButton (welcome, function() welcome:Hide() end, 86, 16, "Close")
close_button:InstallCustomTexture()
close_button:SetPoint ("center", welcome, "center")
close_button:SetPoint ("bottom", welcome, "bottom", 0, 10)
end
Vanguard.CurrentInstance = Vanguard:GetInstance (Vanguard.instance_id)
VanguardFrame:RegisterEvent ("ROLE_CHANGED_INFORM")
@@ -774,6 +795,7 @@ function Vanguard:OnEvent (_, event, arg1, token, time, who_serial, who_name, wh
tank_block_size = 150,
tank_block_color = {0, 0, 0, 0.8},
tank_block_texture = "Details Serenity",
first_run = false,
}
--> Install
+2 -36
View File
@@ -462,43 +462,9 @@ function _G._detalhes:Start()
_detalhes:BrokerTick()
--boss mobs callbacks
_detalhes:ScheduleTimer ("BossModsLink", 5)
-- test dbm callbacks
if (_G.DBM) then
local dbm_callback_phase = function (event, msg)
local mod = _detalhes.encounter_table.DBM_Mod
if (not mod) then
local id = _detalhes:GetEncounterIdFromBossIndex (_detalhes.encounter_table.mapid, _detalhes.encounter_table.id)
if (id) then
for index, tmod in ipairs (DBM.Mods) do
if (tmod.id == id) then
_detalhes.encounter_table.DBM_Mod = tmod
mod = tmod
end
end
end
end
local phase = mod and mod.vb and mod.vb.phase
if (phase and _detalhes.encounter_table.phase ~= phase) then
--_detalhes:Msg ("Current phase:", phase)
_detalhes.encounter_table.phase = phase
--> do thing when the encounter changes the phase
end
end
local dbm_callback_pull = function (event, mod, delay, synced, startHp)
_detalhes.encounter_table.DBM_Mod = mod
_detalhes.encounter_table.DBM_ModTime = time()
end
DBM:RegisterCallback ("DBM_Announce", dbm_callback_phase)
DBM:RegisterCallback ("pull", dbm_callback_pull)
end
--[[
function _detalhes:TestResize()
_detalhes:OpenNewsWindow ("TESTE, |TInterface\\AddOns\\Details\\images\\key_shift:20:40:0:0:64:64:0:64:0:40|t")