- Show light of the martyr damage on death log.

- Truncate spell and source name in the death recap window.
This commit is contained in:
Tercio
2018-09-28 19:19:03 -03:00
parent 7b3078ae39
commit 027cdda48c
9 changed files with 238 additions and 58 deletions
+33 -1
View File
@@ -1,5 +1,5 @@
local dversion = 108
local dversion = 109
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary (major, minor)
@@ -166,6 +166,14 @@ function DF:FadeFrame (frame, t)
end
end
function DF.table.find (t, value)
for i = 1, #t do
if (t[i] == value) then
return i
end
end
end
function DF.table.addunique (t, index, value)
if (not value) then
value = index
@@ -1791,6 +1799,29 @@ local frameshake_play = function (parent, shakeObject, scaleDirection, scaleAmpl
frameshake_do_update (parent, shakeObject)
end
local frameshake_set_config = function (parent, shakeObject, duration, amplitude, frequency, absoluteSineX, absoluteSineY, scaleX, scaleY, fadeInTime, fadeOutTime, anchorPoints)
shakeObject.Amplitude = amplitude or shakeObject.Amplitude
shakeObject.Frequency = frequency or shakeObject.Frequency
shakeObject.Duration = duration or shakeObject.Duration
shakeObject.FadeInTime = fadeInTime or shakeObject.FadeInTime
shakeObject.FadeOutTime = fadeOutTime or shakeObject.FadeOutTime
shakeObject.ScaleX = scaleX or shakeObject.ScaleX
shakeObject.ScaleY = scaleY or shakeObject.ScaleY
if (absoluteSineX ~= nil) then
shakeObject.AbsoluteSineX = absoluteSineX
end
if (absoluteSineY ~= nil) then
shakeObject.AbsoluteSineY = absoluteSineY
end
shakeObject.OriginalScaleX = shakeObject.ScaleX
shakeObject.OriginalScaleY = shakeObject.ScaleY
shakeObject.OriginalFrequency = shakeObject.Frequency
shakeObject.OriginalAmplitude = shakeObject.Amplitude
shakeObject.OriginalDuration = shakeObject.Duration
end
function DF:CreateFrameShake (parent, duration, amplitude, frequency, absoluteSineX, absoluteSineY, scaleX, scaleY, fadeInTime, fadeOutTime, anchorPoints)
--> create the shake table
@@ -1830,6 +1861,7 @@ function DF:CreateFrameShake (parent, duration, amplitude, frequency, absoluteSi
parent.PlayFrameShake = frameshake_play
parent.StopFrameShake = frameshake_stop
parent.UpdateFrameShake = frameshake_do_update
parent.SetFrameShakeSettings = frameshake_set_config
--> register the frame within the frame shake updater
FrameshakeUpdateFrame.RegisterFrame (parent)
+1 -1
View File
@@ -810,7 +810,7 @@ local SwitchOnClick = function (self, button, forced_value, value)
--> safe call
local success, errorText = pcall (slider.OnSwitch, slider, slider.FixedValue, value)
if (not success) then
error ("Details! Framework: OnSwitch() " .. (button:GetName() or "-NONAME-") .. " error: " .. (errorText or ""))
error ("Details! Framework: OnSwitch() " .. (button.GetName and button:GetName() or "-NONAME-") .. " error: " .. (errorText or ""))
end
--> trigger hooks
+7 -12
View File
File diff suppressed because one or more lines are too long
+99 -23
View File
@@ -1256,8 +1256,17 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown)
--add actor spells
for _spellid, _skill in _pairs (ActorSkillsContainer) do
local SkillName, _, SkillIcon = _GetSpellInfo (_spellid)
if (_skill [skill_key] > 0) then
_table_insert (ActorHealingTable, {_spellid, _skill [skill_key], _skill [skill_key]/ActorTotal*100, {SkillName, nil, SkillIcon}, _skill [skill_key]/meu_tempo, _skill.total})
if (_skill [skill_key] > 0 or _skill.anti_heal) then
_table_insert (ActorHealingTable, {
_spellid,
_skill [skill_key],
_skill [skill_key]/ActorTotal*100,
{SkillName, nil, SkillIcon},
_skill [skill_key]/meu_tempo,
_skill.total,
false,
_skill.anti_heal,
})
end
end
@@ -1268,7 +1277,15 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown)
for _spellid, _skill in _pairs (petActor:GetActorSpells()) do
if (_skill [skill_key] > 0) then
local SkillName, _, SkillIcon = _GetSpellInfo (_spellid)
ActorHealingTable [#ActorHealingTable+1] = {_spellid, _skill [skill_key], _skill [skill_key]/ActorTotal*100, {SkillName, nil, SkillIcon}, _skill [skill_key]/meu_tempo, _skill.total, petName:gsub ((" <.*"), "")}
ActorHealingTable [#ActorHealingTable+1] = {
_spellid,
_skill [skill_key],
_skill [skill_key]/ActorTotal*100,
{SkillName, nil, SkillIcon},
_skill [skill_key]/meu_tempo,
_skill.total,
petName:gsub ((" <.*"), "")
}
end
end
end
@@ -1314,7 +1331,10 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown)
for i = 1, _math_min (tooltip_max_abilities, #ActorHealingTable) do
if (ActorHealingTable[i][2] < 1) then
break
local antiHeal = ActorHealingTable[i][8]
if (not antiHeal) then
break
end
end
local spellName = ActorHealingTable[i][4][1]
@@ -1325,15 +1345,34 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown)
end
if (instancia.sub_atributo == 2) then --> hps
GameCooltip:AddLine (spellName ..": ", FormatTooltipNumber (_, _math_floor (ActorHealingTable[i][5])).." (".._cstr ("%.1f", ActorHealingTable[i][3]).."%)")
local formatedTotal = FormatTooltipNumber (_, _math_floor (ActorHealingTable[i][5]))
local antiHeal = ActorHealingTable[i][8]
if (antiHeal) then
formatedTotal = formatedTotal .. " [|cFFFF5500" .. FormatTooltipNumber (_, _math_floor (antiHeal)) .." " .. Loc ["STRING_DAMAGE"] .."|r] "
end
GameCooltip:AddLine (spellName ..": ", formatedTotal .. " (".._cstr ("%.1f", ActorHealingTable[i][3]).."%)")
elseif (instancia.sub_atributo == 3) then --> overheal
local overheal = ActorHealingTable[i][2]
local total = ActorHealingTable[i][6]
GameCooltip:AddLine (spellName .." (|cFFFF3333" .. _math_floor ( (overheal / (overheal+total)) *100) .. "%|r):", FormatTooltipNumber (_, _math_floor (ActorHealingTable[i][2])).." (".._cstr ("%.1f", ActorHealingTable[i][3]).."%)")
local formatedTotal = FormatTooltipNumber (_, _math_floor (ActorHealingTable[i][2]))
local antiHeal = ActorHealingTable[i][8]
if (antiHeal) then
formatedTotal = formatedTotal .. " [|cFFFF5500" .. FormatTooltipNumber (_, _math_floor (antiHeal)) .." " .. Loc ["STRING_DAMAGE"] .."|r] "
end
GameCooltip:AddLine (spellName .." (|cFFFF3333" .. _math_floor ( (overheal / (overheal+total)) *100) .. "%|r):", formatedTotal .. " (".._cstr ("%.1f", ActorHealingTable[i][3]).."%)")
else
GameCooltip:AddLine (spellName ..": ", FormatTooltipNumber (_, ActorHealingTable[i][2]).." (".._cstr ("%.1f", ActorHealingTable[i][3]).."%)")
local formatedTotal = FormatTooltipNumber (_, ActorHealingTable[i][2])
local antiHeal = ActorHealingTable[i][8]
if (antiHeal) then
formatedTotal = formatedTotal .. " [|cFFFF5500" .. FormatTooltipNumber (_, _math_floor (antiHeal)) .." " .. Loc ["STRING_DAMAGE"] .."|r] "
end
GameCooltip:AddLine (spellName ..": ", formatedTotal .. " (" .. _cstr ("%.1f", ActorHealingTable[i][3]) .. "%)")
end
@@ -1804,7 +1843,15 @@ function atributo_heal:MontaInfoHealingDone()
for spellid, tabela in _pairs (tabela) do
local nome, rank, icone = _GetSpellInfo (spellid)
_table_insert (minhas_curas, {spellid, tabela.total, tabela.total/total*100, nome, icone})
_table_insert (minhas_curas, {
spellid,
tabela.total,
tabela.total/total*100,
nome,
icone,
false, --not a pet
tabela.anti_heal,
})
end
--> add pets
@@ -1817,7 +1864,14 @@ function atributo_heal:MontaInfoHealingDone()
local PetSkillsContainer = PetActor.spells._ActorTable
for _spellid, _skill in _pairs (PetSkillsContainer) do --> da foreach em cada spellid do container
local nome, _, icone = _GetSpellInfo (_spellid)
_table_insert (minhas_curas, {_spellid, _skill.total, _skill.total/total*100, nome .. " (|c" .. class_color .. PetName:gsub ((" <.*"), "") .. "|r)", icone, PetActor})
_table_insert (minhas_curas, {
_spellid,
_skill.total,
_skill.total/total*100,
nome .. " (|c" .. class_color .. PetName:gsub ((" <.*"), "") .. "|r)",
icone,
PetActor
})
end
end
end
@@ -1848,6 +1902,9 @@ function atributo_heal:MontaInfoHealingDone()
self:UpdadeInfoBar (barra, index, tabela[1], tabela[4], tabela[2], formated_value, max_, tabela[3], tabela[5], true)
else
local formated_value = SelectedToKFunction (_, _math_floor (tabela[2]))
if (tabela [7]) then
formated_value = formated_value .. " [|cFFFF5500" .. SelectedToKFunction (_, _math_floor (tabela [7])) .." " .. Loc ["STRING_DAMAGE"] .."|r] "
end
self:UpdadeInfoBar (barra, index, tabela[1], tabela[4], tabela[2], formated_value, max_, tabela[3], tabela[5], true)
end
@@ -2075,11 +2132,12 @@ function atributo_heal:MontaDetalhesHealingTaken (nome, barra)
end
end
local absorbed_table = {c = {1, 1, 1, 0.5}, p = 0}
local overhealing_table = {c = {0.5, 0.1, 0.1, 0.9}, p = 0}
local normal_table = {c = {1, 1, 1, 0.5}, p = 0}
local multistrike_table = {c = {1, 1, 1, 0.5}, p = 0}
local critical_table = {c = {1, 1, 1, 0.5}, p = 0}
local absorbed_table = {c = {1, 1, 1, 0.4}, p = 0}
local overhealing_table = {c = {0.5, 0.1, 0.1, 0.4}, p = 0}
local anti_heal_table = {c = {0.5, 0.1, 0.1, 0.4}, p = 0}
local normal_table = {c = {1, 1, 1, 0.4}, p = 0}
local multistrike_table = {c = {1, 1, 1, 0.4}, p = 0}
local critical_table = {c = {1, 1, 1, 0.4}, p = 0}
local data_table = {}
local t1, t2, t3, t4 = {}, {}, {}, {}
@@ -2236,6 +2294,7 @@ function atributo_heal:MontaDetalhesHealingDone (spellid, barra)
end
--> MULTISTRIKE
--[=[
if (esta_magia.m_amt > 0) then
local multistrike_hits = esta_magia.m_amt
@@ -2259,21 +2318,39 @@ function atributo_heal:MontaDetalhesHealingDone (spellid, barra)
t3[8] = multistrike_hits .. " [|cFFC0C0C0" .. _cstr ("%.1f", multistrike_hits / total_hits * 100) .. "%|r]"
end
--]=]
end
_table_sort (data, _detalhes.Sort1)
for i = #data+1, 3 do --> para o overheal aparecer na ultima barra
data[i] = nil
end
-- for i = #data+1, 2 do --> para o antiheal aparecer na penultima barra
-- data[i] = nil
-- end
--> anti heal
if (esta_magia.anti_heal and esta_magia.anti_heal > 0) then
local porcentagem_anti_heal = esta_magia.anti_heal / meu_total * 100
data[3] = t3
anti_heal_table.p = porcentagem_anti_heal
t3[1] = esta_magia.anti_heal
t3[2] = anti_heal_table
t3[3] = "Anti Heal"
t3[4] = ""
t3[5] = ""
t3[6] = ""
t3[7] = ""
t3[8] = _detalhes:comma_value (esta_magia.anti_heal) .. " / " .. _cstr ("%.1f", porcentagem_anti_heal) .. "%"
end
-- for i = #data+1, 3 do --> para o overheal aparecer na ultima barra
-- data[i] = nil
-- end
--> overhealing
if (overheal > 0) then
local porcentagem_overheal = overheal/meu_total*100
data[4] = t4
@@ -2293,7 +2370,6 @@ function atributo_heal:MontaDetalhesHealingDone (spellid, barra)
t4[6] = ""
t4[7] = ""
t4[8] = _detalhes:comma_value (overheal) .. " / " .. _cstr ("%.1f", porcentagem_overheal) .. "%"
end
for index = 1, 4 do
+78 -15
View File
@@ -376,12 +376,8 @@
--> Light of the Martyr - paladin spell which causes damage to the caster it self
elseif (spellid == SPELLID_PALADIN_LIGHTMARTYR) then -- or spellid == 183998 < healing part
local healingActor = healing_cache [who_name]
if (healingActor and healingActor.spells) then
healingActor.total = healingActor.total - (amount or 0)
end
return --> ignore this event
return parser:LOTM_damage (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand)
end
end
@@ -931,6 +927,73 @@
end
--special rule for LOTM
function parser:LOTM_damage (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand)
if (absorbed) then
amount = absorbed + (amount or 0)
end
local healingActor = healing_cache [who_serial]
if (healingActor and healingActor.spells) then
healingActor.total = healingActor.total - (amount or 0)
local spellTable = healingActor.spells:GetSpell (183998)
if (spellTable) then
spellTable.anti_heal = (spellTable.anti_heal or 0) + amount
end
end
local t = last_events_cache [who_name]
if (not t) then
t = _current_combat:CreateLastEventsTable (who_name)
end
local i = t.n
local this_event = t [i]
if (not this_event) then
return print ("Parser Event Error -> Set to 16 DeathLogs and /reload", i, _death_event_amt)
end
this_event [1] = true --> true if this is a damage || false for healing
this_event [2] = spellid --> spellid || false if this is a battle ress line
this_event [3] = amount --> amount of damage or healing
this_event [4] = time --> parser time
this_event [5] = _UnitHealth (who_name) --> current unit heal
this_event [6] = who_name --> source name
this_event [7] = absorbed
this_event [8] = school
this_event [9] = true --> friendly fire
this_event [10] = overkill
i = i + 1
if (i == _death_event_amt+1) then
t.n = 1
else
t.n = i
end
local damageActor = damage_cache [who_serial]
if (damageActor) then
--damage taken
damageActor.damage_taken = damageActor.damage_taken + amount
if (not damageActor.damage_from [who_name]) then --> adiciona a pool de dano tomado de quem
damageActor.damage_from [who_name] = true
end
--friendly fire
damageActor.friendlyfire_total = damageActor.friendlyfire_total + amount
local friend = damageActor.friendlyfire [who_name] or damageActor:CreateFFTable (who_name)
friend.total = friend.total + amount
friend.spells [spellid] = (friend.spells [spellid] or 0) + amount
end
end
--special rule of SLT
function parser:SLT_damage (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand)
--> damager
@@ -1288,19 +1351,19 @@
------------------------------------------------------------------------------------------------
--> get actors
local este_jogador, meu_dono = healing_cache [who_name]
local este_jogador, meu_dono = healing_cache [who_serial]
if (not este_jogador) then --> pode ser um desconhecido ou um pet
este_jogador, meu_dono, who_name = _current_heal_container:PegarCombatente (who_serial, who_name, who_flags, true)
if (not meu_dono and who_flags) then --> se n�o for um pet, adicionar no cache
healing_cache [who_name] = este_jogador
if (not meu_dono and who_flags and who_serial ~= "") then --> se n�o for um pet, adicionar no cache
healing_cache [who_serial] = este_jogador
end
end
local jogador_alvo, alvo_dono = healing_cache [alvo_name]
local jogador_alvo, alvo_dono = healing_cache [alvo_serial]
if (not jogador_alvo) then
jogador_alvo, alvo_dono, alvo_name = _current_heal_container:PegarCombatente (alvo_serial, alvo_name, alvo_flags, true)
if (not alvo_dono and alvo_flags) then
healing_cache [alvo_name] = jogador_alvo
if (not alvo_dono and alvo_flags and also_serial ~= "") then
healing_cache [alvo_serial] = jogador_alvo
end
end
@@ -1592,7 +1655,7 @@
local este_jogador, meu_dono = healing_cache [who_serial]
if (not este_jogador) then --> pode ser um desconhecido ou um pet
este_jogador, meu_dono, who_name = _current_heal_container:PegarCombatente (who_serial, who_name, who_flags, true)
if (not meu_dono and who_flags) then --> se n�o for um pet, adicionar no cache
if (not meu_dono and who_flags and who_serial ~= "") then --> se n�o for um pet, adicionar no cache
healing_cache [who_serial] = este_jogador
end
end
@@ -1600,7 +1663,7 @@
local jogador_alvo, alvo_dono = healing_cache [alvo_serial]
if (not jogador_alvo) then
jogador_alvo, alvo_dono, alvo_name = _current_heal_container:PegarCombatente (alvo_serial, alvo_name, alvo_flags, true)
if (not alvo_dono and alvo_flags) then
if (not alvo_dono and alvo_flags and alvo_serial ~= "") then
healing_cache [alvo_serial] = jogador_alvo
end
end
+4 -2
View File
@@ -4136,7 +4136,7 @@ local create_deathrecap_line = function (parent, n)
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)
amount:SetPoint ("left", line, "left", 240, 0)
lifePercent:SetPoint ("left", line, "left", 320, 0)
--text colors
@@ -4624,9 +4624,11 @@ function _detalhes.OpenDetailsDeathRecap (segment, RecapID, fromChat)
end
spellName = spellName:gsub (L["STRING_DOT"], "")
--print ("link.lua", L["STRING_DOT"], spellName, spellName:find (L["STRING_DOT"]), spellName:gsub (L["STRING_DOT"], ""))
source = source or ""
line.sourceName:SetText (spellName .. " (" .. "|cFFC6B0D9" .. source .. "|r" .. ")")
DetailsFramework:TruncateText (line.sourceName, 185)
if (amount > 1000) then
--line.amount:SetText ("-" .. _detalhes:ToK (amount))
@@ -4642,7 +4644,7 @@ function _detalhes.OpenDetailsDeathRecap (segment, RecapID, fromChat)
if (_detalhes.death_recap.show_life_percent) then
line.lifePercent:Show()
line.amount:SetPoint ("left", line, "left", 220, 0)
line.amount:SetPoint ("left", line, "left", 240, 0)
line.lifePercent:SetPoint ("left", line, "left", 320, 0)
else
line.lifePercent:Hide()
+6
View File
@@ -55,6 +55,10 @@ do
end
end
local lightOfTheMartyr_Name, _, lightOfTheMartyr_Icon = _GetSpellInfo (196917)
lightOfTheMartyr_Name = lightOfTheMartyr_Name or "Deprecated Spell - Light of the Martyr"
lightOfTheMartyr_Icon = lightOfTheMartyr_Icon or ""
local default_user_spells = {
[1] = {name = Loc ["STRING_MELEE"], icon = [[Interface\ICONS\INV_Sword_04]]},
[2] = {name = Loc ["STRING_AUTOSHOT"], icon = [[Interface\ICONS\INV_Weapon_Bow_07]]},
@@ -65,6 +69,8 @@ do
[7] = {name = Loc ["STRING_ENVIRONMENTAL_LAVA"], icon = [[Interface\ICONS\Ability_Rhyolith_Volcano]]},
[8] = {name = Loc ["STRING_ENVIRONMENTAL_SLIME"], icon = [[Interface\ICONS\Ability_Creature_Poison_02]]},
[196917] = {name = lightOfTheMartyr_Name .. " (" .. Loc ["STRING_DAMAGE"] .. ")", icon = lightOfTheMartyr_Icon},
[98021] = {name = Loc ["STRING_SPIRIT_LINK_TOTEM"]},
[44461] = {name = GetSpellInfo (44461) .. " (" .. Loc ["STRING_EXPLOSION"] .. ")"}, --> Living Bomb (explosion)
+4
View File
@@ -3363,6 +3363,10 @@ do
[127] = {name = STRING_SCHOOL_CHAOS, formated = "|cFFFF1111" .. STRING_SCHOOL_CHAOS .. "|r", hex = "FFFF1111", rgb = {255, 17, 17}, decimals = {1.0000, 0.0667, 0.0667}},
}
_detalhes.OverrideSpellSchool = {
--[196917] = 126, --light of the martyr - from holy to fire
}
function _detalhes:GetSpellSchoolName (school)
return _detalhes.spells_school [school] and _detalhes.spells_school [school].name or ""
end
+6 -4
View File
@@ -560,8 +560,10 @@ function gump:SetaDetalheInfoAltura (index, xmod, ymod)
info.dano_porcento:SetPoint ("TOPRIGHT", background, "TOPRIGHT", -x + right, y + (-24))
info.dano_dps:SetPoint ("TOPRIGHT", background, "TOPRIGHT", -x + right, y + (-44))
info.bg:SetPoint ("TOPLEFT", background, "TOPLEFT", 0, 0)
info.bg:SetHeight (background:GetHeight())
info.bg:SetPoint ("TOPLEFT", background, "TOPLEFT", 1, -1)
info.bg:SetHeight (background:GetHeight() - 2)
info.bg:SetWidth (info.bg:GetWidth() - 2) --ofcourse why not
info.bg_end:SetPoint ("LEFT", info.bg, "LEFT", info.bg:GetValue()*2.19, 0)
info.bg_end:SetHeight (background:GetHeight()+2)
info.bg_end:SetWidth (6)
@@ -581,10 +583,10 @@ function gump:SetaDetalheInfoTexto (index, p, arg1, arg2, arg3, arg4, arg5, arg6
if (p) then
if (_type (p) == "table") then
info.bg:SetValue (p.p)
--info.bg:SetStatusBarColor (p.c[1], p.c[2], p.c[3], p.c[4] or 1)
info.bg:SetStatusBarColor (p.c[1], p.c[2], p.c[3], p.c[4] or 1)
else
info.bg:SetValue (p)
--info.bg:SetStatusBarColor (1, 1, 1, 0.5)
info.bg:SetStatusBarColor (1, 1, 1, .5)
end
--if (index == 1) then