diff --git a/Details.toc b/Details.toc index 110c7209..1c39dc84 100644 --- a/Details.toc +++ b/Details.toc @@ -16,6 +16,7 @@ locales\Details-deDE.lua locales\Details-frFR.lua locales\Details-koKR.lua locales\Details-ruRU.lua +locales\Details-zhCN.lua locales\Details-zhTW.lua boot.lua diff --git a/boot.lua b/boot.lua index 0dd1106d..e156cd4d 100644 --- a/boot.lua +++ b/boot.lua @@ -4,8 +4,8 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") _detalhes.build_counter = 656 --it's 656 for release - _detalhes.userversion = "v3.10.10" - _detalhes.realversion = 62 --core version + _detalhes.userversion = "v3.11.0" + _detalhes.realversion = 63 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -20,19 +20,14 @@ do local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) --[[ -|cFFFFFF00v3.10.10 (|cFFFFCC00Mar 10, 2015|r|cFFFFFF00)|r:\n\n -|cFFFFFF00-|r Advanced Death Logs (plugin): done a calibration on endurance calculation.\n\n -|cFFFFFF00-|r Raid Check (plugin): now also show information for 50+ stats runes.\n\n -|cFFFFFF00-|r Fixed cooldowns spell targets on overall data.\n\n -|cFFFFFF00-|r Fixed report custom displays where sometimes it didn't report spell links.\n\n -|cFFFFFF00-|r Replaced old report line saying 'for the last X segments' with 'overall data'.\n\n -|cFFFFFF00-|r Mini-displays on statusbar are now more responsible to right button click.\n\n -|cFFFFFF00-|r Added Mage's Greater Invisibility as cooldown.\n\n +|cFFFFFF00v3.11.0 (|cFFFFCC00Mar 13, 2015|r|cFFFFFF00)|r:\n\n +|cFFFFFF00-|r Added an option for change the amount of lines on death log.\n\n +|cFFFFFF00-|r Added custom display for CC done.\n\n --]] -- - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.10.10 (|cFFFFCC00Mar 10, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): done a calibration on endurance calculation.\n\n|cFFFFFF00-|r Raid Check (plugin): now also show information for 50+ stats runes.\n\n|cFFFFFF00-|r Fixed cooldowns spell targets on overall data.\n\n|cFFFFFF00-|r Fixed report custom displays where sometimes it didn't report spell links.\n\n|cFFFFFF00-|r Replaced old report line saying 'for the last X segments' with 'overall data'.\n\n|cFFFFFF00-|r Mini-displays on statusbar are now more responsible to right button click.\n\n|cFFFFFF00-|r Added Mage's Greater Invisibility as cooldown.\n\n|cFFFFFF00v3.10.8 (|cFFFFCC00Mar 02, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Improved aura creation.\n\n|cFFFFFF00-|r Custom display 'My Spells' now also show your pets.\n\n|cFFFFFF00-|r Fixed 'Raid Check' plugin food detection.\n\n|cFFFFFF00v3.10.6 (|cFFFFCC00Feb 24, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Encounter Details (plugin): several bug fixes and improvements.\n\n|cFFFFFF00-|r Encounter Details (plugin): added new tab showing enemy spells from the encounter with an aura creation panel.\n\n|cFFFFFF00-|r Encounter Details (plugin): added phase indicators on graphic tab, hovering over shows the damage and heal for that specific phase.\n\n|cFFFFFF00-|r Segments menu now also show the encounter try number plus the elapsed combat time.\n\n|cFFFFFF00-|r Several improvements on Overall Data, also, now it has an option to not save it when the character logoff.\n\n|cFFFFFF00-|r Player Details window now closes with right click on any bar.\n\n|cFFFFFF00-|r Fixed Nature's Vigil cooldown.\n\n|cFFFFFF00v3.9.12a (|cFFFFCC00Feb 16, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Roll back on combat detection after reset data, might be causing problems.\n\n|cFFFFFF00v3.9.12 (|cFFFFCC00Feb 13, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): got report buttons for Endurance and Deaths Overall Damage.\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): the Deaths and Endurance limits can now be changed under the plugin options.\n\n|cFFFFFF00-|r Chart Viewer (plugin): has been revamped and now it's less complicated to use.\n\n|cFFFFFF00-|r Time Line (plugin): added options to change the background color and scale.\n\n|cFFFFFF00-|r Raid Check (plugin): its window is now 'always on top'.\n\n|cFFFFFF00-|r Accuracy adjustments on overheal of Divine Aegis and Illuminated Healing.\n\n|cFFFFFF00-|r Removed healthstone from cooldown list, added Nature's Vigil.\n\n|cFFFFFF00-|r Enemies display now shows damage taken instead of damage done.\n\n|cFFFFFF00-|r Tooltip for enemies display now also show damage and healing done by the enemy.\n\n|cFFFFFF00-|r Added an option under miscellaneous to show neutral and hostile creatures on damage taken display.\n\n|cFFFFFF00-|r Added an option to ignore nicknames and always use character names.\n\n|cFFFFFF00-|r Enabling the display icon on title bar now makes the title text automatically move slightly to right.\n\n|cFFFFFF00-|r Fixed issue with skin changing when the window has the statusbar enabled.\n\n|cFFFFFF00v3.9.4 (|cFFFFCC00Feb 03, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added option 'Ignore Mass Toggle', when enabled the window won't be affected when hiding, showing or toggling all windows.\n\n|cFFFFFF00-|r Added window number for slash commands 'hide', 'show' and 'toggle'. Usage: '/details hide 1' to hide window 1.\n\n|cFFFFFF00-|r Removed keybinds for Open and Close, added toggle instead.\n\n|cFFFFFF00-|r Added slash command 'toggle'.\n\n|cFFFFFF00-|r Added display icons for all skins which still didn't have they.\n\n|cFFFFFF00-|r Improved 'Align with right chat' tool, now it also supports Forced Square skin.\n\n|cFFFFFF00-|r Improvements on Bookmark panel.\n\n|cFFFFFF00-|r Improvements on spec icons with transparency.\n\n|cFFFFFF00-|r Created custom spell for Living Bomb explosion.\n\n|cFFFFFF00-|r Fixed statusbar textures and mini displays.\n\n|cFFFFFF00-|r Fixed an issue with title bar buttons when toggling the titlebar anchor from bottom to top position.\n\n|cFFFFFF00-|r Fixed an issue with title bar text when toggling the statusbar position from bottom to top.\n\n|cFFFFFF00-|r Fixed yet another bug with avoidance tab on player detail window.\n\n|cFFFFFF00-|r Fixed the window ungroup button (above the resize one).\n\n|cFFFFFF00v3.8.13 (|cFFFFCC00Jan 26, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r RaidCheck (plugin): added an option to be able to use the report panel.\n\n|cFFFFFF00-|r You Are Not Prepared (plugin): added Auto Close the window, can be disabled through its options panel.\n\n|cFFFFFF00-|r Vanguard (plugin): Added Options Panel.\n\n|cFFFFFF00-|r Details! is now using 'LibWindow-1.1' to save and restore the positioning of the windows, bug might appear, please report if something weird happen.\n\n|cFFFFFF00-|r Improved specialization detection in order to try detect spec changes.\n\n|cFFFFFF00-|r Added options to change the brackets and the separator for dps/percent block.\n\n|cFFFFFF00-|r Added options for show (or hide) totals, dps and percent amount.\n\n|cFFFFFF00-|r Added Segments shortcut menu pressing Shift + Right click.\n\n|cFFFFFF00-|r Fixed positioning after reopen a window previously closed on last logon.\n\n|cFFFFFF00-|r Fixed enemies display where sometimes the bars were black instead of red.\n\n|cFFFFFF00-|r Fixed few places where spec icons wasn't being used on.\n\n|cFFFFFF00-|r Fixed avoidance panel on Player Details Window where sometimes was giving errors.\n\n|cFFFFFF00-|r Fixed priest shadow and holy detection.\n\n|cFFFFFF00-|r Fixed blood and unholy spec icons.\n\n|cFFFFFF00-|r Fixed an issue with 'Always Show me' feature where it was showing the player on Enemies display.\n\n|cFFFFFF00v3.8.1 (|cFFFFCC00Jan 17, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Plugin Vanguard: got full rewrite and now it is more easy to use.\n\n|cFFFFFF00-|r Plugin TimeAttack: fixed problem where sometimes required a reload to start a new time.\n\n|cFFFFFF00-|r Plugin Damage the Game!: fixed a problem where sometimes the time didn't started after level 2.\n\n|cFFFFFF00-|r Added specialization icons.\n\n|cFFFFFF00-|r Fixed Auto-Hide where it wasn't hiding the wallpaper of the window.\n\n|cFFFFFF00-|r Added 'Editing Group' check box on option panel, when enabled, settings changed also are modified on all windows in the group.\n\n|cFFFFFF00-|r Changing window's skin, doesn't change any more settings not related with appearance, for example, Auto-Hide, Switches.\n\n|cFFFFFF00-|r Custom display 'Health Potion & Stone' now also track Healing Tonic.\n\n|cFFFFFF00-|r Custom display 'Damage Taken by Spell' now tracks more spells and also melee hits.\n\n|cFFFFFF00-|r Menus now uses 'Friz Quadrata TT' font as default, also added an option to change it on options panel -> miscellaneous.\n\n|cFFFFFF00-|r 'Switch to Current' feature now switches all windows which have this option enabled.\n\n|cFFFFFF00-|r The message telling to use '/details reinstall' now only shows if a problem happen during the addon load process.\n\n|cFFFFFF00-|r Segments Saved option now can be set to 25, up from 5.\n\n|cFFFFFF00-|r Attempt to fix the bug with the monk spell 'Storm, Earth, and Fire'." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.11.0 (|cFFFFCC00Mar 13, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added an option for change the amount of lines on death log.\n\n|cFFFFFF00-|r Added custom display for CC done.\n\n|cFFFFFF00v3.10.10 (|cFFFFCC00Mar 10, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): done a calibration on endurance calculation.\n\n|cFFFFFF00-|r Raid Check (plugin): now also show information for 50+ stats runes.\n\n|cFFFFFF00-|r Fixed cooldowns spell targets on overall data.\n\n|cFFFFFF00-|r Fixed report custom displays where sometimes it didn't report spell links.\n\n|cFFFFFF00-|r Replaced old report line saying 'for the last X segments' with 'overall data'.\n\n|cFFFFFF00-|r Mini-displays on statusbar are now more responsible to right button click.\n\n|cFFFFFF00-|r Added Mage's Greater Invisibility as cooldown.\n\n|cFFFFFF00v3.10.8 (|cFFFFCC00Mar 02, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Improved aura creation.\n\n|cFFFFFF00-|r Custom display 'My Spells' now also show your pets.\n\n|cFFFFFF00-|r Fixed 'Raid Check' plugin food detection.\n\n|cFFFFFF00v3.10.6 (|cFFFFCC00Feb 24, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Encounter Details (plugin): several bug fixes and improvements.\n\n|cFFFFFF00-|r Encounter Details (plugin): added new tab showing enemy spells from the encounter with an aura creation panel.\n\n|cFFFFFF00-|r Encounter Details (plugin): added phase indicators on graphic tab, hovering over shows the damage and heal for that specific phase.\n\n|cFFFFFF00-|r Segments menu now also show the encounter try number plus the elapsed combat time.\n\n|cFFFFFF00-|r Several improvements on Overall Data, also, now it has an option to not save it when the character logoff.\n\n|cFFFFFF00-|r Player Details window now closes with right click on any bar.\n\n|cFFFFFF00-|r Fixed Nature's Vigil cooldown.\n\n|cFFFFFF00v3.9.12a (|cFFFFCC00Feb 16, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Roll back on combat detection after reset data, might be causing problems.\n\n|cFFFFFF00v3.9.12 (|cFFFFCC00Feb 13, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): got report buttons for Endurance and Deaths Overall Damage.\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): the Deaths and Endurance limits can now be changed under the plugin options.\n\n|cFFFFFF00-|r Chart Viewer (plugin): has been revamped and now it's less complicated to use.\n\n|cFFFFFF00-|r Time Line (plugin): added options to change the background color and scale.\n\n|cFFFFFF00-|r Raid Check (plugin): its window is now 'always on top'.\n\n|cFFFFFF00-|r Accuracy adjustments on overheal of Divine Aegis and Illuminated Healing.\n\n|cFFFFFF00-|r Removed healthstone from cooldown list, added Nature's Vigil.\n\n|cFFFFFF00-|r Enemies display now shows damage taken instead of damage done.\n\n|cFFFFFF00-|r Tooltip for enemies display now also show damage and healing done by the enemy.\n\n|cFFFFFF00-|r Added an option under miscellaneous to show neutral and hostile creatures on damage taken display.\n\n|cFFFFFF00-|r Added an option to ignore nicknames and always use character names.\n\n|cFFFFFF00-|r Enabling the display icon on title bar now makes the title text automatically move slightly to right.\n\n|cFFFFFF00-|r Fixed issue with skin changing when the window has the statusbar enabled.\n\n|cFFFFFF00v3.9.4 (|cFFFFCC00Feb 03, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added option 'Ignore Mass Toggle', when enabled the window won't be affected when hiding, showing or toggling all windows.\n\n|cFFFFFF00-|r Added window number for slash commands 'hide', 'show' and 'toggle'. Usage: '/details hide 1' to hide window 1.\n\n|cFFFFFF00-|r Removed keybinds for Open and Close, added toggle instead.\n\n|cFFFFFF00-|r Added slash command 'toggle'.\n\n|cFFFFFF00-|r Added display icons for all skins which still didn't have they.\n\n|cFFFFFF00-|r Improved 'Align with right chat' tool, now it also supports Forced Square skin.\n\n|cFFFFFF00-|r Improvements on Bookmark panel.\n\n|cFFFFFF00-|r Improvements on spec icons with transparency.\n\n|cFFFFFF00-|r Created custom spell for Living Bomb explosion.\n\n|cFFFFFF00-|r Fixed statusbar textures and mini displays.\n\n|cFFFFFF00-|r Fixed an issue with title bar buttons when toggling the titlebar anchor from bottom to top position.\n\n|cFFFFFF00-|r Fixed an issue with title bar text when toggling the statusbar position from bottom to top.\n\n|cFFFFFF00-|r Fixed yet another bug with avoidance tab on player detail window.\n\n|cFFFFFF00-|r Fixed the window ungroup button (above the resize one).\n\n|cFFFFFF00v3.8.13 (|cFFFFCC00Jan 26, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r RaidCheck (plugin): added an option to be able to use the report panel.\n\n|cFFFFFF00-|r You Are Not Prepared (plugin): added Auto Close the window, can be disabled through its options panel.\n\n|cFFFFFF00-|r Vanguard (plugin): Added Options Panel.\n\n|cFFFFFF00-|r Details! is now using 'LibWindow-1.1' to save and restore the positioning of the windows, bug might appear, please report if something weird happen.\n\n|cFFFFFF00-|r Improved specialization detection in order to try detect spec changes.\n\n|cFFFFFF00-|r Added options to change the brackets and the separator for dps/percent block.\n\n|cFFFFFF00-|r Added options for show (or hide) totals, dps and percent amount.\n\n|cFFFFFF00-|r Added Segments shortcut menu pressing Shift + Right click.\n\n|cFFFFFF00-|r Fixed positioning after reopen a window previously closed on last logon.\n\n|cFFFFFF00-|r Fixed enemies display where sometimes the bars were black instead of red.\n\n|cFFFFFF00-|r Fixed few places where spec icons wasn't being used on.\n\n|cFFFFFF00-|r Fixed avoidance panel on Player Details Window where sometimes was giving errors.\n\n|cFFFFFF00-|r Fixed priest shadow and holy detection.\n\n|cFFFFFF00-|r Fixed blood and unholy spec icons.\n\n|cFFFFFF00-|r Fixed an issue with 'Always Show me' feature where it was showing the player on Enemies display.\n\n|cFFFFFF00v3.8.1 (|cFFFFCC00Jan 17, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Plugin Vanguard: got full rewrite and now it is more easy to use.\n\n|cFFFFFF00-|r Plugin TimeAttack: fixed problem where sometimes required a reload to start a new time.\n\n|cFFFFFF00-|r Plugin Damage the Game!: fixed a problem where sometimes the time didn't started after level 2.\n\n|cFFFFFF00-|r Added specialization icons.\n\n|cFFFFFF00-|r Fixed Auto-Hide where it wasn't hiding the wallpaper of the window.\n\n|cFFFFFF00-|r Added 'Editing Group' check box on option panel, when enabled, settings changed also are modified on all windows in the group.\n\n|cFFFFFF00-|r Changing window's skin, doesn't change any more settings not related with appearance, for example, Auto-Hide, Switches.\n\n|cFFFFFF00-|r Custom display 'Health Potion & Stone' now also track Healing Tonic.\n\n|cFFFFFF00-|r Custom display 'Damage Taken by Spell' now tracks more spells and also melee hits.\n\n|cFFFFFF00-|r Menus now uses 'Friz Quadrata TT' font as default, also added an option to change it on options panel -> miscellaneous.\n\n|cFFFFFF00-|r 'Switch to Current' feature now switches all windows which have this option enabled.\n\n|cFFFFFF00-|r The message telling to use '/details reinstall' now only shows if a problem happen during the addon load process.\n\n|cFFFFFF00-|r Segments Saved option now can be set to 25, up from 5.\n\n|cFFFFFF00-|r Attempt to fix the bug with the monk spell 'Storm, Earth, and Fire'." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " diff --git a/classes/classe_combate.lua b/classes/classe_combate.lua index 62c4b71b..053ad8b7 100644 --- a/classes/classe_combate.lua +++ b/classes/classe_combate.lua @@ -309,8 +309,10 @@ --> core function combate:CreateLastEventsTable (player_name) - --> sixteen indexes, thinking in 32 but it's just too much - local t = { {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {} } + local t = {} + for i = 1, _detalhes.deadlog_events do + t [i] = {} + end t.n = 1 self.player_last_events [player_name] = t return t diff --git a/classes/classe_custom.lua b/classes/classe_custom.lua index b0f14871..38abcae0 100644 --- a/classes/classe_custom.lua +++ b/classes/classe_custom.lua @@ -227,8 +227,9 @@ else actor.report_name = actor.nome end + else + actor.report_name = actor.nome end - end end @@ -673,7 +674,7 @@ if (instancia.row_info.textL_show_number) then bar_number = esta_barra.colocacao .. ". " end - + if (self.enemy) then if (self.arena_enemy) then if (UsingCustomLeftText) then @@ -783,22 +784,37 @@ return self._ActorTable [index] else --> if is a spell object + local class if (actor.id) then local spellname = _GetSpellInfo (actor.id) actor.nome = spellname actor.classe = actor.spellschool + class = actor.spellschool + else + class = actor.classe + if (class == "UNKNOW") then + --> try once again + class = _detalhes:GetClass (actor.nome) + if (class and class ~= "UNKNOW") then + actor.classe = class + end + end end local new_actor = _setmetatable ({ nome = actor.nome, - classe = actor.classe, + classe = class, value = _detalhes:GetOrderNumber (actor.nome), }, atributo_custom.mt) new_actor.name_complement = name_complement - new_actor.displayName = new_actor.nome .. (name_complement or "") + new_actor.displayName = _detalhes:GetOnlyName (new_actor.nome) .. (name_complement or "") new_actor.spec = actor.spec + new_actor.enemy = actor.enemy + new_actor.arena_enemy = actor.arena_enemy + new_actor.arena_ally = actor.arena_ally + if (actor.id) then new_actor.id = actor.id new_actor.icon = select (3, _GetSpellInfo (actor.id)) @@ -1697,6 +1713,111 @@ end end + ---------------------------------------------------------------------------------------------------------------------------------------------------- + --doas + local CC_Done = { + name = "Crowd Control", + icon = [[Interface\ICONS\Spell_Frost_FreezingBreath]], + attribute = false, + spellid = false, + author = "Details!", + desc = "Show the crowd control amount for each player.", + source = false, + target = false, + script_version = 6, + script = [[ + local combat, instance_container, instance = ... + local total, top, amount = 0, 0, 0 + + local misc_actors = combat:GetActorList (DETAILS_ATTRIBUTE_MISC) + + for index, character in ipairs (misc_actors) do + if (character.cc_done) then + local cc_done = floor (character.cc_done) + instance_container:AddValue (character, cc_done) + total = total + cc_done + if (cc_done > top) then + top = cc_done + end + amount = amount + 1 + end + end + + return total, top, amount + ]], + tooltip = [[ + local actor, combat, instance = ... + local spells = {} + for spellid, spell in pairs (actor.cc_done_spells._ActorTable) do + tinsert (spells, {spellid, spell.counter}) + end + + table.sort (spells, _detalhes.Sort2) + + for index, spell in ipairs (spells) do + local name, _, icon = GetSpellInfo (spell [1]) + GameCooltip:AddLine (name, spell [2]) + _detalhes:AddTooltipBackgroundStatusbar() + GameCooltip:AddIcon (icon, 1, 1, 14, 14) + end + + local targets = {} + for playername, amount in pairs (actor.cc_done_targets) do + tinsert (targets, {playername, amount}) + end + + table.sort (targets, _detalhes.Sort2) + + _detalhes:AddTooltipSpellHeaderText ("Targets", "yellow", r, g, b, #targets) + local class, _, _, _, _, r, g, b = _detalhes:GetClass (actor.nome) + GameCooltip:AddStatusBar (100, 1, r, g, b, 1) + + + for index, target in ipairs (targets) do + GameCooltip:AddLine (target[1], target [2]) + _detalhes:AddTooltipBackgroundStatusbar() + + local class, _, _, _, _, r, g, b = _detalhes:GetClass (target [1]) + if (class and class ~= "UNKNOW") then + local texture, l, r, t, b = _detalhes:GetClassIcon (class) + GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small_alpha", 1, 1, 14, 14, l, r, t, b) + else + GameCooltip:AddIcon ("Interface\\GossipFrame\\IncompleteQuestIcon", 1, 1, 14, 14) + end + -- + end + ]], + total_script = [[ + local value, top, total, combat, instance = ... + return floor (value) + ]], + } + +-- /run _detalhes:AddDefaultCustomDisplays() + + local have = false + for _, custom in ipairs (self.custom) do + if (custom.name == "Crowd Control" and (custom.script_version and custom.script_version >= CC_Done.script_version) ) then + have = true + break + end + end + if (not have) then + setmetatable (CC_Done, _detalhes.atributo_custom) + CC_Done.__index = _detalhes.atributo_custom + + for i, custom in ipairs (self.custom) do + if (custom.name == "Crowd Control") then + table.remove (self.custom, i) + tinsert (self.custom, i, CC_Done) + have = true + end + end + if (not have) then + self.custom [#self.custom+1] = CC_Done + end + end + ---------------------------------------------------------------------------------------------------------------------------------------------------- local MySpells = { diff --git a/classes/classe_instancia.lua b/classes/classe_instancia.lua index 909a3345..adece333 100644 --- a/classes/classe_instancia.lua +++ b/classes/classe_instancia.lua @@ -1892,6 +1892,33 @@ function _detalhes:AtualizaSegmentos_AfterCombat (instancia, historico) end +local function ValidateAttribute (atributo, sub_atributo) + + if (atributo == 1) then + if (sub_atributo < 0 or sub_atributo > _detalhes.atributos[1]) then + return false + end + elseif (atributo == 2) then + if (sub_atributo < 0 or sub_atributo > _detalhes.atributos[2]) then + return false + end + elseif (atributo == 3) then + if (sub_atributo < 0 or sub_atributo > _detalhes.atributos[3]) then + return false + end + elseif (atributo == 4) then + if (sub_atributo < 0 or sub_atributo > _detalhes.atributos[4]) then + return false + end + elseif (atributo == 5) then + return true + else + return false + end + + return true +end + function _detalhes:SetDisplay (segmento, atributo, sub_atributo, iniciando_instancia, InstanceMode) if (not self.meu_id) then return @@ -1916,7 +1943,7 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini segmento = instancia instancia = self end - + if (InstanceMode and InstanceMode ~= instancia:GetMode()) then instancia:AlteraModo (instancia, InstanceMode) end @@ -1992,6 +2019,12 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini return end + if (not ValidateAttribute (atributo, sub_atributo)) then + sub_atributo = 1 + atributo = 1 + _detalhes:Msg ("invalid attribute, switching to damage done.") + end + --> Muda o segmento caso necessário if (segmento ~= current_segmento or _detalhes.initializing or iniciando_instancia) then @@ -2397,6 +2430,8 @@ function _detalhes:MontaAtributosOption (instancia, func) CoolTip:SetOption ("SelectedTopAnchorMod", -2) CoolTip:SetOption ("SelectedBottomAnchorMod", 2) + CoolTip:SetOption ("TextFont", _detalhes.font_faces.menus) + local last_selected = atributo_ativo if (atributo_ativo == 5) then last_selected = 6 @@ -2777,6 +2812,7 @@ function _detalhes:monta_relatorio (este_relatorio, custom) total, container, first, container_amount, nm = _detalhes.atributo_custom:RefreshWindow (self, self.showing, true, true) if (nm) then name_member = nm + print ("nm:", nm) end keyName = "report_value" else @@ -2788,7 +2824,6 @@ function _detalhes:monta_relatorio (este_relatorio, custom) --print (total, keyName, first, atributo, container_amount) end - amt = math.min (amt, container_amount or 0) --amt é zero for i = 1, amt do @@ -2803,7 +2838,7 @@ function _detalhes:monta_relatorio (este_relatorio, custom) amount = _thisActor [keyName] is_string = true end - + local name = _thisActor [name_member] .. " " if (_detalhes.remove_realm_from_name and name:find ("-")) then name = name:gsub (("%-.*"), "") diff --git a/classes/classe_others.lua b/classes/classe_others.lua index 2879c0b7..061f88ee 100644 --- a/classes/classe_others.lua +++ b/classes/classe_others.lua @@ -198,53 +198,55 @@ function _detalhes:ToolTipDead (instancia, morte, esta_barra, keydown) local time = event [4] local source = event [6] - if (type (evtype) == "boolean") then - --> is damage or heal - if (evtype) then - --> damage - - local overkill = event [10] or 0 - if (overkill > 0) then - amount = amount - overkill - overkill = " (" .. _detalhes:ToK (overkill) .. " |cFFFF8800overkill|r)" - GameCooltip:AddLine ("" .. _cstr ("%.1f", time - hora_da_morte) .. "s |cFFFFFF00" .. spellname .. "|r (|cFFC6B0D9" .. source .. "|r)", "-" .. _detalhes:ToK (amount) .. overkill .. " (" .. hp .. "%)", 1, "white", "white") + if (time + 12 > hora_da_morte) then + if (type (evtype) == "boolean") then + --> is damage or heal + if (evtype) then + --> damage + + local overkill = event [10] or 0 + if (overkill > 0) then + amount = amount - overkill + overkill = " (" .. _detalhes:ToK (overkill) .. " |cFFFF8800overkill|r)" + GameCooltip:AddLine ("" .. _cstr ("%.1f", time - hora_da_morte) .. "s |cFFFFFF00" .. spellname .. "|r (|cFFC6B0D9" .. source .. "|r)", "-" .. _detalhes:ToK (amount) .. overkill .. " (" .. hp .. "%)", 1, "white", "white") + else + overkill = "" + GameCooltip:AddLine ("" .. _cstr ("%.1f", time - hora_da_morte) .. "s " .. spellname .. " (|cFFC6B0D9" .. source .. "|r)", "-" .. _detalhes:ToK (amount) .. overkill .. " (" .. hp .. "%)", 1, "white", "white") + end + + GameCooltip:AddIcon (spellicon) + + if (event [9]) then + --> friendly fire + GameCooltip:AddStatusBar (hp, 1, "darkorange", true) + else + --> from a enemy + GameCooltip:AddStatusBar (hp, 1, "red", true) + end else - overkill = "" - GameCooltip:AddLine ("" .. _cstr ("%.1f", time - hora_da_morte) .. "s " .. spellname .. " (|cFFC6B0D9" .. source .. "|r)", "-" .. _detalhes:ToK (amount) .. overkill .. " (" .. hp .. "%)", 1, "white", "white") + --> heal + GameCooltip:AddLine ("" .. _cstr ("%.1f", time - hora_da_morte) .. "s " .. spellname .. " (|cFFC6B0D9" .. source .. "|r)", "+" .. _detalhes:ToK (amount) .. " (" .. hp .. "%)", 1, "white", "white") + GameCooltip:AddIcon (spellicon) + GameCooltip:AddStatusBar (hp, 1, "green", true) + end - GameCooltip:AddIcon (spellicon) - - if (event [9]) then - --> friendly fire - GameCooltip:AddStatusBar (hp, 1, "darkorange", true) - else - --> from a enemy - GameCooltip:AddStatusBar (hp, 1, "red", true) + elseif (type (evtype) == "number") then + if (evtype == 1) then + --> cooldown + GameCooltip:AddLine ("" .. _cstr ("%.1f", time - hora_da_morte) .. "s " .. spellname .. " (" .. source .. ")", "cooldown (" .. hp .. "%)", 1, "white", "white") + GameCooltip:AddIcon (spellicon) + GameCooltip:AddStatusBar (100, 1, "yellow", true) + + elseif (evtype == 2 and not battleress) then + --> battle ress + battleress = event + + elseif (evtype == 3) then + --> last cooldown used + lastcooldown = event + end - else - --> heal - GameCooltip:AddLine ("" .. _cstr ("%.1f", time - hora_da_morte) .. "s " .. spellname .. " (|cFFC6B0D9" .. source .. "|r)", "+" .. _detalhes:ToK (amount) .. " (" .. hp .. "%)", 1, "white", "white") - GameCooltip:AddIcon (spellicon) - GameCooltip:AddStatusBar (hp, 1, "green", true) - - end - - elseif (type (evtype) == "number") then - if (evtype == 1) then - --> cooldown - GameCooltip:AddLine ("" .. _cstr ("%.1f", time - hora_da_morte) .. "s " .. spellname .. " (" .. source .. ")", "cooldown (" .. hp .. "%)", 1, "white", "white") - GameCooltip:AddIcon (spellicon) - GameCooltip:AddStatusBar (100, 1, "yellow", true) - - elseif (evtype == 2 and not battleress) then - --> battle ress - battleress = event - - elseif (evtype == 3) then - --> last cooldown used - lastcooldown = event - end end end @@ -278,6 +280,7 @@ function _detalhes:ToolTipDead (instancia, morte, esta_barra, keydown) GameCooltip:SetOption ("LeftBorderSize", -4) GameCooltip:SetOption ("RightBorderSize", 5) GameCooltip:SetOption ("StatusBarTexture", [[Interface\AddOns\Details\images\bar4_reverse]]) + GameCooltip:SetOption ("StatusBarTexture", [[Interface\AddOns\Details\images\BantoBar]]) GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], {.6, 0.1, 0.64453125, 0}, {.8, .8, .8, 0.2}, true) local myPoint = _detalhes.tooltip.anchor_point @@ -334,11 +337,15 @@ function atributo_misc:ReportSingleDeadLine (morte, instancia) local elapsed = _cstr ("%.1f", evento [4] - time_of_death) .."s" local spellname, _, spellicon = _GetSpellInfo (evento [2]) local spelllink - if (evento [2] > 10) then + + if (evento [2] == 1) then + spelllink = GetSpellLink (6603) + elseif (evento [2] > 10) then spelllink = GetSpellLink (evento [2]) else spelllink = spellname end + local source = _detalhes:GetOnlyName (evento [6]) local amount = evento [3] local hp = _math_floor (evento [5] / max_health * 100) @@ -2350,6 +2357,12 @@ function atributo_misc:r_onlyrefresh_shadow (actor) _detalhes.refresh:r_atributo_misc (actor, shadow) + --> cc done + if (actor.cc_done) then + refresh_alvos (shadow.cc_done_targets, actor.cc_done_targets) + refresh_habilidades (shadow.cc_done_spells, actor.cc_done_spells) + end + --> cooldowns if (actor.cooldowns_defensive) then refresh_alvos (shadow.cooldowns_defensive_targets, actor.cooldowns_defensive_targets) @@ -2463,6 +2476,19 @@ function atributo_misc:r_connect_shadow (actor, no_refresh) _detalhes.refresh:r_atributo_misc (actor, shadow) end + if (actor.cc_done) then + if (not shadow.cc_done_targets) then + shadow.cc_done = _detalhes:GetOrderNumber() + shadow.cc_done_targets = {} + shadow.cc_done_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) + end + + shadow.cc_done = shadow.cc_done + actor.cc_done + + somar_alvos (shadow.cc_done_targets, actor.cc_done_targets) + somar_habilidades (shadow.cc_done_spells, actor.cc_done_spells) + end + if (actor.cooldowns_defensive) then if (not shadow.cooldowns_defensive_targets) then shadow.cooldowns_defensive = _detalhes:GetOrderNumber (actor.nome) @@ -2650,6 +2676,16 @@ function _detalhes.refresh:r_atributo_misc (este_jogador, shadow) _setmetatable (este_jogador, _detalhes.atributo_misc) este_jogador.__index = _detalhes.atributo_misc + --> refresh cc done + if (este_jogador.cc_done) then + if (shadow and not shadow.cc_done_targets) then + shadow.cc_done = 0 + shadow.cc_done_targets = {} + shadow.cc_done_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) + end + _detalhes.refresh:r_container_habilidades (este_jogador.cc_done_spells, shadow and shadow.cc_done_spells) + end + --> refresh interrupts if (este_jogador.interrupt_targets) then if (shadow and not shadow.interrupt_targets) then @@ -2740,6 +2776,10 @@ function _detalhes.clear:c_atributo_misc (este_jogador) este_jogador.links = nil este_jogador.minha_barra = nil + if (este_jogador.cc_done_targets) then + _detalhes.clear:c_container_habilidades (este_jogador.cc_done_spells) + end + if (este_jogador.interrupt_targets) then _detalhes.clear:c_container_habilidades (este_jogador.interrupt_spells) end @@ -2772,6 +2812,24 @@ end atributo_misc.__add = function (tabela1, tabela2) + if (tabela2.cc_done) then + tabela1.cc_done = tabela1.cc_done + tabela2.cc_done + + for target_name, amount in _pairs (tabela2.cc_done_targets) do + tabela1.cc_done_targets [target_name] = (tabela1.cc_done_targets [target_name] or 0) + amount + end + + for spellid, habilidade in _pairs (tabela2.cc_done_spells._ActorTable) do + local habilidade_tabela1 = tabela1.cc_done_spells:PegaHabilidade (spellid, true, nil, false) + + for target_name, amount in _pairs (habilidade.targets) do + habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) + amount + end + + somar_keys (habilidade, habilidade_tabela1) + end + end + if (tabela2.interrupt) then if (not tabela1.interrupt) then @@ -3012,6 +3070,24 @@ end atributo_misc.__sub = function (tabela1, tabela2) + if (tabela2.cc_done) then + tabela1.cc_done = tabela1.cc_done - tabela2.cc_done + + for target_name, amount in _pairs (tabela2.cc_done_targets) do + tabela1.cc_done_targets [target_name] = (tabela1.cc_done_targets [target_name] or 0) - amount + end + + for spellid, habilidade in _pairs (tabela2.cc_done_spells._ActorTable) do + local habilidade_tabela1 = tabela1.cc_done_spells:PegaHabilidade (spellid, true, nil, false) + + for target_name, amount in _pairs (habilidade.targets) do + habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) - amount + end + + subtrair_keys (habilidade, habilidade_tabela1) + end + end + if (tabela2.interrupt) then --> total de interrupts tabela1.interrupt = tabela1.interrupt - tabela2.interrupt diff --git a/classes/container_historico.lua b/classes/container_historico.lua index c23db0af..d9c099bc 100644 --- a/classes/container_historico.lua +++ b/classes/container_historico.lua @@ -151,6 +151,11 @@ function historico:adicionar (tabela) --print ("0x10") end + if (not overall_added and (tabela.is_pvp or tabela.is_arena)) then --> is a PvP combat + overall_added = true + --print ("0x10") + end + if (overall_added) then if (_detalhes.debug) then _detalhes:Msg ("(debug) overall data flag match with the current combat.") diff --git a/core/control.lua b/core/control.lua index 047fb3a0..d0d2d0c3 100644 --- a/core/control.lua +++ b/core/control.lua @@ -411,6 +411,10 @@ if (not _detalhes.tabela_vigente.is_boss) then + if (_detalhes.tabela_vigente.is_pvp) then + _detalhes:FlagActorsOnPvPCombat() + end + local in_instance = IsInInstance() --> garrison returns party as instance type. if ((InstanceType == "party" or InstanceType == "raid") and in_instance) then _detalhes.tabela_vigente.is_trash = true @@ -875,6 +879,14 @@ end + function _detalhes:FlagActorsOnPvPCombat() + for class_type, container in _ipairs (_detalhes.tabela_vigente) do + for _, actor in _ipairs (container._ActorTable) do + actor.pvp_component = true + end + end + end + function _detalhes:FlagActorsOnBossFight() for class_type, container in _ipairs (_detalhes.tabela_vigente) do for _, actor in _ipairs (container._ActorTable) do diff --git a/core/gears.lua b/core/gears.lua index 8cb9cff5..984558d4 100644 --- a/core/gears.lua +++ b/core/gears.lua @@ -15,6 +15,37 @@ function _detalhes:UpdateGears() end + + +------------------------------------------------------------------------------------------------------------ + +function _detalhes:SetDeathLogLimit (limit) + + if (limit and type (limit) == "number" and limit >= 8) then + _detalhes.deadlog_events = limit + + local combat = _detalhes.tabela_vigente + + local wipe = table.wipe + for player_name, event_table in pairs (combat.player_last_events) do + if (limit > #event_table) then + for i = #event_table + 1, limit do + event_table [i] = {} + end + else + event_table.n = 1 + for _, t in ipairs (event_table) do + wipe (t) + end + end + end + + _detalhes:UpdateParserGears() + end +end + +------------------------------------------------------------------------------------------------------------ + function _detalhes:TrackSpecsNow (track_everything) local spelllist = _detalhes.SpecSpellList diff --git a/core/meta.lua b/core/meta.lua index d45eea53..1e616107 100644 --- a/core/meta.lua +++ b/core/meta.lua @@ -529,7 +529,7 @@ while (_iter.data) do --search key: ~deletar ~apagar local can_erase = true - if (_iter.data.grupo or _iter.data.boss or _iter.data.boss_fight_component) then + if (_iter.data.grupo or _iter.data.boss or _iter.data.boss_fight_component or _iter.data.pvp_component) then can_erase = false else local owner = _iter.data.owner @@ -606,7 +606,7 @@ while (_iter.data) do --search key: ~deletar ~apagar local can_erase = true - if (_iter.data.grupo or _iter.data.boss or _iter.data.boss_fight_component or IsBossEncounter) then + if (_iter.data.grupo or _iter.data.boss or _iter.data.boss_fight_component or IsBossEncounter or _iter.data.pvp_component) then can_erase = false else local owner = _iter.data.owner diff --git a/core/parser.lua b/core/parser.lua index e444f73d..3e9e0c68 100644 --- a/core/parser.lua +++ b/core/parser.lua @@ -1,4 +1,4 @@ - + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local _detalhes = _G._detalhes @@ -110,6 +110,8 @@ local _recording_buffs_and_debuffs = false --> in combat flag local _in_combat = false + --> deathlog + local _death_event_amt = 16 --> hooks local _hook_cooldowns = false local _hook_deaths = false @@ -145,6 +147,10 @@ ------------------------------------------------------------------------------------------------ --> early checks and fixes +--SPELL_DAMAGE,0000000000000000,nil,0x512,0x0,Player-1174-080D253A,"Neltuvak-Undermine",0x512,0x0,157247,"Reverberations",0x1,0000000000000000,0000000000000000,0,0,0,0,0,0,0,0,0.00,0.00,0,47061,-1,1,0,0,0,nil,nil,nil,nil +--SPELL_DAMAGE,Creature-0-3020-1205-15169-79806-000003513D,"Stone Wall",0x2248,0x0,Player-3209-085116F5,"Xirodots-Azralon",0x514,0x0,161923,"Rune of Crushing Earth",0x8,0000000000000000,0000000000000000,0,0,0,0,0,0,0,0,0.00,0.00,0,72729,-1,8,0,0,0,nil,nil,nil,nil +--SPELL_DAMAGE,0000000000000000,nil,0x514,0x0,Player-3677-070E7EAE,"Alithan-Garrosh",0x514,0x0,157659,"Rippling Smash",0x8,0000000000000000,0000000000000000,0,0,0,0,0,0,0,0,0.00,0.00,0,50610,-1,8,0,0,12765,nil,nil,nil,nil + if (who_serial == "") then if (who_flags and _bit_band (who_flags, OBJECT_TYPE_PETS) ~= 0) then --> é um pet --> pets must have a serial @@ -362,6 +368,10 @@ local this_event = t [i] + if (not this_event) then + print ("event error", 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 @@ -375,7 +385,7 @@ i = i + 1 - if (i == 17) then + if (i == _death_event_amt+1) then t.n = 1 else t.n = i @@ -456,7 +466,7 @@ this_event [10] = overkill i = i + 1 - if (i == 17) then + if (i == _death_event_amt+1) then t.n = 1 else t.n = i @@ -849,7 +859,7 @@ i = i + 1 - if (i == 17) then + if (i == _death_event_amt+1) then t.n = 1 else t.n = i @@ -980,7 +990,7 @@ -- jade spirit doesn't send who_name, that's a shame. if (who_name == alvo_name and raid_members_cache [who_serial] and _in_combat) then --> call record buffs uptime - --[[not tail call, need to fix this]] parser:add_buff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, "BUFF_UPTIME_IN") + parser:add_buff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, "BUFF_UPTIME_IN") end end @@ -1029,12 +1039,17 @@ ------------------------------------------------------------------------------------------------ --> buff uptime if (_recording_buffs_and_debuffs) then + + if (cc_spell_list [spellid]) then + parser:add_cc_done (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname) + end + if (raid_members_cache [who_serial]) then --> call record debuffs uptime - --[[not tail call, need to fix this]] parser:add_debuff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, "DEBUFF_UPTIME_IN") + parser:add_debuff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, "DEBUFF_UPTIME_IN") - elseif (raid_members_cache [alvo_serial] and not raid_members_cache [who_serial]) then --> alvo é da raide é alguem de fora da raide - --[[not tail call, need to fix this]] parser:add_bad_debuff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spellschool, "DEBUFF_UPTIME_IN") + elseif (raid_members_cache [alvo_serial] and not raid_members_cache [who_serial]) then --> alvo é da raide e who é alguem de fora da raide + parser:add_bad_debuff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spellschool, "DEBUFF_UPTIME_IN") end end @@ -1104,6 +1119,50 @@ end end end + + function parser:add_cc_done (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname) + + ------------------------------------------------------------------------------------------------ + --> early checks and fixes + + _current_misc_container.need_refresh = true + + ------------------------------------------------------------------------------------------------ + --> get actors + local este_jogador = misc_cache [who_name] + if (not este_jogador) then + este_jogador = _current_misc_container:PegarCombatente (who_serial, who_name, who_flags, true) + misc_cache [who_name] = este_jogador + end + + ------------------------------------------------------------------------------------------------ + --> build containers on the fly + + if (not este_jogador.cc_done) then + este_jogador.cc_done = _detalhes:GetOrderNumber() + este_jogador.cc_done_spells = container_habilidades:NovoContainer (container_misc) + este_jogador.cc_done_targets = {} + end + + ------------------------------------------------------------------------------------------------ + --> add amount + + --> update last event + este_jogador.last_event = _tempo + + --> add amount + este_jogador.cc_done = este_jogador.cc_done + 1 + este_jogador.cc_done_targets [alvo_name] = (este_jogador.cc_done_targets [alvo_name] or 0) + 1 + + --> actor spells table + local spell = este_jogador.cc_done_spells._ActorTable [spellid] + if (not spell) then + spell = este_jogador.cc_done_spells:PegaHabilidade (spellid, true) + end + + spell.targets [alvo_name] = (spell.targets [alvo_name] or 0) + 1 + spell.counter = spell.counter + 1 + end function parser:buff_refresh (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spellschool, tipo, amount) @@ -1117,7 +1176,7 @@ if (_recording_buffs_and_debuffs) then if (who_name == alvo_name and raid_members_cache [who_serial] and _in_combat) then --> call record buffs uptime - --[[not tail call, need to fix this]] parser:add_buff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, "BUFF_UPTIME_REFRESH") + parser:add_buff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, "BUFF_UPTIME_REFRESH") end end @@ -1183,9 +1242,9 @@ if (_recording_buffs_and_debuffs) then if (raid_members_cache [who_serial]) then --> call record debuffs uptime - --[[not tail call, need to fix this]] parser:add_debuff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, "DEBUFF_UPTIME_REFRESH") + parser:add_debuff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, "DEBUFF_UPTIME_REFRESH") elseif (raid_members_cache [alvo_serial] and not raid_members_cache [who_serial]) then --> alvo é da raide e o caster é inimigo - --[[not tail call, need to fix this]] parser:add_bad_debuff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spellschool, "DEBUFF_UPTIME_REFRESH") + parser:add_bad_debuff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spellschool, "DEBUFF_UPTIME_REFRESH") end end @@ -1253,7 +1312,7 @@ if (_recording_buffs_and_debuffs) then if (who_name == alvo_name and raid_members_cache [who_serial] and _in_combat) then --> call record buffs uptime - --[[not tail call, need to fix this]] parser:add_buff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, "BUFF_UPTIME_OUT") + parser:add_buff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, "BUFF_UPTIME_OUT") end end @@ -1311,9 +1370,9 @@ if (_recording_buffs_and_debuffs) then if (raid_members_cache [who_serial]) then --> call record debuffs uptime - --[[not tail call, need to fix this]] parser:add_debuff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, "DEBUFF_UPTIME_OUT") + parser:add_debuff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, "DEBUFF_UPTIME_OUT") elseif (raid_members_cache [alvo_serial] and not raid_members_cache [who_serial]) then --> alvo é da raide e o caster é inimigo - --[[not tail call, need to fix this]] parser:add_bad_debuff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spellschool, "DEBUFF_UPTIME_OUT") + parser:add_bad_debuff_uptime (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spellschool, "DEBUFF_UPTIME_OUT") end end @@ -1747,7 +1806,7 @@ this_event [6] = who_name --> source name i = i + 1 - if (i == 17) then + if (i == _death_event_amt+1) then t.n = 1 else t.n = i @@ -2257,20 +2316,20 @@ --lesses index = older / higher index = newer local last_index = t.n --or 'next index' - if (last_index < 17 and not t[last_index][4]) then + if (last_index < _death_event_amt+1 and not t[last_index][4]) then for i = 1, last_index-1 do - if (t[i][4] and t[i][4]+16 > time) then + if (t[i][4] and t[i][4]+_death_event_amt > time) then _table_insert (esta_morte, t[i]) end end else - for i = last_index, 16 do --next index to 16 - if (t[i][4] and t[i][4]+16 > time) then + for i = last_index, _death_event_amt do --next index to 16 + if (t[i][4] and t[i][4]+_death_event_amt > time) then _table_insert (esta_morte, t[i]) end end for i = 1, last_index-1 do --1 to latest index - if (t[i][4] and t[i][4]+16 > time) then + if (t[i][4] and t[i][4]+_death_event_amt > time) then _table_insert (esta_morte, t[i]) end end @@ -2287,11 +2346,11 @@ end end - if (_detalhes.deadlog_limit and #esta_morte > _detalhes.deadlog_limit) then - while (#esta_morte > _detalhes.deadlog_limit) do - _table_remove (esta_morte, 1) - end - end + --if (_detalhes.deadlog_limit and #esta_morte > _detalhes.deadlog_limit) then + -- while (#esta_morte > _detalhes.deadlog_limit) do + -- _table_remove (esta_morte, 1) + -- end + --end if (este_jogador.last_cooldown) then local t = {} @@ -2566,19 +2625,26 @@ if (_detalhes.is_in_arena and zoneType ~= "arena") then _detalhes:LeftArena() end + if (_detalhes.is_in_battleground and zoneType ~= "pvp") then + _detalhes.is_in_battleground = nil + end if (zoneType == "pvp") then - if (not _current_combat.pvp) then + + if (_detalhes.debug) then + _detalhes:Msg ("(debug) battleground found.") + end - if (_detalhes.debug) then - _detalhes:Msg ("(debug) battleground found, starting new combat table.") - end - + _detalhes.is_in_battleground = true + + if (_in_combat and not _current_combat.pvp) then + _detalhes:SairDoCombate() + end + + if (not _in_combat) then _detalhes:EntrarEmCombate() - --> sinaliza que esse combate é pvp _current_combat.pvp = true - _current_combat.is_pvp = {name = zoneName, zone = ZoneName, mapid = ZoneMapID} - _detalhes.listener:RegisterEvent ("CHAT_MSG_BG_SYSTEM_NEUTRAL") + _current_combat.is_pvp = {name = zoneName, mapid = ZoneMapID} end elseif (zoneType == "arena") then @@ -2727,20 +2793,6 @@ _table_wipe (_detalhes.encounter_table) end - function _detalhes.parser_functions:CHAT_MSG_BG_SYSTEM_NEUTRAL (...) - local frase = _select (1, ...) - --> reset combat timer - if ( (frase:find ("The battle") and frase:find ("has begun!") ) and _current_combat.pvp) then - --local tempo_do_combate = _tempo - _current_combat:GetStartTime() - local tempo_do_combate = _GetTime() - _current_combat:GetStartTime() - - _detalhes.tabela_overall:SetStartTime (_detalhes.tabela_overall:GetStartTime() + tempo_do_combate) - --_current_combat.start_time = _tempo - _current_combat:SetStartTime (_GetTime()) - _detalhes.listener:UnregisterEvent ("CHAT_MSG_BG_SYSTEM_NEUTRAL") - end - end - function _detalhes.parser_functions:UNIT_PET (...) _detalhes:SchedulePetUpdate (1) end @@ -2907,8 +2959,24 @@ if (_detalhes.debug) then _detalhes:Msg ("(debug) timer is a arena countdown.") end + + elseif (_detalhes.is_in_battleground) then + + local timerType, timeSeconds, totalTime = select (1, ...) + + if (_detalhes.start_battleground) then + _detalhes:CancelTimer (_detalhes.start_battleground, true) + end + + _detalhes.start_battleground = _detalhes:ScheduleTimer ("CreateBattlegroundSegment", timeSeconds) + end end + + function _detalhes:CreateBattlegroundSegment() + _current_combat:SetStartTime (_GetTime()) + print ("Battleground has begun.") + end -- ~load function _detalhes.parser_functions:ADDON_LOADED (...) @@ -3220,6 +3288,7 @@ --> last events pointer last_events_cache = _current_combat.player_last_events + _death_event_amt = _detalhes.deadlog_events --> refresh total containers _current_total = _current_combat.totals diff --git a/framework/cooltip.lua b/framework/cooltip.lua index 9c15ac9d..7b68441e 100644 --- a/framework/cooltip.lua +++ b/framework/cooltip.lua @@ -142,6 +142,8 @@ function DetailsCreateCoolTip() CoolTip.selected_anchor.top = 0 CoolTip.selected_anchor.bottom = 0 + CoolTip._default_font = SharedMedia:Fetch ("font", "Friz Quadrata TT") + --> Create Frames --> main frame @@ -667,10 +669,7 @@ function DetailsCreateCoolTip() menuButton.leftText:SetFont (face, size, flags) end else - size = leftTextTable [6] or CoolTip.OptionsTable.TextSize or 10 - face = leftTextTable [7] or [[Fonts\FRIZQT__.TTF]] - flags = leftTextTable [8] or CoolTip.OptionsTable.TextShadow or nil - menuButton.leftText:SetFont (face, size, flags) + menuButton.leftText:SetFont (CoolTip._default_font, leftTextTable [6] or CoolTip.OptionsTable.TextSize or 10, leftTextTable [8] or CoolTip.OptionsTable.TextShadow) end local height_mod = CoolTip.OptionsTable.TextHeightMod or 0 @@ -744,10 +743,7 @@ function DetailsCreateCoolTip() end else - size = rightTextTable [6] or CoolTip.OptionsTable.TextSize or 10 - face = rightTextTable [7] or [[Fonts\FRIZQT__.TTF]] - flags = rightTextTable [8] or CoolTip.OptionsTable.TextShadow or nil - menuButton.rightText:SetFont (face, size, flags) + menuButton.rightText:SetFont (CoolTip._default_font, rightTextTable [6] or CoolTip.OptionsTable.TextSize or 10, rightTextTable [8] or CoolTip.OptionsTable.TextShadow) end diff --git a/functions/playerclass.lua b/functions/playerclass.lua index 7d1bf1b1..e8577c94 100644 --- a/functions/playerclass.lua +++ b/functions/playerclass.lua @@ -18,17 +18,15 @@ do if (not class) then for index, container in _ipairs (_detalhes.tabela_overall) do - --if (container._NameIndexTable) then - local index = container._NameIndexTable [name] - if (index) then - local actor = container._ActorTable [index] - if (actor.classe ~= "UNGROUPPLAYER") then - local left, right, top, bottom = unpack (_detalhes.class_coords [actor.classe] or unknown_class_coords) - local r, g, b = unpack (_detalhes.class_colors [actor.classe]) - return actor.classe, left, right, top, bottom, r or 1, g or 1, b or 1 - end + local index = container._NameIndexTable [name] + if (index) then + local actor = container._ActorTable [index] + if (actor.classe ~= "UNGROUPPLAYER") then + local left, right, top, bottom = unpack (_detalhes.class_coords [actor.classe] or unknown_class_coords) + local r, g, b = unpack (_detalhes.class_colors [actor.classe]) + return actor.classe, left, right, top, bottom, r or 1, g or 1, b or 1 end - --end + end end return "UNKNOW", 0.75, 1, 0.75, 1, 1, 1, 1, 1 diff --git a/functions/profiles.lua b/functions/profiles.lua index 76f32f3f..93704248 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -877,7 +877,8 @@ local default_profile = { trash_auto_remove = true, --> death log - deadlog_limit = 12, + deadlog_limit = 16, + deadlog_events = 16, --> report report_lines = 5, diff --git a/gumps/janela_options.lua b/gumps/janela_options.lua index 503bf21d..88338684 100644 --- a/gumps/janela_options.lua +++ b/gumps/janela_options.lua @@ -4114,6 +4114,30 @@ function window:CreateFrame2() frame2.timetypeDropdown:SetPoint ("left", frame2.timetypeLabel, "right", 2, 0) window:CreateLineBackground2 (frame2, "timetypeDropdown", "timetypeLabel", Loc ["STRING_OPTIONS_TIMEMEASURE_DESC"]) + + --> death log limit + g:NewLabel (frame2, _, "$parentDeathLogLimitLabel", "DeathLogLimitLabel", Loc ["STRING_OPTIONS_DEATHLIMIT"], "GameFontHighlightLeft") + -- + local onSelectDeathLogLimit = function (_, _, limit_amount) + _detalhes:SetDeathLogLimit (limit_amount) + end + local DeathLogLimitOptions = { + {value = 16, label = "16 Records", onclick = onSelectDeathLogLimit, icon = [[Interface\WorldStateFrame\ColumnIcon-GraveyardDefend0]]}, + {value = 32, label = "32 Records", onclick = onSelectDeathLogLimit, icon = [[Interface\WorldStateFrame\ColumnIcon-GraveyardDefend0]]}, + {value = 45, label = "45 Records", onclick = onSelectDeathLogLimit, icon = [[Interface\WorldStateFrame\ColumnIcon-GraveyardDefend0]]}, + } + local buildDeathLogLimitMenu = function() + return DeathLogLimitOptions + end + local d = g:NewDropDown (frame2, _, "$parentDeathLogLimitDropdown", "DeathLogLimitDropdown", 160, 20, buildDeathLogLimitMenu, nil) -- func, default + d.onenter_backdrop = dropdown_backdrop_onenter + d.onleave_backdrop = dropdown_backdrop_onleave + d:SetBackdrop (dropdown_backdrop) + d:SetBackdropColor (unpack (dropdown_backdrop_onleave)) + + frame2.DeathLogLimitDropdown:SetPoint ("left", frame2.DeathLogLimitLabel, "right", 2, 0) + + window:CreateLineBackground2 (frame2, "DeathLogLimitDropdown", "DeathLogLimitLabel", Loc ["STRING_OPTIONS_DEATHLIMIT_DESC"]) --> Erase Chart Data g:NewLabel (frame2, _, "$parentEraseChartDataLabel", "EraseChartDataLabel", Loc ["STRING_OPTIONS_ERASECHARTDATA"], "GameFontHighlightLeft") @@ -4407,16 +4431,17 @@ function window:CreateFrame2() {"fragsPvpLabel", 2}, {"EraseChartDataLabel", 3}, {"timetypeLabel", 4, true}, + {"DeathLogLimitLabel", 5, true}, - {"OverallDataLabel", 5, true}, - {"OverallDataRaidBossLabel", 6}, - {"OverallDataRaidCleaupLabel", 7}, - {"OverallDataDungeonBossLabel", 8}, - {"OverallDataDungeonCleaupLabel", 9}, - {"OverallDataAllLabel", 10, true}, - {"OverallNewBossLabel", 11, true}, - {"OverallNewChallengeLabel", 12}, - {"OverallOnLogoutLabel", 13}, + {"DataCollectAnchorLabel", 6, true}, + {"damageCaptureImage", 7}, + {"healCaptureImage", 8}, + {"energyCaptureImage", 9}, + {"miscCaptureImage", 10}, + {"auraCaptureImage", 11}, + {"cloudCaptureLabel", 12, true}, + + } window:arrange_menu (frame2, left_side, x, window.top_start_at) @@ -4424,13 +4449,15 @@ function window:CreateFrame2() local x = window.right_start_at local right_side = { - {"DataCollectAnchorLabel", 1, true}, - {"damageCaptureImage", 2}, - {"healCaptureImage", 3}, - {"energyCaptureImage", 4}, - {"miscCaptureImage", 5}, - {"auraCaptureImage", 6}, - {"cloudCaptureLabel", 7, true}, + {"OverallDataLabel", 1, true}, + {"OverallDataRaidBossLabel", 2}, + {"OverallDataRaidCleaupLabel", 3}, + {"OverallDataDungeonBossLabel", 4}, + {"OverallDataDungeonCleaupLabel", 5}, + {"OverallDataAllLabel", 6, true}, + {"OverallNewBossLabel", 7, true}, + {"OverallNewChallengeLabel", 8}, + {"OverallOnLogoutLabel", 9}, } window:arrange_menu (frame2, right_side, x, -90) @@ -10014,6 +10041,7 @@ end --> if not window --> window 2 _G.DetailsOptionsWindow2FragsPvpSlider.MyObject:SetValue (_detalhes.only_pvp_frags) _G.DetailsOptionsWindow2TTDropdown.MyObject:Select (_detalhes.time_type) + _G.DetailsOptionsWindow2DeathLogLimitDropdown.MyObject:Select (_detalhes.deadlog_events) _G.DetailsOptionsWindow2EraseChartDataSlider.MyObject:SetValue (_detalhes.clear_graphic) diff --git a/locales/Details-zhCN.lua b/locales/Details-zhCN.lua new file mode 100644 index 00000000..4b0d9944 --- /dev/null +++ b/locales/Details-zhCN.lua @@ -0,0 +1,4 @@ +local L = LibStub("AceLocale-3.0"):NewLocale("Details", "zhCN") +if not L then return end + +@localization(locale="zhCN", format="lua_additive_table")@ \ No newline at end of file