From 1113bfe3d2926149f6719c75589777ee5081c1c4 Mon Sep 17 00:00:00 2001 From: Tercio Date: Fri, 29 May 2015 16:18:39 -0300 Subject: [PATCH] - Added support for battlegrounds. - Added option for disable showing battleground enemies when the window is in group mode. - Added option to disable the sync from battleground score board. - Enemies from a battleground match segment won't be erased when the player logout. --- API UI.txt | 4 ++ API.txt | 10 ++++ boot.lua | 39 +++++++++--- classes/classe_combate.lua | 10 +++- classes/classe_damage.lua | 11 ++-- classes/container_combatentes.lua | 6 +- core/control.lua | 2 +- core/parser.lua | 99 +++++++++++++++++++++++++++++-- core/windows.lua | 2 +- functions/loaddata.lua | 2 + functions/profiles.lua | 2 + gumps/janela_options.lua | 31 +++++++++- gumps/janela_principal.lua | 32 +++++++--- 13 files changed, 215 insertions(+), 35 deletions(-) diff --git a/API UI.txt b/API UI.txt index 801f2e55..905bb9d8 100644 --- a/API UI.txt +++ b/API UI.txt @@ -215,4 +215,8 @@ Open the bookmark panel on the top of the desired window. _detalhes.switch:CloseMe() Closes the bookmark panel. +_detalhes:GetArenaInfo (mapid) +returns a table containing the texture file and coords for a arena. +_detalhes:GetBattlegroundInfo (mapid) +returns a table containing the texture file and coords for a battleground. diff --git a/API.txt b/API.txt index d83d924c..5b760337 100644 --- a/API.txt +++ b/API.txt @@ -97,6 +97,14 @@ bossInfo = combat:GetBossInfo() returns the table containing informations about the boss encounter. table members: name, zone, mapid, diff, diff_string, id, ej_instance_id, killed, index +battlegroudInfo = combat:GetPvPInfo() +returns the table containing infos about the battlegroud: +table members: name, mapid + +arenaInfo = combat:GetArenaInfo() +returns the table containing infos about the arena: +table members: name, mapid, zone + time = combat:GetCombatTime() returns the length of the combat in seconds, if the combat is in progress, returns the current elapsed time. @@ -135,6 +143,8 @@ DETAILS_TOTALS_ONLYGROUP = true total = combat:GetTotal ( attribute, subAttribute [, onlyGroup] ) returns the total of the requested attribute. + + -------------------------------------------------------------------- Other Calls: diff --git a/boot.lua b/boot.lua index cf11ccf7..27e69f36 100644 --- a/boot.lua +++ b/boot.lua @@ -4,7 +4,7 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") _detalhes.build_counter = 996 --it's 996 for release - _detalhes.userversion = "v3.14.4a" + _detalhes.userversion = "v3.15.0" _detalhes.realversion = 69 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" Details = _detalhes @@ -15,22 +15,22 @@ do local _detalhes = _G._detalhes - + _detalhes.resize_debug = {} local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) --[[ -|cFFFFFF00-|r .\n\n -|cFFFFFF00v3.14.1 (|cFFFFCC00May 15, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added support for skins for Player Detail Window.\n\n -|cFFFFFF00-|r Added report history on report button.\n\n|cFFFFFF00-|r Added key bindings settings for report what is shown on window #1 or #2.\n\n -|cFFFFFF00-|r Added raid history panel. Open it through bookmark or /details history.\n\n -|cFFFFFF00-|r TimeLine (plugin): now also shows marks symbolizing the player death.\n\n +||cFFFFFF00v3.15.0 (|cFFFFCC00May 29, 2015|r|cFFFFFF00)|r:\n\n + |cFFFFFF00-|r Added support for battlegrounds.\n\n +|cFFFFFF00-|r Added option for disable showing battleground enemies when the window is in group mode.\n\n +|cFFFFFF00-|r Added option to disable the sync from battleground score board.\n\n +|cFFFFFF00-|r Enemies from a battleground match segment won't be erased when the player logout.\n\n --]] -- - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.14.4a (|cFFFFCC00May 29, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r TimeLine (plugin): now also shows marks symbolizing the player death.\n\n|cFFFFFF00-|r Added raid history panel. Open it through bookmark or /details history.\n\n|cFFFFFF00-|r Added support for skins for Player Detail Window.\n\n|cFFFFFF00-|r Added report history on report button.\n\n|cFFFFFF00-|r Added key bindings settings for report what is shown on window #1 or #2.\n\n|cFFFFFF00v3.14.0b (|cFFFFCC00May 13, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Several texture changes for a smaller download size.\n\n|cFFFFFF00v3.13.4a (|cFFFFCC00May 06, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Created 'Details! Forge' but is still under development: /details forge.\n\n|cFFFFFF00-|r Several improvements on combatlog reader and custom displays.\n\n|cFFFFFF00-|r Improvements on enemies damage taken tooltip.\n\n|cFFFFFF00v3.13.1 (|cFFFFCC00April 27, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added casted amount for healing and damage spells. The result is shown on Player Detail Window and Comparison Panel.\n\n|cFFFFFF00-|r Added uptime amount for healing spells on Player Detail Window.\n\n|cFFFFFF00-|r Added an option to disable lock/resize/ungroup buttons. It's under miscellaneous bracket on Options Panel.\n\n|cFFFFFF00-|r Wallpaper for menus on title bar got a customization option under tooltips bracket on Options Panel.\n\n|cFFFFFF00-|r Updated spell list for Crowd Control and class detection.\n\n|cFFFFFF00-|r Improved Weakaura creation tool under Encounter Details Plugin.\n\n|cFFFFFF00v3.12.10 (|cFFFFCC00April 18, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added the spell uptime on damage player detail window.\n\n|cFFFFFF00-|r Added Rune Tap as cooldown.\n\n|cFFFFFF00-|r Report lines for deaths is now inverted. No need to scroll up the chat to see the cause of death anymore.\n\n|cFFFFFF00-|r Fixed some annoyances with auto current feature where it was changing the segments even when the user were using the window.\n\n|cFFFFFF00v3.12.7 (|cFFFFCC00April 09, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added slash command /details profile .\n\n|cFFFFFF00v3.12.6 (|cFFFFCC00May 06, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Encounter Details (plugin): added a report button on Emotes tab.\n\n|cFFFFFF00-|r Encounter Details (plugin): improved Weakauras creation.\n\n|cFFFFFF00-|r Encounter Details (plugin): fixed the report text for interrupts and dispells.\n\n|cFFFFFF00-|r Crowd control by Pets now is merged with its owner.\n\n|cFFFFFF00-|r Truncated left text on bars now shows the entire text when hover over the bar.\n\n|cFFFFFF00-|r Added an extra option on minimap menu to disable the minimap icon.\n\n|cFFFFFF00-|r Fixed a problem when disabling the minimap icon through options panel.\n\n|cFFFFFF00-|r Fixed an issue with item level tracker feature.\n\n|cFFFFFF00v3.12.2 (|cFFFFCC00Mar 30, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Raid Check (plugin): added item level.\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): bug fixes, it's important to update it.\n\n|cFFFFFF00-|r Time Line (plugin): bug fixes.\n\n|cFFFFFF00-|r Added option to disabled th eitem level tracker.\n\n|cFFFFFF00-|r Added item level on Raid Check plugin panel.\n\n|cFFFFFF00-|r Added Spirit Link Totem damage and healing on death log.\n\n|cFFFFFF00-|r Added the total of life exchanged by the Spirit Link Totem on player detail window.\n\n|cFFFFFF00-|r Added more spells for crowd control.\n\n|cFFFFFF00-|r Added scroll on bookmark panel.\n\n|cFFFFFF00-|r Fixed issue with Dps/Hps data broker which wasn't respecting the type of time (effective/activity) selected.\n\n|cFFFFFF00-|r Fixed few bugs when using the key bind to toggle windows.\n\n|cFFFFFF00v3.11.5 (|cFFFFCC00Mar 18, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with overall data where max/min amount for spells was being calculated wrong.\n\n|cFFFFFF00-|r Fixed a problem while reporting enemy damage taken.\n\n|cFFFFFF00-|r Fixed an issue with damage taken by spell where some spells wasn't shown.\n\n|cFFFFFF00-|r Few improvements on tooltips.\n\n|cFFFFFF00-|r Fixed a accuracy problem with shaman's spirit link toten where its life exchange was considered healing done.\n\n|cFFFFFF00-|r Boss segments now need to have at least 30 seconds to be added on the overall data.\n\n|cFFFFFF00-|r When the segment limit is reach, segments with less combat time will be erased instead of the olders.\n\n|cFFFFFF00-|r Added item level tracker.\n\n|cFFFFFF00-|r Fixed window positioning when changing from Solo mode to Group mode.\n\n|cFFFFFF00-|r Added an option for change the amount of lines on death log.\n\n|cFFFFFF00-|r Added custom display for CC done.\n\n|cFFFFFF00v3.10.10 (|cFFFFCC00Mar 10, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): done a calibration on endurance calculation.\n\n|cFFFFFF00-|r Raid Check (plugin): now also show information for 50+ stats runes.\n\n|cFFFFFF00-|r Fixed cooldowns spell targets on overall data.\n\n|cFFFFFF00-|r Fixed report custom displays where sometimes it didn't report spell links.\n\n|cFFFFFF00-|r Replaced old report line saying 'for the last X segments' with 'overall data'.\n\n|cFFFFFF00-|r Mini-displays on statusbar are now more responsible to right button click.\n\n|cFFFFFF00-|r Added Mage's Greater Invisibility as cooldown.\n\n|cFFFFFF00v3.10.8 (|cFFFFCC00Mar 02, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Improved aura creation.\n\n|cFFFFFF00-|r Custom display 'My Spells' now also show your pets.\n\n|cFFFFFF00-|r Fixed 'Raid Check' plugin food detection.\n\n|cFFFFFF00v3.10.6 (|cFFFFCC00Feb 24, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Encounter Details (plugin): several bug fixes and improvements.\n\n|cFFFFFF00-|r Encounter Details (plugin): added new tab showing enemy spells from the encounter with an aura creation panel.\n\n|cFFFFFF00-|r Encounter Details (plugin): added phase indicators on graphic tab, hovering over shows the damage and heal for that specific phase.\n\n|cFFFFFF00-|r Segments menu now also show the encounter try number plus the elapsed combat time.\n\n|cFFFFFF00-|r Several improvements on Overall Data, also, now it has an option to not save it when the character logoff.\n\n|cFFFFFF00-|r Player Details window now closes with right click on any bar.\n\n|cFFFFFF00-|r Fixed Nature's Vigil cooldown.\n\n|cFFFFFF00v3.9.12a (|cFFFFCC00Feb 16, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Roll back on combat detection after reset data, might be causing problems.\n\n|cFFFFFF00v3.9.12 (|cFFFFCC00Feb 13, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): got report buttons for Endurance and Deaths Overall Damage.\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): the Deaths and Endurance limits can now be changed under the plugin options.\n\n|cFFFFFF00-|r Chart Viewer (plugin): has been revamped and now it's less complicated to use." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.15.0 (|cFFFFCC00May 29, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added support for battlegrounds.\n\n|cFFFFFF00-|r Added option for disable showing battleground enemies when the window is in group mode.\n\n|cFFFFFF00-|r Added option to disable the sync from battleground score board.\n\n|cFFFFFF00-|r Enemies from a battleground match segment won't be erased when the player logout.\n\n|cFFFFFF00v3.14.4 (|cFFFFCC00May 27, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r TimeLine (plugin): now also shows marks symbolizing the player death.\n\n|cFFFFFF00-|r Added raid history panel. Open it through bookmark or /details history.\n\n|cFFFFFF00-|r Added support for skins for Player Detail Window.\n\n|cFFFFFF00-|r Added report history on report button.\n\n|cFFFFFF00-|r Added key bindings settings for report what is shown on window #1 or #2.\n\n|cFFFFFF00v3.14.0b (|cFFFFCC00May 13, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Several texture changes for a smaller download size.\n\n|cFFFFFF00v3.13.4a (|cFFFFCC00May 06, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Created 'Details! Forge' but is still under development: /details forge.\n\n|cFFFFFF00-|r Several improvements on combatlog reader and custom displays.\n\n|cFFFFFF00-|r Improvements on enemies damage taken tooltip.\n\n|cFFFFFF00v3.13.1 (|cFFFFCC00April 27, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added casted amount for healing and damage spells. The result is shown on Player Detail Window and Comparison Panel.\n\n|cFFFFFF00-|r Added uptime amount for healing spells on Player Detail Window.\n\n|cFFFFFF00-|r Added an option to disable lock/resize/ungroup buttons. It's under miscellaneous bracket on Options Panel.\n\n|cFFFFFF00-|r Wallpaper for menus on title bar got a customization option under tooltips bracket on Options Panel.\n\n|cFFFFFF00-|r Updated spell list for Crowd Control and class detection.\n\n|cFFFFFF00-|r Improved Weakaura creation tool under Encounter Details Plugin.\n\n|cFFFFFF00v3.12.10 (|cFFFFCC00April 18, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added the spell uptime on damage player detail window.\n\n|cFFFFFF00-|r Added Rune Tap as cooldown.\n\n|cFFFFFF00-|r Report lines for deaths is now inverted. No need to scroll up the chat to see the cause of death anymore.\n\n|cFFFFFF00-|r Fixed some annoyances with auto current feature where it was changing the segments even when the user were using the window.\n\n|cFFFFFF00v3.12.7 (|cFFFFCC00April 09, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added slash command /details profile .\n\n|cFFFFFF00v3.12.6 (|cFFFFCC00May 06, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Encounter Details (plugin): added a report button on Emotes tab.\n\n|cFFFFFF00-|r Encounter Details (plugin): improved Weakauras creation.\n\n|cFFFFFF00-|r Encounter Details (plugin): fixed the report text for interrupts and dispells.\n\n|cFFFFFF00-|r Crowd control by Pets now is merged with its owner.\n\n|cFFFFFF00-|r Truncated left text on bars now shows the entire text when hover over the bar.\n\n|cFFFFFF00-|r Added an extra option on minimap menu to disable the minimap icon.\n\n|cFFFFFF00-|r Fixed a problem when disabling the minimap icon through options panel.\n\n|cFFFFFF00-|r Fixed an issue with item level tracker feature.\n\n|cFFFFFF00v3.12.2 (|cFFFFCC00Mar 30, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Raid Check (plugin): added item level.\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): bug fixes, it's important to update it.\n\n|cFFFFFF00-|r Time Line (plugin): bug fixes.\n\n|cFFFFFF00-|r Added option to disabled th eitem level tracker.\n\n|cFFFFFF00-|r Added item level on Raid Check plugin panel.\n\n|cFFFFFF00-|r Added Spirit Link Totem damage and healing on death log.\n\n|cFFFFFF00-|r Added the total of life exchanged by the Spirit Link Totem on player detail window.\n\n|cFFFFFF00-|r Added more spells for crowd control.\n\n|cFFFFFF00-|r Added scroll on bookmark panel.\n\n|cFFFFFF00-|r Fixed issue with Dps/Hps data broker which wasn't respecting the type of time (effective/activity) selected.\n\n|cFFFFFF00-|r Fixed few bugs when using the key bind to toggle windows.\n\n|cFFFFFF00v3.11.5 (|cFFFFCC00Mar 18, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with overall data where max/min amount for spells was being calculated wrong.\n\n|cFFFFFF00-|r Fixed a problem while reporting enemy damage taken.\n\n|cFFFFFF00-|r Fixed an issue with damage taken by spell where some spells wasn't shown.\n\n|cFFFFFF00-|r Few improvements on tooltips.\n\n|cFFFFFF00-|r Fixed a accuracy problem with shaman's spirit link toten where its life exchange was considered healing done.\n\n|cFFFFFF00-|r Boss segments now need to have at least 30 seconds to be added on the overall data.\n\n|cFFFFFF00-|r When the segment limit is reach, segments with less combat time will be erased instead of the olders.\n\n|cFFFFFF00-|r Added item level tracker.\n\n|cFFFFFF00-|r Fixed window positioning when changing from Solo mode to Group mode.\n\n|cFFFFFF00-|r Added an option for change the amount of lines on death log.\n\n|cFFFFFF00-|r Added custom display for CC done.\n\n|cFFFFFF00v3.10.10 (|cFFFFCC00Mar 10, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): done a calibration on endurance calculation.\n\n|cFFFFFF00-|r Raid Check (plugin): now also show information for 50+ stats runes.\n\n|cFFFFFF00-|r Fixed cooldowns spell targets on overall data.\n\n|cFFFFFF00-|r Fixed report custom displays where sometimes it didn't report spell links.\n\n|cFFFFFF00-|r Replaced old report line saying 'for the last X segments' with 'overall data'.\n\n|cFFFFFF00-|r Mini-displays on statusbar are now more responsible to right button click.\n\n|cFFFFFF00-|r Added Mage's Greater Invisibility as cooldown.\n\n|cFFFFFF00v3.10.8 (|cFFFFCC00Mar 02, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Improved aura creation.\n\n|cFFFFFF00-|r Custom display 'My Spells' now also show your pets.\n\n|cFFFFFF00-|r Fixed 'Raid Check' plugin food detection.\n\n|cFFFFFF00v3.10.6 (|cFFFFCC00Feb 24, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Encounter Details (plugin): several bug fixes and improvements.\n\n|cFFFFFF00-|r Encounter Details (plugin): added new tab showing enemy spells from the encounter with an aura creation panel.\n\n|cFFFFFF00-|r Encounter Details (plugin): added phase indicators on graphic tab, hovering over shows the damage and heal for that specific phase.\n\n|cFFFFFF00-|r Segments menu now also show the encounter try number plus the elapsed combat time.\n\n|cFFFFFF00-|r Several improvements on Overall Data, also, now it has an option to not save it when the character logoff.\n\n|cFFFFFF00-|r Player Details window now closes with right click on any bar." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " @@ -47,7 +47,8 @@ do --> armazenas as funções do parser - All parse functions _detalhes.parser = {} _detalhes.parser_functions = {} - _detalhes.parser_frame = CreateFrame ("Frame", nil, _UIParent) + _detalhes.parser_frame = CreateFrame ("Frame") + _detalhes.pvp_parser_frame = CreateFrame ("Frame") _detalhes.parser_frame:Hide() --> armazena os escudos - Shields information for absorbs _detalhes.escudos = {} @@ -103,6 +104,26 @@ do return t.file, t.coords end end + _detalhes.battleground_info = { + [489] = {file = "LoadScreenWarsongGulch", coords = {0, 1, 121/512, 484/512}}, --warsong gulch + [727] = {file = "LoadScreenSilvershardMines", coords = {0, 1, 251/1024, 840/1024}}, --silvershard mines + [529] = {file = "LoadscreenArathiBasin", coords = {0, 1, 126/512, 430/512}}, --arathi basin + [566] = {file = "LoadScreenNetherBattlegrounds", coords = {0, 1, 142/512, 466/512}}, --eye of the storm + [30] = {file = "LoadScreenPvpBattleground", coords = {0, 1, 127/512, 500/512}}, --alterac valley + [761] = {file = "LoadScreenGilneasBG2", coords = {0, 1, 281/1024, 878/1024}}, --the battle for gilneas + [726] = {file = "LoadScreenTwinPeaksBG", coords = {0, 1, 294/1024, 876/1024}}, --twin peaks + [998] = {file = "LoadScreenValleyofPower", coords = {0, 1, 257/1024, 839/1024}}, --temple of kotmogu + [1105] = {file = "LoadScreen_GoldRush", coords = {0, 1, 264/1024, 840/1024}}, --deepwind gorge + [607] = {file = "LoadScreenNorthrendBG", coords = {0, 1, 302/1024, 879/1024}}, --strand of the ancients + [628] = {file = "LOADSCREENISLEOFCONQUEST", coords = {0, 1, 297/1024, 878/1024}}, --isle of conquest + --[] = {file = "", coords = {0, 1, 0, 0}}, -- + } + function _detalhes:GetBattlegroundInfo (mapid) + local t = _detalhes.battleground_info [mapid] + if (t) then + return t.file, t.coords + end + end --> armazena instancias inativas _detalhes.unused_instances = {} _detalhes.default_skin_to_use = "Minimalistic" diff --git a/classes/classe_combate.lua b/classes/classe_combate.lua index 053ad8b7..3bc5be98 100644 --- a/classes/classe_combate.lua +++ b/classes/classe_combate.lua @@ -74,6 +74,14 @@ return self.is_boss end + function combate:GetPvPInfo() + return self.is_pvp + end + + function combate:GetArenaInfo() + return self.is_arena + end + function combate:GetDeaths() return self.last_events_tables end @@ -203,7 +211,7 @@ esta_tabela.pvp = true --> o who é da facção oposta ou foi dado mind control end else - esta_tabela.pvp = true --> se ambos são friendly, seria isso um PVP entre jogadores da mesma facções? + esta_tabela.pvp = true --> se ambos são friendly, seria isso um PVP entre jogadores da mesma facção? end end diff --git a/classes/classe_damage.lua b/classes/classe_damage.lua index a5cb3491..722f5b83 100644 --- a/classes/classe_damage.lua +++ b/classes/classe_damage.lua @@ -288,7 +288,6 @@ --[[exported]] function _detalhes:GetBarColor (actor) actor = actor or self - if (actor.monster) then return _unpack (_detalhes.class_colors.ENEMY) @@ -1731,7 +1730,7 @@ end end if (instancia.row_info.texture_background_class_color) then esta_barra.background:SetVertexColor (actor_class_color_r, actor_class_color_g, actor_class_color_b) - end + end --icon if (self.spellicon) then @@ -1803,7 +1802,7 @@ end else esta_barra.texto_esquerdo:SetText (bar_number .. "|TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:0:32:0:32|t"..self.displayName) --seta o texto da esqueda -- HORDA end - else + else --alliance if (UsingCustomLeftText) then esta_barra.texto_esquerdo:SetText (_string_replace (instancia.row_info.textL_custom_text, esta_barra.colocacao, self.displayName, "|TInterface\\AddOns\\Details\\images\\icones_barra:"..instancia.row_info.height..":"..instancia.row_info.height..":0:0:256:32:32:64:0:32|t")) else @@ -1811,9 +1810,11 @@ end end end - if (instancia.row_info.texture_class_colors) then + --if (instancia.row_info.texture_class_colors and not instancia.showing.is_pvp) then esta_barra.textura:SetVertexColor (0.94117, 0, 0.01960, 1) - end + --elseif (instancia.showing.is_pvp) then + --esta_barra.background:SetVertexColor (1, 0, 0, 0.05) + --end end else if (self.arena_ally) then diff --git a/classes/container_combatentes.lua b/classes/container_combatentes.lua index 57bf94e4..f102eb0b 100644 --- a/classes/container_combatentes.lua +++ b/classes/container_combatentes.lua @@ -184,6 +184,10 @@ if (_detalhes:IsATank (serial)) then novo_objeto.isTank = true end + else + if (_detalhes.pvp_as_group and _detalhes.tabela_vigente.is_pvp and _detalhes.is_in_battleground) then + novo_objeto.grupo = true + end end if (_detalhes.is_in_arena) then @@ -259,7 +263,7 @@ end --> é inimigo - if (_bit_band (flag, 0x00000040) ~= 0) then + if (_bit_band (flag, REACTION_HOSTILE) ~= 0) then if (_bit_band (flag, OBJECT_TYPE_PLAYER) == 0 and _bit_band (flag, OBJECT_TYPE_PETGUARDIAN) == 0) then novo_objeto.monster = true end diff --git a/core/control.lua b/core/control.lua index a25eb61b..1827cf86 100644 --- a/core/control.lua +++ b/core/control.lua @@ -411,7 +411,7 @@ if (not _detalhes.tabela_vigente.is_boss) then - if (_detalhes.tabela_vigente.is_pvp) then + if (_detalhes.tabela_vigente.is_pvp or _detalhes.tabela_vigente.is_arena) then _detalhes:FlagActorsOnPvPCombat() end diff --git a/core/parser.lua b/core/parser.lua index 264278fc..8a7a6649 100644 --- a/core/parser.lua +++ b/core/parser.lua @@ -1,4 +1,3 @@ - ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local _detalhes = _G._detalhes @@ -2899,6 +2898,7 @@ _detalhes:LeftArena() end if (_detalhes.is_in_battleground and zoneType ~= "pvp") then + _detalhes.pvp_parser_frame:StopBgUpdater() _detalhes.is_in_battleground = nil end @@ -2916,9 +2916,12 @@ if (not _in_combat) then _detalhes:EntrarEmCombate() - _current_combat.pvp = true - _current_combat.is_pvp = {name = zoneName, mapid = ZoneMapID} end + + _current_combat.pvp = true + _current_combat.is_pvp = {name = zoneName, mapid = zoneMapID} + + _detalhes.pvp_parser_frame:StartBgUpdater() elseif (zoneType == "arena") then @@ -2938,9 +2941,9 @@ _detalhes.last_instance = zoneMapID end - if (_current_combat.pvp) then - _current_combat.pvp = false - end + --if (_current_combat.pvp) then + -- _current_combat.pvp = false + --end end _detalhes:SchedulePetUpdate (7) @@ -3698,3 +3701,87 @@ return nil --_detalhes:NewError ("Couldn't find a combat object for passed parameters") end end + +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--> battleground parser + + + + _detalhes.pvp_parser_frame:SetScript ("OnEvent", function (self, event) + self:ReadPvPData() + end) + + function _detalhes:BgScoreUpdate() + RequestBattlefieldScoreData() + end + + function _detalhes.pvp_parser_frame:StartBgUpdater() + + if (not _detalhes.use_battleground_server_parser) then + return + end + + _detalhes.pvp_parser_frame:RegisterEvent ("UPDATE_BATTLEFIELD_SCORE") + if (_detalhes.pvp_parser_frame.ticker) then + _detalhes:CancelTimer (_detalhes.pvp_parser_frame.ticker) + end + _detalhes.pvp_parser_frame.ticker = _detalhes:ScheduleRepeatingTimer ("BgScoreUpdate", 10) + end + + function _detalhes.pvp_parser_frame:StopBgUpdater() + _detalhes.pvp_parser_frame:UnregisterEvent ("UPDATE_BATTLEFIELD_SCORE") + _detalhes:CancelTimer (_detalhes.pvp_parser_frame.ticker) + _detalhes.pvp_parser_frame.ticker = nil + end + + function _detalhes.pvp_parser_frame:ReadPvPData() + + local players = GetNumBattlefieldScores() + + for i = 1, players do + + local name, killingBlows, honorableKills, deaths, honorGained, faction, race, class, classToken, damageDone, healingDone, bgRating, ratingChange, preMatchMMR, mmrChange, talentSpec = GetBattlefieldScore (i) + + local actor = _detalhes.tabela_vigente (1, name) + if (actor) then + actor.total = damageDone + actor.classe = classToken + else + local guid = _UnitGUID (name) + if (guid) then + local flag + if (_detalhes.faction_id == faction) then --> is from the same faction + flag = 0x514 + else + flag = 0x548 + end + actor = _current_damage_container:PegarCombatente (guid, name, flag, true) + actor.total = _detalhes:GetOrderNumber() + actor.classe = classToken + end + end + + local actor = _detalhes.tabela_vigente (2, name) + if (actor) then + actor.total = healingDone + actor.classe = classToken + else + local guid = _UnitGUID (name) + if (guid) then + local flag + if (_detalhes.faction_id == faction) then --> is from the same faction + flag = 0x514 + else + flag = 0x548 + end + actor = _current_heal_container:PegarCombatente (guid, name, flag, true) + actor.total = _detalhes:GetOrderNumber() + actor.classe = classToken + end + end + + end + + end + + \ No newline at end of file diff --git a/core/windows.lua b/core/windows.lua index 24778a79..050c3fb3 100644 --- a/core/windows.lua +++ b/core/windows.lua @@ -1006,7 +1006,7 @@ end ---> raid history window +--> raid history window ~history function _detalhes:OpenRaidHistoryWindow() if (not _G.DetailsRaidHistoryWindow) then diff --git a/functions/loaddata.lua b/functions/loaddata.lua index 2241df2b..6ad0f4e6 100644 --- a/functions/loaddata.lua +++ b/functions/loaddata.lua @@ -25,8 +25,10 @@ function _detalhes:ApplyBasicKeys() self.faction = UnitFactionGroup ("player") if (self.faction == PLAYER_FACTION_GROUP[0]) then --> player is horde self.faction_against = PLAYER_FACTION_GROUP[1] --> ally + self.faction_id = 0 elseif (self.faction == PLAYER_FACTION_GROUP[1]) then --> player is alliance self.faction_against = PLAYER_FACTION_GROUP[0] --> horde + self.faction_id = 1 end self.zone_type = nil diff --git a/functions/profiles.lua b/functions/profiles.lua index 8180313e..668a24dc 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -935,6 +935,8 @@ local default_profile = { overall_clear_newchallenge = true, overall_clear_logout = false, close_shields = false, + pvp_as_group = true, + use_battleground_server_parser = true, --> skins standard_skin = false, diff --git a/gumps/janela_options.lua b/gumps/janela_options.lua index eaa441e0..14ec8665 100644 --- a/gumps/janela_options.lua +++ b/gumps/janela_options.lua @@ -4476,12 +4476,34 @@ function window:CreateFrame2() window:CreateLineBackground2 (frame2, "cloudCaptureSlider", "cloudCaptureLabel", Loc ["STRING_OPTIONS_CLOUD_DESC"] ) + --> battleground + --> remote parser + g:NewLabel (frame2, _, "$parentRemoteParserLabel", "RemoteParserLabel", Loc ["STRING_OPTIONS_BG_REMOTE_PARSER"], "GameFontHighlightLeft") + g:NewSwitch (frame2, _, "$parentRemoteParserSlider", "RemoteParserSlider", 60, 20, _, _, _detalhes.use_battleground_server_parser) + frame2.RemoteParserSlider:SetPoint ("left", frame2.RemoteParserLabel, "right", 2) + frame2.RemoteParserSlider.OnSwitch = function (self, _, value) + _detalhes.use_battleground_server_parser = value + end + window:CreateLineBackground2 (frame2, "RemoteParserSlider", "RemoteParserLabel", Loc ["STRING_OPTIONS_BG_REMOTE_PARSER_DESC"]) + + --> show all + g:NewLabel (frame2, _, "$parentShowAllLabel", "ShowAllLabel", Loc ["STRING_OPTIONS_BG_ALL_ALLY"], "GameFontHighlightLeft") + g:NewSwitch (frame2, _, "$parentShowAllSlider", "ShowAllSlider", 60, 20, _, _, _detalhes.pvp_as_group) + frame2.ShowAllSlider:SetPoint ("left", frame2.ShowAllLabel, "right", 2) + frame2.ShowAllSlider.OnSwitch = function (self, _, value) + _detalhes.pvp_as_group = value + end + window:CreateLineBackground2 (frame2, "ShowAllSlider", "ShowAllLabel", Loc ["STRING_OPTIONS_BG_ALL_ALLY_DESC"]) + + --> anchors --general anchor g:NewLabel (frame2, _, "$parentGeneralAnchor", "GeneralAnchorLabel", Loc ["STRING_OPTIONS_GENERAL_ANCHOR"], "GameFontNormal") --captures anchor g:NewLabel (frame2, _, "$parentDataCollectAnchor", "DataCollectAnchorLabel", Loc ["STRING_OPTIONS_DATACOLLECT_ANCHOR"], "GameFontNormal") + --battleground anchor + g:NewLabel (frame2, _, "$parentBattlegroundAnchor", "BattlegroundAnchorLabel", Loc ["STRING_OPTIONS_BG_ANCHOR"], "GameFontNormal") local x = window.left_start_at @@ -4502,8 +4524,6 @@ function window:CreateFrame2() {"miscCaptureImage", 10}, {"auraCaptureImage", 11}, {"cloudCaptureLabel", 12, true}, - - } window:arrange_menu (frame2, left_side, x, window.top_start_at) @@ -4520,6 +4540,10 @@ function window:CreateFrame2() {"OverallNewBossLabel", 7, true}, {"OverallNewChallengeLabel", 8}, {"OverallOnLogoutLabel", 9}, + + {"BattlegroundAnchorLabel", 10, true}, + {"RemoteParserLabel", 11}, + {"ShowAllLabel", 12}, } window:arrange_menu (frame2, right_side, x, -90) @@ -10100,6 +10124,9 @@ end --> if not window _G.DetailsOptionsWindow2CaptureAuraSlider.MyObject:SetValue (_detalhes.capture_real ["aura"]) _G.DetailsOptionsWindow2CloudAuraSlider.MyObject:SetValue (_detalhes.cloud_capture) + _G.DetailsOptionsWindow2RemoteParserSlider.MyObject:SetValue (_detalhes.use_battleground_server_parser) + _G.DetailsOptionsWindow2ShowAllSlider.MyObject:SetValue (_detalhes.pvp_as_group) + --> window 3 local skin = editing_instance.skin diff --git a/gumps/janela_principal.lua b/gumps/janela_principal.lua index 56e747ee..36d703c6 100644 --- a/gumps/janela_principal.lua +++ b/gumps/janela_principal.lua @@ -5323,20 +5323,25 @@ local build_segment_list = function (self, elapsed) CoolTip:SetWallpaper (2, [[Interface\BlackMarket\HotItemBanner]], unknown_boss_tex, unknown_boss_color, true) end - elseif (thisCombat.is_arena) then - - local file, coords = _detalhes:GetArenaInfo (thisCombat.is_arena.mapid) - - enemy = thisCombat.is_arena.name - - CoolTip:AddLine (thisCombat.is_arena.name, _, 1, "yellow") - + elseif (thisCombat.is_pvp) then + CoolTip:AddLine (thisCombat.is_pvp.name, _, 1, "yellow") + enemy = thisCombat.is_pvp.name CoolTip:AddIcon ([[Interface\AddOns\Details\images\icons]], "main", "left", 16, 12, 0.251953125, 0.306640625, 0.205078125, 0.248046875) + local file, coords = _detalhes:GetBattlegroundInfo (thisCombat.is_pvp.mapid) if (file) then CoolTip:SetWallpaper (2, "Interface\\Glues\\LOADINGSCREENS\\" .. file, coords, empty_segment_color) end + + elseif (thisCombat.is_arena) then + CoolTip:AddLine (thisCombat.is_arena.name, _, 1, "yellow") + enemy = thisCombat.is_arena.name + CoolTip:AddIcon ([[Interface\AddOns\Details\images\icons]], "main", "left", 16, 12, 0.251953125, 0.306640625, 0.205078125, 0.248046875) + local file, coords = _detalhes:GetArenaInfo (thisCombat.is_arena.mapid) + if (file) then + CoolTip:SetWallpaper (2, "Interface\\Glues\\LOADINGSCREENS\\" .. file, coords, empty_segment_color) + end else enemy = thisCombat.enemy if (enemy) then @@ -5396,6 +5401,7 @@ local build_segment_list = function (self, elapsed) CoolTip:AddIcon ([[Interface\QUESTFRAME\UI-Quest-BulletPoint]], "main", "left", 16, 16, nil, nil, nil, nil, "orange") local enemy = _detalhes.tabela_vigente.is_boss and _detalhes.tabela_vigente.is_boss.name or _detalhes.tabela_vigente.enemy or "--x--x--" + local file, coords if (_detalhes.tabela_vigente.is_boss and _detalhes.tabela_vigente.is_boss.name) then local portrait = _detalhes:GetBossPortrait (_detalhes.tabela_vigente.is_boss.mapid, _detalhes.tabela_vigente.is_boss.index) @@ -5415,11 +5421,20 @@ local build_segment_list = function (self, elapsed) end end end + elseif (_detalhes.tabela_vigente.is_pvp) then + enemy = _detalhes.tabela_vigente.is_pvp.name + file, coords = _detalhes:GetBattlegroundInfo (_detalhes.tabela_vigente.is_pvp.mapid) + elseif (_detalhes.tabela_vigente.is_arena) then + enemy = _detalhes.tabela_vigente.is_arena.name + file, coords = _detalhes:GetArenaInfo (_detalhes.tabela_vigente.is_arena.mapid) else CoolTip:SetWallpaper (2, [[Interface\ACHIEVEMENTFRAME\UI-Achievement-StatsBackground]], segments_common_tex, segments_common_color) end CoolTip:AddLine (Loc ["STRING_SEGMENT_ENEMY"] .. ":", enemy, 2, "white", "white") + if (file) then + CoolTip:SetWallpaper (2, "Interface\\Glues\\LOADINGSCREENS\\" .. file, coords, empty_segment_color) + end if (not _detalhes.tabela_vigente:GetEndTime()) then if (_detalhes.in_combat) then @@ -5435,7 +5450,6 @@ local build_segment_list = function (self, elapsed) CoolTip:AddLine (Loc ["STRING_SEGMENT_TIME"] .. ":", minutos.."m "..segundos.."s", 2, "white", "white") end - CoolTip:AddLine (Loc ["STRING_SEGMENT_START"] .. ":", _detalhes.tabela_vigente.data_inicio, 2, "white", "white") CoolTip:AddLine (Loc ["STRING_SEGMENT_END"] .. ":", _detalhes.tabela_vigente.data_fim or "in progress", 2, "white", "white")