From e0e09ce6a4ec16473ddd4024b5d8da33376b8603 Mon Sep 17 00:00:00 2001 From: Tercio Date: Sun, 4 Jun 2017 18:54:41 -0300 Subject: [PATCH] - 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. --- boot.lua | 10 +- core/parser.lua | 15 +- functions/link.lua | 430 +++++++++++++++++++++++++++++++++++++++ functions/profiles.lua | 7 + gumps/janela_options.lua | 63 +++++- 5 files changed, 511 insertions(+), 14 deletions(-) diff --git a/boot.lua b/boot.lua index 97ed5939..b27615de 100644 --- a/boot.lua +++ b/boot.lua @@ -3,7 +3,7 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") - _detalhes.build_counter = 3703 + _detalhes.build_counter = 3797 _detalhes.userversion = "v7.2.0." .. _detalhes.build_counter _detalhes.realversion = 119 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" @@ -21,14 +21,14 @@ do local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) --[[ -|cFFFFFF00v7.2.0.3703.119 (|cFFFFCC00May 28th, 2017|r|cFFFFFF00)|r:\n\n -|cFFFFFF00-|r Fixed an error while killing low level mobs with warrior class.\n\n -|cFFFFFF00-|r Added custom display 'Damage on Shields', useful for encounter like Maiden of Vigilance where there's big shields to be removed and you want to know who is doing more damage to it. +|cFFFFFF00v7.2.0.3797.119 (|cFFFFCC00June 04th, 2017|r|cFFFFFF00)|r:\n\n +|cFFFFFF00-|r New Death Recap implemented! replaces the default from Blizzard and can be configured at Options > Raid Tools.\n\n +|cFFFFFF00-|r Fixed Paladin 'Light of the Martyr' damage to self.\n\n --]] -- - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v7.2.0.3703.119 (|cFFFFCC00May 29th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an error while killing low level mobs with warrior class.\n\n|cFFFFFF00-|r Added custom display 'Damage on Shields', useful for encounter like Maiden of Vigilance where there's big shields to be removed and you want to know who is doing more damage to it.\n\n|cFFFFFF00v7.2.0.3693.118 (|cFFFFCC00May 25th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fury Warrior shouldn't be assigned as Protection any more.\n\n|cFFFFFF00-|r Some parser fixes.\n\n|cFFFFFF00v7.2.0.3673.118 (|cFFFFCC00May 09th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Heal Absorbed display under Heal bracket.\n\nHeal Absoorb are the heal denied by abilities such like DK's Necrotic Strike or raid boss Chromatic Anomaly's 'Time Release' ability.\nThe tooltip of this display shows which players got heal denied, which abilities absorbed the heal, which abilities tried to heal but got the heal denied.\n\n|cFFFFFF00-|r Added Alternate Power display under Energy bracket.\n\n|cFFFFFF00-|r Ticket #187: Fixed an issue when comparing hunter pets on the player detail window.\n\n|cFFFFFF00-|r Ticket #189 #186: Fixed a taint issue for some classes when using friendly nameplates on.\n\n|cFFFFFF00v7.2.0.3512.116 (|cFFFFCC00April 27th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Havoc Demon Hunter: your fury energy is being shown under Mana Restored (don't ask me why, the combat log is telling us it's mana).\n\n|cFFFFFF00-|r Pets now are shown on damage tooltips.\n\n|cFFFFFF00-|r Pets are now also shown on the comparison panel.\n\n|cFFFFFF00v7.2.0.3474.116 (|cFFFFCC00April 20th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Plugin: Raid Check > added some food buffs which wasn't being tracked.\n\n|cFFFFFF00v7.2.0.3467.116 (|cFFFFCC00April 07th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for the custom display window where apply and cancel buttons where over the edit window.\n\n|cFFFFFF00-|r Fix for an issue on editing a bookmark.\n\n|cFFFFFF00v7.1.5.3459.116 (|cFFFFCC00Mar 21th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue on dynamic overall data where it wasn't showing DPS.\n\n|cFFFFFF00-|r Fixed an issue with Apply, Save and Cancel buttons when editing a custom display.\n\n|cFFFFFF00-|r Removed the Damage and Healing presets for custom displays, now is only possible create custom displays by scripting them.\n\n|cFFFFFF00v7.1.5.3431.116 (|cFFFFCC00Mar 15th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with bar orientation right to left where fixed bar color isn't working.\n\n|cFFFFFF00-|r The nickname field now use FrizQuadrataTT font and shall be compatible with Cyrillic.\n\n|cFFFFFF00v7.1.5.3418.116 (|cFFFFCC00Mar 1st, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Ticket #167 fix: Light of the Martyr self-damage now does reduce the healing done (following WCL method).\n\n|cFFFFFF00-|r Ticket #169 fix: Damage Prevented is now working for new segments.\n\n|cFFFFFF00-|r Fixed an issue where sometimes BeastMaster's Hati pet wasn't detected correctly.\n\n|cFFFFFF00v7.1.5.3369.116 (|cFFFFCC00Feb 07th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added custom display 'Dynamic Overall Damage' for mythic dungeons.\n\n|cFFFFFF00-|r Fix for Ticket #168: 'Auto Hide While [Not] Inside Instance is broken'.\n\n|cFFFFFF00-|r The bar truncate frame 'DetailsLeftTextAntiTruncate' is now created on Details! load instead on demand.\n\n|cFFFFFF00v7.1.5.3315.116 (|cFFFFCC00Jan 23th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Ticket #162: 'no Monochrome font' available, added an experimental slash command: /run _detalhes:UseOutline ('MONOCHROME').\n\n|cFFFFFF00-|r Ticket #158: 'no elapsed time shown on report to chat', added the elapsed time when reporting a segment.\n\n|cFFFFFF00-|r Ticket #164: 'error when browsing segments', an attempt to fix the problem has been made.\n\n|cFFFFFF00v7.1.5.3305.116 (|cFFFFCC00Jan 15th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Another fix for mythic dungeons overall data reset (thanks Tharai @ Curseforge).\n\n|cFFFFFF00-|r Fix for spec detection on PvP Arenas (thanks Pas06 @ Curseforge).\n\n|cFFFFFF00v7.1.0.3276.115 (|cFFFFCC00Jan 08th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed the overall data not reseting when starting a new mythic+ dungeon.\n\n|cFFFFFF00v7.1.0.3266.115 (|cFFFFCC00Dec 29th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with overall data not updating correctly at the end of the combat.\n\n|cFFFFFF00-|r Added a tutorial line on the window when the user access overall data.\n\n|cFFFFFF00v7.1.0.3236.115 (|cFFFFCC00Dec 19th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Integration with BigWigs should be working okay now.\n\n|cFFFFFF00v7.1.0.3231.115 (|cFFFFCC00Dec 15th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Disabled the link with BigWigs to avoid the 'RegisterMessage' error on every login.\n\n|cFFFFFF00v7.1.0.3229.115 (|cFFFFCC00Dec 09th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r When a window is locked, resize grips shouldn't be enabled messing with bar mouse over.\n\n|cFFFFFF00v7.0.3.3222.115 (|cFFFFCC00November 28th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Unstable Affliction to common spells with the same name.\n\n|cFFFFFF00-|r Fixed few issues with built-in plugins.\n\n|cFFFFFF00v7.0.3.3202.115 (|cFFFFCC00November 08th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Weakauras creator from the Encounter Details plugin and '/details forge' shall work correctly now with Trials of Valor.\n\n|cFFFFFF00-|r Raid history should now be recording your Trials of Valor kills.\n\n|cFFFFFF00-|r Added Trials of Valor raid info, good luck and have fun!.\n\n|cFFFFFF00v7.0.3.3201.115 (|cFFFFCC00November 04th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for Paladin holy icon.\n\n|cFFFFFF00-|r Fix for Rogue outlaw icon.\n\n|cFFFFFF00-|r Fixed misc displays with bar sorted by ascending order.\n\n|cFFFFFF00-|r Fix for '/details show' command while the window is on auto hide.\n\n|cFFFFFF00v7.0.3.3114.115 (|cFFFFCC00October 26th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Encounter Details (plugin): tooltip tutorial is now clamped to screen and its close button should be visible.\n\n|cFFFFFF00-|r Raid Check (plugin): now also works on dungeons.\n\n|cFFFFFF00-|r Added Potion of the Prolongued Power to the tracker.\n\n|cFFFFFF00v7.1.0.3097.115 (|cFFFFCC00October 25th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r renamed 'report history' to 'latest reports'.\n\n|cFFFFFF00-|r attempt to make all Details! users on the party or raid to track rogue's akaari's soul." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v7.2.0.3797.119 (|cFFFFCC00June 04th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r New Death Recap implemented! replaces the default from Blizzard and can be configured at Options > Raid Tools.\n\n|cFFFFFF00-|r Fixed Paladin 'Light of the Martyr' damage to self.\n\n|cFFFFFF00v7.2.0.3703.119 (|cFFFFCC00May 29th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an error while killing low level mobs with warrior class.\n\n|cFFFFFF00-|r Added custom display 'Damage on Shields', useful for encounter like Maiden of Vigilance where there's big shields to be removed and you want to know who is doing more damage to it.\n\n|cFFFFFF00v7.2.0.3693.118 (|cFFFFCC00May 25th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fury Warrior shouldn't be assigned as Protection any more.\n\n|cFFFFFF00-|r Some parser fixes.\n\n|cFFFFFF00v7.2.0.3673.118 (|cFFFFCC00May 09th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Heal Absorbed display under Heal bracket.\n\nHeal Absoorb are the heal denied by abilities such like DK's Necrotic Strike or raid boss Chromatic Anomaly's 'Time Release' ability.\nThe tooltip of this display shows which players got heal denied, which abilities absorbed the heal, which abilities tried to heal but got the heal denied.\n\n|cFFFFFF00-|r Added Alternate Power display under Energy bracket.\n\n|cFFFFFF00-|r Ticket #187: Fixed an issue when comparing hunter pets on the player detail window.\n\n|cFFFFFF00-|r Ticket #189 #186: Fixed a taint issue for some classes when using friendly nameplates on.\n\n|cFFFFFF00v7.2.0.3512.116 (|cFFFFCC00April 27th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Havoc Demon Hunter: your fury energy is being shown under Mana Restored (don't ask me why, the combat log is telling us it's mana).\n\n|cFFFFFF00-|r Pets now are shown on damage tooltips.\n\n|cFFFFFF00-|r Pets are now also shown on the comparison panel.\n\n|cFFFFFF00v7.2.0.3474.116 (|cFFFFCC00April 20th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Plugin: Raid Check > added some food buffs which wasn't being tracked.\n\n|cFFFFFF00v7.2.0.3467.116 (|cFFFFCC00April 07th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for the custom display window where apply and cancel buttons where over the edit window.\n\n|cFFFFFF00-|r Fix for an issue on editing a bookmark.\n\n|cFFFFFF00v7.1.5.3459.116 (|cFFFFCC00Mar 21th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue on dynamic overall data where it wasn't showing DPS.\n\n|cFFFFFF00-|r Fixed an issue with Apply, Save and Cancel buttons when editing a custom display.\n\n|cFFFFFF00-|r Removed the Damage and Healing presets for custom displays, now is only possible create custom displays by scripting them.\n\n|cFFFFFF00v7.1.5.3431.116 (|cFFFFCC00Mar 15th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with bar orientation right to left where fixed bar color isn't working.\n\n|cFFFFFF00-|r The nickname field now use FrizQuadrataTT font and shall be compatible with Cyrillic.\n\n|cFFFFFF00v7.1.5.3418.116 (|cFFFFCC00Mar 1st, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Ticket #167 fix: Light of the Martyr self-damage now does reduce the healing done (following WCL method).\n\n|cFFFFFF00-|r Ticket #169 fix: Damage Prevented is now working for new segments.\n\n|cFFFFFF00-|r Fixed an issue where sometimes BeastMaster's Hati pet wasn't detected correctly.\n\n|cFFFFFF00v7.1.5.3369.116 (|cFFFFCC00Feb 07th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added custom display 'Dynamic Overall Damage' for mythic dungeons.\n\n|cFFFFFF00-|r Fix for Ticket #168: 'Auto Hide While [Not] Inside Instance is broken'.\n\n|cFFFFFF00-|r The bar truncate frame 'DetailsLeftTextAntiTruncate' is now created on Details! load instead on demand.\n\n|cFFFFFF00v7.1.5.3315.116 (|cFFFFCC00Jan 23th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Ticket #162: 'no Monochrome font' available, added an experimental slash command: /run _detalhes:UseOutline ('MONOCHROME').\n\n|cFFFFFF00-|r Ticket #158: 'no elapsed time shown on report to chat', added the elapsed time when reporting a segment.\n\n|cFFFFFF00-|r Ticket #164: 'error when browsing segments', an attempt to fix the problem has been made.\n\n|cFFFFFF00v7.1.5.3305.116 (|cFFFFCC00Jan 15th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Another fix for mythic dungeons overall data reset (thanks Tharai @ Curseforge).\n\n|cFFFFFF00-|r Fix for spec detection on PvP Arenas (thanks Pas06 @ Curseforge).\n\n|cFFFFFF00v7.1.0.3276.115 (|cFFFFCC00Jan 08th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed the overall data not reseting when starting a new mythic+ dungeon.\n\n|cFFFFFF00v7.1.0.3266.115 (|cFFFFCC00Dec 29th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with overall data not updating correctly at the end of the combat.\n\n|cFFFFFF00-|r Added a tutorial line on the window when the user access overall data.\n\n|cFFFFFF00v7.1.0.3236.115 (|cFFFFCC00Dec 19th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Integration with BigWigs should be working okay now.\n\n|cFFFFFF00v7.1.0.3231.115 (|cFFFFCC00Dec 15th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Disabled the link with BigWigs to avoid the 'RegisterMessage' error on every login.\n\n|cFFFFFF00v7.1.0.3229.115 (|cFFFFCC00Dec 09th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r When a window is locked, resize grips shouldn't be enabled messing with bar mouse over.\n\n|cFFFFFF00v7.0.3.3222.115 (|cFFFFCC00November 28th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Unstable Affliction to common spells with the same name.\n\n|cFFFFFF00-|r Fixed few issues with built-in plugins.\n\n|cFFFFFF00v7.0.3.3202.115 (|cFFFFCC00November 08th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Weakauras creator from the Encounter Details plugin and '/details forge' shall work correctly now with Trials of Valor.\n\n|cFFFFFF00-|r Raid history should now be recording your Trials of Valor kills.\n\n|cFFFFFF00-|r Added Trials of Valor raid info, good luck and have fun!.\n\n|cFFFFFF00v7.0.3.3201.115 (|cFFFFCC00November 04th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for Paladin holy icon.\n\n|cFFFFFF00-|r Fix for Rogue outlaw icon.\n\n|cFFFFFF00-|r Fixed misc displays with bar sorted by ascending order.\n\n|cFFFFFF00-|r Fix for '/details show' command while the window is on auto hide.\n\n|cFFFFFF00v7.0.3.3114.115 (|cFFFFCC00October 26th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Encounter Details (plugin): tooltip tutorial is now clamped to screen and its close button should be visible.\n\n|cFFFFFF00-|r Raid Check (plugin): now also works on dungeons.\n\n|cFFFFFF00-|r Added Potion of the Prolongued Power to the tracker.\n\n|cFFFFFF00v7.1.0.3097.115 (|cFFFFCC00October 25th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r renamed 'report history' to 'latest reports'.\n\n|cFFFFFF00-|r attempt to make all Details! users on the party or raid to track rogue's akaari's soul." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " diff --git a/core/parser.lua b/core/parser.lua index bcf058d3..f466b7d2 100644 --- a/core/parser.lua +++ b/core/parser.lua @@ -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 diff --git a/functions/link.lua b/functions/link.lua index c861f286..d1fcc6d7 100644 --- a/functions/link.lua +++ b/functions/link.lua @@ -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) + + + \ No newline at end of file diff --git a/functions/profiles.lua b/functions/profiles.lua index 212c5317..f5cf5b2f 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -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 diff --git a/gumps/janela_options.lua b/gumps/janela_options.lua index 7869e1d0..30fa65f1 100644 --- a/gumps/janela_options.lua +++ b/gumps/janela_options.lua @@ -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},