diff --git a/API.txt b/API.txt index e6fd6295..125f6e7e 100644 --- a/API.txt +++ b/API.txt @@ -95,7 +95,7 @@ returns the current combat object. _detalhes:GetCombatSegments() returns the numeric table containing all past segments. -_detalhes:GetCombatId() +_detalhes:GetCombatNumber() returns the current unique combat number counter. combat number is a unique number given to each combat started, this number won't reset when data is wiped and each character have its own combat number counter. diff --git a/boot.lua b/boot.lua index 147f720e..1a9de850 100644 --- a/boot.lua +++ b/boot.lua @@ -3,9 +3,9 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") - _detalhes.build_counter = 235 --it's 220 for release - _detalhes.userversion = "v3.3.0" - _detalhes.realversion = 48 --core version + _detalhes.build_counter = 245 --it's 245 for release + _detalhes.userversion = "v3.4.0" + _detalhes.realversion = 49 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -19,18 +19,9 @@ do --[[ -|cFFFFFF00v3.3.0 (|cFFFFCC00Nov 25, 2014|r|cFFFFFF00)|r:\n\n - -|cFFFFFF00-|r Added 3D models for the bars in the window. The options for this are under Appearance -> Rows: Advanced.\n\n -|cFFFFFF00-|r Now when showing custom displays, clicking on a bar report what is shown on bar's tooltip.\n\n -|cFFFFFF00-|r More fixes for dungeon bosses identification.\n\n -|cFFFFFF00-|r Fixed a tooltip bug with Debuff Uptime and Aura & Voidzone displays.\n\n -|cFFFFFF00-|r Fixed Player Details Window for friendly fire and damage taken.\n\n -|cFFFFFF00-|r Fixed Molten Core Raid Finder version where all bosses was considered trash segments.\n\n - --]] - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.3.0 (|cFFFFCC00Nov 25, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added 3D models for the bars in the window. The options are at Appearance -> Rows: Advanced.\n\n|cFFFFFF00-|r Now when showing custom displays, clicking on a bar report what is shown on bar's tooltip.\n\n|cFFFFFF00-|r More fixes for dungeon bosses identification.\n\n|cFFFFFF00-|r Fixed a tooltip bug with Debuff Uptime and Aura & Voidzone displays.\n\n|cFFFFFF00-|r Fixed Player Details Window for friendly fire and damage taken.\n\n|cFFFFFF00-|r Fixed Molten Core Raid Finder version where all bosses was considered trash segments.\n\n|cFFFFFF00v3.2.4 (|cFFFFCC00Nov 19, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r More fixes for dungeon bosses recognition.\n\n|cFFFFFF00-|r Fixes for few errors during combat parser.\n\n|cFFFFFF00v3.2.3 (|cFFFFCC00Nov 18, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed Monk's Stagger ability which was counting as damage done.\n\n|cFFFFFF00-|r Added WoD dungeon information, this fixes dungeon bosses being assigned as 'trash cleanup'.\n\n|cFFFFFF00-|r Added more information on API.txt document (is in Details! root folder).\n\n|cFFFFFF00v3.2.1 (|cFFFFCC00Nov 14, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Custom Displays updated to track WoD potions.\n\n|cFFFFFF00-|r Added Feedback panel at options panel.\n\n|cFFFFFF00v3.2.0 (|cFFFFCC00Nov 11, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Major changes on the way Details! store information, these changes saves up to 40% memory and 4% cpu usage.\n\n|cFFFFFF00-|r Fixed problem with pet's healing messing with the owner activity time.\n\n|cFFFFFF00-|r Added Energy -> Resources.\n\n|cFFFFFF00-|r Fixed combat initialization when the player start casting a Dot spell.\n\n|cFFFFFF00-|r Added new custom display: Damage Taken By Spell.\n\n|cFFFFFF00v2.2.3 (|cFFFFCC00Oct 26, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed the healing done problem with Priest's Spirit of Redemption.\n\n|cFFFFFF00-|r Fixed avoidance by absorb when the hit missed was a multistrike hit.\n\n|cFFFFFF00-|r Fixed a script time out problem when erasing data while in combat.\n\n|cFFFFFF00-|r Fixed bug with interrupt tooltip when the player have a pet.\n\n|cFFFFFF00v2.2.1 (|cFFFFCC00Oct 22, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed the gap between the button and its menu which sometimes traveling the mouse between them was activating tooltips from window's bars.\n\n|cFFFFFF00-|r Fixed an annoying menu blink when the window was near the right side of the screen.\n\n|cFFFFFF00-|r Fixed the stretch grab which was over other windows even with the 'stretch always on top' option disabled.\n\n|cFFFFFF00-|r Few fixes on healing done from absorbs.\n\n|cFFFFFF00v2.1.6 (|cFFFFCC00Oct 21, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed death's tooltip which wasn't respecting tooltip's configuration set on options panel.\n\n|cFFFFFF00-|r Now when the window is close to the top of the screen, menus will anchor on bottom side of the menu icons.\n\n|cFFFFFF00-|r Added micro displays options on Window Settings bracket.\n\n|cFFFFFF00-|r Fixed the problem with bar's custom texts.\n\n|cFFFFFF00-|r Lua functions inside custom texts, Chart Data scripts and Custom Displays scripts are now protected calls and won't break the addon functionality if an error occurs. Unfortunately we still doesn't have a documentation for Details! API.\n\n|cFFFFFF00-|r Fixed an incomum bug with tank avoidance tables.\n\n|cFFFFFF00-|r Tiny Threat: added option to use class colors instead of green-to-red colors.\n\n|cFFFFFF00-|r Added option to enable shadows on toolbar's buttons.\n\n|cFFFFFF00-|r Added option to set the specing between each button on toolbar.\n\n|cFFFFFF00-|r Finally we merged the left and right menus into only one with 6 icons.\n\n|cFFFFFF00-|r Removed window button and added a new option bracket to manage windows under Mode Menu.\n\n|cFFFFFF00-|r Few changes on 'Default Skin', 'Minimalistic', 'Simple Gray' and 'ElvUI Frame Style BW' (need reaply).\n\n|cFFFFFF00- Important:|r If the menus is out of the position, just reaply the skin.\n\nv2.0.15 (|cFFFFCC00Oct 15, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed tooltips where sometimes it wans't showing at all.\n\n|cFFFFFF00-|r Fixed the healing done amount on Malkorok encounter.\n\nv2.0.14 (|cFFFFCC00Oct 14, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added pre-potion recognition for WoD pots.\n\n|cFFFFFF00-|r Added spell list for Blackrock Foundry encounters.\n\n|cFFFFFF00-|r Added mouse wheel scroll speed option.\n\n|cFFFFFF00-|r Added support for healing multistrike and damage multistrike.\n\n|cFFFFFF00-|r Added a Change Log button on Options Panel.\n\n|cFFFFFF00-|r When the windows is locked, trying to move the window through toolbar will stretch it instead.\n\n|cFFFFFF00-|r Renamed overheal for shields, now its called 'shield wasted'.\n\n|cFFFFFF00-|r Fine tuning on healing done, should have high accuracy now.\n\n|cFFFFFF00-|r Encounter Details plugin now supports Highmaul and Blackrock Foundry.\n\n|cFFFFFF00-|r New class cooldowns and spells recognition.\n\n|cFFFFFF00-|r Fixed few bugs on comparison panel and avoidance panel.\n\n|cFFFFFF00-|r Fixed encounter recognition, now it should show the encounter name over segments menu.\n\n|cFFFFFF00-|r Fixed Graphic part of Encounter Details Plugin, now he draws more accurately.\n\n|cFFFFFF00v1.29.3 (|cFFFFCC00Oct 11, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an addon crash bug when clicking directly on the sword button.\n\n|cFFFFFF00-|r Removed Flat Skin, added new skin: Serenity.\n\n|cFFFFFF00-|r Fixed many issues with bar animations.\n\n|cFFFFFF00-|r Fixed combat encounter start if the player already is in combat when the boss is pulled.\n\n|cFFFFFF00-|r Fixed wheel scroll when sometimes it move very slow or doesn't move the bars at all.\n\n|cFFFFFF00-|r Added option 'Always Show Me' which when enabled and you aren't at the top ranked players shown in the window, it forces to show you in the last bar.\n\n|cFFFFFF00-|r Added option 'First Hit' which when enabled show who did the first struck in the combat (normally is who pulled the boss).\n\n|cFFFFFF00-|r Added a panel to change class colors.\n\n|cFFFFFF00v1.28.3 (|cFFFFCC00Oct 04, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added support for plugin descriptions on options panel.\n\n|cFFFFFF00-|r Added scale option.\n\n|cFFFFFF00-|r Added a Change Log button on Options Panel.\n\n|cFFFFFF00-|r Added option to use the same profile on all characters without asking.\n\n|cFFFFFF00-|r Added a shortcut color button on main panel on Options Panel." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.4.0 (|cFFFFCC00Nov 29, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed custom displays ignoring 'target' setted.\n\n|cFFFFFF00-|r Fixed plugins showing its icon even when auto hide menus is enabled.\n\n|cFFFFFF00-|r .Updates slash command 'worldboss' now it shows Draenor bosses.\n\n|cFFFFFF00v3.3.0 (|cFFFFCC00Nov 25, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added 3D models for the bars in the window. The options are at Appearance -> Rows: Advanced.\n\n|cFFFFFF00-|r Now when showing custom displays, clicking on a bar report what is shown on bar's tooltip.\n\n|cFFFFFF00-|r More fixes for dungeon bosses identification.\n\n|cFFFFFF00-|r Fixed a tooltip bug with Debuff Uptime and Aura & Voidzone displays.\n\n|cFFFFFF00-|r Fixed Player Details Window for friendly fire and damage taken.\n\n|cFFFFFF00-|r Fixed Molten Core Raid Finder version where all bosses was considered trash segments.\n\n|cFFFFFF00v3.2.4 (|cFFFFCC00Nov 19, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r More fixes for dungeon bosses recognition.\n\n|cFFFFFF00-|r Fixes for few errors during combat parser.\n\n|cFFFFFF00v3.2.3 (|cFFFFCC00Nov 18, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed Monk's Stagger ability which was counting as damage done.\n\n|cFFFFFF00-|r Added WoD dungeon information, this fixes dungeon bosses being assigned as 'trash cleanup'.\n\n|cFFFFFF00-|r Added more information on API.txt document (is in Details! root folder).\n\n|cFFFFFF00v3.2.1 (|cFFFFCC00Nov 14, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Custom Displays updated to track WoD potions.\n\n|cFFFFFF00-|r Added Feedback panel at options panel.\n\n|cFFFFFF00v3.2.0 (|cFFFFCC00Nov 11, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Major changes on the way Details! store information, these changes saves up to 40% memory and 4% cpu usage.\n\n|cFFFFFF00-|r Fixed problem with pet's healing messing with the owner activity time.\n\n|cFFFFFF00-|r Added Energy -> Resources.\n\n|cFFFFFF00-|r Fixed combat initialization when the player start casting a Dot spell.\n\n|cFFFFFF00-|r Added new custom display: Damage Taken By Spell.\n\n|cFFFFFF00v2.2.3 (|cFFFFCC00Oct 26, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed the healing done problem with Priest's Spirit of Redemption.\n\n|cFFFFFF00-|r Fixed avoidance by absorb when the hit missed was a multistrike hit.\n\n|cFFFFFF00-|r Fixed a script time out problem when erasing data while in combat.\n\n|cFFFFFF00-|r Fixed bug with interrupt tooltip when the player have a pet.\n\n|cFFFFFF00v2.2.1 (|cFFFFCC00Oct 22, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed the gap between the button and its menu which sometimes traveling the mouse between them was activating tooltips from window's bars.\n\n|cFFFFFF00-|r Fixed an annoying menu blink when the window was near the right side of the screen.\n\n|cFFFFFF00-|r Fixed the stretch grab which was over other windows even with the 'stretch always on top' option disabled.\n\n|cFFFFFF00-|r Few fixes on healing done from absorbs.\n\n|cFFFFFF00v2.1.6 (|cFFFFCC00Oct 21, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed death's tooltip which wasn't respecting tooltip's configuration set on options panel.\n\n|cFFFFFF00-|r Now when the window is close to the top of the screen, menus will anchor on bottom side of the menu icons.\n\n|cFFFFFF00-|r Added micro displays options on Window Settings bracket.\n\n|cFFFFFF00-|r Fixed the problem with bar's custom texts.\n\n|cFFFFFF00-|r Lua functions inside custom texts, Chart Data scripts and Custom Displays scripts are now protected calls and won't break the addon functionality if an error occurs. Unfortunately we still doesn't have a documentation for Details! API.\n\n|cFFFFFF00-|r Fixed an incomum bug with tank avoidance tables.\n\n|cFFFFFF00-|r Tiny Threat: added option to use class colors instead of green-to-red colors.\n\n|cFFFFFF00-|r Added option to enable shadows on toolbar's buttons.\n\n|cFFFFFF00-|r Added option to set the specing between each button on toolbar.\n\n|cFFFFFF00-|r Finally we merged the left and right menus into only one with 6 icons.\n\n|cFFFFFF00-|r Removed window button and added a new option bracket to manage windows under Mode Menu.\n\n|cFFFFFF00-|r Few changes on 'Default Skin', 'Minimalistic', 'Simple Gray' and 'ElvUI Frame Style BW' (need reaply).\n\n|cFFFFFF00- Important:|r If the menus is out of the position, just reaply the skin.\n\nv2.0.15 (|cFFFFCC00Oct 15, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed tooltips where sometimes it wans't showing at all.\n\n|cFFFFFF00-|r Fixed the healing done amount on Malkorok encounter.\n\nv2.0.14 (|cFFFFCC00Oct 14, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added pre-potion recognition for WoD pots.\n\n|cFFFFFF00-|r Added spell list for Blackrock Foundry encounters.\n\n|cFFFFFF00-|r Added mouse wheel scroll speed option.\n\n|cFFFFFF00-|r Added support for healing multistrike and damage multistrike.\n\n|cFFFFFF00-|r Added a Change Log button on Options Panel.\n\n|cFFFFFF00-|r When the windows is locked, trying to move the window through toolbar will stretch it instead.\n\n|cFFFFFF00-|r Renamed overheal for shields, now its called 'shield wasted'.\n\n|cFFFFFF00-|r Fine tuning on healing done, should have high accuracy now.\n\n|cFFFFFF00-|r Encounter Details plugin now supports Highmaul and Blackrock Foundry.\n\n|cFFFFFF00-|r New class cooldowns and spells recognition.\n\n|cFFFFFF00-|r Fixed few bugs on comparison panel and avoidance panel.\n\n|cFFFFFF00-|r Fixed encounter recognition, now it should show the encounter name over segments menu.\n\n|cFFFFFF00-|r Fixed Graphic part of Encounter Details Plugin, now he draws more accurately.\n\n|cFFFFFF00v1.29.3 (|cFFFFCC00Oct 11, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an addon crash bug when clicking directly on the sword button.\n\n|cFFFFFF00-|r Removed Flat Skin, added new skin: Serenity.\n\n|cFFFFFF00-|r Fixed many issues with bar animations.\n\n|cFFFFFF00-|r Fixed combat encounter start if the player already is in combat when the boss is pulled.\n\n|cFFFFFF00-|r Fixed wheel scroll when sometimes it move very slow or doesn't move the bars at all.\n\n|cFFFFFF00-|r Added option 'Always Show Me' which when enabled and you aren't at the top ranked players shown in the window, it forces to show you in the last bar.\n\n|cFFFFFF00-|r Added option 'First Hit' which when enabled show who did the first struck in the combat (normally is who pulled the boss).\n\n|cFFFFFF00-|r Added a panel to change class colors.\n\n|cFFFFFF00v1.28.3 (|cFFFFCC00Oct 04, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added support for plugin descriptions on options panel.\n\n|cFFFFFF00-|r Added scale option.\n\n|cFFFFFF00-|r Added a Change Log button on Options Panel.\n\n|cFFFFFF00-|r Added option to use the same profile on all characters without asking.\n\n|cFFFFFF00-|r Added a shortcut color button on main panel on Options Panel." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " @@ -256,7 +247,6 @@ do --> Event Frame _detalhes.listener = _CreateFrame ("Frame", nil, _UIParent) _detalhes.listener:RegisterEvent ("ADDON_LOADED") - _detalhes.listener:RegisterEvent ("PLAYER_LOGOUT") _detalhes.listener:SetFrameStrata ("LOW") _detalhes.listener:SetFrameLevel (9) _detalhes.listener.FrameTime = 0 @@ -264,6 +254,10 @@ do _detalhes.overlay_frame = _CreateFrame ("Frame", nil, _UIParent) _detalhes.overlay_frame:SetFrameStrata ("TOOLTIP") + --> Pet Owner Finder + _CreateFrame ("GameTooltip", "DetailsPetOwnerFinder", nil, "GameTooltipTemplate") + + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> functions diff --git a/classes/classe_damage.lua b/classes/classe_damage.lua index acea65e6..23a7ebc9 100644 --- a/classes/classe_damage.lua +++ b/classes/classe_damage.lua @@ -1275,9 +1275,9 @@ function atributo_damage:AtualizaBarra (instancia, barras_container, qual_barra, porcentagem = _cstr ("%.1f", self [keyName] / instancia.top * 100) end - --tempo da shadow não é mais calculado pela timemachine - if ((_detalhes.time_type == 2 and self.grupo) or not _detalhes:CaptureGet ("damage") or not self.shadow) then --not self.shadow is overall but... - if (not self.shadow and combat_time == 0) then + --> tempo da shadow não é calculado pela timemachine + if ( (_detalhes.time_type == 2 and self.grupo) or not _detalhes:CaptureGet ("damage") or instancia.segmento == -1) then + if (instancia.segmento == -1 and combat_time == 0) then local p = _detalhes.tabela_vigente (1, self.nome) if (p) then local t = p:Tempo() @@ -3055,24 +3055,16 @@ function atributo_damage:MontaTooltipAlvos (esta_barra, index, instancia) end ---controla se o dps do jogador esta travado ou destravado +--> controla se o dps do jogador esta travado ou destravado function atributo_damage:Iniciar (iniciar) if (iniciar == nil) then - return self.dps_started --retorna se o dps esta aberto ou fechado para este jogador + return self.dps_started --> retorna se o dps esta aberto ou fechado para este jogador elseif (iniciar) then self.dps_started = true self:RegistrarNaTimeMachine() --coloca ele da timeMachine - if (self.shadow) then - self.shadow.dps_started = true --> isso foi posto recentemente - --self.shadow:RegistrarNaTimeMachine() - end else self.dps_started = false self:DesregistrarNaTimeMachine() --retira ele da timeMachine - if (self.shadow) then - --self.shadow:DesregistrarNaTimeMachine() - self.shadow.dps_started = false --> isso foi posto recentemente - end end end @@ -3127,8 +3119,14 @@ end if (not shadow) then shadow = overall_dano:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true) + shadow.classe = actor.classe shadow.grupo = actor.grupo + shadow.isTank = actor.isTank + shadow.boss = actor.boss + shadow.boss_fight_component = actor.boss_fight_component + shadow.fight_component = actor.fight_component + shadow.start_time = time() - 3 shadow.end_time = time() end @@ -3179,8 +3177,14 @@ end if (not shadow) then shadow = overall_dano:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true) + shadow.classe = actor.classe + shadow.isTank = actor.isTank shadow.grupo = actor.grupo + shadow.boss = actor.boss + shadow.boss_fight_component = actor.boss_fight_component + shadow.fight_component = actor.fight_component + shadow.start_time = time() - 3 shadow.end_time = time() end @@ -3189,12 +3193,16 @@ end if (not no_refresh) then _detalhes.refresh:r_atributo_damage (actor, shadow) end + --> tempo decorrido (captura de dados) - if (actor.end_time) then - local tempo = (actor.end_time or time()) - actor.start_time - shadow.start_time = shadow.start_time - tempo + local end_time = actor.end_time + if (not actor.end_time) then + end_time = time() end + local tempo = end_time - actor.start_time + shadow.start_time = shadow.start_time - tempo + --> total de dano (captura de dados) shadow.total = shadow.total + actor.total --> total de dano sem o pet (captura de dados) @@ -3390,8 +3398,6 @@ function _detalhes.refresh:r_atributo_damage (este_jogador, shadow) --> restaura metas do ator _setmetatable (este_jogador, _detalhes.atributo_damage) este_jogador.__index = _detalhes.atributo_damage - --> atribui a shadow a ele - este_jogador.shadow = shadow --> restaura as metas dos containers _detalhes.refresh:r_container_habilidades (este_jogador.spells, shadow.spells) end diff --git a/classes/classe_energy.lua b/classes/classe_energy.lua index 16542c23..8bcc19aa 100644 --- a/classes/classe_energy.lua +++ b/classes/classe_energy.lua @@ -1388,8 +1388,14 @@ end if (not shadow) then shadow = overall_energy:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true) + shadow.classe = actor.classe shadow.grupo = actor.grupo + shadow.isTank = actor.isTank + shadow.boss = actor.boss + shadow.boss_fight_component = actor.boss_fight_component + shadow.fight_component = actor.fight_component + end --> restaura a meta e indexes ao ator @@ -1421,8 +1427,14 @@ end if (not shadow) then shadow = overall_energy:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true) + shadow.classe = actor.classe shadow.grupo = actor.grupo + shadow.isTank = actor.isTank + shadow.boss = actor.boss + shadow.boss_fight_component = actor.boss_fight_component + shadow.fight_component = actor.fight_component + end --> restaura a meta e indexes ao ator @@ -1477,11 +1489,9 @@ end function _detalhes.refresh:r_atributo_energy (este_jogador, shadow) _setmetatable (este_jogador, _detalhes.atributo_energy) este_jogador.__index = _detalhes.atributo_energy - - este_jogador.shadow = shadow - + _detalhes.refresh:r_container_habilidades (este_jogador.spells, shadow.spells) - + if (not shadow.powertype) then shadow.powertype = este_jogador.powertype end diff --git a/classes/classe_heal.lua b/classes/classe_heal.lua index 7808c3e7..305e6c8f 100644 --- a/classes/classe_heal.lua +++ b/classes/classe_heal.lua @@ -113,15 +113,7 @@ function atributo_heal:NovaTabela (serial, nome, link) } _setmetatable (_new_healActor, atributo_heal) - - --if (link) then --> se não for a shadow - --_new_healActor.last_events_table = _detalhes:CreateActorLastEventTable() - --_new_healActor.last_events_table.original = true - - --_new_healActor.targets.shadow = link.targets - --_new_healActor.spells.shadow = link.spells - --end - + return _new_healActor end @@ -580,8 +572,8 @@ function atributo_heal:AtualizaBarra (instancia, barras_container, qual_barra, l porcentagem = _cstr ("%.1f", self [keyName] / instancia.top * 100) end - if ((_detalhes.time_type == 2 and self.grupo) or (not _detalhes:CaptureGet ("heal") and not _detalhes:CaptureGet ("aura")) or not self.shadow) then - if (not self.shadow and combat_time == 0) then + if ((_detalhes.time_type == 2 and self.grupo) or (not _detalhes:CaptureGet ("heal") and not _detalhes:CaptureGet ("aura")) or instancia.segmento == -1) then + if (instancia.segmento == -1 and combat_time == 0) then local p = _detalhes.tabela_vigente (2, self.nome) if (p) then local t = p:Tempo() @@ -1992,17 +1984,9 @@ function atributo_heal:Iniciar (iniciar) elseif (iniciar) then self.iniciar_hps = true self:RegistrarNaTimeMachine() --coloca ele da timeMachine - if (self.shadow) then - self.shadow.iniciar_hps = true --> isso foi posto recentemente - --self.shadow:RegistrarNaTimeMachine() - end else self.iniciar_hps = false self:DesregistrarNaTimeMachine() --retira ele da timeMachine - if (self.shadow) then - self.shadow.iniciar_hps = false --> isso foi posto recentemente - --self.shadow:DesregistrarNaTimeMachine() - end end end @@ -2048,8 +2032,14 @@ end if (not shadow) then shadow = overall_cura:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true) + shadow.classe = actor.classe shadow.grupo = actor.grupo + shadow.isTank = actor.isTank + shadow.boss = actor.boss + shadow.boss_fight_component = actor.boss_fight_component + shadow.fight_component = actor.fight_component + shadow.start_time = time() - 3 shadow.end_time = time() end @@ -2103,8 +2093,14 @@ end if (not shadow) then shadow = overall_cura:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true) + shadow.classe = actor.classe shadow.grupo = actor.grupo + shadow.isTank = actor.isTank + shadow.boss = actor.boss + shadow.boss_fight_component = actor.boss_fight_component + shadow.fight_component = actor.fight_component + shadow.start_time = time() - 3 shadow.end_time = time() end @@ -2115,10 +2111,13 @@ end end --> tempo decorrido (captura de dados) - if (actor.end_time) then - local tempo = (actor.end_time or time()) - actor.start_time - shadow.start_time = shadow.start_time - tempo + local end_time = actor.end_time + if (not actor.end_time) then + end_time = time() end + + local tempo = end_time - actor.start_time + shadow.start_time = shadow.start_time - tempo --> total de cura (captura de dados) shadow.total = shadow.total + actor.total @@ -2364,7 +2363,6 @@ function _detalhes.refresh:r_atributo_heal (este_jogador, shadow) _setmetatable (este_jogador, atributo_heal) este_jogador.__index = atributo_heal - este_jogador.shadow = shadow _detalhes.refresh:r_container_habilidades (este_jogador.spells, shadow.spells) end diff --git a/classes/classe_instancia.lua b/classes/classe_instancia.lua index 79e5f36d..cc3eba6e 100644 --- a/classes/classe_instancia.lua +++ b/classes/classe_instancia.lua @@ -593,6 +593,30 @@ end end end new_instance:ChangeSkin() + + else + --> se não tiver um padrão, criar de outra instância já aberta. + local copy_from + for i = 1, next_id-1 do + local opened_instance = _detalhes:GetInstance (i) + if (opened_instance and opened_instance:IsEnabled() and opened_instance.baseframe) then + copy_from = opened_instance + break + end + end + + if (copy_from) then + for key, value in pairs (copy_from) do + if (_detalhes.instance_defaults [key] ~= nil) then + if (type (value) == "table") then + new_instance [key] = table_deepcopy (value) + else + new_instance [key] = value + end + end + end + new_instance:ChangeSkin() + end end return new_instance @@ -2419,7 +2443,7 @@ function _detalhes:AlteraModo (instancia, qual, from_mode_menu) instancia.atributo = instancia.atributo or 1 instancia.showing[instancia.atributo].need_refresh = true end - + if (qual == modo_alone) then instancia.LastModo = instancia.modo @@ -2496,7 +2520,7 @@ function _detalhes:AlteraModo (instancia, qual, from_mode_menu) _detalhes:SendEvent ("DETAILS_INSTANCE_CHANGEMODE", nil, instancia, modo_all) _detalhes:SendEvent ("DETAILS_INSTANCE_CHANGEATTRIBUTE", nil, instancia, instancia.atributo, instancia.sub_atributo) end - + local checked if (instancia.modo == 1) then checked = 4 @@ -2507,14 +2531,20 @@ function _detalhes:AlteraModo (instancia, qual, from_mode_menu) elseif (instancia.modo == 4) then checked = 3 end - + _detalhes.popup:Select (1, checked) + if (from_mode_menu) then instancia.baseframe.cabecalho.modo_selecao:GetScript ("OnEnter")(instancia.baseframe.cabecalho.modo_selecao) + + --> running OnEnter does also trigger an instance enter event, so we need to manually leave the instance: + _detalhes.OnLeaveMainWindow (instancia, instancia.baseframe.cabecalho.modo_selecao) + if (instancia.desaturated_menu) then instancia.baseframe.cabecalho.modo_selecao:GetNormalTexture():SetDesaturated (true) end end + end local function GetDpsHps (_thisActor, key) diff --git a/classes/classe_others.lua b/classes/classe_others.lua index f2f7e0be..c14d74a2 100644 --- a/classes/classe_others.lua +++ b/classes/classe_others.lua @@ -1245,11 +1245,15 @@ function _detalhes:CatchRaidDebuffUptime (in_or_out) -- "DEBUFF_UPTIME_IN" local name, _, _, _, _, _, _, unitCaster, _, _, spellid = UnitDebuff ("raid"..raidIndex.."target", debuffIndex) if (name and unitCaster) then local playerName, realmName = _UnitName (unitCaster) - if (realmName and realmName ~= "") then - playerName = playerName .. "-" .. realmName + local playerGUID = _UnitGUID (unitCaster) + + if (playerGUID) then + if (realmName and realmName ~= "") then + playerName = playerName .. "-" .. realmName + end + + _detalhes.parser:add_debuff_uptime (nil, GetTime(), playerGUID, playerName, 0x00000417, his_target, _UnitName ("raid"..raidIndex.."target"), 0x842, spellid, name, in_or_out) end - - _detalhes.parser:add_debuff_uptime (nil, GetTime(), _UnitGUID (unitCaster), playerName, 0x00000417, his_target, _UnitName ("raid"..raidIndex.."target"), 0x842, spellid, name, in_or_out) end end end @@ -1270,11 +1274,14 @@ function _detalhes:CatchRaidDebuffUptime (in_or_out) -- "DEBUFF_UPTIME_IN" local name, _, _, _, _, _, _, unitCaster, _, _, spellid = UnitDebuff ("party"..raidIndex.."target", debuffIndex) if (name and unitCaster) then local playerName, realmName = _UnitName (unitCaster) - if (realmName and realmName ~= "") then - playerName = playerName .. "-" .. realmName + local playerGUID = _UnitGUID (unitCaster) + if (playerGUID) then + if (realmName and realmName ~= "") then + playerName = playerName .. "-" .. realmName + end + + _detalhes.parser:add_debuff_uptime (nil, GetTime(), playerGUID, playerName, 0x00000417, his_target, _UnitName ("party"..raidIndex.."target"), 0x842, spellid, name, in_or_out) end - - _detalhes.parser:add_debuff_uptime (nil, GetTime(), _UnitGUID (unitCaster), playerName, 0x00000417, his_target, _UnitName ("party"..raidIndex.."target"), 0x842, spellid, name, in_or_out) end end end @@ -1287,10 +1294,13 @@ function _detalhes:CatchRaidDebuffUptime (in_or_out) -- "DEBUFF_UPTIME_IN" local name, _, _, _, _, _, _, unitCaster, _, _, spellid = UnitDebuff ("playertarget", debuffIndex) if (name and unitCaster) then local playerName, realmName = _UnitName (unitCaster) - if (realmName and realmName ~= "") then - playerName = playerName .. "-" .. realmName + local playerGUID = _UnitGUID (unitCaster) + if (playerGUID) then + if (realmName and realmName ~= "") then + playerName = playerName .. "-" .. realmName + end + _detalhes.parser:add_debuff_uptime (nil, GetTime(), playerGUID, playerName, 0x00000417, his_target, _UnitName ("playertarget"), 0x842, spellid, name, in_or_out) end - _detalhes.parser:add_debuff_uptime (nil, GetTime(), _UnitGUID (unitCaster), playerName, 0x00000417, his_target, _UnitName ("playertarget"), 0x842, spellid, name, in_or_out) end end end @@ -1303,10 +1313,13 @@ function _detalhes:CatchRaidDebuffUptime (in_or_out) -- "DEBUFF_UPTIME_IN" local name, _, _, _, _, _, _, unitCaster, _, _, spellid = UnitDebuff ("playertarget", debuffIndex) if (name and unitCaster) then local playerName, realmName = _UnitName (unitCaster) - if (realmName and realmName ~= "") then - playerName = playerName .. "-" .. realmName + local playerGUID = _UnitGUID (unitCaster) + if (playerGUID) then + if (realmName and realmName ~= "") then + playerName = playerName .. "-" .. realmName + end + _detalhes.parser:add_debuff_uptime (nil, GetTime(), playerGUID, playerName, 0x00000417, his_target, _UnitName ("playertarget"), 0x842, spellid, name, in_or_out) end - _detalhes.parser:add_debuff_uptime (nil, GetTime(), _UnitGUID (unitCaster), playerName, 0x00000417, his_target, _UnitName ("playertarget"), 0x842, spellid, name, in_or_out) end end end @@ -1328,15 +1341,18 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) if (name and unitCaster == "raid"..raidIndex) then local playerName, realmName = _UnitName ("raid"..raidIndex) - if (realmName and realmName ~= "") then - playerName = playerName .. "-" .. realmName - end - - _detalhes.parser:add_buff_uptime (nil, GetTime(), _UnitGUID ("raid"..raidIndex), playerName, 0x00000514, _UnitGUID ("raid"..raidIndex), playerName, 0x00000514, spellid, name, in_or_out) - - if (in_or_out == "BUFF_UPTIME_IN") then - if (_detalhes.PotionList [spellid]) then - pot_usage [playerName] = spellid + local playerGUID = _UnitGUID ("raid"..raidIndex) + if (playerGUID) then + if (realmName and realmName ~= "") then + playerName = playerName .. "-" .. realmName + end + + _detalhes.parser:add_buff_uptime (nil, GetTime(), playerGUID, playerName, 0x00000514, playerGUID, playerName, 0x00000514, spellid, name, in_or_out) + + if (in_or_out == "BUFF_UPTIME_IN") then + if (_detalhes.PotionList [spellid]) then + pot_usage [playerName] = spellid + end end end end @@ -1352,15 +1368,18 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) if (name and unitCaster == "party"..partyIndex) then local playerName, realmName = _UnitName ("party"..partyIndex) - if (realmName and realmName ~= "") then - playerName = playerName .. "-" .. realmName - end - - _detalhes.parser:add_buff_uptime (nil, GetTime(), _UnitGUID ("party"..partyIndex), playerName, 0x00000514, _UnitGUID ("party"..partyIndex), playerName, 0x00000514, spellid, name, in_or_out) - - if (in_or_out == "BUFF_UPTIME_IN") then - if (_detalhes.PotionList [spellid]) then - pot_usage [playerName] = spellid + local playerGUID = _UnitGUID ("party" .. partyIndex) + if (playerGUID) then + if (realmName and realmName ~= "") then + playerName = playerName .. "-" .. realmName + end + + _detalhes.parser:add_buff_uptime (nil, GetTime(), playerGUID, playerName, 0x00000514, playerGUID, playerName, 0x00000514, spellid, name, in_or_out) + + if (in_or_out == "BUFF_UPTIME_IN") then + if (_detalhes.PotionList [spellid]) then + pot_usage [playerName] = spellid + end end end end @@ -1372,15 +1391,17 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) local name, _, _, _, _, _, _, unitCaster, _, _, spellid = _UnitAura ("player", buffIndex, nil, "HELPFUL") if (name and unitCaster == "player") then local playerName = _UnitName ("player") + local playerGUID = _UnitGUID ("player") - if (in_or_out == "BUFF_UPTIME_IN") then - if (_detalhes.PotionList [spellid]) then - pot_usage [playerName] = spellid + if (playerGUID) then + if (in_or_out == "BUFF_UPTIME_IN") then + if (_detalhes.PotionList [spellid]) then + pot_usage [playerName] = spellid + end end + + _detalhes.parser:add_buff_uptime (nil, GetTime(), playerGUID, playerName, 0x00000514, playerGUID, playerName, 0x00000514, spellid, name, in_or_out) end - - _detalhes.parser:add_buff_uptime (nil, GetTime(), _UnitGUID ("player"), playerName, 0x00000514, _UnitGUID ("player"), playerName, 0x00000514, spellid, name, in_or_out) - end end @@ -1402,12 +1423,15 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) if (name and unitCaster == "party"..groupIndex) then local playerName, realmName = _UnitName ("party"..groupIndex) - if (realmName and realmName ~= "") then - playerName = playerName .. "-" .. realmName + local playerGUID = _UnitGUID ("party"..groupIndex) + + if (playerGUID) then + if (realmName and realmName ~= "") then + playerName = playerName .. "-" .. realmName + end + + _detalhes.parser:add_buff_uptime (nil, GetTime(), playerGUID, playerName, 0x00000417, playerGUID, playerName, 0x00000417, spellid, name, in_or_out) end - - _detalhes.parser:add_buff_uptime (nil, GetTime(), _UnitGUID ("party"..groupIndex), playerName, 0x00000417, _UnitGUID ("party"..groupIndex), playerName, 0x00000417, spellid, name, in_or_out) - end end end @@ -1416,7 +1440,10 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) local name, _, _, _, _, _, _, unitCaster, _, _, spellid = _UnitAura ("player", buffIndex, nil, "HELPFUL") if (name and unitCaster == "player") then local playerName = _UnitName ("player") - _detalhes.parser:add_buff_uptime (nil, GetTime(), _UnitGUID ("player"), playerName, 0x00000417, _UnitGUID ("player"), playerName, 0x00000417, spellid, name, in_or_out) + local playerGUID = _UnitGUID ("player") + if (playerGUID) then + _detalhes.parser:add_buff_uptime (nil, GetTime(), playerGUID, playerName, 0x00000417, playerGUID, playerName, 0x00000417, spellid, name, in_or_out) + end end end @@ -1428,14 +1455,17 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) local name, _, _, _, _, _, _, unitCaster, _, _, spellid = _UnitAura ("player", buffIndex, nil, "HELPFUL") if (name and unitCaster == "player") then local playerName = _UnitName ("player") + local playerGUID = _UnitGUID ("player") - if (in_or_out == "BUFF_UPTIME_IN") then - if (_detalhes.PotionList [spellid]) then - pot_usage [playerName] = spellid + if (playerGUID) then + if (in_or_out == "BUFF_UPTIME_IN") then + if (_detalhes.PotionList [spellid]) then + pot_usage [playerName] = spellid + end end + + _detalhes.parser:add_buff_uptime (nil, GetTime(), playerGUID, playerName, 0x00000417, playerGUID, playerName, 0x00000417, spellid, name, in_or_out) end - - _detalhes.parser:add_buff_uptime (nil, GetTime(), _UnitGUID ("player"), playerName, 0x00000417, _UnitGUID ("player"), playerName, 0x00000417, spellid, name, in_or_out) end end @@ -2171,8 +2201,14 @@ function atributo_misc:r_onlyrefresh_shadow (actor) if (not shadow) then shadow = overall_misc:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true) + shadow.classe = actor.classe shadow.grupo = actor.grupo + shadow.isTank = actor.isTank + shadow.boss = actor.boss + shadow.boss_fight_component = actor.boss_fight_component + shadow.fight_component = actor.fight_component + end _detalhes.refresh:r_atributo_misc (actor, shadow) @@ -2274,8 +2310,14 @@ function atributo_misc:r_connect_shadow (actor, no_refresh) if (not shadow) then shadow = overall_misc:PegarCombatente (actor.serial, actor.nome, actor.flag_original, true) + shadow.classe = actor.classe shadow.grupo = actor.grupo + shadow.isTank = actor.isTank + shadow.boss = actor.boss + shadow.boss_fight_component = actor.boss_fight_component + shadow.fight_component = actor.fight_component + end --> aplica a meta e indexes @@ -2469,7 +2511,6 @@ end function _detalhes.refresh:r_atributo_misc (este_jogador, shadow) _setmetatable (este_jogador, _detalhes.atributo_misc) este_jogador.__index = _detalhes.atributo_misc - este_jogador.shadow = shadow --> refresh interrupts if (este_jogador.interrupt_targets) then diff --git a/classes/container_combatentes.lua b/classes/container_combatentes.lua index b891caad..c0904c49 100644 --- a/classes/container_combatentes.lua +++ b/classes/container_combatentes.lua @@ -8,6 +8,8 @@ local _UnitClass = UnitClass --api local local _IsInInstance = IsInInstance --api local + local _UnitGUID = UnitGUID --api local + local strsplit = strsplit --api local local _setmetatable = setmetatable --lua local local _getmetatable = getmetatable --lua local @@ -39,9 +41,12 @@ local container_misc_target = _detalhes.container_type.CONTAINER_MISCTARGET_CLASS local container_enemydebufftarget_target = _detalhes.container_type.CONTAINER_ENEMYDEBUFFTARGET_CLASS + local container_pets = {} + --> flags local REACTION_HOSTILE = 0x00000040 local IS_GROUP_OBJECT = 0x00000007 + local REACTION_FRIENDLY = 0x00000010 local OBJECT_TYPE_MASK = 0x0000FC00 local OBJECT_TYPE_OBJECT = 0x00004000 local OBJECT_TYPE_PETGUARDIAN = 0x00003000 @@ -136,7 +141,7 @@ end --> read the actor flag - local read_actor_flag = function (novo_objeto, shadow_objeto, dono_do_pet, serial, flag, nome, container_type) + local read_actor_flag = function (novo_objeto, dono_do_pet, serial, flag, nome, container_type) if (flag) then @@ -154,16 +159,9 @@ if ( (_bit_band (flag, IS_GROUP_OBJECT) ~= 0 and novo_objeto.classe ~= "UNGROUPPLAYER")) then --> faz parte do grupo novo_objeto.grupo = true - - if (shadow_objeto) then - shadow_objeto.grupo = true - end if (_detalhes:IsATank (serial)) then novo_objeto.isTank = true - if (shadow_objeto) then - shadow_objeto.isTank = true - end end end @@ -251,23 +249,77 @@ novo_objeto.serial = serial end - function container_combatentes:PegarCombatente (serial, nome, flag, criar, isOwner) - - --> verifica se é um pet, se for confere se tem o nome do dono, se não tiver, precisa por - local dono_do_pet + local pet_blacklist = {} + local pet_tooltip_frame = _G.DetailsPetOwnerFinder + local pet_text_object = _G ["DetailsPetOwnerFinderTextLeft2"] + + local find_pet_owner = function (serial, nome, flag, self) + + pet_tooltip_frame:SetOwner (WorldFrame, "ANCHOR_NONE") + pet_tooltip_frame:SetHyperlink ("unit:" .. serial or "") - --if (flag and _bit_band (flag, OBJECT_TYPE_PETS) ~= 0) then --> é um pet - if (_detalhes.tabela_pets.pets [serial]) then --> é um pet - --> aqui ele precisaria achar as tag < > pra saber se o nome passado já não veio com o dono imbutido, se não tiver as tags, terá que ser posto aqui - if (not nome:find ("<") or not nome:find (">")) then --> find é lento, não teria outra forma de fazer isso? - local nome_dele, dono_nome, dono_serial, dono_flag = _detalhes.tabela_pets:PegaDono (serial, nome, flag) - if (nome_dele and dono_nome) then - nome = nome_dele - dono_do_pet = self:PegarCombatente (dono_serial, dono_nome, dono_flag, true, nome) + local text = pet_text_object:GetText() + --print ("Unknow Owner:", nome, "ToolTip Text:", text) + + if (text and text ~= "") then + text = text:gsub ("'s", "") --> enUS + + for _, ownerName in _ipairs ({strsplit (" ", text)}) do + local cur_combat = _detalhes.tabela_vigente + if (cur_combat and cur_combat.raid_roster [ownerName]) then + local ownerGuid = _UnitGUID (ownerName) + if (ownerGuid) then + + _detalhes.tabela_pets:Adicionar (serial, nome, flag, ownerGuid, ownerName, 0x00000417) + local nome_dele, dono_nome, dono_serial, dono_flag = _detalhes.tabela_pets:PegaDono (serial, nome, flag) + + local dono_do_pet + if (nome_dele and dono_nome) then + nome = nome_dele + dono_do_pet = self:PegarCombatente (dono_serial, dono_nome, dono_flag, true, nome) + end + + --print ("Owner Found:", ownerName, nome) + return nome, dono_do_pet + end end end end + end + + function container_combatentes:PegarCombatente (serial, nome, flag, criar) + --[[statistics]]-- _detalhes.statistics.container_calls = _detalhes.statistics.container_calls + 1 + + --> verifica se é um pet, se for confere se tem o nome do dono, se não tiver, precisa por + local dono_do_pet + serial = serial or "ns" + + if (container_pets [serial]) then --> é um pet reconhecido + --[[statistics]]-- _detalhes.statistics.container_pet_calls = _detalhes.statistics.container_pet_calls + 1 + + local nome_dele, dono_nome, dono_serial, dono_flag = _detalhes.tabela_pets:PegaDono (serial, nome, flag) + if (nome_dele and dono_nome) then + nome = nome_dele + dono_do_pet = self:PegarCombatente (dono_serial, dono_nome, dono_flag, true) + end + + elseif (not pet_blacklist [serial]) then --> verifica se é um pet + + pet_blacklist [serial] = true + + --> try to find the owner + if (flag and _bit_band (flag, OBJECT_TYPE_PETGUARDIAN) ~= 0) then + + --[[statistics]]-- _detalhes.statistics.container_unknow_pet = _detalhes.statistics.container_unknow_pet + 1 + + local find_nome, find_owner = find_pet_owner (serial, nome, flag, self) + if (find_nome and find_owner) then + nome, dono_do_pet = find_nome, find_owner + end + end + end + --> pega o index no mapa local index = self._NameIndexTable [nome] --> retorna o actor @@ -277,24 +329,7 @@ --> não achou, criar elseif (criar) then - --> espelho do container no overall - local shadow = self.shadow - local shadow_objeto - - --> se tiver o espelho (não for a tabela overall já) - if (shadow) then - --> apenas verifica se ele existe ou não - shadow_objeto = shadow:PegarCombatente (_, nome) - --> se não existir, cria-lo - if (not shadow_objeto) then - --> tira o nome do pet - local novo_nome = nome:gsub ((" <.*"), "") - --> cria o objeto - shadow_objeto = shadow:PegarCombatente (serial, novo_nome, flag, true) - end - end - - local novo_objeto = self.funcao_de_criacao (_, serial, nome, shadow_objeto) --> shadow_objeto passa para o classe_damage gravar no .targets e .spells, mas não grava nele mesmo + local novo_objeto = self.funcao_de_criacao (_, serial, nome) novo_objeto.nome = nome -- tipo do container @@ -303,14 +338,13 @@ if (self.tipo == container_damage) then --> CONTAINER DAMAGE get_actor_class (novo_objeto, nome, flag) - read_actor_flag (novo_objeto, shadow_objeto, dono_do_pet, serial, flag, nome, "damage") + read_actor_flag (novo_objeto, dono_do_pet, serial, flag, nome, "damage") if (dono_do_pet) then dono_do_pet.pets [#dono_do_pet.pets+1] = nome end - if (shadow_objeto) then - novo_objeto.shadow = shadow_objeto + if (self.shadow) then if (novo_objeto.grupo and _detalhes.in_combat) then _detalhes.cache_damage_group [#_detalhes.cache_damage_group+1] = novo_objeto end @@ -322,7 +356,7 @@ end --> try to guess his class - if (shadow) then --> não executar 2x + if (self.shadow) then --> não executar 2x _detalhes:ScheduleTimer ("GuessClass", 1, {novo_objeto, self, 1}) end end @@ -334,14 +368,13 @@ elseif (self.tipo == container_heal) then --> CONTAINER HEALING get_actor_class (novo_objeto, nome, flag) - read_actor_flag (novo_objeto, shadow_objeto, dono_do_pet, serial, flag, nome, "heal") + read_actor_flag (novo_objeto, dono_do_pet, serial, flag, nome, "heal") if (dono_do_pet) then dono_do_pet.pets [#dono_do_pet.pets+1] = nome end - if (shadow_objeto) then - novo_objeto.shadow = shadow_objeto + if (self.shadow) then if (novo_objeto.grupo and _detalhes.in_combat) then _detalhes.cache_healing_group [#_detalhes.cache_healing_group+1] = novo_objeto end @@ -353,7 +386,7 @@ end --> try to guess his class - if (shadow) then --> não executar 2x + if (self.shadow) then --> não executar 2x _detalhes:ScheduleTimer ("GuessClass", 1, {novo_objeto, self, 1}) end end @@ -362,23 +395,19 @@ elseif (self.tipo == container_energy) then --> CONTAINER ENERGY get_actor_class (novo_objeto, nome, flag) - read_actor_flag (novo_objeto, shadow_objeto, dono_do_pet, serial, flag, nome, "energy") + read_actor_flag (novo_objeto, dono_do_pet, serial, flag, nome, "energy") if (dono_do_pet) then dono_do_pet.pets [#dono_do_pet.pets+1] = nome end - if (shadow_objeto) then - novo_objeto.shadow = shadow_objeto - end - if (novo_objeto.classe == "UNGROUPPLAYER") then --> is a player if (_bit_band (flag, REACTION_HOSTILE ) ~= 0) then --> is hostile novo_objeto.enemy = true end --> try to guess his class - if (shadow) then --> não executar 2x + if (self.shadow) then --> não executar 2x _detalhes:ScheduleTimer ("GuessClass", 1, {novo_objeto, self, 1}) end end @@ -386,25 +415,21 @@ elseif (self.tipo == container_misc) then --> CONTAINER MISC get_actor_class (novo_objeto, nome, flag) - read_actor_flag (novo_objeto, shadow_objeto, dono_do_pet, serial, flag, nome, "misc") + read_actor_flag (novo_objeto, dono_do_pet, serial, flag, nome, "misc") --local teste_classe = if (dono_do_pet) then dono_do_pet.pets [#dono_do_pet.pets+1] = nome end - - if (shadow_objeto) then - novo_objeto.shadow = shadow_objeto - end - + if (novo_objeto.classe == "UNGROUPPLAYER") then --> is a player if (_bit_band (flag, REACTION_HOSTILE ) ~= 0) then --> is hostile novo_objeto.enemy = true end --> try to guess his class - if (shadow) then --> não executar 2x + if (self.shadow) then --> não executar 2x _detalhes:ScheduleTimer ("GuessClass", 1, {novo_objeto, self, 1}) end end @@ -417,34 +442,20 @@ novo_objeto.e_rage = 0 novo_objeto.e_energy = 0 novo_objeto.runepower = 0 - - if (shadow_objeto) then - novo_objeto.shadow = shadow_objeto - end - + elseif (self.tipo == container_enemydebufftarget_target) then novo_objeto.uptime = 0 novo_objeto.actived = false novo_objeto.activedamt = 0 - - if (shadow_objeto) then - novo_objeto.shadow = shadow_objeto - end - + elseif (self.tipo == container_misc_target) then --> CONTAINER ALVOS DO MISC - if (shadow_objeto) then - novo_objeto.shadow = shadow_objeto - end elseif (self.tipo == container_friendlyfire) then --> CONTAINER FRIENDLY FIRE get_actor_class (novo_objeto, nome) - - if (shadow_objeto) then - novo_objeto.shadow = shadow_objeto - end + end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -462,6 +473,14 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> core + function _detalhes:UpdateContainerCombatentes() + container_pets = _detalhes.tabela_pets.pets + _detalhes:UpdatePetsOnParser() + end + function _detalhes:ClearCCPetsBlackList() + table.wipe (pet_blacklist) + end + function container_combatentes:FuncaoDeCriacao (tipo) if (tipo == container_damage_target) then return alvo_da_habilidade.NovaTabela diff --git a/classes/container_habilidades.lua b/classes/container_habilidades.lua index 1f85ea98..44521cd0 100644 --- a/classes/container_habilidades.lua +++ b/classes/container_habilidades.lua @@ -90,8 +90,6 @@ local _ container.__index = _detalhes.container_habilidades local func_criacao = container_habilidades:FuncaoDeCriacao (container.tipo) container.funcao_de_criacao = func_criacao - --> seta a shadow - container.shadow = shadow end function _detalhes.clear:c_container_habilidades (container) diff --git a/classes/container_historico.lua b/classes/container_historico.lua index 9b33ff9b..8b6978ab 100644 --- a/classes/container_historico.lua +++ b/classes/container_historico.lua @@ -284,6 +284,7 @@ function historico:resetar() _detalhes.tabela_historico = historico:NovoHistorico() --joga fora a tabela antiga e cria uma nova --novo container para armazenar pets _detalhes.tabela_pets = _detalhes.container_pets:NovoContainer() + _detalhes:UpdateContainerCombatentes() _detalhes.container_pets:BuscarPets() -- nova tabela do overall e current _detalhes.tabela_overall = combate:NovaTabela() --joga fora a tabela antiga e cria uma nova diff --git a/classes/container_pets.lua b/classes/container_pets.lua index 4c4a2777..d2040f08 100644 --- a/classes/container_pets.lua +++ b/classes/container_pets.lua @@ -121,14 +121,10 @@ function container_pets:BuscarPets() if (pet_serial) then if (not _detalhes.tabela_pets.pets [pet_serial]) then local nome, realm = _UnitName ("raid"..i) - if (nome == "Unknown Entity") then - _detalhes:SchedulePetUpdate (1) - else - if (realm and realm ~= "") then - nome = nome.."-"..realm - end - _detalhes.tabela_pets:Adicionar (pet_serial, _UnitName ("raidpet"..i), 0x1114, _UnitGUID ("raid"..i), nome, 0x514) + if (realm and realm ~= "") then + nome = nome.."-"..realm end + _detalhes.tabela_pets:Adicionar (pet_serial, _UnitName ("raidpet"..i), 0x1114, _UnitGUID ("raid"..i), nome, 0x514) end end end @@ -139,14 +135,12 @@ function container_pets:BuscarPets() if (pet_serial) then if (not _detalhes.tabela_pets.pets [pet_serial]) then local nome, realm = _UnitName ("party"..i) - if (nome == "Unknown Entity") then - _detalhes:SchedulePetUpdate (1) - else - if (realm and realm ~= "") then - nome = nome.."-"..realm - end - _detalhes.tabela_pets:Adicionar (pet_serial, _UnitName ("partypet"..i), 0x1114, _UnitGUID ("party"..i), nome, 0x514) + + if (realm and realm ~= "") then + nome = nome.."-"..realm end + _detalhes.tabela_pets:Adicionar (pet_serial, _UnitName ("partypet"..i), 0x1114, _UnitGUID ("party"..i), nome, 0x514) + end end end @@ -201,6 +195,8 @@ function _detalhes:LimparPets() --a tabela antiga será descartada pelo garbage collector. --_table_wipe (_detalhes.tabela_pets.pets) _detalhes.tabela_pets.pets = _new_PetTable + _detalhes:UpdateContainerCombatentes() + end local have_schedule = false diff --git a/classes/custom_damage_done.lua b/classes/custom_damage_done.lua index d82f7e91..377955e1 100644 --- a/classes/custom_damage_done.lua +++ b/classes/custom_damage_done.lua @@ -294,7 +294,7 @@ return actor.targets [_detalhes.playername] or 0 else - return actor.targets [targetactor] or 0 + return actor.targets [target] or 0 end else diff --git a/core/control.lua b/core/control.lua index 9ed33eff..87784976 100644 --- a/core/control.lua +++ b/core/control.lua @@ -217,9 +217,6 @@ BossIndex = BossIds [serial] if (BossIndex) then Actor.boss = true - if (Actor.shadow) then - Actor.shadow.boss = true - end return boss_found (BossIndex, _detalhes:GetBossName (ZoneMapID, BossIndex), ZoneName, ZoneMapID, DifficultyID) end end @@ -230,9 +227,10 @@ return false end - + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> 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 function _detalhes:EntrarEmCombate (...) @@ -283,6 +281,8 @@ --> é o timer que ve se o jogador ta em combate ou não -- check if any party or raid members are in combat _detalhes.tabela_vigente.verifica_combate = _detalhes:ScheduleRepeatingTimer ("EstaEmCombate", 1) + _detalhes:ClearCCPetsBlackList() + _table_wipe (_detalhes.encounter_end_table) _table_wipe (_detalhes.pets_ignored) @@ -351,6 +351,12 @@ _detalhes:Msg ("(debug) ended a combat.") end + --if (_detalhes.statistics) then + -- for k, v in pairs (_detalhes.statistics) do + -- print (k, v) + -- end + --end + _detalhes.leaving_combat = true _detalhes.last_combat_time = _tempo @@ -857,9 +863,6 @@ for class_type, container in _ipairs (_detalhes.tabela_vigente) do for _, actor in _ipairs (container._ActorTable) do actor.boss_fight_component = true - if (actor.shadow) then - actor.shadow.boss_fight_component = true - end end end end @@ -868,16 +871,10 @@ local on_energy = energy_container._ActorTable [energy_container._NameIndexTable [name]] if (on_energy) then on_energy.fight_component = true - if (on_energy.shadow) then - on_energy.shadow.fight_component = true - end end local on_misc = misc_container._ActorTable [misc_container._NameIndexTable [name]] if (on_misc) then on_misc.fight_component = true - if (on_misc.shadow) then - on_misc.shadow.fight_component = true - end end end @@ -897,9 +894,6 @@ local target_object = container._ActorTable [container._NameIndexTable [target_name]] if (target_object) then target_object.fight_component = true - if (target_object.shadow) then - target_object.shadow.fight_component = true - end fight_component (energy_container, misc_container, target_name) end end @@ -908,9 +902,6 @@ local target_object = container._ActorTable [container._NameIndexTable [damager_actor]] if (target_object) then target_object.fight_component = true - if (target_object.shadow) then - target_object.shadow.fight_component = true - end fight_component (energy_container, misc_container, damager_actor) end end @@ -919,9 +910,6 @@ local target_object = container._ActorTable [container._NameIndexTable [healer_actor]] if (target_object) then target_object.fight_component = true - if (target_object.shadow) then - target_object.shadow.fight_component = true - end fight_component (energy_container, misc_container, healer_actor) end end @@ -1227,3 +1215,4 @@ function _detalhes:UpdateControl() _tempo = _detalhes._tempo end + diff --git a/core/meta.lua b/core/meta.lua index 3f47b050..1008db37 100644 --- a/core/meta.lua +++ b/core/meta.lua @@ -620,6 +620,9 @@ --> elimina pets antigos _detalhes:LimparPets() + if (not _detalhes.in_combat) then + _detalhes:ClearCCPetsBlackList() + end --> wipa container de escudos _table_wipe (_detalhes.escudos) diff --git a/core/parser.lua b/core/parser.lua index e3e45162..6f790201 100644 --- a/core/parser.lua +++ b/core/parser.lua @@ -85,6 +85,8 @@ local tanks_members_cache = setmetatable ({}, _detalhes.weaktable) --> damage and heal last events local last_events_cache = {} --> placeholder + --> pets + local container_pets = {} --> place holder ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> constants @@ -211,6 +213,8 @@ end end + --[[statistics]]-- _detalhes.statistics.damage_calls = _detalhes.statistics.damage_calls + 1 + _current_damage_container.need_refresh = true ------------------------------------------------------------------------------------------------ @@ -374,14 +378,16 @@ if (meu_dono.end_time) then meu_dono.end_time = nil else - meu_dono:IniciarTempo (_tempo, meu_dono.shadow) + --meu_dono:IniciarTempo (_tempo) + meu_dono.start_time = _tempo end end if (este_jogador.end_time) then este_jogador.end_time = nil else - este_jogador:IniciarTempo (_tempo, este_jogador.shadow) + --este_jogador:IniciarTempo (_tempo) + este_jogador.start_time = _tempo end if (este_jogador.nome == _detalhes.playername and token ~= "SPELL_PERIODIC_DAMAGE") then --> iniciando o dps do "PLAYER" @@ -571,22 +577,28 @@ ----------------------------------------------------------------------------------------------------------------------------------------- function parser:summon (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellName) + --[[statistics]]-- _detalhes.statistics.pets_summons = _detalhes.statistics.pets_summons + 1 + if (not who_name) then who_name = "[*] " .. spellName end --> pet summon another pet - local sou_pet = _detalhes.tabela_pets.pets [who_serial] + local sou_pet = container_pets [who_serial] if (sou_pet) then --> okey, ja é um pet who_name, who_serial, who_flags = sou_pet[1], sou_pet[2], sou_pet[3] end - local alvo_pet = _detalhes.tabela_pets.pets [alvo_serial] + local alvo_pet = container_pets [alvo_serial] if (alvo_pet) then who_name, who_serial, who_flags = alvo_pet[1], alvo_pet[2], alvo_pet[3] end - return _detalhes.tabela_pets:Adicionar (alvo_serial, alvo_name, alvo_flags, who_serial, who_name, who_flags) + _detalhes.tabela_pets:Adicionar (alvo_serial, alvo_name, alvo_flags, who_serial, who_name, who_flags) + + --print ("SUMMON", alvo_name, _detalhes.tabela_pets.pets, _detalhes.tabela_pets.pets [alvo_serial], alvo_serial) + + return end ----------------------------------------------------------------------------------------------------------------------------------------- @@ -615,6 +627,8 @@ function parser:heal_absorb (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spellschool, owner_serial, owner_name, owner_flags, owner_flags2, shieldid, shieldname, shieldtype, amount) + --[[statistics]]-- _detalhes.statistics.absorbs_calls = _detalhes.statistics.absorbs_calls + 1 + if (not shieldname) then owner_serial, owner_name, owner_flags, owner_flags2, shieldid, shieldname, shieldtype, amount = spellid, spellname, spellschool, owner_serial, owner_name, owner_flags, owner_flags2, shieldid end @@ -650,7 +664,7 @@ ------------------------------------------------------------------------------------------------ --> early checks and fixes - + --> only capture heal if is in combat if (not _in_combat) then return @@ -674,6 +688,8 @@ return end + --[[statistics]]-- _detalhes.statistics.heal_calls = _detalhes.statistics.heal_calls + 1 + local cura_efetiva = absorbed if (is_shield) then --> o shield ja passa o numero exato da cura e o overheal @@ -771,14 +787,16 @@ if (meu_dono.end_time) then meu_dono.end_time = nil else - meu_dono:IniciarTempo (_tempo, meu_dono.shadow) + --meu_dono:IniciarTempo (_tempo) + meu_dono.start_time = _tempo end end if (este_jogador.end_time) then --> o combate terminou, reabrir o tempo este_jogador.end_time = nil else - este_jogador:IniciarTempo (_tempo, este_jogador.shadow) + --este_jogador:IniciarTempo (_tempo) + este_jogador.start_time = _tempo end end @@ -1462,6 +1480,8 @@ powertype = is_resource amount = 0 end + + --[[statistics]]-- _detalhes.statistics.energy_calls = _detalhes.statistics.energy_calls + 1 _current_energy_container.need_refresh = true @@ -1923,7 +1943,6 @@ --> update last event este_jogador.last_event = _tempo - --shadow.last_event = _tempo --> combat ress total _current_total [4].ress = _current_total [4].ress + 1 @@ -2783,7 +2802,7 @@ _detalhes:LoadCombatTables() --> load the profiles _detalhes:LoadConfig() - + _detalhes:UpdateParserGears() _detalhes:Start() end @@ -2822,7 +2841,7 @@ _detalhes.listener:SetScript ("OnEvent", _detalhes.OnEvent) - --> logout function ~save + --> logout function ~save ~logout local saver = CreateFrame ("frame", nil, UIParent) saver:RegisterEvent ("PLAYER_LOGOUT") @@ -2836,41 +2855,55 @@ tremove (_detalhes_global.exit_errors, 6) end + _detalhes_global.exit_log = {} + + _detalhes.saver_error_func = saver_error + _detalhes.logoff_saving_data = true --> close info window if (_detalhes.FechaJanelaInfo) then + tinsert (_detalhes_global.exit_log, "1 - Closing Janela Info.") xpcall (_detalhes.FechaJanelaInfo, saver_error) end --> do not save window pos - for id, instance in _detalhes:ListInstances() do - if (instance.baseframe) then - instance.baseframe:SetUserPlaced (false) + if (_detalhes.tabela_instancias) then + tinsert (_detalhes_global.exit_log, "2 - Clearing user place from instances.") + for id, instance in _detalhes:ListInstances() do + if (instance.baseframe) then + instance.baseframe:SetUserPlaced (false) + end end end --> leave combat start save tables if (_detalhes.in_combat and _detalhes.tabela_vigente) then + tinsert (_detalhes_global.exit_log, "3 - Leaving current combat.") xpcall (_detalhes.SairDoCombate, saver_error) _detalhes.can_panic_mode = true end - if (_detalhes.CheckSwitchOnLogon and _detalhes.tabela_instancias[1] and getmetatable (_detalhes.tabela_instancias[1])) then + if (_detalhes.CheckSwitchOnLogon and _detalhes.tabela_instancias[1] and _detalhes.tabela_instancias and getmetatable (_detalhes.tabela_instancias[1])) then + tinsert (_detalhes_global.exit_log, "4 - Reversing switches.") xpcall (_detalhes.CheckSwitchOnLogon, saver_error) end if (_detalhes.wipe_full_config) then + tinsert (_detalhes_global.exit_log, "5 - Is a full config wipe.") _detalhes_global = nil _detalhes_database = nil return end --> save the config + tinsert (_detalhes_global.exit_log, "6 - Saving Config.") xpcall (_detalhes.SaveConfig, saver_error) + tinsert (_detalhes_global.exit_log, "7 - Saving Profiles.") xpcall (_detalhes.SaveProfile, saver_error) --> save the nicktag cache + tinsert (_detalhes_global.exit_log, "8 - Saving nicktag cache.") _detalhes_database.nick_tag_cache = table_deepcopy (_detalhes_database.nick_tag_cache) end) @@ -2880,20 +2913,6 @@ function _detalhes:OnParserEvent (evento, time, token, hidding, who_serial, who_name, who_flags, who_flags2, alvo_serial, alvo_name, alvo_flags, alvo_flags2, ...) local funcao = token_list [token] ---[[ -Prismatic Crystal still bugged on Combat Log - -Mage's damage towards the Prismatic Crystal is still triggering a SPELL_DAMAGE Combat Log Event, I think this isn't indented. - -So in practice, what happens is: - -- Player cast Frost Bolt against his Crystal which is near 3 enemies. -- Combat Log trigger [b]4 SPELL_DAMAGE[/b] events: 3 events splitting the damage against the 3 enemies and 1 event with the total damage against the crystal <- this last one should not happen, it's literally duplicating the mage's damage. - -The only way to detect the damage towards the crystal is getting [b]every single[/b] combatlog event and splitting the target GUID getting the crystal's npcId. -This workaround will consume a huge amount of Cpu (any addon which counts damage will need to use this fix). ---]] - if (funcao) then return funcao (nil, token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, ... ) else @@ -2905,6 +2924,9 @@ This workaround will consume a huge amount of Cpu (any addon which counts damage function _detalhes:UpdateParser() _tempo = _detalhes._tempo end + function _detalhes:UpdatePetsOnParser() + container_pets = _detalhes.tabela_pets.pets + end function _detalhes:PrintParserCacheIndexes() diff --git a/core/plugins_toolbar.lua b/core/plugins_toolbar.lua index 7c8051ff..416aed96 100644 --- a/core/plugins_toolbar.lua +++ b/core/plugins_toolbar.lua @@ -42,6 +42,8 @@ button.tooltip = tooltip button:SetScript ("OnClick", func) + --print ("ED button 2:", ENCOUNTERDETAILS_BUTTON:GetAlpha(), ENCOUNTERDETAILS_BUTTON:IsShown()) + --> textures button:SetNormalTexture (icon) button:SetPushedTexture (icon) @@ -86,16 +88,17 @@ LastIcon = instance.baseframe.cabecalho.report end - local x = 0 - if (instance.consolidate) then - LastIcon = instance.consolidateButtonTexture - x = x - 3 - end - _detalhes.ToolBar.Shown [#_detalhes.ToolBar.Shown+1] = Button - Button:SetPoint ("left", LastIcon.widget or LastIcon, "right", Button.x + x, Button.y) + Button:SetPoint ("left", LastIcon.widget or LastIcon, "right", Button.x, Button.y) + Button:Show() + if (instance.auto_hide_menu.left and not instance.is_interacting) then + instance:ToolbarMenuButtons() + Button:SetAlpha (0) + return + end + if (Effect) then if (type (Effect) == "string") then if (Effect == "blink") then @@ -206,8 +209,8 @@ instance:ChangeSkin() else - --instance:SetMenuAlpha() instance:ToolbarMenuButtons() + instance:SetAutoHideMenu (nil, nil, true) end return true diff --git a/core/timemachine.lua b/core/timemachine.lua index 37eaa05a..7b198c42 100644 --- a/core/timemachine.lua +++ b/core/timemachine.lua @@ -158,25 +158,8 @@ end end - function _detalhes:IniciarTempo (tempo, shadow) - - -- inicia o tempo no objeto atual - -------------------------------------------------------------------------------- - + function _detalhes:IniciarTempo (tempo) self.start_time = tempo - - -- inicia o tempo no shadow do objeto - -------------------------------------------------------------------------------- - - if (shadow.end_time) then - local subs = shadow.end_time - shadow.start_time - shadow.start_time = tempo - subs - shadow.end_time = nil - else - if (shadow.start_time == 0) then - shadow.start_time = tempo - end - end end function _detalhes:TerminarTempo() diff --git a/core/windows.lua b/core/windows.lua index 397cfcc9..2aaf294f 100644 --- a/core/windows.lua +++ b/core/windows.lua @@ -764,6 +764,12 @@ _detalhes:GetFramework():ShowTutorialAlertFrame ("How to Use Bookmarks", "switch fast between displays", func) end +--> translate window + + function _detalhes:OpenTranslateWindow() + + end + --> feedback window function _detalhes:OpenFeedbackWindow() diff --git a/framework/button.lua b/framework/button.lua index 4b607080..da6b000b 100644 --- a/framework/button.lua +++ b/framework/button.lua @@ -725,7 +725,7 @@ local ButtonMetaFunctions = {} if (button.MyObject.capsule_textalign) then if (button.MyObject.icon) then - button.MyObject.icon:SetPoint ("left", button, "left", 5 + button.MyObject.icon.leftpadding, -1) + button.MyObject.icon:SetPoint ("left", button, "left", 5 + (button.MyObject.icon.leftpadding or 0), -1) elseif (button.MyObject.capsule_textalign == "left") then button.text:SetPoint ("left", button, "left", 3, -1) elseif (button.MyObject.capsule_textalign == "center") then @@ -735,7 +735,7 @@ local ButtonMetaFunctions = {} end else if (button.MyObject.icon) then - button.MyObject.icon:SetPoint ("left", button, "left", 7 + button.MyObject.icon.leftpadding, -2) + button.MyObject.icon:SetPoint ("left", button, "left", 7 + (button.MyObject.icon.leftpadding or 0), -2) else button.text:SetPoint ("center", button,"center", 1, -1) end @@ -820,7 +820,7 @@ local ButtonMetaFunctions = {} if (button.MyObject.capsule_textalign) then if (button.MyObject.icon) then - button.MyObject.icon:SetPoint ("left", button, "left", 4 + button.MyObject.icon.leftpadding, 0) + button.MyObject.icon:SetPoint ("left", button, "left", 4 + (button.MyObject.icon.leftpadding or 0), 0) elseif (button.MyObject.capsule_textalign == "left") then button.text:SetPoint ("left", button, "left", 2, 0) elseif (button.MyObject.capsule_textalign == "center") then @@ -830,7 +830,7 @@ local ButtonMetaFunctions = {} end else if (button.MyObject.icon) then - button.MyObject.icon:SetPoint ("left", button, "left", 4 + button.MyObject.icon.leftpadding, 0) + button.MyObject.icon:SetPoint ("left", button, "left", 4 + (button.MyObject.icon.leftpadding or 0), 0) else button.text:SetPoint ("center", button,"center", 0, 0) end diff --git a/functions/loaddata.lua b/functions/loaddata.lua index d7553f2c..71b0f55c 100644 --- a/functions/loaddata.lua +++ b/functions/loaddata.lua @@ -179,6 +179,7 @@ function _detalhes:LoadCombatTables() _detalhes.tabela_overall = _detalhes.combate:NovaTabela() _detalhes.tabela_vigente = _detalhes.combate:NovaTabela (_, _detalhes.tabela_overall) _detalhes.tabela_pets = _detalhes.container_pets:NovoContainer() + _detalhes:UpdateContainerCombatentes() else --> build basic containers @@ -192,6 +193,7 @@ function _detalhes:LoadCombatTables() 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 @@ -200,6 +202,7 @@ function _detalhes:LoadCombatTables() _detalhes.tabela_overall = _detalhes.combate:NovaTabela() _detalhes.tabela_vigente = _detalhes.combate:NovaTabela (_, _detalhes.tabela_overall) _detalhes.tabela_pets = _detalhes.container_pets:NovoContainer() + _detalhes:UpdateContainerCombatentes() end --> re-build all indexes and metatables @@ -231,6 +234,7 @@ function _detalhes:LoadCombatTables() 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 f651145a..d98de722 100644 --- a/functions/playerclass.lua +++ b/functions/playerclass.lua @@ -84,12 +84,10 @@ do local class = _detalhes.ClassSpellList [spellid] if (class) then Actor.classe = class - Actor.shadow.classe = class Actor.guessing_class = nil if (container) then container.need_refresh = true - container.shadow.need_refresh = true end if (Actor.minha_barra and type (Actor.minha_barra) == "table") then @@ -104,14 +102,11 @@ do local class = _detalhes:GetClass (Actor.nome) if (class) then Actor.classe = class - Actor.shadow.classe = class Actor.need_refresh = true - Actor.shadow.need_refresh = true Actor.guessing_class = nil if (container) then container.need_refresh = true - container.shadow.need_refresh = true end if (Actor.minha_barra and type (Actor.minha_barra) == "table") then diff --git a/functions/savedata.lua b/functions/savedata.lua index 220b3a40..2cbf06ef 100644 --- a/functions/savedata.lua +++ b/functions/savedata.lua @@ -75,10 +75,10 @@ function _detalhes:SaveConfig() _detalhes_database.tabela_pets = _detalhes.tabela_pets.pets end - _detalhes:TimeDataCleanUpTemporary() + xpcall (_detalhes.TimeDataCleanUpTemporary, _detalhes.saver_error_func) --> buffs - _detalhes.Buffs:SaveBuffs() + xpcall (_detalhes.Buffs.SaveBuffs, _detalhes.saver_error_func) --> salva o container do personagem for key, value in pairs (_detalhes.default_player_data) do diff --git a/functions/skins.lua b/functions/skins.lua index 2f001d8a..26addfce 100644 --- a/functions/skins.lua +++ b/functions/skins.lua @@ -408,7 +408,9 @@ local _ ["show_statusbar"] = false, ["backdrop_texture"] = "Details Ground", - ["color"] = {1, 1, 1, 0.919999}, + --["color"] = {1, 1, 1, 0.919999}, + --["color"] = {0.5960, 0.5686, 1, 0.919999}, purple + ["color"] = {0.70980, 0.75686, 1, 0.919999}, ["menu_anchor"] = {15, 1, ["side"] = 2}, ["bg_r"] = 1, diff --git a/functions/slash.lua b/functions/slash.lua index a1e7e737..de4707b9 100644 --- a/functions/slash.lua +++ b/functions/slash.lua @@ -69,8 +69,7 @@ function SlashCmdList.DETAILS (msg, editbox) elseif (command == Loc ["STRING_SLASH_WORLDBOSS"] or command == "worldboss") then - --local questIds = {Galleon = 32098, Sha = 32099, Oondasta = 32519, Celestials = 33117, Ordos = 33118, Nalak = 32518} - local questIds = {{"The Celestials", 33117}, {"Ordos", 33118}, {"Nalak", 32518}, {"Oondasta", 32519}, {"Salyis's Warband (Galleon)", 32098}, {"Sha of Anger", 32099}} + local questIds = {{"Tarlna the Ageless", 81535}, {"Drov the Ruiner ", 87437}, {"Rukhmar", 87493}} for _, _table in pairs (questIds) do print (format ("%s: \124cff%s\124r", _table [1], IsQuestFlaggedCompleted (_table [2]) and "ff0000"..Loc ["STRING_KILLED"] or "00ff00"..Loc ["STRING_ALIVE"])) end diff --git a/gumps/janela_options.lua b/gumps/janela_options.lua index 64172d81..13371036 100644 --- a/gumps/janela_options.lua +++ b/gumps/janela_options.lua @@ -8,7 +8,7 @@ 5 - row texts 6 - window settings 7 - left menu - 8 - ------------ + 8 - row advanced 9 - wallpaper 10 - performance teaks 11 - raid tools @@ -17,7 +17,7 @@ 14 - attribute text 15 - custom spells 16 - data for charts - 17 - hide and show + 17 - auto hide settings 18 - misc settings 19 - externals widgets 20 - tooltip @@ -325,7 +325,7 @@ function _detalhes:OpenOptionsWindow (instance, no_reopen, section) --> create bars - local fillbars = g:NewButton (window, _, "$parentCreateExampleBarsButton", nil, 110, 14, _detalhes.CreateTestBars, nil, nil, nil, Loc ["STRING_OPTIONS_TESTBARS"]) + local fillbars = g:NewButton (window, _, "$parentCreateExampleBarsButton", nil, 110, 14, _detalhes.CreateTestBars, nil, nil, nil, Loc ["STRING_OPTIONS_TESTBARS"], 1) fillbars:SetPoint ("bottomleft", window.widget, "bottomleft", 41, 12) fillbars.textalign = "left" fillbars:SetHook ("OnEnter", function() @@ -340,7 +340,7 @@ function _detalhes:OpenOptionsWindow (instance, no_reopen, section) --> change log - local changelog = g:NewButton (window, _, "$parentOpenChangeLogButton", nil, 110, 14, _detalhes.OpenNewsWindow, nil, nil, nil, Loc ["STRING_OPTIONS_CHANGELOG"]) + local changelog = g:NewButton (window, _, "$parentOpenChangeLogButton", nil, 110, 14, _detalhes.OpenNewsWindow, nil, nil, nil, Loc ["STRING_OPTIONS_CHANGELOG"], 1) changelog:SetPoint ("left", fillbars, "right", 10, 0) changelog.textalign = "left" changelog:SetHook ("OnEnter", function() @@ -355,8 +355,7 @@ function _detalhes:OpenOptionsWindow (instance, no_reopen, section) --> send feedback - - local feedback_button = g:NewButton (window, _, "$parentOpenFeedbackButton", nil, 110, 14, _detalhes.OpenFeedbackWindow, nil, nil, nil, Loc ["STRING_OPTIONS_SENDFEEDBACK"]) + local feedback_button = g:NewButton (window, _, "$parentOpenFeedbackButton", nil, 80, 14, _detalhes.OpenFeedbackWindow, nil, nil, nil, Loc ["STRING_OPTIONS_SENDFEEDBACK"], 1) feedback_button:SetPoint ("left", changelog, "right", 10, 0) feedback_button.textalign = "left" feedback_button:SetHook ("OnEnter", function() @@ -369,6 +368,22 @@ function _detalhes:OpenOptionsWindow (instance, no_reopen, section) local feedback_image = g:NewImage (window, [[Interface\Buttons\UI-RADIOBUTTON]], 8, 9, "artwork", {20/64, 27/64, 4/16, 11/16}) feedback_image:SetPoint ("right", feedback_button, "left", -1, 0) + --> translate +--[[ + local translate_button = g:NewButton (window, _, "$parentOpenTranslateButton", nil, 140, 14, _detalhes.OpenTranslateWindow, nil, nil, nil, Loc ["STRING_TRANSLATE_LANGUAGE"], 1) + translate_button:SetPoint ("left", feedback_button, "right", 10, 0) + translate_button.textalign = "left" + translate_button:SetHook ("OnEnter", function() + translate_button:SetTextColor (1, 1, 0) + end) + translate_button:SetHook ("OnLeave", function() + translate_button:SetTextColor (0.9999, 0.8196, 0, 1) + end) + + local feedback_image = g:NewImage (window, "Interface\\Buttons\\UI-RADIOBUTTON", 8, 9, "artwork", {20/64, 27/64, 4/16, 11/16}) + feedback_image:SetPoint ("right", translate_button, "left", -1, 0) +--]] + --> right click to close --local right_click_close = window:CreateRightClickLabel ("short", 14, 14, "Close") --right_click_close:SetPoint ("left", fillbars, "right", 90, 0) @@ -5021,10 +5036,8 @@ function window:CreateFrame4() g:NewSwitch (frame4, _, "$parentShowMeSlider", "ShowMeSlider", 60, 20, _, _, instance.following.enabled) frame4.ShowMeSlider:SetPoint ("left", frame4.ShowMeLabel, "right", 2, -1) frame4.ShowMeSlider.OnSwitch = function (self, instance, value) - instance.following.enabled = value - instance:RefreshBars() - instance:InstanceReset() - instance:ReajustaGump() + --instance.following.enabled = value + instance:SetBarFollowPlayer (value) end window:CreateLineBackground2 (frame4, "ShowMeSlider", "ShowMeLabel", Loc ["STRING_OPTIONS_BAR_FOLLOWING_DESC"]) diff --git a/gumps/janela_principal.lua b/gumps/janela_principal.lua index f4b3d8e1..50404059 100644 --- a/gumps/janela_principal.lua +++ b/gumps/janela_principal.lua @@ -3166,6 +3166,19 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) end +function _detalhes:SetBarFollowPlayer (follow) + + if (follow == nil) then + follow = self.following.enabled + end + + self.following.enabled = follow + + self:RefreshBars() + self:InstanceReset() + self:ReajustaGump() +end + function _detalhes:SetBarGrowDirection (direction) if (not direction) then @@ -3980,25 +3993,18 @@ function _detalhes:InstanceButtonsColors (red, green, blue, alpha, no_save, only if (self:IsLowerInstance()) then for _, ThisButton in _ipairs (_detalhes.ToolBar.Shown) do ThisButton:SetAlpha (alpha) + --print (ThisButton:GetName()) end end + + else - elseif (only_right) then - - local icons = {baseToolbar.novo, baseToolbar.fechar, baseToolbar.reset} + local icons = {baseToolbar.modo_selecao, baseToolbar.segmento, baseToolbar.atributo, baseToolbar.report, baseToolbar.fechar, baseToolbar.reset, baseToolbar.fechar} for _, button in _ipairs (icons) do button:SetAlpha (alpha) end - else - - local icons = {baseToolbar.modo_selecao, baseToolbar.segmento, baseToolbar.atributo, baseToolbar.report, baseToolbar.novo, baseToolbar.fechar, baseToolbar.reset} - - for _, button in _ipairs (icons) do - button:SetAlpha (alpha) - end - if (self:IsLowerInstance()) then for _, ThisButton in _ipairs (_detalhes.ToolBar.Shown) do ThisButton:SetAlpha (alpha) diff --git a/plugins/Details_DungeonInfo-Warlords/Details_DungeonInfo-Warlords.lua b/plugins/Details_DungeonInfo-Warlords/Details_DungeonInfo-Warlords.lua index 9794026b..58232375 100644 --- a/plugins/Details_DungeonInfo-Warlords/Details_DungeonInfo-Warlords.lua +++ b/plugins/Details_DungeonInfo-Warlords/Details_DungeonInfo-Warlords.lua @@ -72,6 +72,7 @@ local BloodmaulSlagMines = { [74787] = 1, --Slave Watcher Crushto [74366] = 2, --Forgemaster Gog'duh [86223] = 3, --Roltall + [75786] = 3, --Roltall [86224] = 4, --Gug'rokk [74790] = 4, --Gug'rokk }, @@ -216,7 +217,10 @@ local IronDocks = { [86231] = 2, --Makogg Emberblade [80808] = 2, --Neesa Nox [86232] = 3, --Oshir + [79852] = 3, --Oshir [86233] = 4, --Skulloc + [83612] = 4, --Skulloc + [83616] = 4, --Skulloc }, encounters = { diff --git a/plugins/Details_YouAreNotPrepared/Details_YouAreNotPrepared.lua b/plugins/Details_YouAreNotPrepared/Details_YouAreNotPrepared.lua index c8aca298..05610d7f 100644 --- a/plugins/Details_YouAreNotPrepared/Details_YouAreNotPrepared.lua +++ b/plugins/Details_YouAreNotPrepared/Details_YouAreNotPrepared.lua @@ -469,7 +469,7 @@ end function YouAreNotPrepared:EndCombat() - if (YouAreNotPrepared.last_death_combat_id == YouAreNotPrepared.combat_id) then + if (YouAreNotPrepared.last_death_combat_id == YouAreNotPrepared.combat_counter) then if (YouAreNotPrepared.db.auto_open) then YouAreNotPrepared.ShowMeFromInstanceAlert() else @@ -493,7 +493,7 @@ death_table = d if (combat.is_boss) then --> encounter or pvp - YouAreNotPrepared.last_death_combat_id = YouAreNotPrepared.combat_id + YouAreNotPrepared.last_death_combat_id = YouAreNotPrepared.combat_counter return YouAreNotPrepared:AddDeath ({combat.is_boss.name or combat.enemy or "Unknown", time_of_death, last_cooldown, death_table, max_health, time}) end end diff --git a/startup.lua b/startup.lua index 7a1853e9..00efc309 100644 --- a/startup.lua +++ b/startup.lua @@ -148,7 +148,10 @@ function _G._detalhes:Start() --> refresh desaturated icons if is lower instance if (index == lower_instance) then instance:DesaturateMenu() + + instance:SetAutoHideMenu (nil, nil, true) end + end end @@ -173,6 +176,7 @@ function _G._detalhes:Start() end self.CheckWallpaperAfterStartup = nil _detalhes.profile_loaded = nil + end _detalhes:ScheduleTimer ("CheckWallpaperAfterStartup", 5) @@ -251,6 +255,7 @@ function _G._detalhes:Start() --> send details startup done signal function self:AnnounceStartup() + self:SendEvent ("DETAILS_STARTED", "SEND_TO_ALL") if (_detalhes.in_group) then @@ -263,9 +268,17 @@ function _G._detalhes:Start() _detalhes.parser_functions:ZONE_CHANGED_NEW_AREA() _detalhes.AnnounceStartup = nil + end self:ScheduleTimer ("AnnounceStartup", 5) + --function self:RunAutoHideMenu() + -- local lower_instance = _detalhes:GetLowerInstanceNumber() + -- local instance = self:GetInstance (lower_instance) + -- instance:SetAutoHideMenu (nil, nil, true) + --end + --self:ScheduleTimer ("RunAutoHideMenu", 15) + --> announce alpha version function self:AnnounceVersion() for index, instancia in _detalhes:ListInstances() do @@ -489,97 +502,6 @@ function _G._detalhes:Start() end) --]] - --[[ start world map zoom - WorldMapScrollFrame:HookScript ("OnMouseWheel", function() - local HScroll = WorldMapScrollFrame:GetHorizontalScroll() - local VScroll = WorldMapScrollFrame:GetVerticalScroll() - - if (MantainWorldMapZoomH ~= HScroll or MantainWorldMapZoomV ~= VScroll) then - MantainWorldMapZoomMouseX, MantainWorldMapZoomMouseY = GetCursorPosition() - end - MantainWorldMapZoomH = HScroll - MantainWorldMapZoomV = VScroll - MantainWorldMapZoomScale = WorldMapDetailFrame:GetScale(); - end) - - local MAX_ZOOM = 1.495; - - hooksecurefunc ("ToggleWorldMap", function() - - if (WorldMapFrame:IsShown()) then - - if ((MantainWorldMapZoomV and MantainWorldMapZoomH) and (MantainWorldMapZoomH ~= 0 or MantainWorldMapZoomV ~= 0)) then - - local last_opened = MantainWorldMapZoomLastOpened or time() - MantainWorldMapZoomLastOpened = time() - - if (last_opened+60 < time()) then - WorldMapScrollFrame_ResetZoom() - MantainWorldMapZoomMouseX, MantainWorldMapZoomMouseY = nil, nil - MantainWorldMapZoomH = nil - MantainWorldMapZoomV = nil - MantainWorldMapZoomScale = nil - return - end - - local scrollFrame = WorldMapScrollFrame; - local oldScrollH = MantainWorldMapZoomH - local oldScrollV = MantainWorldMapZoomV - - -- get the mouse position on the frame, with 0,0 at top left - local cursorX, cursorY = MantainWorldMapZoomMouseX, MantainWorldMapZoomMouseY - local relativeFrame; - if ( WorldMapFrame_InWindowedMode() ) then - relativeFrame = UIParent; - else - relativeFrame = WorldMapFrame; - end - local frameX = cursorX / relativeFrame:GetScale() - scrollFrame:GetLeft(); - local frameY = scrollFrame:GetTop() - cursorY / relativeFrame:GetScale(); - - local oldScale = WorldMapDetailFrame:GetScale(); - --local newScale = oldScale + delta * 0.3; - local newScale = MantainWorldMapZoomScale - newScale = max(WORLDMAP_SETTINGS.size, newScale); - newScale = min(MAX_ZOOM, newScale); - WorldMapDetailFrame:SetScale(newScale); - QUEST_POI_FRAME_WIDTH = WorldMapDetailFrame:GetWidth() * newScale; - QUEST_POI_FRAME_HEIGHT = WorldMapDetailFrame:GetHeight() * newScale; - - scrollFrame.maxX = QUEST_POI_FRAME_WIDTH - 1002 * WORLDMAP_SETTINGS.size; - scrollFrame.maxY = QUEST_POI_FRAME_HEIGHT - 668 * WORLDMAP_SETTINGS.size; - scrollFrame.zoomedIn = abs(WorldMapDetailFrame:GetScale() - WORLDMAP_SETTINGS.size) > 0.05; - scrollFrame.continent = GetCurrentMapContinent(); - scrollFrame.mapID = GetCurrentMapAreaID(); - - -- figure out new scroll values - local scaleChange = newScale / oldScale; - local newScrollH = scaleChange * ( frameX + oldScrollH ) - frameX; - local newScrollV = scaleChange * ( frameY + oldScrollV ) - frameY; - -- clamp scroll values - newScrollH = min(newScrollH, scrollFrame.maxX); - newScrollH = max(0, newScrollH); - newScrollV = min(newScrollV, scrollFrame.maxY); - newScrollV = max(0, newScrollV); - - -- set scroll values - scrollFrame:SetHorizontalScroll(oldScrollH); - scrollFrame:SetVerticalScroll(oldScrollV); - - WorldMapFrame_Update(); - WorldMapScrollFrame_ReanchorQuestPOIs(); - WorldMapBlobFrame_ResetHitTranslations(); - WorldMapBlobFrame_DelayedUpdateBlobs(); - - - end - else - MantainWorldMapZoomLastOpened = time() - end - end) - - --]] - --> register molten core local molten_core = {