diff --git a/boot.lua b/boot.lua index 6e1bb985..cc842fff 100644 --- a/boot.lua +++ b/boot.lua @@ -4,10 +4,10 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") _detalhes.build_counter = 570 --it's 570 for release - _detalhes.userversion = "v3.10.1" - _detalhes.realversion = 60 --core version + _detalhes.userversion = "v3.10.2" + _detalhes.realversion = 61 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" - + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> initialization stuff @@ -20,17 +20,18 @@ do local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) --[[ -|cFFFFFF00v3.10.1 (|cFFFFCC00Feb 19, 2015|r|cFFFFFF00)|r:\n\n +|cFFFFFF00v3.10.2 (|cFFFFCC00Feb 20, 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 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.10.1 (|cFFFFCC00Feb 19, 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 the 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 Player Details window now closes with right click on any bar.\n\n|cFFFFFF00-|r Fixed Nature's Vigil cooldown.\n\n +-- |cFFFFFF00v3.10.2 (|cFFFFCC00Feb 20, 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 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 - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.10.1 (|cFFFFCC00Feb 19, 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 the 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 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'.\n\n|cFFFFFF00-|r Fixed 'Icon Pick' panel.\n\n|cFFFFFF00-|r Fixed bug when reporting friendly fire through player detail window.\n\n|cFFFFFF00-|r Fixed bug with report window where sometimes it was reporting on a wrong channel.\n\n|cFFFFFF00v3.7.1 (|cFFFFCC00Jan 08, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Plugin 'Damage Rank': is now called 'Damage, the Game!' and had its levels adjusted for WoD.\n\n|cFFFFFF00-|r Plugin 'Tiny Threat': fixed player name where it was showing the realm name too.\n\n|cFFFFFF00-|r Plugin 'Vanguard': fixed frame details (clicking on a bar) shown behind the Vanguard panel.\n\n|cFFFFFF00-|r Plugin 'Vanguard': fixed a problem when clicking with right button wasn't opening the bookmark panel.\n\n|cFFFFFF00-|r Plugin 'Vanguard': incoming heals now count shield amount on the player too.\n\n|cFFFFFF00-|r Plugin 'Vanguard' Known Bug: incoming damage and melee vs avoidance seems to be inaccurate by now, we need more time to study and fix it.\n\n|cFFFFFF00-|r Added Twins Ogron's Charge as custom spells, one for the charge by him self and other for the copies (mythic only).\n\n|cFFFFFF00-|r Added option panel for Raid Check plugin.\n\n|cFFFFFF00-|r Added key bindings for open a window, close a window and select a bookmark." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.10.2 (|cFFFFCC00Feb 20, 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 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'.\n\n|cFFFFFF00-|r Fixed 'Icon Pick' panel.\n\n|cFFFFFF00-|r Fixed bug when reporting friendly fire through player detail window.\n\n|cFFFFFF00-|r Fixed bug with report window where sometimes it was reporting on a wrong channel.\n\n|cFFFFFF00v3.7.1 (|cFFFFCC00Jan 08, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Plugin 'Damage Rank': is now called 'Damage, the Game!' and had its levels adjusted for WoD.\n\n|cFFFFFF00-|r Plugin 'Tiny Threat': fixed player name where it was showing the realm name too.\n\n|cFFFFFF00-|r Plugin 'Vanguard': fixed frame details (clicking on a bar) shown behind the Vanguard panel.\n\n|cFFFFFF00-|r Plugin 'Vanguard': fixed a problem when clicking with right button wasn't opening the bookmark panel.\n\n|cFFFFFF00-|r Plugin 'Vanguard': incoming heals now count shield amount on the player too.\n\n|cFFFFFF00-|r Plugin 'Vanguard' Known Bug: incoming damage and melee vs avoidance seems to be inaccurate by now, we need more time to study and fix it.\n\n|cFFFFFF00-|r Added Twins Ogron's Charge as custom spells, one for the charge by him self and other for the copies (mythic only).\n\n|cFFFFFF00-|r Added option panel for Raid Check plugin.\n\n|cFFFFFF00-|r Added key bindings for open a window, close a window and select a bookmark." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " @@ -274,6 +275,7 @@ do --> functions _detalhes.empty_function = function() end + _detalhes.empty_table = {} --> register textures and fonts for shared media local SharedMedia = LibStub:GetLibrary ("LibSharedMedia-3.0") @@ -350,7 +352,23 @@ do --> welcome function _detalhes:WelcomeMsgLogon() + _detalhes:Msg ("you can always reset the addon running the command |cFFFFFF00'/details reinstall'|r if it does fail to load after being updated.") + + function _detalhes:wipe_combat_after_failed_load() + _detalhes.tabela_historico = _detalhes.historico:NovoHistorico() + _detalhes.tabela_overall = _detalhes.combate:NovaTabela() + _detalhes.tabela_vigente = _detalhes.combate:NovaTabela (_, _detalhes.tabela_overall) + _detalhes.tabela_pets = _detalhes.container_pets:NovoContainer() + _detalhes:UpdateContainerCombatentes() + + _detalhes_database.tabela_overall = nil + _detalhes_database.tabela_historico = nil + + _detalhes:Msg ("seems failed to load, please type /reload to try again.") + end + _detalhes:ScheduleTimer ("wipe_combat_after_failed_load", 5) + end _detalhes.failed_to_load = _detalhes:ScheduleTimer ("WelcomeMsgLogon", 20) diff --git a/classes/classe_damage.lua b/classes/classe_damage.lua index fb6f4386..c07d0d39 100644 --- a/classes/classe_damage.lua +++ b/classes/classe_damage.lua @@ -3771,7 +3771,7 @@ function _detalhes.refresh:r_atributo_damage (este_jogador, shadow) _setmetatable (este_jogador, _detalhes.atributo_damage) este_jogador.__index = _detalhes.atributo_damage --> restaura as metas dos containers - _detalhes.refresh:r_container_habilidades (este_jogador.spells, shadow.spells) + _detalhes.refresh:r_container_habilidades (este_jogador.spells, shadow and shadow.spells) end function _detalhes.clear:c_atributo_damage (este_jogador) diff --git a/classes/classe_energy.lua b/classes/classe_energy.lua index 0b8dfff4..3f6d039e 100644 --- a/classes/classe_energy.lua +++ b/classes/classe_energy.lua @@ -1564,9 +1564,9 @@ function _detalhes.refresh:r_atributo_energy (este_jogador, shadow) _setmetatable (este_jogador, _detalhes.atributo_energy) este_jogador.__index = _detalhes.atributo_energy - _detalhes.refresh:r_container_habilidades (este_jogador.spells, shadow.spells) + _detalhes.refresh:r_container_habilidades (este_jogador.spells, shadow and shadow.spells) - if (not shadow.powertype) then + if (shadow and not shadow.powertype) then shadow.powertype = este_jogador.powertype end end diff --git a/classes/classe_heal.lua b/classes/classe_heal.lua index 3bc9d014..055cf035 100644 --- a/classes/classe_heal.lua +++ b/classes/classe_heal.lua @@ -2441,7 +2441,7 @@ function _detalhes.refresh:r_atributo_heal (este_jogador, shadow) _setmetatable (este_jogador, atributo_heal) este_jogador.__index = atributo_heal - _detalhes.refresh:r_container_habilidades (este_jogador.spells, shadow.spells) + _detalhes.refresh:r_container_habilidades (este_jogador.spells, shadow and shadow.spells) end function _detalhes.clear:c_atributo_heal (este_jogador) diff --git a/classes/classe_others.lua b/classes/classe_others.lua index 7677a906..4a260ce3 100644 --- a/classes/classe_others.lua +++ b/classes/classe_others.lua @@ -2456,9 +2456,9 @@ function atributo_misc:r_connect_shadow (actor, no_refresh) end if (actor.buff_uptime) then - if (not shadow.buff_uptime_spell_targets) then + if (not shadow.buff_uptime_targets) then shadow.buff_uptime = 0 - shadow.buff_uptime_spell_targets = {} + shadow.buff_uptime_targets = {} shadow.buff_uptime_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) end @@ -2627,28 +2627,28 @@ function _detalhes.refresh:r_atributo_misc (este_jogador, shadow) --> refresh interrupts if (este_jogador.interrupt_targets) then - if (not shadow.interrupt_targets) then + if (shadow and not shadow.interrupt_targets) then shadow.interrupt = 0 shadow.interrupt_targets = {} shadow.interrupt_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) shadow.interrompeu_oque = {} end - _detalhes.refresh:r_container_habilidades (este_jogador.interrupt_spells, shadow.interrupt_spells) + _detalhes.refresh:r_container_habilidades (este_jogador.interrupt_spells, shadow and shadow.interrupt_spells) end --> refresh buff uptime if (este_jogador.buff_uptime_targets) then - if (not shadow.buff_uptime_spell_targets) then + if (shadow and not shadow.buff_uptime_targets) then shadow.buff_uptime = 0 - shadow.buff_uptime_spell_targets = {} + shadow.buff_uptime_targets = {} shadow.buff_uptime_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) end - _detalhes.refresh:r_container_habilidades (este_jogador.buff_uptime_spells, shadow.buff_uptime_spells) + _detalhes.refresh:r_container_habilidades (este_jogador.buff_uptime_spells, shadow and shadow.buff_uptime_spells) end --> refresh buff uptime if (este_jogador.debuff_uptime_targets) then - if (not shadow.debuff_uptime_targets) then + if (shadow and not shadow.debuff_uptime_targets) then shadow.debuff_uptime = 0 if (este_jogador.boss_debuff) then shadow.debuff_uptime_targets = {} @@ -2662,49 +2662,49 @@ function _detalhes.refresh:r_atributo_misc (este_jogador, shadow) end shadow.debuff_uptime_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) end - _detalhes.refresh:r_container_habilidades (este_jogador.debuff_uptime_spells, shadow.debuff_uptime_spells) + _detalhes.refresh:r_container_habilidades (este_jogador.debuff_uptime_spells, shadow and shadow.debuff_uptime_spells) end --> refresh cooldowns defensive if (este_jogador.cooldowns_defensive_targets) then - if (not shadow.cooldowns_defensive_targets) then + if (shadow and not shadow.cooldowns_defensive_targets) then shadow.cooldowns_defensive = 0 shadow.cooldowns_defensive_targets = {} shadow.cooldowns_defensive_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) end - _detalhes.refresh:r_container_habilidades (este_jogador.cooldowns_defensive_spells, shadow.cooldowns_defensive_spells) + _detalhes.refresh:r_container_habilidades (este_jogador.cooldowns_defensive_spells, shadow and shadow.cooldowns_defensive_spells) end --> refresh ressers if (este_jogador.ress_targets) then - if (not shadow.ress_targets) then + if (shadow and not shadow.ress_targets) then shadow.ress = 0 shadow.ress_targets = {} shadow.ress_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) end - _detalhes.refresh:r_container_habilidades (este_jogador.ress_spells, shadow.ress_spells) + _detalhes.refresh:r_container_habilidades (este_jogador.ress_spells, shadow and shadow.ress_spells) end --> refresh dispells if (este_jogador.dispell_targets) then - if (not shadow.dispell_targets) then + if (shadow and not shadow.dispell_targets) then shadow.dispell = 0 shadow.dispell_targets = {} shadow.dispell_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) --> cria o container das habilidades usadas para interromper shadow.dispell_oque = {} end - _detalhes.refresh:r_container_habilidades (este_jogador.dispell_spells, shadow.dispell_spells) + _detalhes.refresh:r_container_habilidades (este_jogador.dispell_spells, shadow and shadow.dispell_spells) end --> refresh cc_breaks if (este_jogador.cc_break_targets) then - if (not shadow.cc_break) then + if (shadow and not shadow.cc_break) then shadow.cc_break = 0 shadow.cc_break_targets = {} shadow.cc_break_spells = container_habilidades:NovoContainer (_detalhes.container_type.CONTAINER_MISC_CLASS) shadow.cc_break_oque = {} end - _detalhes.refresh:r_container_habilidades (este_jogador.cc_break_spells, shadow.cc_break_spells) + _detalhes.refresh:r_container_habilidades (este_jogador.cc_break_spells, shadow and shadow.cc_break_spells) end end diff --git a/classes/container_historico.lua b/classes/container_historico.lua index 8fff7276..e0b719d2 100644 --- a/classes/container_historico.lua +++ b/classes/container_historico.lua @@ -33,9 +33,21 @@ function historico:adicionar_overall (tabela) end end + --> 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]}) + _detalhes.tabela_overall = _detalhes.tabela_overall + tabela tabela.overall_added = true + if (not _detalhes.tabela_overall.overall_enemy_name) then + _detalhes.tabela_overall.overall_enemy_name = tabela.is_boss and tabela.is_boss.name or tabela.enemy + else + if (_detalhes.tabela_overall.overall_enemy_name ~= (tabela.is_boss and tabela.is_boss.name or tabela.enemy)) then + _detalhes.tabela_overall.overall_enemy_name = "-- x -- x --" + end + end + if (_detalhes.tabela_overall.start_time == 0) then _detalhes.tabela_overall.start_time = tabela.start_time _detalhes.tabela_overall.end_time = tabela.end_time @@ -222,16 +234,20 @@ function _detalhes:CheckFreeze (instancia, index_liberado, tabela) end end -function _detalhes:OverallOptions (reset_new_boss, reset_new_challenge) +function _detalhes:OverallOptions (reset_new_boss, reset_new_challenge, reset_on_logoff) if (reset_new_boss == nil) then reset_new_boss = _detalhes.overall_clear_newboss end if (reset_new_challenge == nil) then reset_new_challenge = _detalhes.overall_clear_newchallenge end + if (reset_on_logoff == nil) then + reset_on_logoff = _detalhes.overall_clear_logout + end _detalhes.overall_clear_newboss = reset_new_boss _detalhes.overall_clear_newchallenge = reset_new_challenge + _detalhes.overall_clear_logout = reset_on_logoff end function historico:resetar_overall() diff --git a/core/meta.lua b/core/meta.lua index 1936f763..c4637f9a 100644 --- a/core/meta.lua +++ b/core/meta.lua @@ -49,6 +49,66 @@ tabela._NameIndexTable = mapa end + --> reaplica as tabelas no overall + function _detalhes:RestauraOverallMetaTables() + + local is_in_instance = select (1, IsInInstance()) + + local combate = _detalhes.tabela_overall + combate.overall_refreshed = true + combate.hasSaved = true + + combate.__call = _detalhes.call_combate + + _detalhes.refresh:r_combate (combate) + + _detalhes.refresh:r_container_combatentes (combate [class_type_dano]) + _detalhes.refresh:r_container_combatentes (combate [class_type_cura]) + _detalhes.refresh:r_container_combatentes (combate [class_type_e_energy]) + _detalhes.refresh:r_container_combatentes (combate [class_type_misc]) + + local todos_atributos = {combate [class_type_dano]._ActorTable, combate [class_type_cura]._ActorTable, combate [class_type_e_energy]._ActorTable, combate [class_type_misc]._ActorTable} + + for class_type, atributo in _ipairs (todos_atributos) do + for _, esta_classe in _ipairs (atributo) do + + local nome = esta_classe.nome + + if (is_in_instance and _detalhes.remove_realm_from_name) then + esta_classe.displayName = nome:gsub (("%-.*"), "") + elseif (_detalhes.remove_realm_from_name) then + esta_classe.displayName = nome:gsub (("%-.*"), "%*") + else + esta_classe.displayName = nome + end + + if (class_type == class_type_dano) then + _detalhes.refresh:r_atributo_damage (esta_classe) + + elseif (class_type == class_type_cura) then + _detalhes.refresh:r_atributo_heal (esta_classe) + + elseif (class_type == class_type_e_energy) then + _detalhes.refresh:r_atributo_energy (esta_classe) + + elseif (class_type == class_type_misc) then + _detalhes.refresh:r_atributo_misc (esta_classe) + + end + + end + end + + for class_type, atributo in _ipairs (todos_atributos) do + for _, esta_classe in _ipairs (atributo) do + if (esta_classe.ownerName) then --> nome do owner + esta_classe.owner = combate (class_type, esta_classe.ownerName) + end + end + end + + end + --> reaplica indexes e metatables function _detalhes:RestauraMetaTables() @@ -78,10 +138,13 @@ end --> tempo padrao do overall - --combate_overall.start_time = _tempo - combate_overall.start_time = GetTime() - --combate_overall.end_time = _tempo - combate_overall.end_time = GetTime() + + local overall_saved = combate_overall.overall_refreshed + + if (not overall_saved) then + combate_overall.start_time = GetTime() + combate_overall.end_time = GetTime() + end local is_in_instance = select (1, IsInInstance()) @@ -90,15 +153,29 @@ for index, combate in _ipairs (tabelas_do_historico) do combate.hasSaved = true - - --> aumenta o tempo do combate do overall - if (combate.end_time and combate.start_time) then - combate_overall.start_time = combate_overall.start_time - (combate.end_time - combate.start_time) - end - + --> recupera a meta e indexes da tabela do combate _detalhes.refresh:r_combate (combate, combate_overall) + --> aumenta o tempo do combate do overall + if (combate.end_time and combate.start_time and not overall_saved) then + combate_overall.start_time = combate_overall.start_time - (combate.end_time - combate.start_time) + end + + if (not overall_saved and combate.overall_added) then + if (not _detalhes.tabela_overall.overall_enemy_name) then + _detalhes.tabela_overall.overall_enemy_name = combate.is_boss and combate.is_boss.name or combate.enemy + else + if (_detalhes.tabela_overall.overall_enemy_name ~= (combate.is_boss and combate.is_boss.name or combate.enemy)) then + _detalhes.tabela_overall.overall_enemy_name = "-- x -- x --" + end + end + + combate_overall.segments_added =combate_overall.segments_added or {} + tinsert (combate_overall.segments_added, {name = combate:GetCombatName (true), elapsed = combate:GetCombatTime(), clock = combate:GetDate()[1]}) + + end + --> recupera a meta e indexes dos 4 container _detalhes.refresh:r_container_combatentes (combate [class_type_dano], overall_dano) _detalhes.refresh:r_container_combatentes (combate [class_type_cura], overall_cura) @@ -124,28 +201,28 @@ local shadow if (class_type == class_type_dano) then - if (combate.overall_added) then + if (combate.overall_added and not overall_saved) then shadow = atributo_damage:r_connect_shadow (esta_classe) else shadow = atributo_damage:r_onlyrefresh_shadow (esta_classe) end elseif (class_type == class_type_cura) then - if (combate.overall_added) then + if (combate.overall_added and not overall_saved) then shadow = atributo_heal:r_connect_shadow (esta_classe) else shadow = atributo_heal:r_onlyrefresh_shadow (esta_classe) end elseif (class_type == class_type_e_energy) then - if (combate.overall_added) then + if (combate.overall_added and not overall_saved) then shadow = atributo_energy:r_connect_shadow (esta_classe) else shadow = atributo_energy:r_onlyrefresh_shadow (esta_classe) end elseif (class_type == class_type_misc) then - if (combate.overall_added) then + if (combate.overall_added and not overall_saved) then shadow = atributo_misc:r_connect_shadow (esta_classe) else shadow = atributo_misc:r_onlyrefresh_shadow (esta_classe) @@ -291,17 +368,35 @@ end function _detalhes:DoOwnerCleanup() - for index, combat in _ipairs (_detalhes.tabela_historico.tabelas or {}) do + local combats = _detalhes.tabela_historico.tabelas or {} + local overall_added + if (not _detalhes.overall_clear_logout) then + tinsert (combats, _detalhes.tabela_overall) + overall_added = true + end + + for index, combat in _ipairs (combats) do for index, container in _ipairs (combat) do for index, esta_classe in _ipairs (container._ActorTable) do esta_classe.owner = nil end end end + + if (overall_added) then + tremove (combats, #combats) + end end function _detalhes:DoClassesCleanup() - for index, combat in _ipairs (_detalhes.tabela_historico.tabelas or {}) do + local combats = _detalhes.tabela_historico.tabelas or {} + local overall_added + if (not _detalhes.overall_clear_logout) then + tinsert (combats, _detalhes.tabela_overall) + overall_added = true + end + + for index, combat in _ipairs (combats) do for class_type, container in _ipairs (combat) do for index, esta_classe in _ipairs (container._ActorTable) do @@ -321,32 +416,60 @@ end end end + + if (overall_added) then + tremove (combats, #combats) + end end function _detalhes:DoContainerCleanup() - for index, combat in _ipairs (_detalhes.tabela_historico.tabelas or {}) do + local combats = _detalhes.tabela_historico.tabelas or {} + local overall_added + if (not _detalhes.overall_clear_logout) then + tinsert (combats, _detalhes.tabela_overall) + overall_added = true + end + + for index, combat in _ipairs (combats) do _detalhes.clear:c_combate (combat) for index, container in _ipairs (combat) do _detalhes.clear:c_container_combatentes (container) end end + + if (overall_added) then + tremove (combats, #combats) + end end function _detalhes:DoContainerIndexCleanup() - for index, combat in _ipairs (_detalhes.tabela_historico.tabelas or {}) do + local combats = _detalhes.tabela_historico.tabelas or {} + local overall_added + if (not _detalhes.overall_clear_logout) then + tinsert (combats, _detalhes.tabela_overall) + overall_added = true + end + + for index, combat in _ipairs (combats) do for index, container in _ipairs (combat) do _detalhes.clear:c_container_combatentes_index (container) end end + + if (overall_added) then + tremove (combats, #combats) + end end --> limpa indexes, metatables e shadows function _detalhes:PrepareTablesForSave() + _detalhes.clear_ungrouped = true + --> clear instances _detalhes:DoInstanceCleanup() - _detalhes:DoClassesCleanup() - _detalhes:DoContainerCleanup() + _detalhes:DoClassesCleanup() --aumentou 1 combat + _detalhes:DoContainerCleanup() --aumentou 1 combat --> clear combats local tabelas_de_combate = {} @@ -373,12 +496,65 @@ local tabela_atual = _detalhes.tabela_vigente or _detalhes.combate:NovaTabela (_, _detalhes.tabela_overall) --> limpa a tabela overall - _detalhes.tabela_overall = nil + if (_detalhes.overall_clear_logout) then + _detalhes.tabela_overall = nil + _detalhes_database.tabela_overall = nil + else + local _combate = _detalhes.tabela_overall + + _combate.previous_combat = nil + local todos_atributos = {_combate [class_type_dano] or {}, _combate [class_type_cura] or {}, _combate [class_type_e_energy] or {}, _combate [class_type_misc] or {}} + + for class_type, _tabela in _ipairs (todos_atributos) do + local conteudo = _tabela._ActorTable + + --> Limpa tabelas que não estejam em grupo + if (conteudo) then + if (_detalhes.clear_ungrouped) then + local _iter = {index = 1, data = conteudo[1], cleaned = 0} --> ._ActorTable[1] para pegar o primeiro index + + 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 + can_erase = false + else + local owner = _iter.data.owner + if (owner) then + local owner_actor = _combate [class_type]._NameIndexTable [owner.nome] + if (owner_actor) then + local owner_actor = _combate [class_type]._ActorTable [owner_actor] + if (owner_actor) then + if (owner.grupo or owner.boss or owner.boss_fight_component) then + can_erase = false + end + end + end + end + end + + if (can_erase) then + _table_remove (conteudo, _iter.index) + _iter.cleaned = _iter.cleaned + 1 + _iter.data = conteudo [_iter.index] + else + _iter.index = _iter.index + 1 + _iter.data = conteudo [_iter.index] + end + end + + if (_iter.cleaned > 0) then + ReconstroiMapa (_tabela) + end + end + end + end + end for _, _tabela in _ipairs (historico_tabelas) do tabelas_de_combate [#tabelas_de_combate+1] = _tabela end - + for tabela_index, _combate in _ipairs (tabelas_de_combate) do --> limpa a tabela do grafico @@ -409,9 +585,7 @@ --> Limpa tabelas que não estejam em grupo if (conteudo) then - - _detalhes.clear_ungrouped = true - + if (_detalhes.clear_ungrouped) then local _iter = {index = 1, data = conteudo[1], cleaned = 0} --> ._ActorTable[1] para pegar o primeiro index @@ -503,7 +677,7 @@ end end - if (_iter.cleaned > 0) then --> desencargo de consciência, reconstruir o mapa depois de excluir + if (_iter.cleaned > 0) then ReconstroiMapa (_tabela) end @@ -513,7 +687,7 @@ end end - + --> panic mode if (_detalhes.segments_panic_mode and _detalhes.can_panic_mode) then if (_detalhes.tabela_vigente.is_boss) then diff --git a/functions/loaddata.lua b/functions/loaddata.lua index 3ed93017..335865e2 100644 --- a/functions/loaddata.lua +++ b/functions/loaddata.lua @@ -178,71 +178,81 @@ function _detalhes:LoadCombatTables() _detalhes:UpdateContainerCombatentes() else - --> build basic containers - -- segments - _detalhes.tabela_historico = _detalhes_database.tabela_historico or _detalhes.historico:NovoHistorico() - -- overall - _detalhes.tabela_overall = _detalhes.combate:NovaTabela() - - -- pets - _detalhes.tabela_pets = _detalhes.container_pets:NovoContainer() - if (_detalhes_database.tabela_pets) then - _detalhes.tabela_pets.pets = table_deepcopy (_detalhes_database.tabela_pets) - end - _detalhes:UpdateContainerCombatentes() - - --> if the core revision was incremented, reset all combat data - if (_detalhes_database.last_realversion and _detalhes_database.last_realversion < _detalhes.realversion) then - --> details was been hard upgraded - _detalhes.tabela_historico = _detalhes.historico:NovoHistorico() + --> build basic containers + -- segments + _detalhes.tabela_historico = _detalhes_database.tabela_historico or _detalhes.historico:NovoHistorico() + -- overall _detalhes.tabela_overall = _detalhes.combate:NovaTabela() - _detalhes.tabela_vigente = _detalhes.combate:NovaTabela (_, _detalhes.tabela_overall) + + -- pets _detalhes.tabela_pets = _detalhes.container_pets:NovoContainer() + if (_detalhes_database.tabela_pets) then + _detalhes.tabela_pets.pets = table_deepcopy (_detalhes_database.tabela_pets) + end _detalhes:UpdateContainerCombatentes() - else - --> check integrity - local combat = _detalhes.tabela_historico.tabelas [1] - if (combat) then - if (not combat[1] or not combat[2] or not combat[3] or not combat[4]) then - --> something went wrong in last logon, let's just reset and we are good to go - _detalhes.tabela_historico = _detalhes.historico:NovoHistorico() - _detalhes.tabela_vigente = _detalhes.combate:NovaTabela (_, _detalhes.tabela_overall) - _detalhes.tabela_pets = _detalhes.container_pets:NovoContainer() - _detalhes:UpdateContainerCombatentes() + + --> if the core revision was incremented, reset all combat data + if (_detalhes_database.last_realversion and _detalhes_database.last_realversion < _detalhes.realversion) then + --> details was been hard upgraded + _detalhes.tabela_historico = _detalhes.historico:NovoHistorico() + _detalhes.tabela_overall = _detalhes.combate:NovaTabela() + _detalhes.tabela_vigente = _detalhes.combate:NovaTabela (_, _detalhes.tabela_overall) + _detalhes.tabela_pets = _detalhes.container_pets:NovoContainer() + _detalhes:UpdateContainerCombatentes() + + _detalhes_database.tabela_historico = nil + _detalhes_database.tabela_overall = nil + else + --> check integrity + local combat = _detalhes.tabela_historico.tabelas [1] + if (combat) then + if (not combat[1] or not combat[2] or not combat[3] or not combat[4]) then + --> something went wrong in last logon, let's just reset and we are good to go + _detalhes.tabela_historico = _detalhes.historico:NovoHistorico() + _detalhes.tabela_vigente = _detalhes.combate:NovaTabela (_, _detalhes.tabela_overall) + _detalhes.tabela_pets = _detalhes.container_pets:NovoContainer() + _detalhes:UpdateContainerCombatentes() + end end end - end - --> re-build all indexes and metatables - _detalhes:RestauraMetaTables() + if (not _detalhes.overall_clear_logout) then + if (_detalhes_database.tabela_overall) then + _detalhes.tabela_overall = _detalhes_database.tabela_overall + _detalhes:RestauraOverallMetaTables() + end + end + + --> re-build all indexes and metatables + _detalhes:RestauraMetaTables() - --> get last combat table - local historico_UM = _detalhes.tabela_historico.tabelas[1] + --> get last combat table + local historico_UM = _detalhes.tabela_historico.tabelas[1] + + if (historico_UM) then + _detalhes.tabela_vigente = historico_UM --> significa que elas eram a mesma tabela, então aqui elas se tornam a mesma tabela + else + _detalhes.tabela_vigente = _detalhes.combate:NovaTabela (_, _detalhes.tabela_overall) + end + + --> need refresh for all containers + for _, container in ipairs (_detalhes.tabela_overall) do + container.need_refresh = true + end + for _, container in ipairs (_detalhes.tabela_vigente) do + container.need_refresh = true + end - if (historico_UM) then - _detalhes.tabela_vigente = historico_UM --> significa que elas eram a mesma tabela, então aqui elas se tornam a mesma tabela - else - _detalhes.tabela_vigente = _detalhes.combate:NovaTabela (_, _detalhes.tabela_overall) - end - - --> need refresh for all containers - for _, container in ipairs (_detalhes.tabela_overall) do - container.need_refresh = true - end - for _, container in ipairs (_detalhes.tabela_vigente) do - container.need_refresh = true - end - - --> erase combat data from the database - _detalhes_database.tabela_vigente = nil - _detalhes_database.tabela_historico = nil - _detalhes_database.tabela_pets = nil - - -- double check for pet container - if (not _detalhes.tabela_pets or not _detalhes.tabela_pets.pets) then - _detalhes.tabela_pets = _detalhes.container_pets:NovoContainer() - end - _detalhes:UpdateContainerCombatentes() + --> erase combat data from the database + _detalhes_database.tabela_vigente = nil + _detalhes_database.tabela_historico = nil + _detalhes_database.tabela_pets = nil + + -- double check for pet container + if (not _detalhes.tabela_pets or not _detalhes.tabela_pets.pets) then + _detalhes.tabela_pets = _detalhes.container_pets:NovoContainer() + end + _detalhes:UpdateContainerCombatentes() end end diff --git a/functions/playerclass.lua b/functions/playerclass.lua index 8fe11347..9e219613 100644 --- a/functions/playerclass.lua +++ b/functions/playerclass.lua @@ -18,15 +18,17 @@ do if (not class) then for _, container in _ipairs (_detalhes.tabela_overall) do - 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 + --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 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 0a849179..4ccb2ea7 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -913,6 +913,7 @@ local default_profile = { overall_flag = 0xD, overall_clear_newboss = true, overall_clear_newchallenge = true, + overall_clear_logout = false, --> skins standard_skin = false, diff --git a/functions/savedata.lua b/functions/savedata.lua index 2cbf06ef..07fb5cfb 100644 --- a/functions/savedata.lua +++ b/functions/savedata.lua @@ -64,11 +64,16 @@ function _detalhes:SaveConfig() _detalhes:SaveLocalInstanceConfig() --> cleanup + _detalhes:PrepareTablesForSave() _detalhes_database.tabela_instancias = {} --_detalhes.tabela_instancias --[[instances now saves only inside the profile --]] _detalhes_database.tabela_historico = _detalhes.tabela_historico + if (not _detalhes.overall_clear_logout) then + _detalhes_database.tabela_overall = _detalhes.tabela_overall + end + local name, ttype, difficulty, difficultyName, maxPlayers, playerDifficulty, isDynamicInstance, mapID, instanceGroupSize = GetInstanceInfo() if (ttype == "party" or ttype == "raid") then --> salvar container de pet diff --git a/gumps/janela_options.lua b/gumps/janela_options.lua index 21dd28cb..e8639c28 100644 --- a/gumps/janela_options.lua +++ b/gumps/janela_options.lua @@ -4194,6 +4194,19 @@ function window:CreateFrame2() -- window:CreateLineBackground2 (frame2, "OverallNewChallengeSlider", "OverallNewChallengeLabel", Loc ["STRING_OPTIONS_OVERALL_CHALLENGE_DESC"]) + --erase on logout overall_clear_logout + g:NewLabel (frame2, _, "$parentOverallOnLogoutLabel", "OverallOnLogoutLabel", Loc ["STRING_OPTIONS_OVERALL_LOGOFF"], "GameFontHighlightLeft") + -- + g:NewSwitch (frame2, _, "$parentOverallOnLogoutSlider", "OverallOnLogoutSlider", 60, 20, _, _, false) + frame2.OverallOnLogoutSlider:SetPoint ("left", frame2.OverallOnLogoutLabel, "right", 2, 0) + -- + frame2.OverallOnLogoutSlider.OnSwitch = function (self, _, value) + _detalhes:OverallOptions (nil, nil, value) + _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) + end + -- + window:CreateLineBackground2 (frame2, "OverallOnLogoutSlider", "OverallOnLogoutLabel", Loc ["STRING_OPTIONS_OVERALL_LOGOFF_DESC"]) + --> captures --> icons @@ -4337,6 +4350,7 @@ function window:CreateFrame2() {"OverallDataAllLabel", 10, true}, {"OverallNewBossLabel", 11, true}, {"OverallNewChallengeLabel", 12}, + {"OverallOnLogoutLabel", 13}, } window:arrange_menu (frame2, left_side, x, window.top_start_at) @@ -9952,6 +9966,7 @@ end --> if not window _G.DetailsOptionsWindow2OverallNewBossSlider.MyObject:SetValue (_detalhes.overall_clear_newboss) _G.DetailsOptionsWindow2OverallNewChallengeSlider.MyObject:SetValue (_detalhes.overall_clear_newchallenge) + _G.DetailsOptionsWindow2OverallOnLogoutSlider.MyObject:SetValue (_detalhes.overall_clear_logout) _G.DetailsOptionsWindow2CaptureDamageSlider.MyObject:SetValue (_detalhes.capture_real ["damage"]) _G.DetailsOptionsWindow2CaptureHealSlider.MyObject:SetValue (_detalhes.capture_real ["heal"]) diff --git a/gumps/janela_principal.lua b/gumps/janela_principal.lua index 9213f3e6..83dd0343 100644 --- a/gumps/janela_principal.lua +++ b/gumps/janela_principal.lua @@ -5314,7 +5314,9 @@ local build_segment_list = function (self, elapsed) CoolTip:AddMenu (1, instancia.TrocaTabela, -1) CoolTip:AddIcon ([[Interface\QUESTFRAME\UI-Quest-BulletPoint]], "main", "left", 16, 16, nil, nil, nil, nil, "orange") - CoolTip:AddLine (Loc ["STRING_SEGMENT_ENEMY"] .. ":", "--x--x--", 2, "white", "white") + local enemy_name = _detalhes.tabela_overall.overall_enemy_name + + CoolTip:AddLine (Loc ["STRING_SEGMENT_ENEMY"] .. ":", enemy_name, 2, "white", "white") if (not _detalhes.tabela_overall:GetEndTime()) then if (_detalhes.in_combat) then @@ -5350,6 +5352,25 @@ local build_segment_list = function (self, elapsed) end CoolTip:AddLine (Loc ["STRING_SEGMENT_END"] .. ":", lastFight, 2, "white", "white") + -- combats added + local combats_added = _detalhes.tabela_overall.segments_added or _detalhes.empty_table + CoolTip:AddLine ("Segments" .. ":", #combats_added, 2, "white", "white") + + if (#combats_added > 0) then + CoolTip:AddLine ("", "", 2, "white", "white") + end + + for i, segment in _ipairs (combats_added) do + local minutos, segundos = _math_floor (segment.elapsed/60), _math_floor (segment.elapsed%60) + + local name = segment.name + if (name:len() > 20) then + name = string.sub (name, 1, #name - (#name - 20)) + end + + CoolTip:AddLine ("" .. name, minutos.."m "..segundos.."s", 2, "white", "white") + end + --> fill é a quantidade de menu que esta sendo mostrada if (instancia.segmento == -1) then if (fill - 2 == menuIndex) then diff --git a/locales/Details-deDE.lua b/locales/Details-deDE.lua index 8f28bdd8..2be08586 100644 --- a/locales/Details-deDE.lua +++ b/locales/Details-deDE.lua @@ -1,4 +1,4 @@ local L = LibStub("AceLocale-3.0"):NewLocale("Details", "deDE") if not L then return end -@localization(locale="deDE", format="lua_additive_table", escape-non-ascii=true)@ \ No newline at end of file +@localization(locale="deDE", format="lua_additive_table")@ \ No newline at end of file diff --git a/locales/Details-esES.lua b/locales/Details-esES.lua index 4703097f..037ecf4b 100644 --- a/locales/Details-esES.lua +++ b/locales/Details-esES.lua @@ -1,4 +1,4 @@ local L = LibStub("AceLocale-3.0"):NewLocale("Details", "esES") if not L then return end -@localization(locale="esES", format="lua_additive_table", escape-non-ascii=true)@ \ No newline at end of file +@localization(locale="esES", format="lua_additive_table")@ \ No newline at end of file diff --git a/locales/Details-esMX.lua b/locales/Details-esMX.lua index 75da3e46..a574f5bb 100644 --- a/locales/Details-esMX.lua +++ b/locales/Details-esMX.lua @@ -1,4 +1,4 @@ local L = LibStub("AceLocale-3.0"):NewLocale("Details", "esMX") if not L then return end -@localization(locale="esMX", format="lua_additive_table", escape-non-ascii=true)@ \ No newline at end of file +@localization(locale="esMX", format="lua_additive_table")@ \ No newline at end of file diff --git a/locales/Details-frFR.lua b/locales/Details-frFR.lua index 45d58834..7cc61325 100644 --- a/locales/Details-frFR.lua +++ b/locales/Details-frFR.lua @@ -1,4 +1,4 @@ local L = LibStub("AceLocale-3.0"):NewLocale("Details", "frFR") if not L then return end -@localization(locale="frFR", format="lua_additive_table", escape-non-ascii=true)@ \ No newline at end of file +@localization(locale="frFR", format="lua_additive_table")@ \ No newline at end of file diff --git a/locales/Details-koKR.lua b/locales/Details-koKR.lua index ab9702de..4aa439eb 100644 --- a/locales/Details-koKR.lua +++ b/locales/Details-koKR.lua @@ -1,4 +1,4 @@ local L = LibStub("AceLocale-3.0"):NewLocale("Details", "koKR") if not L then return end -@localization(locale="koKR", format="lua_additive_table", escape-non-ascii=true)@ \ No newline at end of file +@localization(locale="koKR", format="lua_additive_table")@ \ No newline at end of file diff --git a/locales/Details-ptBR.lua b/locales/Details-ptBR.lua index 5cedaeb4..898ef332 100644 --- a/locales/Details-ptBR.lua +++ b/locales/Details-ptBR.lua @@ -1,7 +1,7 @@ local L = LibStub("AceLocale-3.0"):NewLocale("Details", "ptBR") if not L then return end -@localization(locale="ptBR", format="lua_additive_table", escape-non-ascii=true)@ +@localization(locale="ptBR", format="lua_additive_table")@ diff --git a/locales/Details-ruRU.lua b/locales/Details-ruRU.lua index 21fa39b6..e9aa2868 100644 --- a/locales/Details-ruRU.lua +++ b/locales/Details-ruRU.lua @@ -1,4 +1,4 @@ local L = LibStub("AceLocale-3.0"):NewLocale("Details", "ruRU") if not L then return end -@localization(locale="ruRU", format="lua_additive_table", escape-non-ascii=true)@ \ No newline at end of file +@localization(locale="ruRU", format="lua_additive_table")@ \ No newline at end of file diff --git a/locales/Details-zhTW.lua b/locales/Details-zhTW.lua index f5507ab8..5f96c89e 100644 --- a/locales/Details-zhTW.lua +++ b/locales/Details-zhTW.lua @@ -1,4 +1,4 @@ local L = LibStub("AceLocale-3.0"):NewLocale("Details", "zhTW") if not L then return end -@localization(locale="zhTW", format="lua_additive_table", escape-non-ascii=true)@ \ No newline at end of file +@localization(locale="zhTW", format="lua_additive_table")@ \ No newline at end of file