From c30e2312b770a2f090fec184ce69a424ce0d4d90 Mon Sep 17 00:00:00 2001 From: Tercio Date: Tue, 14 Apr 2015 18:44:47 -0300 Subject: [PATCH] - Report lines for deaths is now inverted. No need to scroll up the chat to see the cause of death anymore. Fixed some annoyances with auto current feature where it was changing the segments even when the user were using the window. --- boot.lua | 13 +++--- classes/classe_instancia.lua | 8 +++- classes/classe_others.lua | 41 ++++++++++++++----- classes/container_historico.lua | 9 ++-- core/control.lua | 23 +++++++++-- core/network.lua | 4 ++ core/plugins.lua | 4 -- core/util.lua | 33 ++++++++++----- functions/events.lua | 16 +++++--- gumps/janela_info.lua | 2 + gumps/janela_principal.lua | 1 + gumps/janela_report.lua | 5 +++ .../Details_TimeAttack/Details_TimeAttack.lua | 4 +- 13 files changed, 118 insertions(+), 45 deletions(-) diff --git a/boot.lua b/boot.lua index e2c60f26..7437af92 100644 --- a/boot.lua +++ b/boot.lua @@ -1,10 +1,10 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> global name declaration - + _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") _detalhes.build_counter = 775 --it's 775 for release - _detalhes.userversion = "v3.12.7" + _detalhes.userversion = "v3.12.9" _detalhes.realversion = 66 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" Details = _detalhes @@ -22,13 +22,16 @@ do --[[ |cFFFFFF00-|r .\n\n -|cFFFFFF00v3.12.7 (|cFFFFCC00May 09, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added slash command /details profile .\n\n - +|cFFFFFF00v3.12.9 (|cFFFFCC00April 14, 2015|r|cFFFFFF00)|r:\n\n +|cFFFFFF00-|r Report lines for deaths is now inverted. No need to scroll up the chat to see the cause of death anymore.\n\n +|cFFFFFF00-|r Fixed some annoyances with auto current feature where it was changing the segments even when the user were using the window.\n\n --]] +-- |cFFFFFF00v3.12.9 (|cFFFFCC00April 14, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Report lines for deaths is now inverted. No need to scroll up the chat to see the cause of death anymore.\n\n|cFFFFFF00-|r Fixed some annoyances with auto current feature where it was changing the segments even when the user were using the window.\n\n + -- - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.12.7 (|cFFFFCC00May 09, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added slash command /details profile .\n\n|cFFFFFF00v3.12.6 (|cFFFFCC00May 06, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Encounter Details (plugin): added a report button on Emotes tab.\n\n|cFFFFFF00-|r Encounter Details (plugin): improved Weakauras creation.\n\n|cFFFFFF00-|r Encounter Details (plugin): fixed the report text for interrupts and dispells.\n\n|cFFFFFF00-|r Crowd control by Pets now is merged with its owner.\n\n|cFFFFFF00-|r Truncated left text on bars now shows the entire text when hover over the bar.\n\n|cFFFFFF00-|r Added an extra option on minimap menu to disable the minimap icon.\n\n|cFFFFFF00-|r Fixed a problem when disabling the minimap icon through options panel.\n\n|cFFFFFF00-|r Fixed an issue with item level tracker feature.\n\n|cFFFFFF00v3.12.2 (|cFFFFCC00Mar 30, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Raid Check (plugin): added item level.\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): bug fixes, it's important to update it.\n\n|cFFFFFF00-|r Time Line (plugin): bug fixes.\n\n|cFFFFFF00-|r Added option to disabled th eitem level tracker.\n\n|cFFFFFF00-|r Added item level on Raid Check plugin panel.\n\n|cFFFFFF00-|r Added Spirit Link Totem damage and healing on death log.\n\n|cFFFFFF00-|r Added the total of life exchanged by the Spirit Link Totem on player detail window.\n\n|cFFFFFF00-|r Added more spells for crowd control.\n\n|cFFFFFF00-|r Added scroll on bookmark panel.\n\n|cFFFFFF00-|r Fixed issue with Dps/Hps data broker which wasn't respecting the type of time (effective/activity) selected.\n\n|cFFFFFF00-|r Fixed few bugs when using the key bind to toggle windows.\n\n|cFFFFFF00v3.11.5 (|cFFFFCC00Mar 18, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with overall data where max/min amount for spells was being calculated wrong.\n\n|cFFFFFF00-|r Fixed a problem while reporting enemy damage taken.\n\n|cFFFFFF00-|r Fixed an issue with damage taken by spell where some spells wasn't shown.\n\n|cFFFFFF00-|r Few improvements on tooltips.\n\n|cFFFFFF00-|r Fixed a accuracy problem with shaman's spirit link toten where its life exchange was considered healing done.\n\n|cFFFFFF00-|r Boss segments now need to have at least 30 seconds to be added on the overall data.\n\n|cFFFFFF00-|r When the segment limit is reach, segments with less combat time will be erased instead of the olders.\n\n|cFFFFFF00-|r Added item level tracker.\n\n|cFFFFFF00-|r Fixed window positioning when changing from Solo mode to Group mode.\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." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.12.9 (|cFFFFCC00April 14, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Report lines for deaths is now inverted. No need to scroll up the chat to see the cause of death anymore.\n\n|cFFFFFF00-|r Fixed some annoyances with auto current feature where it was changing the segments even when the user were using the window.\n\n|cFFFFFF00v3.12.7 (|cFFFFCC00April 09, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added slash command /details profile .\n\n|cFFFFFF00v3.12.6 (|cFFFFCC00May 06, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Encounter Details (plugin): added a report button on Emotes tab.\n\n|cFFFFFF00-|r Encounter Details (plugin): improved Weakauras creation.\n\n|cFFFFFF00-|r Encounter Details (plugin): fixed the report text for interrupts and dispells.\n\n|cFFFFFF00-|r Crowd control by Pets now is merged with its owner.\n\n|cFFFFFF00-|r Truncated left text on bars now shows the entire text when hover over the bar.\n\n|cFFFFFF00-|r Added an extra option on minimap menu to disable the minimap icon.\n\n|cFFFFFF00-|r Fixed a problem when disabling the minimap icon through options panel.\n\n|cFFFFFF00-|r Fixed an issue with item level tracker feature.\n\n|cFFFFFF00v3.12.2 (|cFFFFCC00Mar 30, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Raid Check (plugin): added item level.\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): bug fixes, it's important to update it.\n\n|cFFFFFF00-|r Time Line (plugin): bug fixes.\n\n|cFFFFFF00-|r Added option to disabled th eitem level tracker.\n\n|cFFFFFF00-|r Added item level on Raid Check plugin panel.\n\n|cFFFFFF00-|r Added Spirit Link Totem damage and healing on death log.\n\n|cFFFFFF00-|r Added the total of life exchanged by the Spirit Link Totem on player detail window.\n\n|cFFFFFF00-|r Added more spells for crowd control.\n\n|cFFFFFF00-|r Added scroll on bookmark panel.\n\n|cFFFFFF00-|r Fixed issue with Dps/Hps data broker which wasn't respecting the type of time (effective/activity) selected.\n\n|cFFFFFF00-|r Fixed few bugs when using the key bind to toggle windows.\n\n|cFFFFFF00v3.11.5 (|cFFFFCC00Mar 18, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with overall data where max/min amount for spells was being calculated wrong.\n\n|cFFFFFF00-|r Fixed a problem while reporting enemy damage taken.\n\n|cFFFFFF00-|r Fixed an issue with damage taken by spell where some spells wasn't shown.\n\n|cFFFFFF00-|r Few improvements on tooltips.\n\n|cFFFFFF00-|r Fixed a accuracy problem with shaman's spirit link toten where its life exchange was considered healing done.\n\n|cFFFFFF00-|r Boss segments now need to have at least 30 seconds to be added on the overall data.\n\n|cFFFFFF00-|r When the segment limit is reach, segments with less combat time will be erased instead of the olders.\n\n|cFFFFFF00-|r Added item level tracker.\n\n|cFFFFFF00-|r Fixed window positioning when changing from Solo mode to Group mode.\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." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " diff --git a/classes/classe_instancia.lua b/classes/classe_instancia.lua index a6205510..57b9e318 100644 --- a/classes/classe_instancia.lua +++ b/classes/classe_instancia.lua @@ -1825,6 +1825,10 @@ end ------------------------------------------------------------------------------------------------------------------------ function _detalhes:CheckSwitchToCurrent() + if (DetailsReportWindow and DetailsReportWindow:IsShown()) then + _detalhes.delay_CheckSwitchToCurrent = true + return + end for _, instance in _ipairs (_detalhes.tabela_instancias) do if (instance.ativa and instance.baseframe and instance.segmento ~= 0 and instance.auto_current) then instance:TrocaTabela (0) --> muda o segmento pra current @@ -1897,7 +1901,7 @@ function _detalhes:AtualizaSegmentos_AfterCombat (instancia, historico) local segmento = instancia.segmento local _fadeType, _fadeSpeed = _unpack (_detalhes.row_fade_in) - + if (segmento == _detalhes.segments_amount) then --> significa que o index [5] passou a ser [6] com a entrada da nova tabela instancia.showing = historico.tabelas [_detalhes.segments_amount] --> então ele volta a pegar o index [5] que antes era o index [4] @@ -1906,6 +1910,7 @@ function _detalhes:AtualizaSegmentos_AfterCombat (instancia, historico) instancia.v_barras = true instancia:ResetaGump() instancia:AtualizaGumpPrincipal (true) + _detalhes:AtualizarJanela (instancia) elseif (segmento < _detalhes.segments_amount and segmento > 0) then instancia.showing = historico.tabelas [segmento] @@ -1915,6 +1920,7 @@ function _detalhes:AtualizaSegmentos_AfterCombat (instancia, historico) instancia.v_barras = true instancia:ResetaGump() instancia:AtualizaGumpPrincipal (true) + _detalhes:AtualizarJanela (instancia) end end diff --git a/classes/classe_others.lua b/classes/classe_others.lua index 071cee1d..60143894 100644 --- a/classes/classe_others.lua +++ b/classes/classe_others.lua @@ -312,8 +312,27 @@ end --[1] tabela [2] time [3] nome [4] classe [5] maxhealth [6] time of death --[1] true damage/ false heal [2] spellid [3] amount [4] time [5] current health [6] source +local report_table = {} +local ReportSingleDeathFunc = function (IsCurrent, IsReverse, AmtLines) + + AmtLines = AmtLines + 1 + + local t = {} + for i = 1, _math_min (#report_table, AmtLines) do + local table = report_table [i] + t [#t+1] = table [1] .. table [4] .. table [2] .. table [3] + end + + local title = tremove (t, 1) + t = _detalhes.table.reverse (t) + tinsert (t, 1, title) + + _detalhes:SendReportLines (t) + +end + function atributo_misc:ReportSingleDeadLine (morte, instancia) --- + local barra = instancia.barras [morte.minha_barra] local max_health = morte [5] @@ -333,11 +352,11 @@ function atributo_misc:ReportSingleDeadLine (morte, instancia) end local default_len = _detalhes.fontstring_len:GetStringWidth() - local reportar = {"Details! " .. Loc ["STRING_REPORT_SINGLE_DEATH"] .. " " .. morte [3] .. " " .. Loc ["STRING_ACTORFRAME_REPORTAT"] .. " " .. morte [6]} + wipe (report_table) + local report_array = report_table + report_array[1] = {"Details! " .. Loc ["STRING_REPORT_SINGLE_DEATH"] .. " " .. morte [3] .. " " .. Loc ["STRING_ACTORFRAME_REPORTAT"] .. " " .. morte [6], "", "", ""} - local report_array = {} - - for index, evento in _ipairs (morte [1]) do + for index, evento in _ipairs (_detalhes.table.reverse (morte [1])) do if (evento [1] and type (evento [1]) == "boolean") then --> damage if (evento [3]) then local elapsed = _cstr ("%.1f", evento [4] - time_of_death) .."s" @@ -381,16 +400,18 @@ function atributo_misc:ReportSingleDeadLine (morte, instancia) end end - for index = #report_array, 1, -1 do - local table = report_array [index] - reportar [#reportar+1] = table [1] .. table [4] .. table [2] .. table [3] - end + _detalhes:SendReportWindow (ReportSingleDeathFunc, nil, nil, true) + + --for index = #report_array, 1, -1 do + -- local table = report_array [index] + -- reportar [#reportar+1] = table [1] .. table [4] .. table [2] .. table [3] + --end --for index, table in _ipairs (report_array) do -- reportar [#reportar+1] = table [1] .. table [4] .. table [2] .. table [3] --end - return _detalhes:Reportar (reportar, {_no_current = true, _no_inverse = true, _custom = true}) + --return _detalhes:Reportar (reportar, {_no_current = true, _no_inverse = true, _custom = true}) end function atributo_misc:ReportSingleCooldownLine (misc_actor, instancia) diff --git a/classes/container_historico.lua b/classes/container_historico.lua index efe6673a..b131a548 100644 --- a/classes/container_historico.lua +++ b/classes/container_historico.lua @@ -35,7 +35,11 @@ function historico:adicionar_overall (tabela) --> store the segments added to the overall data _detalhes.tabela_overall.segments_added = _detalhes.tabela_overall.segments_added or {} - tinsert (_detalhes.tabela_overall.segments_added, {name = tabela:GetCombatName (true), elapsed = tabela:GetCombatTime(), clock = tabela:GetDate()[1]}) + tinsert (_detalhes.tabela_overall.segments_added, 1, {name = tabela:GetCombatName (true), elapsed = tabela:GetCombatTime(), clock = tabela:GetDate()[1]}) + + if (#_detalhes.tabela_overall.segments_added > 20) then + tremove (_detalhes.tabela_overall.segments_added, 21) + end _detalhes.tabela_overall = _detalhes.tabela_overall + tabela tabela.overall_added = true @@ -291,8 +295,7 @@ function historico:adicionar (tabela) --> chama a função que irá atualizar as instâncias com segmentos no histórico _detalhes:InstanciaCallFunction (_detalhes.AtualizaSegmentos_AfterCombat, self) - - _detalhes:InstanciaCallFunction (_detalhes.AtualizarJanela) + --_detalhes:InstanciaCallFunction (_detalhes.AtualizarJanela) end --> verifica se tem alguma instancia congelada mostrando o segmento recém liberado diff --git a/core/control.lua b/core/control.lua index 91bef3ac..08635035 100644 --- a/core/control.lua +++ b/core/control.lua @@ -230,7 +230,7 @@ --> internal functions -- _detalhes.statistics = {container_calls = 0, container_pet_calls = 0, container_unknow_pet = 0, damage_calls = 0, heal_calls = 0, absorbs_calls = 0, energy_calls = 0, pets_summons = 0} - -- ~start ~inicio + -- ~start ~inicio ~novo ñovo function _detalhes:EntrarEmCombate (...) if (_detalhes.debug) then @@ -333,7 +333,7 @@ end end - -- ~end + -- ~end ~leave function _detalhes:SairDoCombate (bossKilled, from_encounter_end) if (_detalhes.debug) then @@ -592,8 +592,8 @@ _detalhes:CancelTimer (_detalhes.cloud_process) end - _detalhes.in_combat = false --sinaliza ao addon que não há combate no momento - _detalhes.leaving_combat = false --sinaliza que não esta mais saindo do combate + _detalhes.in_combat = false + _detalhes.leaving_combat = false _detalhes:OnCombatPhaseChanged() _table_wipe (_detalhes.tabela_vigente.PhaseData.damage_section) @@ -964,8 +964,23 @@ end end + function _detalhes:PostponeInstanceToCurrent (instance) + if ((instance.last_interaction+6 < _detalhes._tempo) and (not DetailsReportWindow or not DetailsReportWindow:IsShown())) then + if (instance.segmento == 0) then + return _detalhes:TrocaSegmentoAtual (instance) + end + end + _detalhes:ScheduleTimer ("PostponeInstanceToCurrent", 2, instance) + end + function _detalhes:TrocaSegmentoAtual (instancia) if (instancia.segmento == 0) then --> esta mostrando a tabela Atual + + if ((instancia.last_interaction and (instancia.last_interaction+6 > _detalhes._tempo)) or (DetailsReportWindow and DetailsReportWindow:IsShown())) then + --> postpone + return _detalhes:ScheduleTimer ("PostponeInstanceToCurrent", 2, instancia) + end + instancia.showing =_detalhes.tabela_vigente instancia:ResetaGump() _detalhes.gump:Fade (instancia, "in", nil, "barras") diff --git a/core/network.lua b/core/network.lua index 1322e7b4..45c0fe50 100644 --- a/core/network.lua +++ b/core/network.lua @@ -566,6 +566,8 @@ --> enter JoinChannelByName (room_name) _detalhes.is_connected = true + + _detalhes:SendEvent ("REALM_CHANNEL_ENTER") end function _detalhes:LeaveChatChannel() @@ -601,6 +603,8 @@ _detalhes.is_connected = false _detalhes.listener:UnregisterEvent ("CHAT_MSG_CHANNEL") + + _detalhes:SendEvent ("REALM_CHANNEL_LEAVE") end function _detalhes:DoZoneCheck() diff --git a/core/plugins.lua b/core/plugins.lua index e6f32594..fbfa6486 100644 --- a/core/plugins.lua +++ b/core/plugins.lua @@ -1,7 +1,3 @@ ---File Revision: 1 ---Last Modification: 27/07/2013 --- Change Log: - -- 27/07/2013: Finished alpha version. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/core/util.lua b/core/util.lua index 4f7f2fe8..8d1a4c1f 100644 --- a/core/util.lua +++ b/core/util.lua @@ -188,9 +188,31 @@ end return false end + + --> reverse numerical table + function _detalhes:reverse_table (t) + local new = {} + local index = 1 + for i = #t, 1, -1 do + new [index] = t[i] + index = index + 1 + end + return new + end _detalhes.table = {} + function _detalhes.table.reverse (t) + local new = {} + local index = 1 + for i = #t, 1, -1 do + new [index] = t[i] + index = index + 1 + end + return new + end + --yah, i know + function _detalhes.table.copy (t1, t2) local table_deepcopy = table_deepcopy for key, value in pairs (t2) do @@ -309,17 +331,6 @@ return from > #s and "" or s:match(".*%S", from) end - --> reverse numerical table - function _detalhes:reverse_table (t) - local new = {} - local index = 1 - for i = #t, 1, -1 do - new [index] = t[i] - index = index + 1 - end - return new - end - -- lua base64 codec (c) 2006-2008 by Alex Kloss - http://www.it-rfc.de - licensed under the terms of the LGPL2 - http://lua-users.org/wiki/BaseSixtyFour do _detalhes._encode = {} diff --git a/functions/events.lua b/functions/events.lua index fc107213..684a55fc 100644 --- a/functions/events.lua +++ b/functions/events.lua @@ -1,13 +1,10 @@ ---File Revision: 1 ---Last Modification: 27/07/2013 --- Change Log: - -- 27/07/2013: Finished alpha version. - + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local _detalhes = _G._detalhes local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) local _ + --> Event types: _detalhes.RegistredEvents = { --> instances @@ -50,7 +47,12 @@ --> buffs ["BUFF_UPDATE"] = {}, - ["BUFF_UPDATE_DEBUFFPOWER"] = {} + ["BUFF_UPDATE_DEBUFFPOWER"] = {}, + + --> network + ["REALM_CHANNEL_ENTER"] = {}, + ["REALM_CHANNEL_LEAVE"] = {}, + } local function AlreadyRegistred (_tables, _object) @@ -93,6 +95,8 @@ local common_events = { ["GROUP_ONENTER"] = true, ["GROUP_ONLEAVE"] = true, ["ZONE_TYPE_CHANGED"] = true, + ["REALM_CHANNEL_ENTER"] = true, + ["REALM_CHANNEL_LEAVE"] = true, } ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/gumps/janela_info.lua b/gumps/janela_info.lua index 48982de0..685ed692 100644 --- a/gumps/janela_info.lua +++ b/gumps/janela_info.lua @@ -29,6 +29,8 @@ local classe_icones = _G.CLASS_ICON_TCOORDS function _detalhes:AbreJanelaInfo (jogador, from_att_change) + --print (debugstack()) + if (not _detalhes.row_singleclick_overwrite [self.atributo] or not _detalhes.row_singleclick_overwrite [self.atributo][self.sub_atributo]) then _detalhes:FechaJanelaInfo() return diff --git a/gumps/janela_principal.lua b/gumps/janela_principal.lua index 3a2168d5..23800d92 100644 --- a/gumps/janela_principal.lua +++ b/gumps/janela_principal.lua @@ -348,6 +348,7 @@ local function OnEnterMainWindow (instancia, self) instancia.is_interacting = true instancia:SetMenuAlpha (nil, nil, nil, nil, true) instancia:SetAutoHideMenu (nil, nil, true) + instancia.last_interaction = _detalhes._tempo or time() if (instancia.baseframe:GetFrameLevel() > instancia.rowframe:GetFrameLevel()) then instancia.rowframe:SetFrameLevel (instancia.baseframe:GetFrameLevel()) diff --git a/gumps/janela_report.lua b/gumps/janela_report.lua index fe83482f..70cf62fc 100644 --- a/gumps/janela_report.lua +++ b/gumps/janela_report.lua @@ -572,6 +572,11 @@ General/Trade: 255 189 192 este_gump:SetScript ("OnHide", function (self) _detalhes.janela_report.ativa = false _detalhes.last_report_id = nil + + if (_detalhes.delay_CheckSwitchToCurrent) then + _detalhes.delay_CheckSwitchToCurrent = nil + _detalhes:CheckSwitchToCurrent() + end end) este_gump:SetWidth (320) diff --git a/plugins/Details_TimeAttack/Details_TimeAttack.lua b/plugins/Details_TimeAttack/Details_TimeAttack.lua index 819747d5..2dde24eb 100644 --- a/plugins/Details_TimeAttack/Details_TimeAttack.lua +++ b/plugins/Details_TimeAttack/Details_TimeAttack.lua @@ -1172,7 +1172,9 @@ function TimeAttack:OnEvent (_, event, ...) --> Register needed events _G._detalhes:RegisterEvent (TimeAttack, "COMBAT_PLAYER_ENTER") - + _G._detalhes:RegisterEvent (TimeAttack, "REALM_CHANNEL_ENTER") + _G._detalhes:RegisterEvent (TimeAttack, "REALM_CHANNEL_LEAVE") + --> create widgets CreatePluginFrames()