From 6ac2c37bef87655cde41890ea4dfd7bb3631de18 Mon Sep 17 00:00:00 2001 From: Tercio Date: Thu, 9 Aug 2018 00:39:13 -0300 Subject: [PATCH] - Hotfix an initialization issue caused by a stealth patch in the client addon API. --- boot.lua | 4 ++- classes/classe_damage.lua | 2 +- classes/container_combatentes.lua | 9 +++++ core/network.lua | 12 +++++++ core/parser.lua | 59 ++++++++++++++++++++++++++++--- gumps/janela_report.lua | 4 +-- startup.lua | 2 ++ 7 files changed, 84 insertions(+), 8 deletions(-) diff --git a/boot.lua b/boot.lua index 48c9218b..31409842 100644 --- a/boot.lua +++ b/boot.lua @@ -3,7 +3,7 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") - _detalhes.build_counter = 6120 + _detalhes.build_counter = 6131 _detalhes.userversion = "v8.0.1." .. _detalhes.build_counter _detalhes.realversion = 132 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" @@ -109,6 +109,8 @@ do _detalhes.pets_ignored = {} _detalhes.pets_no_owner = {} _detalhes.pets_players = {} + --> dual candidates + _detalhes.duel_candidates = {} --> armazena as skins dispon�veis para as janelas _detalhes.skins = {} --> armazena os hooks das fun��es do parser diff --git a/classes/classe_damage.lua b/classes/classe_damage.lua index 31a88fbf..473d325e 100644 --- a/classes/classe_damage.lua +++ b/classes/classe_damage.lua @@ -2659,7 +2659,7 @@ local set_text_size = function (bar, instance) end --> this is the in bar icon (icon inside the player bar, like faction or role icon) padding, icon has the row height as is width and height - padding -local InBarIconPadding = 0 +local InBarIconPadding = 6 --[[ exported]] function _detalhes:SetBarLeftText (bar, instance, enemy, arena_enemy, arena_ally, UsingCustomLeftText) diff --git a/classes/container_combatentes.lua b/classes/container_combatentes.lua index 748a055f..6cbea1a4 100644 --- a/classes/container_combatentes.lua +++ b/classes/container_combatentes.lua @@ -247,6 +247,15 @@ end end + --> pvp duel + if (_detalhes.duel_candidates [serial]) then + --> check if is recent + if (_detalhes.duel_candidates [serial]+20 > GetTime()) then + novo_objeto.grupo = true + novo_objeto.enemy = true + end + end + if (_detalhes.is_in_arena) then local my_team_color = GetBattlefieldArenaFaction() diff --git a/core/network.lua b/core/network.lua index 469d2531..f28040de 100644 --- a/core/network.lua +++ b/core/network.lua @@ -43,6 +43,8 @@ local CONST_CLOUD_DATARC = "CE" local CONST_CLOUD_EQUALIZE = "EQ" + local CONST_PVP_ENEMY = "PP" + local CONST_ROGUE_SR = "SR" --soul rip from akaari's soul (LEGION ONLY) _detalhes.network.ids = { @@ -60,6 +62,8 @@ ["GUILD_SYNC"] = CONST_GUILD_SYNC, + ["PVP_ENEMY"] = CONST_PVP_ENEMY, + ["MISSDATA_ROGUE_SOULRIP"] = CONST_ROGUE_SR, --soul rip from akaari's soul (LEGION ONLY) } @@ -374,6 +378,12 @@ end end + function _detalhes.network.ReceivedEnemyPlayer (player, realm, core_version, data) + -- ["PVP_ENEMY"] = CONST_PVP_ENEMY, + end + + + _detalhes.network.functions = { [CONST_HIGHFIVE_REQUEST] = _detalhes.network.HighFive_Request, [CONST_HIGHFIVE_DATA] = _detalhes.network.HighFive_DataReceived, @@ -390,6 +400,8 @@ [CONST_GUILD_SYNC] = _detalhes.network.GuildSync, [CONST_ROGUE_SR] = _detalhes.network.HandleMissData, --soul rip from akaari's soul (LEGION ONLY) + + [CONST_PVP_ENEMY] = _detalhes.network.ReceivedEnemyPlayer, } ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/core/parser.lua b/core/parser.lua index c8776d61..1a27a7a7 100644 --- a/core/parser.lua +++ b/core/parser.lua @@ -103,6 +103,7 @@ local container_damage_target = _detalhes.container_type.CONTAINER_DAMAGETARGET_CLASS local container_misc = _detalhes.container_type.CONTAINER_MISC_CLASS + local duel_candidates = _detalhes.duel_candidates local OBJECT_TYPE_ENEMY = 0x00000040 local OBJECT_TYPE_PLAYER = 0x00000400 @@ -668,10 +669,16 @@ ------------------------------------------------------------------------------------------------ --> firendly fire - - if ( - (_bit_band (alvo_flags, REACTION_FRIENDLY) ~= 0 and _bit_band (who_flags, REACTION_FRIENDLY) ~= 0) or --ajdt d' brx - (raid_members_cache [alvo_serial] and raid_members_cache [who_serial] and alvo_serial:find ("Player") and who_serial:find ("Player")) --amrl + if ( + ( + (_bit_band (alvo_flags, REACTION_FRIENDLY) ~= 0 and _bit_band (who_flags, REACTION_FRIENDLY) ~= 0) or --ajdt d' brx + (raid_members_cache [alvo_serial] and raid_members_cache [who_serial] and alvo_serial:find ("Player") and who_serial:find ("Player")) --amrl + ) + and + ( + --> if the target isn't a pvp duel target + not jogador_alvo.enemy and not este_jogador.enemy + ) ) then --> ignore soul link (damage from the warlock on his pet) @@ -4340,6 +4347,50 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _detalhes:DispatchAutoRunCode ("on_leavecombat") end + --> this is mostly triggered when the player enters in a dual against another player + function _detalhes.parser_functions:UNIT_FACTION (unit) + --> check if outdoors + --unit was nil, nameplate might bug here, it should track after the event + if (_detalhes.zone_type == "none" and unit) then + local serial = UnitGUID (unit) + --> the serial is valid and isn't the player? + if (serial and serial ~= UnitGUID ("player")) then + _detalhes.duel_candidates [serial] = GetTime() + + local playerName = _detalhes:GetCLName (unit) + + --> check if the player is inside the current combat and flag the objects + if (playerName and _current_combat) then + local enemyPlayer1 = _current_combat:GetActor (1, playerName) + local enemyPlayer2 = _current_combat:GetActor (2, playerName) + local enemyPlayer3 = _current_combat:GetActor (3, playerName) + local enemyPlayer4 = _current_combat:GetActor (4, playerName) + if (enemyPlayer1) then + --> set to show when the player is solo play + enemyPlayer1.grupo = true + enemyPlayer1.enemy = true + if (IsInGroup()) then + --> broadcast the enemy to group members so they can "watch" the damage + + end + end + if (enemyPlayer2) then + enemyPlayer2.grupo = true + enemyPlayer2.enemy = true + end + if (enemyPlayer3) then + enemyPlayer3.grupo = true + enemyPlayer3.enemy = true + end + if (enemyPlayer4) then + enemyPlayer4.grupo = true + enemyPlayer4.enemy = true + end + end + end + end + end + function _detalhes.parser_functions:ROLE_CHANGED_INFORM (...) if (_detalhes.last_assigned_role ~= _UnitGroupRolesAssigned ("player")) then _detalhes:CheckSwitchOnLogon (true) diff --git a/gumps/janela_report.lua b/gumps/janela_report.lua index ede2531a..29c184be 100644 --- a/gumps/janela_report.lua +++ b/gumps/janela_report.lua @@ -345,7 +345,6 @@ local function cria_drop_down (este_gump) end local build_list = function() - local output_array = {} for index, case in ipairs (lista) do @@ -355,7 +354,8 @@ local function cria_drop_down (este_gump) end local channels = {_GetChannelList()} --> coloca o resultado em uma tabela .. {id1, canal1, id2, canal2} - for i = 1, #channels, 2 do --> total de canais + --09/august/2018: GetChannelList passed to return 3 values for each channel instead of 2 + for i = 1, #channels, 3 do --> total de canais output_array [#output_array + 1] = {iconsize = iconsize, value = "CHANNEL|"..channels [i+1], label = channels [i]..". "..channels [i+1], onclick = on_click, icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], texcoord = {0.3046875, 0.4453125, 0.109375, 0.390625}, iconcolor = {149/255, 112/255, 112/255}} end diff --git a/startup.lua b/startup.lua index a2d96712..1cfc41f1 100644 --- a/startup.lua +++ b/startup.lua @@ -278,6 +278,8 @@ function _G._detalhes:Start() self.listener:RegisterEvent ("PLAYER_ROLES_ASSIGNED") self.listener:RegisterEvent ("ROLE_CHANGED_INFORM") + self.listener:RegisterEvent ("UNIT_FACTION") + self.listener:RegisterEvent ("PLAYER_SPECIALIZATION_CHANGED") --test immersion stuff