Skip to content

Commit

Permalink
Testing death recaps and put back fixes for grouping
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Mar 12, 2022
1 parent 2e7875f commit e581d35
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 27 deletions.
37 changes: 21 additions & 16 deletions classes/class_instance.lua
Original file line number Diff line number Diff line change
Expand Up @@ -360,28 +360,28 @@ end
function _detalhes:ShutDownAllInstances()
for index, instance in _ipairs (_detalhes.tabela_instancias) do
if (instance:IsEnabled() and instance.baseframe and not instance.ignore_mass_showhide) then
instance:ShutDown()
instance:ShutDown(true)
end
end
end

--> alias
function _detalhes:HideWindow()
return self:DesativarInstancia()
function _detalhes:HideWindow(all)
return self:DesativarInstancia(all)
end
function _detalhes:ShutDown()
return self:DesativarInstancia()
function _detalhes:ShutDown(all)
return self:DesativarInstancia(all)
end
function _detalhes:Shutdown()
return self:DesativarInstancia()
function _detalhes:Shutdown(all)
return self:DesativarInstancia(all)
end

function _detalhes:GetNumWindows()

end

--> desativando a inst�ncia ela fica em stand by e apenas hida a janela ~shutdown ~close ~fechar
function _detalhes:DesativarInstancia()
function _detalhes:DesativarInstancia(all)

self.ativa = false
_detalhes.opened_windows = _detalhes.opened_windows-1
Expand Down Expand Up @@ -413,7 +413,9 @@ end
Details.FadeHandler.Fader (self.rowframe, 1)
Details.FadeHandler.Fader (self.windowSwitchButton, 1)

self:Desagrupar (-1)
if (not all) then
self:Desagrupar (-1)
end

if (self.modo == modo_raid) then
_detalhes.RaidTables:DisableRaidMode (self)
Expand Down Expand Up @@ -534,7 +536,7 @@ end
for index = math.min (#_detalhes.tabela_instancias, _detalhes.instances_amount), 1, -1 do
local instancia = _detalhes:GetInstance (index)
if (instancia and not instancia.ignore_mass_showhide) then
instancia:AtivarInstancia (temp)
instancia:AtivarInstancia (temp, true)
end
end
end
Expand Down Expand Up @@ -583,14 +585,14 @@ end
end

--> alias
function _detalhes:ShowWindow (temp)
return self:AtivarInstancia (temp)
function _detalhes:ShowWindow (temp, all)
return self:AtivarInstancia (temp, all)
end
function _detalhes:EnableInstance (temp)
return self:AtivarInstancia (temp)
function _detalhes:EnableInstance (temp, all)
return self:AtivarInstancia (temp, all)
end

function _detalhes:AtivarInstancia (temp)
function _detalhes:AtivarInstancia (temp, all)
self.ativa = true
self.cached_bar_width = self.cached_bar_width or 0

Expand Down Expand Up @@ -647,7 +649,10 @@ end
end

self:DesaturateMenu()
self:Desagrupar (-1)

if (not all) then
self:Desagrupar (-1)
end

self:CheckFor_EnabledTrashSuppression()

Expand Down
10 changes: 6 additions & 4 deletions core/parser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2423,9 +2423,11 @@
end
end

if (spellid == 27827) then --> spirit of redemption (holy priest)
parser:dead ("UNIT_DIED", time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags)
ignore_death [who_name] = true
if (spellid == 27827) then --> spirit of redemption (holy ~priest) ~spirit
--C_Timer.After(0.1, function()
parser:dead ("UNIT_DIED", time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags)
ignore_death [who_name] = true
--end)
return

elseif (spellid == SPELLID_MONK_GUARD) then
Expand Down Expand Up @@ -4264,7 +4266,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
misc_cache [alvo_name] = este_jogador
end
end

--> objeto da morte
local esta_morte = {}

Expand Down
83 changes: 76 additions & 7 deletions functions/deathrecap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,14 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
return
end

--hide blizzard death recap
DeathRecapFrame.Recap1:Hide()
DeathRecapFrame.Recap2:Hide()
DeathRecapFrame.Recap3:Hide()
DeathRecapFrame.Recap4:Hide()
DeathRecapFrame.Recap5:Hide()


--create details death recap if not existant
if (not Details.DeathRecap) then
Details.DeathRecap = CreateFrame ("frame", "DetailsDeathRecap", DeathRecapFrame, "BackdropTemplate")
Details.DeathRecap:SetAllPoints()
Expand Down Expand Up @@ -284,14 +286,14 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
tinsert (Details.DeathRecap.Segments, i, segmentButton)
end
end

for i = 1, 10 do
Details.DeathRecap.Lines [i]:Hide()
Details.DeathRecap.Lines[i]:Hide()
end

--segment to use
local death = Details.tabela_vigente.last_events_tables

--see if this segment has a death for the player
local foundPlayer = false
for index = #death, 1, -1 do
Expand All @@ -313,7 +315,7 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
end
end
end

--segments
if (Details.death_recap.show_segments) then
local last_index = 0
Expand Down Expand Up @@ -593,7 +595,74 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
end

hooksecurefunc (_G, "DeathRecap_LoadUI", function()
hooksecurefunc (_G, "DeathRecapFrame_OpenRecap", function (RecapID)
Details.OpenDetailsDeathRecap (nil, RecapID)
hooksecurefunc (_G, "DeathRecapFrame_OpenRecap", function(RecapID)
local currentCombat = Details:GetCurrentCombat()
--get the player current death and link the death table with the death recapID
local playerDeaths = currentCombat:GetPlayerDeaths(UnitName("player"))
if (playerDeaths) then
local latestDeath = playerDeaths[#playerDeaths]
if (latestDeath) then
latestDeath.RecapID = RecapID

--synchronize last events from Details! and Blizzard recap
local events = DeathRecap_GetEvents(recapID)
--death is event index 1 (the event that killed the player)
local evtData = events[1]

if (evtData) then
--recap by blizzard
local spellName = evtData.spellName
local spellId = evtData.spellId
local event = evtData.event
local environmentalType = evtData.environmentalType
local timeStamp = evtData.timestamp
local amountDamage = evtData.amount
local overkill = evtData.overkill
local absorbed = evtData.absorbed
local resisted = evtData.resisted
local blocked = evtData.blocked
local currentHp = evtData.currentHP
local hideCaster = evtData.hideCaster
local sourceName = evtData.sourceName
local casterPrestige = evtData.casterPrestige
local spellSchool = evtData.school

print("Killed by (Blizzard-Debug): ", spellName, "amount:", amountDamage)

--recap by Details!
local deathEventsDetails = latestDeath[1]
for evIndex = #deathEventsDetails, 1, -1 do
local ev = deathEventsDetails[evIndex]
local evType = ev[1]
local spellId = ev[2]
local amount = ev[3]
--is a damage? true boolean
if (type(evType) == "boolean" and evType) then
local spellName, _, spellIcon = Details.GetSpellInfo(spellId)
if (spellName) then
print("Killed by (Details!-Debug): ", spellName, "amount:", amount)
else
print("Killed by (Details!-Debug): spell not found")
end
break
end
end

Details:Msg("the message above are debugs of an Alpha version of Details!")

local whatKilledThePlayer = 0
end
end
end

Details.OpenDetailsDeathRecap(nil, RecapID)
end)
end)

--[=[ hooks not loaded at this point
Details:InstallHook(DETAILS_HOOK_DEATH, function(_, _, _, _, _, _, _, targetName)
if (targetName == UnitName("player")) then
end
end)
--]=]

0 comments on commit e581d35

Please sign in to comment.