From aedc9ea2eab17bf734d453d640e2efe7ff3dab89 Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Tue, 18 Jan 2022 14:53:59 -0300 Subject: [PATCH] Added Power Infusion buff to the buff update of the target --- Libs/DF/fw.lua | 2 +- Libs/DF/panel.lua | 11 +++++++++++ boot.lua | 4 +++- core/parser.lua | 13 +++++++++++++ frames/window_playerbreakdown.lua | 8 +++++++- 5 files changed, 35 insertions(+), 3 deletions(-) diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua index 066b8a91..9d6af8ee 100644 --- a/Libs/DF/fw.lua +++ b/Libs/DF/fw.lua @@ -1,6 +1,6 @@ -local dversion = 283 +local dversion = 284 local major, minor = "DetailsFramework-1.0", dversion local DF, oldminor = LibStub:NewLibrary (major, minor) diff --git a/Libs/DF/panel.lua b/Libs/DF/panel.lua index ea9b9b65..e3b17b11 100644 --- a/Libs/DF/panel.lua +++ b/Libs/DF/panel.lua @@ -9643,6 +9643,8 @@ DF.TimeLineBlockFunctions = { --dataIndex stores which line index from the data this line will use --lineData store members: .text .icon .timeline local lineData = data.lines [self.dataIndex] + + self.spellId = lineData.spellId --if there's an icon, anchor the text at the right side of the icon --this is the title and icon of the title @@ -9784,6 +9786,14 @@ DF.TimeLineFunctions = { line = CreateFrame ("frame", "$parentLine" .. index, self.body, "BackdropTemplate") DF:Mixin (line, DF.TimeLineBlockFunctions) self.lines [index] = line + + local lineHeader = CreateFrame("frame", nil, line, "BackdropTemplate") + lineHeader:SetPoint("topleft", line, "topleft", 0, 0) + lineHeader:SetPoint("bottomleft", line, "bottomleft", 0, 0) + lineHeader:SetScript("OnEnter", self.options.header_on_enter) + lineHeader:SetScript("OnLeave", self.options.header_on_leave) + + line.lineHeader = lineHeader --store the individual textures that shows the timeline information line.blocks = {} @@ -9884,6 +9894,7 @@ DF.TimeLineFunctions = { for i = 1, #self.data.lines do local line = self:GetLine (i) line.dataIndex = i --this index is used inside the line update function to know which data to get + line.lineHeader:SetWidth(self.options.header_width) line:SetBlocksFromData() --the function to update runs within the line object end diff --git a/boot.lua b/boot.lua index e9444df5..3bf77223 100644 --- a/boot.lua +++ b/boot.lua @@ -38,6 +38,7 @@ do Added an option to change your own bar color. Bookmark window now uses the same scale than the options panel. Class Color window now uses the same scale than the options panel. + If not casted on the player itself Power Infusion now shows in the buff list of the target. Fixed all issues with the options panel scale. Fixed auto hide windows which wasn't saving its group when unhiding (fix by Flamanis). Fixed some XML Headers which was giving errors on loading (fix by github user h0tw1r3). @@ -398,7 +399,8 @@ do --> player detail skin _detalhes.playerdetailwindow_skins = {} - _detalhes.BitfieldSwapDebuffsIDs = {265646, 272407, 269691, 273401, 269131, 260900, 260926, 284995, 292826, 311367, 310567, 308996, 307832, 327414, 337253} + _detalhes.BitfieldSwapDebuffsIDs = {265646, 272407, 269691, 273401, 269131, 260900, 260926, 284995, 292826, 311367, 310567, 308996, 307832, 327414, 337253, + 36797, 37122} --> auto run code _detalhes.RunCodeTypes = { diff --git a/core/parser.lua b/core/parser.lua index d3c2f33b..a6117ffc 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -150,6 +150,10 @@ apoc = {}, } + local buffs_to_other_players = { + [10060] = true, --power infusion + } + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> constants local container_misc = _detalhes.container_type.CONTAINER_MISC_CLASS @@ -2432,6 +2436,9 @@ elseif (container_pets [who_serial] and container_pets [who_serial][2] == alvo_serial) then --um pet colocando uma aura do dono parser:add_buff_uptime (token, time, alvo_serial, alvo_name, alvo_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, "BUFF_UPTIME_IN") + + elseif (buffs_to_other_players[spellid]) then + parser:add_buff_uptime(token, time, alvo_serial, alvo_name, alvo_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, "BUFF_UPTIME_IN") end end @@ -2677,6 +2684,9 @@ elseif (container_pets [who_serial] and container_pets [who_serial][2] == alvo_serial) then --um pet colocando uma aura do dono parser:add_buff_uptime (token, time, alvo_serial, alvo_name, alvo_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, "BUFF_UPTIME_REFRESH") + + elseif (buffs_to_other_players[spellid]) then + parser:add_buff_uptime(token, time, alvo_serial, alvo_name, alvo_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, "BUFF_UPTIME_REFRESH") end end @@ -2826,6 +2836,9 @@ elseif (container_pets [who_serial] and container_pets [who_serial][2] == alvo_serial) then --um pet colocando uma aura do dono parser:add_buff_uptime (token, time, alvo_serial, alvo_name, alvo_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, "BUFF_UPTIME_OUT") + + elseif (buffs_to_other_players[spellid]) then + parser:add_buff_uptime(token, time, alvo_serial, alvo_name, alvo_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, "BUFF_UPTIME_OUT") end end diff --git a/frames/window_playerbreakdown.lua b/frames/window_playerbreakdown.lua index 8bd94623..66c71380 100644 --- a/frames/window_playerbreakdown.lua +++ b/frames/window_playerbreakdown.lua @@ -99,6 +99,10 @@ function Details:GetPlayerObjectFromBreakdownWindow() return info.jogador end +function Details:GetBreakdownWindow() + return Details.playerDetailWindow +end + --english alias --window object from Details:GetWindow(n) and playerObject from Details:GetPlayer(playerName, attribute) function Details:OpenPlayerBreakdown (windowObject, playerObject) @@ -338,7 +342,9 @@ function _detalhes:AbreJanelaInfo (jogador, from_att_change, refresh, ShiftKeyDo end end - shownTab:Click() + if (shownTab) then + shownTab:Click() + end end -- for beta todo: info background need a major rewrite