- Added new Death Recap implemented! replaces the default from Blizzard and can be configured at Options > Raid Tools.

- Fixed Paladin 'Light of the Martyr' damage to self.
This commit is contained in:
Tercio
2017-06-04 18:54:41 -03:00
parent 593970b944
commit e0e09ce6a4
5 changed files with 511 additions and 14 deletions
+5 -5
View File
File diff suppressed because one or more lines are too long
+8 -7
View File
@@ -204,7 +204,7 @@
-- /run local f=CreateFrame("frame");f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");f:SetScript("OnEvent",function(self, ...) local a = select(3, ...);print (a);if (a=="SPELL_CAST_SUCCESS")then print (...) end end)
function parser:spell_dmg (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand)
------------------------------------------------------------------------------------------------
--> early checks and fixes
@@ -253,12 +253,13 @@
elseif (spellid == 196917) then -- or spellid == 183998 < healing part
local healingActor = healing_cache [who_name]
if (healingActor and healingActor.spells) then
local spell = healingActor.spells._ActorTable [spellid]
if (spell) then
healingActor.total = healingActor.total - (amount or 0)
spell.total = spell.total - (amount or 0)
return
end
healingActor.total = healingActor.total - (amount or 0)
--local spell = healingActor.spells._ActorTable [spellid]
--if (spell) then
-- spell.total = spell.total - (amount or 0)
-- return
--end
end
return --> ignore this event
end
+430
View File
@@ -3002,4 +3002,434 @@
end
--_detalhes:ScheduleTimer ("OpenForge", 3)
----------------------------------------------------------------------------------------------------------------------------------
--framename:
-- DeathRecapFrame
-- OpenDeathRecapUI()
-- Blizzard_DeathRecap
local textAlpha = 0.9
local on_deathrecap_line_enter = function (self)
if (self.spellid) then
GameTooltip:SetOwner (self, "ANCHOR_RIGHT")
_detalhes:GameTooltipSetSpellByID (self.spellid)
self:SetBackdropColor (.3, .3, .3, .2)
GameTooltip:Show()
self.backgroundTextureOverlay:Show()
self.timeAt:SetAlpha (1)
self.sourceName:SetAlpha (1)
self.amount:SetAlpha (1)
self.lifePercent:SetAlpha (1)
end
end
local on_deathrecap_line_leave = function (self)
GameTooltip:Hide()
self:SetBackdropColor (.3, .3, .3, 0)
self.backgroundTextureOverlay:Hide()
self.timeAt:SetAlpha (textAlpha)
self.sourceName:SetAlpha (textAlpha)
self.amount:SetAlpha (textAlpha)
self.lifePercent:SetAlpha (textAlpha)
end
local create_deathrecap_line = function (parent, n)
local line = CreateFrame ("frame", "DetailsDeathRecapLine" .. n, parent)
line:SetPoint ("topleft", parent, "topleft", 10, (-24 * n) - 17)
line:SetPoint ("topright", parent, "topright", -10, (-24 * n) - 17)
--line:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16,
--insets = {left = 0, right = 0, top = 0, bottom = 0}})
line:SetScript ("OnEnter", on_deathrecap_line_enter)
line:SetScript ("OnLeave", on_deathrecap_line_leave)
line:SetSize (300, 21)
if (n % 2 == 0) then
--line:SetBackdropColor (0, 0, 0, 0)
else
--line:SetBackdropColor (.3, .3, .3, 0)
end
local timeAt = line:CreateFontString (nil, "overlay", "GameFontNormal")
local backgroundTexture = line:CreateTexture (nil, "border")
local backgroundTextureOverlay = line:CreateTexture (nil, "artwork")
local spellIcon = line:CreateTexture (nil, "overlay")
local spellIconBorder = line:CreateTexture (nil, "overlay")
spellIcon:SetDrawLayer ("overlay", 1)
spellIconBorder:SetDrawLayer ("overlay", 2)
local sourceName = line:CreateFontString (nil, "overlay", "GameFontNormal")
local amount = line:CreateFontString (nil, "overlay", "GameFontNormal")
local lifePercent = line:CreateFontString (nil, "overlay", "GameFontNormal")
--grave icon
local graveIcon = line:CreateTexture (nil, "overlay")
graveIcon:SetTexture ([[Interface\MINIMAP\POIIcons]])
graveIcon:SetTexCoord (146/256, 160/256, 0/512, 18/512)
graveIcon:SetPoint ("left", line, "left", 11, 0)
graveIcon:SetSize (14, 18)
--spell icon
spellIcon:SetSize (19, 19)
spellIconBorder:SetTexture ([[Interface\ENCOUNTERJOURNAL\LootTab]])
spellIconBorder:SetTexCoord (6/256, 38/256, 49/128, 81/128)
spellIconBorder:SetSize (20, 20)
spellIconBorder:SetPoint ("topleft", spellIcon, "topleft", 0, 0)
--locations
timeAt:SetPoint ("left", line, "left", 2, 0)
spellIcon:SetPoint ("left", line, "left", 50, 0)
sourceName:SetPoint ("left", line, "left", 82, 0)
amount:SetPoint ("left", line, "left", 220, 0)
lifePercent:SetPoint ("left", line, "left", 320, 0)
--text colors
_detalhes.gump:SetFontColor (amount, "red")
_detalhes.gump:SetFontColor (timeAt, "gray")
_detalhes.gump:SetFontColor (sourceName, "yellow")
--text alpha
timeAt:SetAlpha (textAlpha)
sourceName:SetAlpha (textAlpha)
amount:SetAlpha (textAlpha)
lifePercent:SetAlpha (textAlpha)
--text setup
amount:SetWidth (75)
amount:SetJustifyH ("right")
lifePercent:SetWidth (36)
lifePercent:SetJustifyH ("right")
--background
--backgroundTexture:SetTexture ([[Interface\AdventureMap\AdventureMap]])
--backgroundTexture:SetTexCoord (460/1024, 659/1024, 330/1024, 350/1024)
backgroundTexture:SetTexture ([[Interface\AddOns\Details\images\deathrecap_background]])
backgroundTexture:SetTexCoord (0, 1, 0, 1)
backgroundTexture:SetVertexColor (.1, .1, .1, .3)
--top border
local TopFader = line:CreateTexture (nil, "border")
TopFader:SetTexture ([[Interface\AddOns\Details\images\deathrecap_background_top]])
TopFader:SetTexCoord (0, 1, 0, 1)
TopFader:SetVertexColor (.1, .1, .1, .3)
TopFader:SetPoint ("bottomleft", backgroundTexture, "topleft", 0, -0)
TopFader:SetPoint ("bottomright", backgroundTexture, "topright", 0, -0)
TopFader:SetHeight (32)
TopFader:Hide()
line.TopFader = TopFader
if (n == 10) then
--bottom fader
local backgroundTexture2 = line:CreateTexture (nil, "border")
backgroundTexture2:SetTexture ([[Interface\AddOns\Details\images\deathrecap_background_bottom]])
backgroundTexture2:SetTexCoord (0, 1, 0, 1)
backgroundTexture2:SetVertexColor (.1, .1, .1, .3)
backgroundTexture2:SetPoint ("topleft", backgroundTexture, "bottomleft", 0, 0)
backgroundTexture2:SetPoint ("topright", backgroundTexture, "bottomright", 0, 0)
backgroundTexture2:SetHeight (32)
--_detalhes.gump:SetFontColor (amount, "red")
_detalhes.gump:SetFontSize (amount, 16)
_detalhes.gump:SetFontSize (lifePercent, 16)
backgroundTexture:SetVertexColor (.2, .1, .1, .3)
end
--backgroundTexture:SetAllPoints()
backgroundTexture:SetPoint ("topleft", 0, 1)
backgroundTexture:SetPoint ("bottomright", 0, -1)
backgroundTexture:SetDesaturated (true)
backgroundTextureOverlay:SetTexture ([[Interface\AdventureMap\AdventureMap]])
backgroundTextureOverlay:SetTexCoord (460/1024, 659/1024, 330/1024, 350/1024)
backgroundTextureOverlay:SetAllPoints()
backgroundTextureOverlay:SetDesaturated (true)
backgroundTextureOverlay:SetAlpha (0.5)
backgroundTextureOverlay:Hide()
line.timeAt = timeAt
line.spellIcon = spellIcon
line.sourceName = sourceName
line.amount = amount
line.lifePercent = lifePercent
line.backgroundTexture = backgroundTexture
line.backgroundTextureOverlay = backgroundTextureOverlay
line.graveIcon = graveIcon
if (n == 10) then
graveIcon:Show()
line.timeAt:Hide()
else
graveIcon:Hide()
end
return line
end
local OpenDetailsDeathRecapAtSegment = function (segment)
_detalhes.OpenDetailsDeathRecap (segment)
end
function _detalhes.OpenDetailsDeathRecap (segment)
if (not _detalhes.death_recap.enabled) then
if (Details.DeathRecap and Details.DeathRecap.Lines) then
for i = 1, 10 do
Details.DeathRecap.Lines [i]:Hide()
end
for i, button in ipairs (Details.DeathRecap.Segments) do
button:Hide()
end
end
return
end
DeathRecapFrame.Recap1:Hide()
DeathRecapFrame.Recap2:Hide()
DeathRecapFrame.Recap3:Hide()
DeathRecapFrame.Recap4:Hide()
DeathRecapFrame.Recap5:Hide()
if (not Details.DeathRecap) then
Details.DeathRecap = CreateFrame ("frame", "DetailsDeathRecap", DeathRecapFrame)
Details.DeathRecap:SetAllPoints()
--lines
Details.DeathRecap.Lines = {}
for i = 1, 10 do
Details.DeathRecap.Lines [i] = create_deathrecap_line (Details.DeathRecap, i)
end
--segments
Details.DeathRecap.Segments = {}
for i = 5, 1, -1 do
local segmentButton = CreateFrame ("button", "DetailsDeathRecapSegmentButton" .. i, Details.DeathRecap)
segmentButton:SetSize (16, 20)
segmentButton:SetPoint ("topright", DeathRecapFrame, "topright", (-abs (i-6) * 22) - 10, -5)
local text = segmentButton:CreateFontString (nil, "overlay", "GameFontNormal")
segmentButton.text = text
text:SetText ("#" .. i)
text:SetPoint ("center")
_detalhes.gump:SetFontColor (text, "silver")
segmentButton:SetScript ("OnClick", function()
OpenDetailsDeathRecapAtSegment (i)
end)
tinsert (Details.DeathRecap.Segments, i, segmentButton)
end
end
for i = 1, 10 do
Details.DeathRecap.Lines [i]:Hide()
end
--segment to use
local death = _detalhes.tabela_vigente.last_events_tables
--segments
if (_detalhes.death_recap.show_segments) then
local last_index = 0
local buttonsInUse = {}
for i, button in ipairs (Details.DeathRecap.Segments) do
if (_detalhes.tabela_historico.tabelas [i]) then
button:Show()
tinsert (buttonsInUse, button)
_detalhes.gump:SetFontColor (button.text, "silver")
last_index = i
else
button:Hide()
end
end
local buttonsInUse2 = {}
for i = #buttonsInUse, 1, -1 do
tinsert (buttonsInUse2, buttonsInUse[i])
end
for i = 1, #buttonsInUse2 do
local button = buttonsInUse2 [i]
button:ClearAllPoints()
button:SetPoint ("topright", DeathRecapFrame, "topright", (-i * 22) - 10, -5)
end
if (not segment) then
_detalhes.gump:SetFontColor (Details.DeathRecap.Segments [1].text, "orange")
else
_detalhes.gump:SetFontColor (Details.DeathRecap.Segments [segment].text, "orange")
death = _detalhes.tabela_historico.tabelas [segment].last_events_tables
end
else
for i, button in ipairs (Details.DeathRecap.Segments) do
button:Hide()
end
end
if (not death) then
return
end
--get the relevance config
local relevanceTime = _detalhes.death_recap.relevance_time
--for index, t in ipairs (death) do
for index = #death, 1, -1 do
local t = death [index]
if (t [3] == _detalhes.playername) then
local events = t [1]
local timeOfDeath = t [2]
local BiggestDamageHits = {}
for i = #events, 1, -1 do
tinsert (BiggestDamageHits, events [i])
end
table.sort (BiggestDamageHits, function (t1, t2)
return t1[3] > t2[3]
end)
for i = #BiggestDamageHits, 1, -1 do
if (BiggestDamageHits [i][4] + relevanceTime < timeOfDeath) then
tremove (BiggestDamageHits, i)
end
end
--verifica se o evento que matou o jogador esta na lista, se nao, adiciona no primeiro index do BiggestDamageHits
local hitKill
for i = #events, 1, -1 do
local event = events [i]
local evType = event [1]
if (type (evType) == "boolean" and evType) then
hitKill = event
break
end
end
if (hitKill) then
local haveHitKill = false
for index, t in ipairs (BiggestDamageHits) do
if (t == hitKill) then
haveHitKill = true
break
end
end
if (not haveHitKill) then
tinsert (BiggestDamageHits, 1, hitKill)
end
end
--tem menos que 10 eventos com grande dano dentro dos ultimos 5 segundos
--precisa preencher com danos pequenos
if (#BiggestDamageHits < 10) then
for i = #events, 1, -1 do
local event = events [i]
local evType = event [1]
if (type (evType) == "boolean" and evType) then
local alreadyHave = false
for index, t in ipairs (BiggestDamageHits) do
if (t == event) then
alreadyHave = true
break
end
end
if (not alreadyHave) then
tinsert (BiggestDamageHits, event)
if (#BiggestDamageHits == 10) then
break
end
end
end
end
else
--encurta a tabela em no maximo 10 eventos
while (#BiggestDamageHits > 10) do
tremove (BiggestDamageHits, 11)
end
end
table.sort (BiggestDamageHits, function (t1, t2)
return t1[4] > t2[4]
end)
local events = BiggestDamageHits
local maxHP = t [5]
local lineIndex = 10
--for i = #events, 1, -1 do
for i, event in ipairs (events) do
local event = events [i]
local evType = event [1]
local hp = min (floor (event [5] / maxHP * 100), 100)
local spellName, _, spellIcon = _detalhes.GetSpellInfo (event [2])
local amount = event [3]
local eventTime = event [4]
local source = event [6]
local overkill = event [10] or 0
if (type (evType) == "boolean" and evType) then
local line = Details.DeathRecap.Lines [lineIndex]
if (line) then
line.timeAt:SetText (format ("%.1f", eventTime - timeOfDeath) .. "s")
line.spellIcon:SetTexture (spellIcon)
line.TopFader:Hide()
--line.spellIcon:SetTexCoord (.1, .9, .1, .9)
--line.sourceName:SetText ("|cFFC6B0D9" .. source .. "|r")
line.sourceName:SetText (spellName)
if (amount > 1000) then
--line.amount:SetText ("-" .. _detalhes:ToK (amount))
line.amount:SetText ("-" .. amount)
else
line.amount:SetText ("-" .. floor (amount))
end
line.lifePercent:SetText (hp .. "%")
line.spellid = event [2]
line:Show()
if (_detalhes.death_recap.show_life_percent) then
line.lifePercent:Show()
line.amount:SetPoint ("left", line, "left", 220, 0)
line.lifePercent:SetPoint ("left", line, "left", 320, 0)
else
line.lifePercent:Hide()
line.amount:SetPoint ("left", line, "left", 280, 0)
--line.lifePercent:SetPoint ("left", line, "left", 320, 0)
end
end
lineIndex = lineIndex - 1
end
end
local lastLine = Details.DeathRecap.Lines [lineIndex + 1]
if (lastLine) then
lastLine.TopFader:Show()
end
DeathRecapFrame.Unavailable:Hide()
break
end
end
end
hooksecurefunc (_G, "DeathRecap_LoadUI", function()
hooksecurefunc (_G, "DeathRecapFrame_OpenRecap", function()
_detalhes.OpenDetailsDeathRecap()
end)
end)
+7
View File
@@ -1177,6 +1177,13 @@ local default_global_data = {
item_level_pool = {},
--> latest report
latest_report_table = {},
--> death recap
death_recap = {
enabled = true,
relevance_time = 7,
show_life_percent = false,
show_segments = false,
},
}
_detalhes.default_global_data = default_global_data
+61 -2
View File
@@ -10305,8 +10305,7 @@ function window:CreateFrame11()
--slider para quantidade de danos a mostrar
g:NewLabel (frame11, _, "$parentDeathsDamageLabel", "DeathsDamageLabel", Loc ["STRING_OPTIONS_RT_DEATHS_HITS"], "GameFontHighlightLeft")
local s = g:NewSlider (frame11, _, "$parentDeathsDamageSlider", "DeathsDamageSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 1, 5, 1, _detalhes.announce_deaths.last_hits, nil, nil, nil, options_slider_template)
--config_slider (s)
frame11.DeathsDamageSlider:SetPoint ("left", frame11.DeathsDamageLabel, "right", 2)
frame11.DeathsDamageSlider:SetHook ("OnValueChange", function (self, _, amount)
_detalhes.announce_deaths.last_hits = amount
@@ -10351,6 +10350,59 @@ function window:CreateFrame11()
frame11.DeathChannelDropdown:SetPoint ("left", frame11.DeathChannelLabel, "right", 2)
window:CreateLineBackground2 (frame11, "DeathChannelDropdown", "DeathChannelLabel", Loc ["STRING_OPTIONS_RT_DEATHS_WHERE_DESC"])
--> death recap
--enabled?
g:NewLabel (frame11, _, "$parentEnableDeathRecapLabel", "EnableDeathRecapLabel", "Enabled", "GameFontHighlightLeft")
g:NewSwitch (frame11, _, "$parentEnableDeathRecapSlider", "EnableDeathRecapSlider", 60, 20, _, _, _detalhes.death_recap.enabled, nil, nil, nil, nil, options_switch_template)
frame11.EnableDeathRecapSlider:SetPoint ("left", frame11.EnableDeathRecapLabel, "right", 2)
frame11.EnableDeathRecapSlider:SetAsCheckBox()
frame11.EnableDeathRecapSlider.OnSwitch = function (_, _, value)
_detalhes.death_recap.enabled = value
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
end
window:CreateLineBackground2 (frame11, "EnableDeathRecapSlider", "EnableDeathRecapLabel", "Modify the Blizzard's Death Recap screen.")
--time relevance
g:NewLabel (frame11, _, "$parentDeathRecapRelevanceLabel", "DeathRecapRelevanceLabel", "Relevance Time", "GameFontHighlightLeft")
g:NewSlider (frame11, _, "$parentDeathRecapRelevanceSlider", "DeathRecapRelevanceSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 1, 12, 1, _detalhes.death_recap.relevance_time, nil, nil, nil, options_slider_template)
frame11.DeathRecapRelevanceSlider:SetPoint ("left", frame11.DeathRecapRelevanceLabel, "right", 2)
frame11.DeathsDamageSlider:SetHook ("OnValueChange", function (self, _, amount)
_detalhes.death_recap.relevance_time = amount
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
end)
window:CreateLineBackground2 (frame11, "DeathRecapRelevanceSlider", "DeathRecapRelevanceLabel", "Attempt to fill the Death Recap with high damage (discart low hits) in the relevant time before death.")
--show life
g:NewLabel (frame11, _, "$parentEnableDeathRecapLifePercentLabel", "EnableDeathRecapLifePercentLabel", "Life Percent", "GameFontHighlightLeft")
g:NewSwitch (frame11, _, "$parentEnableDeathRecapLifePercentSlider", "EnableDeathRecapLifePercentSlider", 60, 20, _, _, _detalhes.death_recap.show_life_percent, nil, nil, nil, nil, options_switch_template)
frame11.EnableDeathRecapLifePercentSlider:SetPoint ("left", frame11.EnableDeathRecapLifePercentLabel, "right", 2)
frame11.EnableDeathRecapLifePercentSlider:SetAsCheckBox()
frame11.EnableDeathRecapLifePercentSlider.OnSwitch = function (_, _, value)
_detalhes.death_recap.show_life_percent = value
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
end
window:CreateLineBackground2 (frame11, "EnableDeathRecapLifePercentSlider", "EnableDeathRecapLifePercentLabel", "Show the percent of life the player had when received the hit.")
--show segments
g:NewLabel (frame11, _, "$parentEnableDeathRecapSegmentsLabel", "EnableDeathRecapSegmentsLabel", "Segment List", "GameFontHighlightLeft")
g:NewSwitch (frame11, _, "$parentEnableDeathRecapSegmentsSlider", "EnableDeathRecapSegmentsSlider", 60, 20, _, _, _detalhes.death_recap.show_segments, nil, nil, nil, nil, options_switch_template)
frame11.EnableDeathRecapSegmentsSlider:SetPoint ("left", frame11.EnableDeathRecapSegmentsLabel, "right", 2)
frame11.EnableDeathRecapSegmentsSlider:SetAsCheckBox()
frame11.EnableDeathRecapSegmentsSlider.OnSwitch = function (_, _, value)
_detalhes.death_recap.show_segments = value
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
end
window:CreateLineBackground2 (frame11, "EnableDeathRecapSegmentsSlider", "EnableDeathRecapSegmentsLabel", "Show a list of the latest segments in case you want to see recaps from previous fights.")
--> general tools
--> pre pots
g:NewLabel (frame11, _, "$parentEnabledPrePotLabel", "EnabledPrePotLabel", Loc ["STRING_OPTIONS_RT_INFOS_PREPOTION"], "GameFontHighlightLeft")
@@ -10384,6 +10436,7 @@ function window:CreateFrame11()
g:NewLabel (frame11, _, "$parentAnnouncersAnchorInterrupt", "AnnouncersInterrupt", Loc ["STRING_OPTIONS_RT_INTERRUPT_ANCHOR"], "GameFontNormal")
g:NewLabel (frame11, _, "$parentAnnouncersAnchorCooldowns", "AnnouncersCooldowns", Loc ["STRING_OPTIONS_RT_COOLDOWNS_ANCHOR"], "GameFontNormal")
g:NewLabel (frame11, _, "$parentAnnouncersAnchorDeaths", "AnnouncersDeaths", Loc ["STRING_OPTIONS_RT_DEATHS_ANCHOR"], "GameFontNormal")
g:NewLabel (frame11, _, "$parentAnnouncersAnchorDeathRecap", "AnnouncersDeathRecap", "Death Recap:", "GameFontNormal")
g:NewLabel (frame11, _, "$parentAnnouncersAnchorOther", "AnnouncersOther", Loc ["STRING_OPTIONS_RT_OTHER_ANCHOR"], "GameFontNormal")
local x = window.left_start_at
@@ -10414,6 +10467,12 @@ function window:CreateFrame11()
{"DeathChannelLabel", 3},
{"DeathsDamageLabel", 4},
{"DeathsAmountLabel", 5},
{"AnnouncersDeathRecap", 5, true},
{"EnableDeathRecapLabel", 5},
{"DeathRecapRelevanceLabel", 5},
{"EnableDeathRecapLifePercentLabel", 5},
{"EnableDeathRecapSegmentsLabel", 5},
{"AnnouncersOther", 6, true},
{"EnabledPrePotLabel", 7},
{"EnabledFirstHitLabel", 8},