diff --git a/Definitions.lua b/Definitions.lua index ea52f6df..8a122757 100644 --- a/Definitions.lua +++ b/Definitions.lua @@ -103,7 +103,7 @@ ---@field SetAttribute fun(self: frame, name: string, value: any) ---@field SetScript fun(self: frame, event: string, handler: function) ---@field GetScript fun(self: frame, event: string) : function ----@field SetFrameStrata fun(self: frame, strata: framestrata|string) +---@field SetFrameStrata fun(self: frame, strata: framestrata|"background"|"low"|"medium"|"high"|"dialog"|"fullscreen"|"fullscreen_dialog"|"tooltip") ---@field SetFrameLevel fun(self: frame, level: number) ---@field SetClampedToScreen fun(self: frame, clamped: boolean) ---@field SetClampRectInsets fun(self: frame, left: number, right: number, top: number, bottom: number) @@ -116,6 +116,9 @@ ---@field SetToplevel fun(self: frame, toplevel: boolean) ---@field SetPropagateKeyboardInput fun(self: frame, propagate: boolean) ---@field SetPropagateGamepadInput fun(self: frame, propagate: boolean) +---@field StartMoving fun(self: frame) +---@field StartSizing fun(self: frame, point: string) +---@field StopMovingOrSizing fun(self: frame) ---@field GetAttribute fun(self: frame, name: string) : any ---@field GetFrameLevel fun(self: frame) : number ---@field GetFrameStrata fun(self: frame) : framestrata|string @@ -150,7 +153,7 @@ ---@field GetFontString fun(self: button) : fontstring ---@field SetButtonState fun(self: button, state: string, enable: boolean) ---@field GetButtonState fun(self: button, state: string) : boolean ----@field RegisterForClicks fun(self: button, button1: string|nil, button2: string|nil) +---@field RegisterForClicks fun(self: button, button1: nil|"AnyUp"|"AnyDown"|"LeftButtonDown"|"LeftButtonUp"|"MiddleButtonUp"|"MiddleButtonDown"|"RightButtonDown"|"RightButtonUp"|"Button4Up"|"Button4Down"|"Button5Up"|"Button5Down", button2: nil|"AnyUp"|"AnyDown"|"LeftButtonDown"|"LeftButtonUp"|"MiddleButtonUp"|"MiddleButtonDown"|"RightButtonDown"|"RightButtonUp"|"Button4Up"|"Button4Down"|"Button5Up"|"Button5Down") ---@class fontstring : uiobject ---@field SetDrawLayer fun(self: fontstring, layer: "background"|"border"|"artwork"|"overlay"|"highlight", subLayer: number|nil) @@ -326,6 +329,7 @@ ---@field targets_overheal table ---@field targets_absorbs table ---@field id number --spellid +---@field is_shield boolean --true if the spell is a shield ---@field successful_casted number successful casted times (only for enemies) ---@field g_amt number glacing hits ---@field g_dmg number diff --git a/Libs/DF/panel.lua b/Libs/DF/panel.lua index 8fdb8a94..2fa11c1b 100644 --- a/Libs/DF/panel.lua +++ b/Libs/DF/panel.lua @@ -5054,7 +5054,7 @@ local default_icon_row_options = { } function detailsFramework:CreateIconRow (parent, name, options) - local f = CreateFrame("frame", name, parent, "BackdropTemplate") + local f = _G.CreateFrame("frame", name, parent, "BackdropTemplate") f.IconPool = {} f.NextIcon = 1 f.AuraCache = {} @@ -5077,19 +5077,46 @@ end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --~header +--definitions +---@class headerframe: frame +---@field GetColumnWidth fun(self: headerframe, columnId: number) +---@field SetHeaderTable fun(self: headerframe, newTable) +---@field GetSelectedColumn fun(self: headerframe) +---@field Refresh fun(self: headerframe) +---@field UpdateSortArrow fun(self: headerframe, columnHeader: headercolumnframe, defaultShown: boolean, defaultOrder: string) +---@field UpdateColumnHeader fun(self: headerframe, columnHeader: headercolumnframe, headerIndex) +---@field ResetColumnHeaderBackdrop fun(self: headerframe, columnHeader: headercolumnframe) +---@field SetBackdropColorForSelectedColumnHeader fun(self: headerframe, columnHeader: headercolumnframe) +---@field ClearColumnHeader fun(self: headerframe, columnHeader: headercolumnframe) +---@field GetNextHeader fun(self: headerframe) : headercolumnframe +---@field columnHeadersCreated headercolumnframe[] +---@field HeaderTable table +---@field NextHeader number +---@field HeaderWidth number +---@field HeaderHeight number +---@field columnSelected number + +---@class headercolumnframe: frame +---@field Icon texture +---@field Text fontstring +---@field Arrow texture +---@field Separator texture +---@field resizerButton button + + --mixed functions detailsFramework.HeaderFunctions = { AddFrameToHeaderAlignment = function(self, frame) self.FramesToAlign = self.FramesToAlign or {} - tinsert(self.FramesToAlign, frame) + _G.tinsert(self.FramesToAlign, frame) end, ResetFramesToHeaderAlignment = function(self) - wipe(self.FramesToAlign) + _G.wipe(self.FramesToAlign) end, SetFramesToHeaderAlignment = function(self, ...) - wipe(self.FramesToAlign) + _G.wipe(self.FramesToAlign) self.FramesToAlign = {...} end, @@ -5097,9 +5124,9 @@ detailsFramework.HeaderFunctions = { return self.FramesToAlign or {} end, - --@self: an object like a line - --@headerFrame: the main header frame - --@anchor: which side the columnHeaders are attach + ---@param self uiobject + ---@param headerFrame headerframe + ---@param anchor string AlignWithHeader = function(self, headerFrame, anchor) local columnHeaderFrames = headerFrame.columnHeadersCreated anchor = anchor or "topleft" @@ -5108,6 +5135,7 @@ detailsFramework.HeaderFunctions = { local frame = self.FramesToAlign[i] frame:ClearAllPoints() + ---@type headercolumnframe local columnHeader = columnHeaderFrames[i] if (columnHeader) then local offset = 0 @@ -5124,10 +5152,12 @@ detailsFramework.HeaderFunctions = { end end, - --@self: column header button + ---comment + ---@param self button + ---@param buttonClicked string OnClick = function(self, buttonClicked) - --get the header main frame + ---@type headerframe local headerFrame = self:GetParent() --if this header does not have a clickable header, just ignore @@ -5136,6 +5166,7 @@ detailsFramework.HeaderFunctions = { end --get the latest column header selected + ---@type headercolumnframe local previousColumnHeader = headerFrame.columnHeadersCreated[headerFrame.columnSelected] previousColumnHeader.Arrow:Hide() headerFrame:ResetColumnHeaderBackdrop(previousColumnHeader) @@ -5159,13 +5190,37 @@ detailsFramework.HeaderFunctions = { end end end, + + ---comment + ---@param self button + ---@param buttonClicked string + OnMouseDown = function(self, buttonClicked) + if (buttonClicked == "LeftButton") then + + end + end, + + ---comment + ---@param self button + ---@param buttonClicked string + OnMouseUp = function(self, buttonClicked) + if (buttonClicked == "LeftButton") then + + end + end, } + detailsFramework.HeaderCoreFunctions = { + ---@param self headerframe + ---@param columnId number + ---@return number GetColumnWidth = function(self, columnId) return self.HeaderTable[columnId].width end, + ---@param self headerframe + ---@param newTable table SetHeaderTable = function(self, newTable) self.columnHeadersCreated = self.columnHeadersCreated or {} self.HeaderTable = newTable @@ -5176,12 +5231,14 @@ detailsFramework.HeaderCoreFunctions = { end, --return which header is current selected and the the order ASC DESC + ---@param self headerframe GetSelectedColumn = function(self) return self.columnSelected, self.columnHeadersCreated[self.columnSelected or 1].order end, --clean up and rebuild the header following the header options --@self: main header frame + ---@param self headerframe Refresh = function(self) --refresh background frame self:SetBackdrop(self.options.backdrop) @@ -5263,7 +5320,10 @@ detailsFramework.HeaderCoreFunctions = { self:SetSize(self.HeaderWidth, self.HeaderHeight) end, - --@self: main header frame + ---@param self headerframe + ---@param columnHeader headercolumnframe + ---@param defaultShown boolean + ---@param defaultOrder string UpdateSortArrow = function(self, columnHeader, defaultShown, defaultOrder) local options = self.options local order = defaultOrder or columnHeader.order @@ -5292,7 +5352,9 @@ detailsFramework.HeaderCoreFunctions = { end end, - --@self: main header frame + ---@param self headerframe + ---@param columnHeader headercolumnframe + ---@param headerIndex number UpdateColumnHeader = function(self, columnHeader, headerIndex) local headerData = self.HeaderTable[headerIndex] @@ -5378,21 +5440,24 @@ detailsFramework.HeaderCoreFunctions = { columnHeader.InUse = true end, - --reset column header backdrop - --@self: main header frame + ---reset column header backdrop + ---@param self headerframe + ---@param columnHeader headercolumnframe ResetColumnHeaderBackdrop = function(self, columnHeader) columnHeader:SetBackdrop(self.options.header_backdrop) columnHeader:SetBackdropColor(unpack(self.options.header_backdrop_color)) columnHeader:SetBackdropBorderColor(unpack(self.options.header_backdrop_border_color)) end, - --@self: main header frame + ---@param self headerframe + ---@param columnHeader headercolumnframe SetBackdropColorForSelectedColumnHeader = function(self, columnHeader) columnHeader:SetBackdropColor(unpack(self.options.header_backdrop_color_selected)) end, - --clear the column header - --@self: main header frame + ---clear the column header + ---@param self headerframe + ---@param columnHeader headercolumnframe ClearColumnHeader = function(self, columnHeader) columnHeader:SetSize(self.options.header_width, self.options.header_height) self:ResetColumnHeaderBackdrop(columnHeader) @@ -5405,16 +5470,27 @@ detailsFramework.HeaderCoreFunctions = { columnHeader.Text:Hide() end, - --get the next column header, create one if doesn't exists - --@self: main header frame + ---get the next column header, create one if doesn't exists + ---@param self headerframe GetNextHeader = function(self) local nextHeader = self.NextHeader local columnHeader = self.columnHeadersCreated[nextHeader] if (not columnHeader) then --create a new column header + ---@type headercolumnframe local newHeader = CreateFrame("button", "$parentHeaderIndex" .. nextHeader, self, "BackdropTemplate") newHeader:SetScript("OnClick", detailsFramework.HeaderFunctions.OnClick) + newHeader:SetMovable(true) + newHeader:SetResizable(true) + + newHeader:SetScript("OnMouseDown", function() + print(11) + end) + + newHeader:SetScript("OnMouseUp", function() + print(22) --doesn't work either + end) --header icon detailsFramework:CreateImage(newHeader, "", self.options.header_height, self.options.header_height, "ARTWORK", nil, "Icon", "$parentIcon") @@ -5425,6 +5501,33 @@ detailsFramework.HeaderCoreFunctions = { --header selected and order icon detailsFramework:CreateImage(newHeader, self.options.arrow_up_texture, 12, 12, "ARTWORK", nil, "Arrow", "$parentArrow") + ---rezise button + ---@type button + local resizerButton = _G.CreateFrame("button", "$parentResizer", newHeader) + resizerButton:SetWidth(4) + resizerButton:SetFrameLevel(newHeader:GetFrameLevel()+2) + resizerButton:SetPoint("topright", newHeader, "topright", -1, 0) + resizerButton:SetPoint("bottomright", newHeader, "bottomright", -1, 0) + resizerButton:EnableMouse(true) + resizerButton:RegisterForClicks("LeftButtonDown", "LeftButtonUp") + newHeader.resizerButton = resizerButton + + resizerButton:SetScript("OnMouseDown", function() + newHeader.bIsRezising = true + print(1) + --newHeader:StartSizing("right") + end) + + resizerButton:SetScript("OnMouseUp", function() + newHeader.bIsRezising = false + print(2) + --newHeader:StopMovingOrSizing() + end) + + resizerButton.texture = resizerButton:CreateTexture(nil, "overlay") + resizerButton.texture:SetAllPoints() + resizerButton.texture:SetColorTexture(1, 1, 1, 1) + newHeader.Arrow:SetPoint("right", newHeader, "right", -1, 0) newHeader.Separator:Hide() @@ -5480,8 +5583,10 @@ local default_header_options = { line_separator_gap_align = false, } +---@return headerframe function detailsFramework:CreateHeader(parent, headerTable, options, frameName) - local newHeader = CreateFrame("frame", frameName or "$parentHeaderLine", parent, "BackdropTemplate") + ---@type headerframe + local newHeader = _G.CreateFrame("frame", frameName or "$parentHeaderLine", parent, "BackdropTemplate") detailsFramework:Mixin(newHeader, detailsFramework.OptionsFunctions) detailsFramework:Mixin(newHeader, detailsFramework.HeaderCoreFunctions) diff --git a/classes/class_custom.lua b/classes/class_custom.lua index 4e69681b..d47f1b9f 100644 --- a/classes/class_custom.lua +++ b/classes/class_custom.lua @@ -1748,7 +1748,7 @@ desc = Loc ["STRING_CUSTOM_MYSPELLS_DESC"], source = false, target = false, - script_version = 8, + script_version = 9, script = [[ --get the parameters passed local combat, instance_container, instance = ... diff --git a/classes/class_damage.lua b/classes/class_damage.lua index 5f5f501c..9e8b045b 100644 --- a/classes/class_damage.lua +++ b/classes/class_damage.lua @@ -5424,146 +5424,150 @@ function atributo_damage:MontaDetalhesDamageDone (spellId, spellLine, instance) local spellTable = spellTable local blockId = 6 - local thatRectangle66 = Details222.BreakdownWindow.GetBlockIndex(blockId) - thatRectangle66 = thatRectangle66:GetFrame() - --hide all textures created - if (thatRectangle66.ChartTextures) then - for i = 1, #thatRectangle66.ChartTextures do - thatRectangle66.ChartTextures[i]:Hide() - end - end + if false then --debug the stuff for the chart damage done in the 6th spellblock + --GetBlockIndex doesn't exists anymore + local thatRectangle66 = Details222.BreakdownWindow.GetBlockIndex(blockId) + thatRectangle66 = thatRectangle66:GetFrame() - local chartData = Details222.TimeCapture.GetChartDataFromSpell(spellTable) - if (chartData and instance) then - local width, height = thatRectangle66:GetSize() - --reset which texture is the next to be used - thatRectangle66.nextChartTextureId = 1 - - local amountOfTimeStamps = 12 - - if (not thatRectangle66.timeStamps) then - thatRectangle66.timeStamps = {} - for i = 1, amountOfTimeStamps do - thatRectangle66.timeStamps[i] = thatRectangle66:CreateFontString(nil, "overlay", "GameFontNormal") - thatRectangle66.timeStamps[i]:SetPoint("topleft", thatRectangle66, "topleft", 2 + (i - 1) * (width / amountOfTimeStamps), -2) - DetailsFramework:SetFontSize(thatRectangle66.timeStamps[i], 9) + --hide all textures created + if (thatRectangle66.ChartTextures) then + for i = 1, #thatRectangle66.ChartTextures do + thatRectangle66.ChartTextures[i]:Hide() end end - if (not thatRectangle66.bloodLustIndicators) then - thatRectangle66.bloodLustIndicators = {} - for i = 1, 5 do - local thisIndicator = thatRectangle66:CreateTexture(nil, "artwork", nil, 4) - thisIndicator:SetColorTexture(0.0980392, 0.0980392, 0.439216) - thatRectangle66.bloodLustIndicators[#thatRectangle66.bloodLustIndicators+1] = thisIndicator - end - end + local chartData = Details222.TimeCapture.GetChartDataFromSpell(spellTable) + if (chartData and instance) then + local width, height = thatRectangle66:GetSize() + --reset which texture is the next to be used + thatRectangle66.nextChartTextureId = 1 - for i = 1, #thatRectangle66.bloodLustIndicators do - thatRectangle66.bloodLustIndicators[i]:Hide() - end + local amountOfTimeStamps = 12 - if (not thatRectangle66.ChartTextures) then - thatRectangle66.ChartTextures = {} - function thatRectangle66:GetChartTexture() - local thisTexture = thatRectangle66.ChartTextures[thatRectangle66.nextChartTextureId] - if (not thisTexture) then - thisTexture = thatRectangle66:CreateTexture(nil, "artwork", nil, 5) - thisTexture:SetColorTexture(1, 1, 1, 0.65) - thatRectangle66.ChartTextures[thatRectangle66.nextChartTextureId] = thisTexture + if (not thatRectangle66.timeStamps) then + thatRectangle66.timeStamps = {} + for i = 1, amountOfTimeStamps do + thatRectangle66.timeStamps[i] = thatRectangle66:CreateFontString(nil, "overlay", "GameFontNormal") + thatRectangle66.timeStamps[i]:SetPoint("topleft", thatRectangle66, "topleft", 2 + (i - 1) * (width / amountOfTimeStamps), -2) + DetailsFramework:SetFontSize(thatRectangle66.timeStamps[i], 9) end - thatRectangle66.nextChartTextureId = thatRectangle66.nextChartTextureId + 1 - - return thisTexture end - end - --elapsed combat time - local combatObject = instance:GetShowingCombat() - local combatTime = math.floor(combatObject:GetCombatTime()) - thatRectangle66.timeStamps[1]:SetText(DetailsFramework:IntegerToTimer(0)) - for i = 2, #thatRectangle66.timeStamps do - local timePerSegment = combatTime / #thatRectangle66.timeStamps - thatRectangle66.timeStamps[i]:SetText(DetailsFramework:IntegerToTimer(i * timePerSegment)) - end - --compute the width oif each texture - local textureWidth = width / combatTime - --compute the max height of a texture can have - local maxValue = 0 - local numData = 0 - - --need to put the data in order FIRST - --each damage then need to be parsed - - local dataInOrder = {} - - local CONST_INDEX_TIMESTAMP = 1 - local CONST_INDEX_DAMAGEDONE = 2 - local CONST_INDEX_EVENTDAMAGE = 3 - - for timeStamp, value in pairs(chartData) do - dataInOrder[#dataInOrder+1] = {timeStamp, value} - dataInOrder[#dataInOrder+1] = {timeStamp, value} - dataInOrder[#dataInOrder+1] = {timeStamp, value} - numData = numData + 1 - end - - table.sort(dataInOrder, function(t1, t2) return t1[CONST_INDEX_TIMESTAMP] < t2[CONST_INDEX_TIMESTAMP] end) - local damageDoneByTime = dataInOrder - - --parser the damage done - local currentTotalDamage = 0 - - for i = 1, #damageDoneByTime do - local damageEvent = damageDoneByTime[i] - - local atTime = damageEvent[CONST_INDEX_TIMESTAMP] - local totalDamageUntilHere = damageEvent[CONST_INDEX_DAMAGEDONE] --raw damage - - local spellDamage = totalDamageUntilHere - currentTotalDamage - currentTotalDamage = currentTotalDamage + spellDamage - - damageEvent[CONST_INDEX_EVENTDAMAGE] = spellDamage - - maxValue = math.max(spellDamage, maxValue) - end - - --build the chart - for i = 1, #damageDoneByTime do - --for timeStamp, value in pairs(chartData) do --as it is pairs the data is scattered - local damageEvent = damageDoneByTime[i] - local timeStamp = damageEvent[CONST_INDEX_TIMESTAMP] - local damageDone = damageEvent[CONST_INDEX_EVENTDAMAGE] - - local thisTexture = thatRectangle66:GetChartTexture() - thisTexture:SetWidth(textureWidth) - - local texturePosition = textureWidth * timeStamp - - thisTexture:SetPoint("bottomleft", thatRectangle66, "bottomleft", 1 + texturePosition, 1) - - local percentFromPeak = damageDone / maxValue --normalized - thisTexture:SetHeight(math.min(percentFromPeak * height, height - 15)) - thisTexture:Show() - - --print("DEBUG", 7 , "Peak:", percentFromPeak, "position:", texturePosition, "damage done:", damageDone) --debug - end - - --show bloodlust indicators, member .bloodlust is not guarantted - if (combatObject.bloodlust) then - --bloodlust not being added into the combat object, probably a bug on Parser - local bloodlustDuration = 40 - for i = 1, #combatObject.bloodlust do - thatRectangle66.bloodLustIndicators[i]:Show() - thatRectangle66.bloodLustIndicators[i]:SetAlpha(0.46) - thatRectangle66.bloodLustIndicators[i]:SetSize(bloodlustDuration / combatTime * width, height - 2) - thatRectangle66.bloodLustIndicators[i]:SetPoint("bottomleft", thatRectangle66, "bottomleft", 0, 0) + if (not thatRectangle66.bloodLustIndicators) then + thatRectangle66.bloodLustIndicators = {} + for i = 1, 5 do + local thisIndicator = thatRectangle66:CreateTexture(nil, "artwork", nil, 4) + thisIndicator:SetColorTexture(0.0980392, 0.0980392, 0.439216) + thatRectangle66.bloodLustIndicators[#thatRectangle66.bloodLustIndicators+1] = thisIndicator + end end - end - DetailsBreakdownWindow_DetalheInfoBG_bg_end6:Hide() - thatRectangle66:SetShown(true) + for i = 1, #thatRectangle66.bloodLustIndicators do + thatRectangle66.bloodLustIndicators[i]:Hide() + end + + if (not thatRectangle66.ChartTextures) then + thatRectangle66.ChartTextures = {} + function thatRectangle66:GetChartTexture() + local thisTexture = thatRectangle66.ChartTextures[thatRectangle66.nextChartTextureId] + if (not thisTexture) then + thisTexture = thatRectangle66:CreateTexture(nil, "artwork", nil, 5) + thisTexture:SetColorTexture(1, 1, 1, 0.65) + thatRectangle66.ChartTextures[thatRectangle66.nextChartTextureId] = thisTexture + end + thatRectangle66.nextChartTextureId = thatRectangle66.nextChartTextureId + 1 + + return thisTexture + end + end + + --elapsed combat time + local combatObject = instance:GetShowingCombat() + local combatTime = math.floor(combatObject:GetCombatTime()) + thatRectangle66.timeStamps[1]:SetText(DetailsFramework:IntegerToTimer(0)) + for i = 2, #thatRectangle66.timeStamps do + local timePerSegment = combatTime / #thatRectangle66.timeStamps + thatRectangle66.timeStamps[i]:SetText(DetailsFramework:IntegerToTimer(i * timePerSegment)) + end + --compute the width oif each texture + local textureWidth = width / combatTime + --compute the max height of a texture can have + local maxValue = 0 + local numData = 0 + + --need to put the data in order FIRST + --each damage then need to be parsed + + local dataInOrder = {} + + local CONST_INDEX_TIMESTAMP = 1 + local CONST_INDEX_DAMAGEDONE = 2 + local CONST_INDEX_EVENTDAMAGE = 3 + + for timeStamp, value in pairs(chartData) do + dataInOrder[#dataInOrder+1] = {timeStamp, value} + dataInOrder[#dataInOrder+1] = {timeStamp, value} + dataInOrder[#dataInOrder+1] = {timeStamp, value} + numData = numData + 1 + end + + table.sort(dataInOrder, function(t1, t2) return t1[CONST_INDEX_TIMESTAMP] < t2[CONST_INDEX_TIMESTAMP] end) + local damageDoneByTime = dataInOrder + + --parser the damage done + local currentTotalDamage = 0 + + for i = 1, #damageDoneByTime do + local damageEvent = damageDoneByTime[i] + + local atTime = damageEvent[CONST_INDEX_TIMESTAMP] + local totalDamageUntilHere = damageEvent[CONST_INDEX_DAMAGEDONE] --raw damage + + local spellDamage = totalDamageUntilHere - currentTotalDamage + currentTotalDamage = currentTotalDamage + spellDamage + + damageEvent[CONST_INDEX_EVENTDAMAGE] = spellDamage + + maxValue = math.max(spellDamage, maxValue) + end + + --build the chart + for i = 1, #damageDoneByTime do + --for timeStamp, value in pairs(chartData) do --as it is pairs the data is scattered + local damageEvent = damageDoneByTime[i] + local timeStamp = damageEvent[CONST_INDEX_TIMESTAMP] + local damageDone = damageEvent[CONST_INDEX_EVENTDAMAGE] + + local thisTexture = thatRectangle66:GetChartTexture() + thisTexture:SetWidth(textureWidth) + + local texturePosition = textureWidth * timeStamp + + thisTexture:SetPoint("bottomleft", thatRectangle66, "bottomleft", 1 + texturePosition, 1) + + local percentFromPeak = damageDone / maxValue --normalized + thisTexture:SetHeight(math.min(percentFromPeak * height, height - 15)) + thisTexture:Show() + + --print("DEBUG", 7 , "Peak:", percentFromPeak, "position:", texturePosition, "damage done:", damageDone) --debug + end + + --show bloodlust indicators, member .bloodlust is not guarantted + if (combatObject.bloodlust) then + --bloodlust not being added into the combat object, probably a bug on Parser + local bloodlustDuration = 40 + for i = 1, #combatObject.bloodlust do + thatRectangle66.bloodLustIndicators[i]:Show() + thatRectangle66.bloodLustIndicators[i]:SetAlpha(0.46) + thatRectangle66.bloodLustIndicators[i]:SetSize(bloodlustDuration / combatTime * width, height - 2) + thatRectangle66.bloodLustIndicators[i]:SetPoint("bottomleft", thatRectangle66, "bottomleft", 0, 0) + end + end + + DetailsBreakdownWindow_DetalheInfoBG_bg_end6:Hide() + thatRectangle66:SetShown(true) + end end _table_sort(data, Details.Sort1) @@ -5573,9 +5577,8 @@ function atributo_damage:MontaDetalhesDamageDone (spellId, spellLine, instance) end for i = #data+2, 5 do - gump:HidaDetalheInfo (i) + gump:HidaDetalheInfo(i) end - end function Details:BuildPlayerDetailsSpellChart() @@ -5662,7 +5665,6 @@ function Details:BuildPlayerDetailsSpellChart() end function atributo_damage:MontaTooltipDamageTaken (thisLine, index) - local aggressor = info.instancia.showing [1]:PegarCombatente (_, thisLine.nome_inimigo) local container = aggressor.spells._ActorTable local habilidades = {} diff --git a/classes/class_instance.lua b/classes/class_instance.lua index e9a83eaa..197923ce 100644 --- a/classes/class_instance.lua +++ b/classes/class_instance.lua @@ -332,7 +332,7 @@ local instanceMixins = { --update player breakdown window if opened if (not bForceRefresh) then if (Details:IsBreakdownWindowOpen()) then - return Details:GetPlayerObjectFromBreakdownWindow():MontaInfo() + return Details:GetActorObjectFromBreakdownWindow():MontaInfo() end end end @@ -519,9 +519,9 @@ local instanceMixins = { Details:CloseBreakdownWindow() else ---@type actor - local actorObject = Details:GetPlayerObjectFromBreakdownWindow() + local actorObject = Details:GetActorObjectFromBreakdownWindow() if (actorObject) then - Details:OpenPlayerBreakdown(instance, actorObject, true) + Details:OpenBreakdownWindow(instance, actorObject, true) else Details:CloseBreakdownWindow() end @@ -2832,13 +2832,13 @@ function _detalhes:TrocaTabela(instance, segmentId, attributeId, subAttributeId, if (Details.playerDetailWindow:IsShown() and instance == Details.playerDetailWindow.instancia) then if (not instance.showing or instance.atributo > 4) then - Details:FechaJanelaInfo() + Details:CloseBreakdownWindow() else - local actor = instance.showing (instance.atributo, Details.playerDetailWindow.jogador.nome) - if (actor) then - instance:AbreJanelaInfo (actor, true) + local actorObject = instance.showing (instance.atributo, Details.playerDetailWindow.jogador.nome) + if (actorObject) then + Details:OpenBreakdownWindow(instance, actorObject, true) else - Details:FechaJanelaInfo() + Details:CloseBreakdownWindow() end end end diff --git a/classes/container_segments.lua b/classes/container_segments.lua index f38e9caf..b04b6648 100644 --- a/classes/container_segments.lua +++ b/classes/container_segments.lua @@ -451,7 +451,7 @@ function segmentClass:resetar_overall() -- _detalhes.schedule_remove_overall = true --else --fecha a janela de informa��es do jogador - Details:FechaJanelaInfo() + Details:CloseBreakdownWindow() Details.tabela_overall = combatClass:NovaTabela() @@ -498,7 +498,7 @@ function segmentClass:resetar() --_detalhes.schedule_remove_overall = nil --fecha a janela de informa��es do jogador - Details:FechaJanelaInfo() + Details:CloseBreakdownWindow() --empty temporary tables Details.atributo_damage:ClearTempTables() diff --git a/core/parser.lua b/core/parser.lua index 1abc7730..003f18f9 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -5827,10 +5827,10 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _detalhes.logoff_saving_data = true --close info window - if (_detalhes.FechaJanelaInfo) then + if (_detalhes.CloseBreakdownWindow) then tinsert(_detalhes_global.exit_log, "1 - Closing Janela Info.") currentStep = "Fecha Janela Info" - xpcall(_detalhes.FechaJanelaInfo, saver_error) + xpcall(_detalhes.CloseBreakdownWindow, saver_error) end --do not save window pos diff --git a/frames/window_main.lua b/frames/window_main.lua index 4e4db787..b27d6355 100644 --- a/frames/window_main.lua +++ b/frames/window_main.lua @@ -1950,19 +1950,22 @@ local lineScript_Onmousedown = function(self, button) end local lineScript_Onmouseup = function(self, button) - local is_shift_down = _IsShiftKeyDown() - local is_control_down = _IsControlKeyDown() + local bIsShiftDown = _IsShiftKeyDown() + local bIsControlDown = _IsControlKeyDown() - if (self._instance.baseframe.isMoving) then - move_janela(self._instance.baseframe, false, self._instance) - self._instance:SaveMainWindowPosition() + ---@type instance + local instanceObject = self._instance - if (self._instance:MontaTooltip(self, self.row_id)) then + if (instanceObject.baseframe.isMoving) then + move_janela(instanceObject.baseframe, false, instanceObject) + instanceObject:SaveMainWindowPosition() + + if (instanceObject:MontaTooltip(self, self.row_id)) then GameCooltip:Show (self, 1) end end - self._instance:HandleTextsOnMouseClick (self, "up") + instanceObject:HandleTextsOnMouseClick (self, "up") local x, y = _GetCursorPosition() x = floor(x) @@ -1970,14 +1973,14 @@ local lineScript_Onmouseup = function(self, button) if (self.mouse_down and (self.mouse_down+0.4 > GetTime() and (x == self.x and y == self.y)) or (x == self.x and y == self.y)) then if (self.button == "LeftButton" or self.button == "MiddleButton") then - if (self._instance.atributo == 5 or is_shift_down) then + if (instanceObject.atributo == 5 or bIsShiftDown) then --report - if (self._instance.atributo == 5 and is_shift_down) then - local custom = self._instance:GetCustomObject() + if (instanceObject.atributo == 5 and bIsShiftDown) then + local custom = instanceObject:GetCustomObject() if (custom and custom.on_shift_click) then - local func = loadstring (custom.on_shift_click) + local func = loadstring(custom.on_shift_click) if (func) then - local successful, errortext = pcall(func, self, self.minha_tabela, self._instance) + local successful, errortext = pcall(func, self, self.minha_tabela, instanceObject) if (not successful) then Details:Msg("error occurred custom script shift+click:", errortext) end @@ -1986,18 +1989,18 @@ local lineScript_Onmouseup = function(self, button) end end - if (Details.row_singleclick_overwrite [self._instance.atributo] and type(Details.row_singleclick_overwrite [self._instance.atributo][self._instance.sub_atributo]) == "function") then - return Details.row_singleclick_overwrite [self._instance.atributo][self._instance.sub_atributo] (_, self.minha_tabela, self._instance, is_shift_down, is_control_down) + if (Details.row_singleclick_overwrite [instanceObject.atributo] and type(Details.row_singleclick_overwrite [instanceObject.atributo][instanceObject.sub_atributo]) == "function") then + return Details.row_singleclick_overwrite [instanceObject.atributo][instanceObject.sub_atributo] (_, self.minha_tabela, instanceObject, bIsShiftDown, bIsControlDown) end - return Details:ReportSingleLine (self._instance, self) + return Details:ReportSingleLine (instanceObject, self) end if (not self.minha_tabela) then return Details:Msg("this bar is waiting update.") end - self._instance:AbreJanelaInfo (self.minha_tabela, nil, nil, is_shift_down, is_control_down) + Details:OpenBreakdownWindow(instanceObject, self.minha_tabela, nil, nil, bIsShiftDown, bIsControlDown) end end end diff --git a/frames/window_playerbreakdown.lua b/frames/window_playerbreakdown.lua index 16b140ab..f4b35708 100644 --- a/frames/window_playerbreakdown.lua +++ b/frames/window_playerbreakdown.lua @@ -1,9 +1,9 @@ -local _detalhes = _G._detalhes -local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) -local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0") +local Details = _G.Details +local Loc = _G.LibStub("AceLocale-3.0"):GetLocale ( "Details" ) +local SharedMedia = _G.LibStub:GetLibrary("LibSharedMedia-3.0") -local gump = _detalhes.gump +local gump = Details.gump local _ local addonName, Details222 = ... @@ -11,72 +11,34 @@ local addonName, Details222 = ... local ipairs = ipairs local pairs = pairs local type = type -local unpack = unpack +local unpack = _G.unpack --api locals -local CreateFrame = CreateFrame -local GetTime = GetTime -local _GetSpellInfo = _detalhes.getspellinfo -local _GetCursorPosition = GetCursorPosition -local GameTooltip = GameTooltip - -local sub_atributos = _detalhes.sub_atributos -local info = _detalhes.playerDetailWindow -local breakdownWindow = info -local container3_bars_pointFunc +local CreateFrame = _G.CreateFrame +local subAttributes = Details.sub_atributos +local breakdownWindow = Details.playerDetailWindow local SummaryWidgets = {} local CurrentTab = "Summary" -local CONST_BAR_HEIGHT = 20 -local CONST_TARGET_HEIGHT = 18 - local PLAYER_DETAILS_WINDOW_WIDTH = 890 local PLAYER_DETAILS_WINDOW_HEIGHT = 574 - local PLAYER_DETAILS_STATUSBAR_HEIGHT = 20 local PLAYER_DETAILS_STATUSBAR_ALPHA = 1 -local containerSettings = { - spells = { - width = 419, - height = 290, - point = {"TOPLEFT", breakdownWindow, "TOPLEFT", 2, -76}, - scrollHeight = 264, - }, - targets = { - width = 418, - height = 150, - point = {"BOTTOMLEFT", breakdownWindow, "BOTTOMLEFT", 2, 6 + PLAYER_DETAILS_STATUSBAR_HEIGHT}, - }, -} - -local spellInfoSettings = { - width = 430, - amount = 6, -} - -_detalhes.player_details_tabs = {} -info.currentTabsInUse = {} +Details.player_details_tabs = {} +breakdownWindow.currentTabsInUse = {} ------------------------------------------------------------------------------------------------------------------------------ --self = instancia --jogador = classe_damage ou classe_heal -do - local gradientStartColor = Details222.ColorScheme.GetColorFor("gradient-background") - local gradientUp = DetailsFramework:CreateTexture(info, {gradient = "vertical", fromColor = "transparent", toColor = gradientStartColor}, 1, 300, "artwork", {0, 1, 0, 1}) - gradientUp:SetPoint("tops", 1, 1) - local gradientDown = DetailsFramework:CreateTexture(info, {gradient = "vertical", fromColor = gradientStartColor, toColor = "transparent"}, 1, 50, "artwork", {0, 1, 0, 1}) - gradientDown:SetPoint("bottoms") -end - function Details:GetBreakdownTabsInUse() - return info.currentTabsInUse + return breakdownWindow.currentTabsInUse end function Details:GetBreakdownTabByName(tabName, tablePool) - tablePool = tablePool or _detalhes.player_details_tabs + tablePool = tablePool or Details.player_details_tabs for index = 1, #tablePool do local tab = tablePool[index] if (tab.tabname == tabName) then @@ -87,22 +49,22 @@ end --return the combat being used to show the data in the opened breakdown window function Details:GetCombatFromBreakdownWindow() - return info.instancia and info.instancia.showing + return breakdownWindow.instancia and breakdownWindow.instancia.showing end --return the window that requested to open the player breakdown window function Details:GetActiveWindowFromBreakdownWindow() - return info.instancia + return breakdownWindow.instancia end --return if the breakdown window is showing damage or heal function Details:GetDisplayTypeFromBreakdownWindow() - return info.atributo, info.sub_atributo + return breakdownWindow.atributo, breakdownWindow.sub_atributo end --return the actor object in use by the breakdown window -function Details:GetPlayerObjectFromBreakdownWindow() - return info.jogador +function Details:GetActorObjectFromBreakdownWindow() + return breakdownWindow.jogador end function Details:GetBreakdownWindow() @@ -110,282 +72,160 @@ function Details:GetBreakdownWindow() end function Details:IsBreakdownWindowOpen() - return info.ativo + return breakdownWindow.ativo end -function Details222.PlayerBreakdown.StartMoving() - breakdownWindow:StartMoving() - breakdownWindow.bIsMoving = true -end - -function Details222.PlayerBreakdown.StopMoving() - if (breakdownWindow.bIsMoving) then - breakdownWindow:StopMovingOrSizing() - breakdownWindow.bIsMoving = false - end -end - -function Details222.PlayerBreakdown.OnMouseDown(frameClicked, button) - if (button == "LeftButton" and not breakdownWindow.bIsMoving) then - breakdownWindow.latestFrameClicked = frameClicked - Details222.PlayerBreakdown.StartMoving() - - elseif (button == "RightButton" and not breakdownWindow.bIsMoving) then - Details:CloseBreakdownWindow() - end -end - -function Details222.PlayerBreakdown.OnMouseUp(button) - if (button == "LeftButton" and breakdownWindow.bIsMoving) then - Details222.PlayerBreakdown.StopMoving() - end -end - ---english alias ---window object from Details:GetWindow(n) and playerObject from Details:GetPlayer(playerName, attribute) -function Details:OpenPlayerBreakdown(windowObject, playerObject, from_att_change) --windowObject = instanceObject - windowObject:AbreJanelaInfo(playerObject, from_att_change) -end - -function _detalhes:AbreJanelaInfo (jogador, from_att_change, refresh, ShiftKeyDown, ControlKeyDown) +---open the breakdown window +---@param self details +---@param instanceObject instance +---@param actorObject actor +---@param bFromAttributeChange boolean|nil +---@param bIsRefresh boolean|nil +---@param bIsShiftKeyDown boolean|nil +---@param bIsControlKeyDown boolean|nil +function Details:OpenBreakdownWindow(instanceObject, actorObject, bFromAttributeChange, bIsRefresh, bIsShiftKeyDown, bIsControlKeyDown) --create the player list frame in the left side of the window Details.PlayerBreakdown.CreatePlayerListFrame() - if (not _detalhes.row_singleclick_overwrite [self.atributo] or not _detalhes.row_singleclick_overwrite [self.atributo][self.sub_atributo]) then - _detalhes:FechaJanelaInfo() + if (not Details.row_singleclick_overwrite[instanceObject.atributo] or not Details.row_singleclick_overwrite[instanceObject.atributo][instanceObject.sub_atributo]) then + Details:CloseBreakdownWindow() return - elseif (type(_detalhes.row_singleclick_overwrite [self.atributo][self.sub_atributo]) == "function") then - if (from_att_change) then - _detalhes:FechaJanelaInfo() + elseif (type(Details.row_singleclick_overwrite[instanceObject.atributo][instanceObject.sub_atributo]) == "function") then + if (bFromAttributeChange) then + Details:CloseBreakdownWindow() return end - return _detalhes.row_singleclick_overwrite [self.atributo][self.sub_atributo] (_, jogador, self, ShiftKeyDown, ControlKeyDown) + return Details.row_singleclick_overwrite[instanceObject.atributo][instanceObject.sub_atributo](_, actorObject, instanceObject, bIsShiftKeyDown, bIsControlKeyDown) end - if (self.modo == _detalhes._detalhes_props["MODO_RAID"]) then - _detalhes:FechaJanelaInfo() + if (instanceObject:GetMode() == DETAILS_MODE_RAID) then + Details:CloseBreakdownWindow() return end - if (not breakdownWindow.registeredLibWindow) then - local LibWindow = LibStub("LibWindow-1.1") - breakdownWindow.registeredLibWindow = true - if (LibWindow) then - breakdownWindow.libWindowTable = breakdownWindow.libWindowTable or {} - LibWindow.RegisterConfig(breakdownWindow, breakdownWindow.libWindowTable) - LibWindow.RestorePosition(breakdownWindow) - LibWindow.MakeDraggable(breakdownWindow) - LibWindow.SavePosition(breakdownWindow) - else - breakdownWindow:SetScript("OnMouseDown", function(self, button) - Details222.PlayerBreakdown.OnMouseDown(button) - end) - breakdownWindow:SetScript("OnMouseUp", function(self, button) - Details222.PlayerBreakdown.OnMouseUp(button) - end) - end - end - - ---@type function - local onEventFunction = breakdownWindow:GetScript("OnEvent") - - if (not onEventFunction) then - ---this is a workaround of an issue when a frame calls StartMoving() on the parent, many times the child doesn't receive the OnMouseUp event - ---@param breakdownWindow frame - ---@param event string - ---@param button string - breakdownWindow:SetScript("OnEvent", function(breakdownWindow, event, button) - if (breakdownWindow.bIsMoving and breakdownWindow.latestFrameClicked) then - Details222.PlayerBreakdown.StopMoving() - local OnMouseUp = breakdownWindow.latestFrameClicked:GetScript("OnMouseUp") - if (OnMouseUp) then - OnMouseUp(breakdownWindow.latestFrameClicked, button) - end - breakdownWindow.latestFrameClicked = nil - end - end) - breakdownWindow:RegisterEvent("GLOBAL_MOUSE_UP") - end - - --_detalhes.info_jogador armazena o jogador que esta sendo mostrado na janela de detalhes - if (info.jogador and info.jogador == jogador and self and info.atributo and self.atributo == info.atributo and self.sub_atributo == info.sub_atributo and not refresh) then - _detalhes:FechaJanelaInfo() --se clicou na mesma barra ent�o fecha a janela de detalhes + --Details.info_jogador armazena o jogador que esta sendo mostrado na janela de detalhes + if (breakdownWindow.jogador and breakdownWindow.jogador == actorObject and instanceObject and breakdownWindow.atributo and instanceObject.atributo == breakdownWindow.atributo and instanceObject.sub_atributo == breakdownWindow.sub_atributo and not bIsRefresh) then + Details:CloseBreakdownWindow() --se clicou na mesma barra ent�o fecha a janela de detalhes return - elseif (not jogador) then - _detalhes:FechaJanelaInfo() + + elseif (not actorObject) then + Details:CloseBreakdownWindow() return end - if (info.barras1) then - for index, barra in ipairs(info.barras1) do - barra.other_actor = nil - end - end - - if (info.barras2) then - for index, barra in ipairs(info.barras2) do - barra.icone:SetTexture("") - barra.icone:SetTexCoord(0, 1, 0, 1) - end - end - - if (not info.bHasInitialized) then - local infoNumPoints = info:GetNumPoints() + if (not breakdownWindow.bHasInitialized) then + local infoNumPoints = breakdownWindow:GetNumPoints() for i = 1, infoNumPoints do - local point1, anchorObject, point2, x, y = info:GetPoint(i) + local point1, anchorObject, point2, x, y = breakdownWindow:GetPoint(i) if (not anchorObject) then - info:ClearAllPoints() + breakdownWindow:ClearAllPoints() end end - info:SetUserPlaced(false) - info:SetDontSavePosition(true) + breakdownWindow:SetUserPlaced(false) + breakdownWindow:SetDontSavePosition(true) local okay, errorText = pcall(function() - info:SetPoint("center", _G.UIParent, "center", 0, 0) + breakdownWindow:SetPoint("center", _G.UIParent, "center", 0, 0) end) if (not okay) then - info:ClearAllPoints() - info:SetPoint("center", _G.UIParent, "center", 0, 0) + breakdownWindow:ClearAllPoints() + breakdownWindow:SetPoint("center", _G.UIParent, "center", 0, 0) end - info.bHasInitialized = true + breakdownWindow.bHasInitialized = true end - if (not info.RightSideBar) then - info.RightSideBar = CreateFrame("frame", nil, info, "BackdropTemplate") - info.RightSideBar:SetWidth(20) - info.RightSideBar:SetPoint("topleft", info, "topright", 1, 0) - info.RightSideBar:SetPoint("bottomleft", info, "bottomright", 1, 0) - local rightSideBarAlpha = 0.75 - - DetailsFramework:ApplyStandardBackdrop(info.RightSideBar) - - local toggleMergePlayerSpells = function() - Details.merge_player_abilities = not Details.merge_player_abilities - local playerObject = Details:GetPlayerObjectFromBreakdownWindow() - local instanceObject = Details:GetActiveWindowFromBreakdownWindow() - Details:OpenPlayerBreakdown(instanceObject, playerObject) --toggle - Details:OpenPlayerBreakdown(instanceObject, playerObject) - end - local mergePlayerSpellsCheckbox = DetailsFramework:CreateSwitch(info, toggleMergePlayerSpells, Details.merge_player_abilities, _, _, _, _, _, _, _, _, _, _, DetailsFramework:GetTemplate("switch", "OPTIONS_CHECKBOX_BRIGHT_TEMPLATE")) - mergePlayerSpellsCheckbox:SetAsCheckBox() - mergePlayerSpellsCheckbox:SetPoint("bottom", info.RightSideBar, "bottom", 0, 2) - - local mergePlayerSpellsLabel = info.RightSideBar:CreateFontString(nil, "overlay", "GameFontNormal") - mergePlayerSpellsLabel:SetText("Merge Player Spells") - DetailsFramework:SetFontRotation(mergePlayerSpellsLabel, 90) - mergePlayerSpellsLabel:SetPoint("center", mergePlayerSpellsCheckbox.widget, "center", -6, mergePlayerSpellsCheckbox:GetHeight()/2 + mergePlayerSpellsLabel:GetStringWidth() / 2) - - -- - - local toggleMergePetSpells = function() - Details.merge_pet_abilities = not Details.merge_pet_abilities - local playerObject = Details:GetPlayerObjectFromBreakdownWindow() - local instanceObject = Details:GetActiveWindowFromBreakdownWindow() - Details:OpenPlayerBreakdown(instanceObject, playerObject) --toggle - Details:OpenPlayerBreakdown(instanceObject, playerObject) - end - local mergePetSpellsCheckbox = DetailsFramework:CreateSwitch(info, toggleMergePetSpells, Details.merge_pet_abilities, _, _, _, _, _, _, _, _, _, _, DetailsFramework:GetTemplate("switch", "OPTIONS_CHECKBOX_BRIGHT_TEMPLATE")) - mergePetSpellsCheckbox:SetAsCheckBox(true) - mergePetSpellsCheckbox:SetPoint("bottom", info.RightSideBar, "bottom", 0, 160) - - local mergePetSpellsLabel = info.RightSideBar:CreateFontString(nil, "overlay", "GameFontNormal") - mergePetSpellsLabel:SetText("Merge Pet Spells") - DetailsFramework:SetFontRotation(mergePetSpellsLabel, 90) - mergePetSpellsLabel:SetPoint("center", mergePetSpellsCheckbox.widget, "center", -6, mergePetSpellsCheckbox:GetHeight()/2 + mergePetSpellsLabel:GetStringWidth() / 2) - - mergePlayerSpellsCheckbox:SetAlpha(rightSideBarAlpha) - mergePlayerSpellsLabel:SetAlpha(rightSideBarAlpha) - mergePetSpellsCheckbox:SetAlpha(rightSideBarAlpha) - mergePetSpellsLabel:SetAlpha(rightSideBarAlpha) + if (not breakdownWindow.RightSideBar) then + breakdownWindow:CreateRightSideBar() end - info.ativo = true --sinaliza o addon que a janela esta aberta - info.atributo = self.atributo --instancia.atributo -> grava o atributo (damage, heal, etc) - info.sub_atributo = self.sub_atributo --instancia.sub_atributo -> grava o sub atributo (damage done, dps, damage taken, etc) - info.jogador = jogador --de qual jogador (objeto classe_damage) - info.instancia = self --salva a refer�ncia da inst�ncia que pediu o info - info.target_text = Loc ["STRING_TARGETS"] .. ":" - info.target_member = "total" - info.target_persecond = false + breakdownWindow.ativo = true --sinaliza o addon que a janela esta aberta + breakdownWindow.atributo = instanceObject.atributo --instancia.atributo -> grava o atributo (damage, heal, etc) + breakdownWindow.sub_atributo = instanceObject.sub_atributo --instancia.sub_atributo -> grava o sub atributo (damage done, dps, damage taken, etc) + breakdownWindow.jogador = actorObject --de qual jogador (objeto classe_damage) + breakdownWindow.instancia = instanceObject --salva a refer�ncia da inst�ncia que pediu o breakdownWindow + breakdownWindow.target_text = Loc ["STRING_TARGETS"] .. ":" + breakdownWindow.target_member = "total" + breakdownWindow.target_persecond = false - info.mostrando = nil + breakdownWindow.mostrando = nil - local nome = info.jogador.nome --nome do jogador - local atributo_nome = sub_atributos[info.atributo].lista [info.sub_atributo] .. " " .. Loc ["STRING_ACTORFRAME_REPORTOF"] --// nome do atributo // precisa ser o sub atributo correto??? + local nome = breakdownWindow.jogador.nome --nome do jogador + local atributo_nome = subAttributes[breakdownWindow.atributo].lista [breakdownWindow.sub_atributo] .. " " .. Loc ["STRING_ACTORFRAME_REPORTOF"] --// nome do atributo // precisa ser o sub atributo correto??? --removendo o nome da realm do jogador if (nome:find("-")) then nome = nome:gsub(("-.*"), "") end - if (info.instancia.atributo == 1 and info.instancia.sub_atributo == 6) then --enemy - atributo_nome = sub_atributos [info.atributo].lista [1] .. " " .. Loc ["STRING_ACTORFRAME_REPORTOF"] + if (breakdownWindow.instancia.atributo == 1 and breakdownWindow.instancia.sub_atributo == 6) then --enemy + atributo_nome = subAttributes [breakdownWindow.atributo].lista [1] .. " " .. Loc ["STRING_ACTORFRAME_REPORTOF"] end - info.nome:SetText(nome) - info.atributo_nome:SetText(atributo_nome) + breakdownWindow.actorName:SetText(nome) --found it + breakdownWindow.attributeName:SetText(atributo_nome) - local serial = jogador.serial + local serial = actorObject.serial local avatar if (serial ~= "") then avatar = NickTag:GetNicknameTable (serial) end if (avatar and avatar [1]) then - info.nome:SetText((not _detalhes.ignore_nicktag and avatar [1]) or nome) + breakdownWindow.actorName:SetText((not Details.ignore_nicktag and avatar [1]) or nome) end if (avatar and avatar [2]) then - info.avatar:SetTexture(avatar [2]) - info.avatar_bg:SetTexture(avatar [4]) + breakdownWindow.avatar:SetTexture(avatar [2]) + breakdownWindow.avatar_bg:SetTexture(avatar [4]) if (avatar [5]) then - info.avatar_bg:SetTexCoord(unpack(avatar [5])) + breakdownWindow.avatar_bg:SetTexCoord(unpack(avatar [5])) end if (avatar [6]) then - info.avatar_bg:SetVertexColor(unpack(avatar [6])) + breakdownWindow.avatar_bg:SetVertexColor(unpack(avatar [6])) end - info.avatar_nick:SetText(avatar [1] or nome) - info.avatar_attribute:SetText(atributo_nome) + breakdownWindow.avatar_nick:SetText(avatar [1] or nome) + breakdownWindow.avatar_attribute:SetText(atributo_nome) - info.avatar_attribute:SetPoint("CENTER", info.avatar_nick, "CENTER", 0, 14) - info.avatar:Show() - info.avatar_bg:Show() - info.avatar_bg:SetAlpha(.65) - info.avatar_nick:Show() - info.avatar_attribute:Show() - info.nome:Hide() - info.atributo_nome:Hide() + breakdownWindow.avatar_attribute:SetPoint("CENTER", breakdownWindow.avatar_nick, "CENTER", 0, 14) + breakdownWindow.avatar:Show() + breakdownWindow.avatar_bg:Show() + breakdownWindow.avatar_bg:SetAlpha(.65) + breakdownWindow.avatar_nick:Show() + breakdownWindow.avatar_attribute:Show() + breakdownWindow.actorName:Hide() + breakdownWindow.attributeName:Hide() else - info.avatar:Hide() - info.avatar_bg:Hide() - info.avatar_nick:Hide() - info.avatar_attribute:Hide() + breakdownWindow.avatar:Hide() + breakdownWindow.avatar_bg:Hide() + breakdownWindow.avatar_nick:Hide() + breakdownWindow.avatar_attribute:Hide() - info.nome:Show() - info.atributo_nome:Show() + breakdownWindow.actorName:Show() + breakdownWindow.attributeName:Show() end - info.atributo_nome:SetPoint("CENTER", info.nome, "CENTER", 0, 14) + breakdownWindow.attributeName:SetPoint("CENTER", breakdownWindow.actorName, "CENTER", 0, 14) --need a way to comunicate with the main tab showing spells --need to send a signal to reset its contents and prepare for a new player - --spellsTab.ResetBars() + --spellsTab.ResetBars() --to be implemented - local classe = jogador.classe + ---@type string + local actorClass = actorObject.classe - if (not classe) then - classe = "monster" + if (not actorClass) then + actorClass = "monster" end - info.classe_icone:SetTexture("Interface\\AddOns\\Details\\images\\classes") --top left - info.SetClassIcon (jogador, classe) + breakdownWindow.classIcon:SetTexture("Interface\\AddOns\\Details\\images\\classes") --top left + breakdownWindow.SetClassIcon(actorObject, actorClass) - Details.FadeHandler.Fader(info, 0) + Details.FadeHandler.Fader(breakdownWindow, 0) Details:UpdateBreakdownPlayerList() Details:InitializeAurasTab() Details:InitializeCompareTab() @@ -395,10 +235,10 @@ function _detalhes:AbreJanelaInfo (jogador, from_att_change, refresh, ShiftKeyDo local tabsReplaced = {} local tabReplacedAmount = 0 - table.wipe(info.currentTabsInUse) + table.wipe(breakdownWindow.currentTabsInUse) - for index = 1, #_detalhes.player_details_tabs do - local tab = _detalhes.player_details_tabs[index] + for index = 1, #Details.player_details_tabs do + local tab = Details.player_details_tabs[index] tab.replaced = nil tabsShown[#tabsShown+1] = tab end @@ -409,8 +249,8 @@ function _detalhes:AbreJanelaInfo (jogador, from_att_change, refresh, ShiftKeyDo if (tab.replaces) then local attributeList = tab.replaces.attributes - if (attributeList[info.atributo]) then - if (attributeList[info.atributo][info.sub_atributo]) then + if (attributeList[breakdownWindow.atributo]) then + if (attributeList[breakdownWindow.atributo][breakdownWindow.sub_atributo]) then local tabReplaced, tabIndex = Details:GetBreakdownTabByName(tab.replaces.tabNameToReplace, tabsShown) if (tabReplaced and tabIndex < index) then tabReplaced:Hide() @@ -419,8 +259,8 @@ function _detalhes:AbreJanelaInfo (jogador, from_att_change, refresh, ShiftKeyDo tremove(tabsShown, tabIndex) tinsert(tabsShown, tabIndex, tab) - if (tabReplaced.tabname == info.selectedTab) then - info.selectedTab = tab.tabname + if (tabReplaced.tabname == breakdownWindow.selectedTab) then + breakdownWindow.selectedTab = tab.tabname end tabReplaced.replaced = true @@ -442,20 +282,20 @@ function _detalhes:AbreJanelaInfo (jogador, from_att_change, refresh, ShiftKeyDo end tabsShown = newTabsShown - info.currentTabsInUse = newTabsShown + breakdownWindow.currentTabsInUse = newTabsShown - info:ShowTabs() + breakdownWindow:ShowTabs() Details222.BreakdownWindow.CurrentDefaultTab = nil local shownTab for index = 1, #tabsShown do local tabButton = tabsShown[index] - if (tabButton:condition(info.jogador, info.atributo, info.sub_atributo)) then + if (tabButton:condition(breakdownWindow.jogador, breakdownWindow.atributo, breakdownWindow.sub_atributo)) then if (tabButton.IsDefaultTab) then Details222.BreakdownWindow.CurrentDefaultTab = tabButton end - if (info.selectedTab == tabButton.tabname) then + if (breakdownWindow.selectedTab == tabButton.tabname) then tabButton:DoClick() tabButton:OnShowFunc() shownTab = tabButton @@ -466,34 +306,78 @@ function _detalhes:AbreJanelaInfo (jogador, from_att_change, refresh, ShiftKeyDo if (shownTab) then shownTab:Click() end -end --end of "AbreJanelaInfo()" - - ---alias -function Details:CloseBreakdownWindow(bFromEscape) - return _detalhes:FechaJanelaInfo(bFromEscape) end -function _detalhes:FechaJanelaInfo(fromEscape) - if (info.ativo) then +function Details:CloseBreakdownWindow(fromEscape) + if (breakdownWindow.ativo) then if (fromEscape) then - Details.FadeHandler.Fader(info, "in") + Details.FadeHandler.Fader(breakdownWindow, "in") else - Details.FadeHandler.Fader(info, 1) + Details.FadeHandler.Fader(breakdownWindow, 1) end - info.ativo = false --sinaliza o addon que a janela esta agora fechada + breakdownWindow.ativo = false --sinaliza o addon que a janela esta agora fechada - --_detalhes.info_jogador.detalhes = nil - info.jogador = nil - info.atributo = nil - info.sub_atributo = nil - info.instancia = nil + --Details.info_jogador.detalhes = nil + breakdownWindow.jogador = nil + breakdownWindow.atributo = nil + breakdownWindow.sub_atributo = nil + breakdownWindow.instancia = nil - info.nome:SetText("") - info.atributo_nome:SetText("") + breakdownWindow.actorName:SetText("") + breakdownWindow.attributeName:SetText("") end end +function breakdownWindow:CreateRightSideBar() + breakdownWindow.RightSideBar = CreateFrame("frame", nil, breakdownWindow, "BackdropTemplate") + breakdownWindow.RightSideBar:SetWidth(20) + breakdownWindow.RightSideBar:SetPoint("topleft", breakdownWindow, "topright", 1, 0) + breakdownWindow.RightSideBar:SetPoint("bottomleft", breakdownWindow, "bottomright", 1, 0) + local rightSideBarAlpha = 0.75 + + DetailsFramework:ApplyStandardBackdrop(breakdownWindow.RightSideBar) + + local toggleMergePlayerSpells = function() + Details.merge_player_abilities = not Details.merge_player_abilities + local playerObject = Details:GetActorObjectFromBreakdownWindow() + local instanceObject = Details:GetActiveWindowFromBreakdownWindow() + Details:OpenBreakdownWindow(instanceObject, playerObject) --toggle + Details:OpenBreakdownWindow(instanceObject, playerObject) + end + + local mergePlayerSpellsCheckbox = DetailsFramework:CreateSwitch(breakdownWindow, toggleMergePlayerSpells, Details.merge_player_abilities, _, _, _, _, _, _, _, _, _, _, DetailsFramework:GetTemplate("switch", "OPTIONS_CHECKBOX_BRIGHT_TEMPLATE")) + mergePlayerSpellsCheckbox:SetAsCheckBox() + mergePlayerSpellsCheckbox:SetPoint("bottom", breakdownWindow.RightSideBar, "bottom", 0, 2) + + local mergePlayerSpellsLabel = breakdownWindow.RightSideBar:CreateFontString(nil, "overlay", "GameFontNormal") + mergePlayerSpellsLabel:SetText("Merge Player Spells") + DetailsFramework:SetFontRotation(mergePlayerSpellsLabel, 90) + mergePlayerSpellsLabel:SetPoint("center", mergePlayerSpellsCheckbox.widget, "center", -6, mergePlayerSpellsCheckbox:GetHeight()/2 + mergePlayerSpellsLabel:GetStringWidth() / 2) + + -- + + local toggleMergePetSpells = function() + Details.merge_pet_abilities = not Details.merge_pet_abilities + local playerObject = Details:GetActorObjectFromBreakdownWindow() + local instanceObject = Details:GetActiveWindowFromBreakdownWindow() + Details:OpenBreakdownWindow(instanceObject, playerObject) --toggle + Details:OpenBreakdownWindow(instanceObject, playerObject) + end + local mergePetSpellsCheckbox = DetailsFramework:CreateSwitch(breakdownWindow, toggleMergePetSpells, Details.merge_pet_abilities, _, _, _, _, _, _, _, _, _, _, DetailsFramework:GetTemplate("switch", "OPTIONS_CHECKBOX_BRIGHT_TEMPLATE")) + mergePetSpellsCheckbox:SetAsCheckBox(true) + mergePetSpellsCheckbox:SetPoint("bottom", breakdownWindow.RightSideBar, "bottom", 0, 160) + + local mergePetSpellsLabel = breakdownWindow.RightSideBar:CreateFontString(nil, "overlay", "GameFontNormal") + mergePetSpellsLabel:SetText("Merge Pet Spells") + DetailsFramework:SetFontRotation(mergePetSpellsLabel, 90) + mergePetSpellsLabel:SetPoint("center", mergePetSpellsCheckbox.widget, "center", -6, mergePetSpellsCheckbox:GetHeight()/2 + mergePetSpellsLabel:GetStringWidth() / 2) + + mergePlayerSpellsCheckbox:SetAlpha(rightSideBarAlpha) + mergePlayerSpellsLabel:SetAlpha(rightSideBarAlpha) + mergePetSpellsCheckbox:SetAlpha(rightSideBarAlpha) + mergePetSpellsLabel:SetAlpha(rightSideBarAlpha) +end + ---@type {[number]: boolean} Details222.BreakdownWindow.ExpandedSpells = {} @@ -511,12 +395,6 @@ function Details222.BreakdownWindow.IsSpellExpanded(spellID) return Details222.BreakdownWindow.ExpandedSpells[spellID] end ---determina qual a pocis�o que a barra de detalhes vai ocupar ------------------------------------------------------------------------------------------------------------------------------- ---namespace -function Details222.BreakdownWindow.GetBlockIndex(index) --getting the infomation from the new spells tab, this will be depreccated soon - return Details.playerDetailWindow.grupos_detalhes[index] -end ---receives spell data to show in the summary tab ---@param data table @@ -534,576 +412,129 @@ function Details222.BreakdownWindow.SendSpellData(data, actorObject, combatObjec end end ---cria os textos em geral da janela info -function breakdownWindow.CreateTexts(SWW) - breakdownWindow.nome = breakdownWindow:CreateFontString(nil, "OVERLAY", "QuestFont_Large") - breakdownWindow.nome:SetPoint("TOPLEFT", breakdownWindow, "TOPLEFT", 105, -54) - - breakdownWindow.atributo_nome = breakdownWindow:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall") - - breakdownWindow.avatar = breakdownWindow:CreateTexture(nil, "overlay") - breakdownWindow.avatar_bg = breakdownWindow:CreateTexture(nil, "overlay") - breakdownWindow.avatar_attribute = breakdownWindow:CreateFontString(nil, "overlay", "GameFontHighlightSmall") - breakdownWindow.avatar_nick = breakdownWindow:CreateFontString(nil, "overlay", "QuestFont_Large") - breakdownWindow.avatar:SetDrawLayer("overlay", 3) - breakdownWindow.avatar_bg:SetDrawLayer("overlay", 2) - breakdownWindow.avatar_nick:SetDrawLayer("overlay", 4) - - breakdownWindow.avatar:SetPoint("TOPLEFT", breakdownWindow, "TOPLEFT", 60, -10) - breakdownWindow.avatar_bg:SetPoint("TOPLEFT", breakdownWindow, "TOPLEFT", 60, -12) - breakdownWindow.avatar_bg:SetSize(275, 60) - - breakdownWindow.avatar_nick:SetPoint("TOPLEFT", breakdownWindow, "TOPLEFT", 195, -54) - - breakdownWindow.avatar:Hide() - breakdownWindow.avatar_bg:Hide() - breakdownWindow.avatar_nick:Hide() -end - - -local default_icon_change = function(jogador, classe) +function breakdownWindow.SetClassIcon(jogador, classe) if (classe ~= "UNKNOW" and classe ~= "UNGROUPPLAYER") then - info.classe_icone:SetTexCoord(_detalhes.class_coords [classe][1], _detalhes.class_coords [classe][2], _detalhes.class_coords [classe][3], _detalhes.class_coords [classe][4]) + breakdownWindow.classIcon:SetTexCoord(Details.class_coords [classe][1], Details.class_coords [classe][2], Details.class_coords [classe][3], Details.class_coords [classe][4]) if (jogador.enemy) then - if (_detalhes.faction_against == "Horde") then - info.nome:SetTextColor(1, 91/255, 91/255, 1) + if (Details.faction_against == "Horde") then + breakdownWindow.actorName:SetTextColor(1, 91/255, 91/255, 1) else - info.nome:SetTextColor(151/255, 215/255, 1, 1) + breakdownWindow.actorName:SetTextColor(151/255, 215/255, 1, 1) end else - info.nome:SetTextColor(1, 1, 1, 1) + breakdownWindow.actorName:SetTextColor(1, 1, 1, 1) end else if (jogador.enemy) then - if (_detalhes.class_coords [_detalhes.faction_against]) then - info.classe_icone:SetTexCoord(unpack(_detalhes.class_coords [_detalhes.faction_against])) - if (_detalhes.faction_against == "Horde") then - info.nome:SetTextColor(1, 91/255, 91/255, 1) + if (Details.class_coords [Details.faction_against]) then + breakdownWindow.classIcon:SetTexCoord(unpack(Details.class_coords [Details.faction_against])) + if (Details.faction_against == "Horde") then + breakdownWindow.actorName:SetTextColor(1, 91/255, 91/255, 1) else - info.nome:SetTextColor(151/255, 215/255, 1, 1) + breakdownWindow.actorName:SetTextColor(151/255, 215/255, 1, 1) end else - info.nome:SetTextColor(1, 1, 1, 1) + breakdownWindow.actorName:SetTextColor(1, 1, 1, 1) end else - info.classe_icone:SetTexCoord(_detalhes.class_coords ["MONSTER"][1], _detalhes.class_coords ["MONSTER"][2], _detalhes.class_coords ["MONSTER"][3], _detalhes.class_coords ["MONSTER"][4]) + breakdownWindow.classIcon:SetTexCoord(Details.class_coords ["MONSTER"][1], Details.class_coords ["MONSTER"][2], Details.class_coords ["MONSTER"][3], Details.class_coords ["MONSTER"][4]) end end end -function _detalhes:InstallPDWSkin(skin_name, func) - if (not skin_name) then - return false -- sem nome - elseif (_detalhes.playerdetailwindow_skins[skin_name]) then - return false -- ja existe - end - - _detalhes.playerdetailwindow_skins[skin_name] = func - return true +function Details:SetBreakdownWindowBackgroundTexture(texture) + breakdownWindow.backgroundTexture:SetTexture(texture) end -function _detalhes:ApplyPDWSkin(skin_name) ---already built - if (not DetailsBreakdownWindow.Loaded) then - if (skin_name) then - _detalhes.player_details_window.skin = skin_name - end - return - end - ---hide extra frames - local window = DetailsBreakdownWindow - if (window.extra_frames) then - for framename, frame in pairs(window.extra_frames) do - frame:Hide() - end - end - ---apply default first - local default_skin = _detalhes.playerdetailwindow_skins["WoWClassic"] - pcall(default_skin.func) - ---than do the change - if (not skin_name) then - skin_name = _detalhes.player_details_window.skin - end - - local skin = _detalhes.playerdetailwindow_skins [skin_name] - if (skin) then - local successful, errortext = pcall(skin.func) - if (not successful) then - _detalhes:Msg("error occurred on skin call():", errortext) - local former_skin = _detalhes.playerdetailwindow_skins [_detalhes.player_details_window.skin] - pcall(former_skin.func) - else - _detalhes.player_details_window.skin = skin_name - end - else - _detalhes:Msg("skin not found.") - end - - if (info and info:IsShown() and info.jogador and info.jogador.classe) then - info.SetClassIcon (info.jogador, info.jogador.classe) - end - - _detalhes:ApplyRPSkin (skin_name) -end - -function _detalhes:SetPlayerDetailsWindowTexture (texture) - DetailsBreakdownWindow.bg1:SetTexture(texture) -end - -function _detalhes:SetPDWBarConfig (texture) - local window = DetailsBreakdownWindow - - if (texture) then - _detalhes.player_details_window.bar_texture = texture - local texture = SharedMedia:Fetch ("statusbar", texture) - - for _, bar in ipairs(window.barras1) do - bar.textura:SetStatusBarTexture(texture) - end - for _, bar in ipairs(window.barras2) do - bar.textura:SetStatusBarTexture(texture) - end - for _, bar in ipairs(window.barras3) do - bar.textura:SetStatusBarTexture(texture) - end - end -end - -local default_skin = function()end -_detalhes:InstallPDWSkin("WoWClassic", {func = default_skin, author = "Details! Team", version = "v1.0", desc = "Default skin."}) --deprecated - -local elvui_skin = function() - local window = DetailsBreakdownWindow - window.bg1:SetTexture([[Interface\AddOns\Details\images\background]], true) - window.bg1:SetAlpha(0.7) - window.bg1:SetVertexColor(0.27, 0.27, 0.27) - window.bg1:SetVertTile(true) - window.bg1:SetHorizTile(true) - window.bg1:SetSize(PLAYER_DETAILS_WINDOW_WIDTH, PLAYER_DETAILS_WINDOW_HEIGHT) - - window:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]]}) - window:SetBackdropColor(1, 1, 1, 0.3) - window:SetBackdropBorderColor(0, 0, 0, 1) - local bgs_alpha = 0.6 - - window.leftbars1_backgound:SetPoint("topleft", window.container_barras, "topleft", -2, 3) - window.leftbars1_backgound:SetPoint("bottomright", window.container_barras, "bottomright", 3, -3) - window.leftbars2_backgound:SetPoint("topleft", window.container_alvos, "topleft", -2, 23) - window.leftbars2_backgound:SetPoint("bottomright", window.container_alvos, "bottomright", 4, 0) - - window.leftbars1_backgound:SetAlpha(bgs_alpha) - window.leftbars2_backgound:SetAlpha(bgs_alpha) - - window.right_background1:SetAlpha(bgs_alpha) - window.right_background2:SetAlpha(bgs_alpha) - window.right_background3:SetAlpha(bgs_alpha) - window.right_background4:SetAlpha(bgs_alpha) - window.right_background5:SetAlpha(bgs_alpha) - - window.close_button:GetNormalTexture():SetDesaturated(true) - - local titlebar = window.extra_frames ["ElvUITitleBar"] - if (not titlebar) then - titlebar = CreateFrame("frame", nil, window, "BackdropTemplate") - titlebar:SetPoint("topleft", window, "topleft", 2, -3) - titlebar:SetPoint("topright", window, "topright", -2, -3) - titlebar:SetHeight(20) - titlebar:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) - titlebar:SetBackdropColor(.5, .5, .5, 1) - titlebar:SetBackdropBorderColor(0, 0, 0, 1) - window.extra_frames ["ElvUITitleBar"] = titlebar - - local name_bg_texture = window:CreateTexture(nil, "background") - name_bg_texture:SetTexture([[Interface\PetBattles\_PetBattleHorizTile]], true) - name_bg_texture:SetHorizTile(true) - name_bg_texture:SetTexCoord(0, 1, 126/256, 19/256) - name_bg_texture:SetPoint("topleft", window, "topleft", 2, -22) - --name_bg_texture:SetPoint("topright", window, "topright", -2, -22) - name_bg_texture:SetPoint("bottomright", window, "bottomright") - name_bg_texture:SetHeight(54) - name_bg_texture:SetVertexColor(0, 0, 0, 0.2) - window.extra_frames ["ElvUINameTexture"] = name_bg_texture - else - titlebar:Show() - window.extra_frames ["ElvUINameTexture"]:Show() - end - - window.title_string:ClearAllPoints() - window.title_string:SetPoint("center", window, "center") - window.title_string:SetPoint("top", window, "top", 0, -7) - window.title_string:SetParent(titlebar) - window.title_string:SetTextColor(.8, .8, .8, 1) - - window.classe_icone:SetParent(titlebar) - window.classe_icone:SetDrawLayer("overlay") - window.classe_icone:SetPoint("TOPLEFT", window, "TOPLEFT", 2, -25) - window.classe_icone:SetWidth(49) - window.classe_icone:SetHeight(49) - window.classe_icone:SetAlpha(1) - - window.close_button:SetWidth(20) - window.close_button:SetHeight(20) - window.close_button:SetPoint("TOPRIGHT", window, "TOPRIGHT", 0, -3) - - - window.avatar:SetParent(titlebar) - - --bar container - window.container_barras:SetPoint(unpack(containerSettings.spells.point)) - window.container_barras:SetSize(containerSettings.spells.width, containerSettings.spells.height) - - --target container - window.container_alvos:SetPoint(unpack(containerSettings.targets.point)) - window.container_alvos:SetSize(containerSettings.targets.width, containerSettings.targets.height) - - --texts - window.nome:SetPoint("TOPLEFT", window, "TOPLEFT", 105, -48) - - --report button - window.topleft_report:SetPoint("BOTTOMLEFT", window.container_barras, "TOPLEFT", 43, 2) - - --no targets texture - window.no_targets:SetPoint("BOTTOMLEFT", window, "BOTTOMLEFT", 3, 6) - window.no_targets:SetSize(418, 150) - window.no_targets:SetAlpha(0.4) - - --right panel textures - window.bg2_sec_texture:SetPoint("topleft", window.bg1_sec_texture, "topleft", 7, 0) - window.bg2_sec_texture:SetPoint("bottomright", window.bg1_sec_texture, "bottomright", -30, 0) - window.bg2_sec_texture:SetTexture([[Interface\Glues\CREDITS\Warlords\Shadowmoon_Color_jlo3]]) - window.bg2_sec_texture:SetDesaturated(true) - window.bg2_sec_texture:SetAlpha(0) - - window.bg3_sec_texture:SetPoint("topleft", window.bg2_sec_texture, "topleft", 0, 0) - window.bg3_sec_texture:SetPoint("bottomright", window.bg2_sec_texture, "bottomright", 0, 0) - window.bg3_sec_texture:SetTexture(0, 0, 0, 0.3) - - --the 5 spell details blocks - not working - for i, infoblock in ipairs(_detalhes.playerDetailWindow.grupos_detalhes) do - infoblock.bg:SetSize(330, 47) - end - local xLocation = {-85, -136, -191, -246, -301} - local heightTable = {50, 50, 50, 50, 50, 48} - - for i = 1, spellInfoSettings.amount do - window ["right_background" .. i]:SetPoint("topleft", window, "topleft", 351, xLocation [i]) - window ["right_background" .. i]:SetSize(spellInfoSettings.width, heightTable [i]) - - end - - --seta configs dos 5 blocos da direita - info:SetDetailInfoConfigs("Interface\\AddOns\\Details\\images\\bar_background_dark", {1, 1, 1, 0.35}, -6 + 100, 0) - - window.bg1_sec_texture:SetPoint("topleft", window.bg1, "topleft", 446, -86) - window.bg1_sec_texture:SetWidth(337) - window.bg1_sec_texture:SetHeight(362) - - --container 3 bars - local x_start = 56 - local y_start = -10 - - local janela = window.container_detalhes - - container3_bars_pointFunc = function(barra, index) - local y = (index-1) * 17 - y = y*-1 - - barra:SetPoint("LEFT", info.bg1_sec_texture, "LEFT", 0, 0) - barra:SetPoint("RIGHT", info.bg1_sec_texture, "RIGHT", 0, 0) - - --barra:SetPoint("LEFT", janela, "LEFT", x_start, 0) - --barra:SetPoint("RIGHT", janela, "RIGHT", 62, 0) - barra:SetPoint("TOP", janela, "TOP", 0, y+y_start) - end - - for index, barra in ipairs(window.barras3) do - local y = (index-1) * 17 - y = y*-1 - barra:SetPoint("LEFT", janela, "LEFT", x_start, 0) - barra:SetPoint("RIGHT", janela, "RIGHT", 62, 0) - barra:SetPoint("TOP", janela, "TOP", 0, y+y_start) - end - - --scrollbar - do - --get textures - local normalTexture = window.container_barras.cima:GetNormalTexture() - local pushedTexture = window.container_barras.cima:GetPushedTexture() - local disabledTexture = window.container_barras.cima:GetDisabledTexture() - - --set the new textures - normalTexture:SetTexture([[Interface\Buttons\Arrow-Up-Up]]) - pushedTexture:SetTexture([[Interface\Buttons\Arrow-Up-Down]]) - disabledTexture:SetTexture([[Interface\Buttons\Arrow-Up-Disabled]]) - - normalTexture:SetPoint("topleft", window.container_barras.cima, "topleft", 1, 0) - normalTexture:SetPoint("bottomright", window.container_barras.cima, "bottomright", 1, 0) - pushedTexture:SetPoint("topleft", window.container_barras.cima, "topleft", 1, 0) - pushedTexture:SetPoint("bottomright", window.container_barras.cima, "bottomright", 1, 0) - disabledTexture:SetPoint("topleft", window.container_barras.cima, "topleft", 1, 0) - disabledTexture:SetPoint("bottomright", window.container_barras.cima, "bottomright", 1, 0) - - disabledTexture:SetAlpha(0.5) - - window.container_barras.cima:SetSize(16, 16) - window.container_barras.cima:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]]}) - window.container_barras.cima:SetBackdropColor(0, 0, 0, 0.3) - window.container_barras.cima:SetBackdropBorderColor(0, 0, 0, 1) - end - - do - --get textures - local normalTexture = window.container_barras.baixo:GetNormalTexture() - local pushedTexture = window.container_barras.baixo:GetPushedTexture() - local disabledTexture = window.container_barras.baixo:GetDisabledTexture() - - --set the new textures - normalTexture:SetTexture([[Interface\Buttons\Arrow-Down-Up]]) - pushedTexture:SetTexture([[Interface\Buttons\Arrow-Down-Down]]) - disabledTexture:SetTexture([[Interface\Buttons\Arrow-Down-Disabled]]) - - normalTexture:SetPoint("topleft", window.container_barras.baixo, "topleft", 1, -4) - normalTexture:SetPoint("bottomright", window.container_barras.baixo, "bottomright", 1, -4) - - pushedTexture:SetPoint("topleft", window.container_barras.baixo, "topleft", 1, -4) - pushedTexture:SetPoint("bottomright", window.container_barras.baixo, "bottomright", 1, -4) - - disabledTexture:SetPoint("topleft", window.container_barras.baixo, "topleft", 1, -4) - disabledTexture:SetPoint("bottomright", window.container_barras.baixo, "bottomright", 1, -4) - - disabledTexture:SetAlpha(0.5) - - window.container_barras.baixo:SetSize(16, 16) - window.container_barras.baixo:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]]}) - window.container_barras.baixo:SetBackdropColor(0, 0, 0, 0.3) - window.container_barras.baixo:SetBackdropBorderColor(0, 0, 0, 1) - end - - window.container_barras.slider:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]]}) - window.container_barras.slider:SetBackdropColor(0, 0, 0, 0.35) - window.container_barras.slider:SetBackdropBorderColor(0, 0, 0, 1) - - window.container_barras.slider:Altura (containerSettings.spells.scrollHeight) - window.container_barras.slider:cimaPoint (0, 13) - window.container_barras.slider:baixoPoint (0, -13) - - window.container_barras.slider.thumb:SetTexture([[Interface\AddOns\Details\images\icons2]]) - window.container_barras.slider.thumb:SetTexCoord(482/512, 492/512, 104/512, 120/512) - window.container_barras.slider.thumb:SetSize(12, 12) - window.container_barras.slider.thumb:SetVertexColor(0.6, 0.6, 0.6, 0.95) - - -- - - - do - local f = window.container_alvos - - --get textures - local normalTexture = f.cima:GetNormalTexture() - local pushedTexture = f.cima:GetPushedTexture() - local disabledTexture = f.cima:GetDisabledTexture() - - --set the new textures - normalTexture:SetTexture([[Interface\Buttons\Arrow-Up-Up]]) - pushedTexture:SetTexture([[Interface\Buttons\Arrow-Up-Down]]) - disabledTexture:SetTexture([[Interface\Buttons\Arrow-Up-Disabled]]) - - normalTexture:SetPoint("topleft", f.cima, "topleft", 1, 0) - normalTexture:SetPoint("bottomright", f.cima, "bottomright", 1, 0) - pushedTexture:SetPoint("topleft", f.cima, "topleft", 1, 0) - pushedTexture:SetPoint("bottomright", f.cima, "bottomright", 1, 0) - disabledTexture:SetPoint("topleft", f.cima, "topleft", 1, 0) - disabledTexture:SetPoint("bottomright", f.cima, "bottomright", 1, 0) - - disabledTexture:SetAlpha(0.5) - - f.cima:SetSize(16, 16) - f.cima:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]]}) - f.cima:SetBackdropColor(0, 0, 0, 0.3) - f.cima:SetBackdropBorderColor(0, 0, 0, 1) - end - - do - local f = window.container_alvos - - --get textures - local normalTexture = f.baixo:GetNormalTexture() - local pushedTexture = f.baixo:GetPushedTexture() - local disabledTexture = f.baixo:GetDisabledTexture() - - --set the new textures - normalTexture:SetTexture([[Interface\Buttons\Arrow-Down-Up]]) - pushedTexture:SetTexture([[Interface\Buttons\Arrow-Down-Down]]) - disabledTexture:SetTexture([[Interface\Buttons\Arrow-Down-Disabled]]) - - normalTexture:SetPoint("topleft", f.baixo, "topleft", 1, -4) - normalTexture:SetPoint("bottomright", f.baixo, "bottomright", 1, -4) - - pushedTexture:SetPoint("topleft", f.baixo, "topleft", 1, -4) - pushedTexture:SetPoint("bottomright", f.baixo, "bottomright", 1, -4) - - disabledTexture:SetPoint("topleft", f.baixo, "topleft", 1, -4) - disabledTexture:SetPoint("bottomright", f.baixo, "bottomright", 1, -4) - - disabledTexture:SetAlpha(0.5) - - f.baixo:SetSize(16, 16) - f.baixo:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]]}) - f.baixo:SetBackdropColor(0, 0, 0, 0.3) - f.baixo:SetBackdropBorderColor(0, 0, 0, 1) - end - - window.container_alvos.slider:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]]}) - window.container_alvos.slider:SetBackdropColor(0, 0, 0, 0.35) - window.container_alvos.slider:SetBackdropBorderColor(0, 0, 0, 1) - - window.container_alvos.slider:Altura (137) - window.container_alvos.slider:cimaPoint (0, 13) - window.container_alvos.slider:baixoPoint (0, -13) - - window.container_alvos.slider.thumb:SetTexture([[Interface\AddOns\Details\images\icons2]]) - window.container_alvos.slider.thumb:SetTexCoord(482/512, 492/512, 104/512, 120/512) - window.container_alvos.slider.thumb:SetSize(12, 12) - window.container_alvos.slider.thumb:SetVertexColor(0.6, 0.6, 0.6, 0.95) - - --class icon - ---set the spell, spec or class icon - ---@param actorObject actor - ---@param class string|nil - window.SetClassIcon = function(actorObject, class) - if (actorObject.spellicon) then - window.classe_icone:SetTexture(actorObject.spellicon) - window.classe_icone:SetTexCoord(.1, .9, .1, .9) - - elseif (actorObject.spec) then - window.classe_icone:SetTexture([[Interface\AddOns\Details\images\spec_icons_normal_alpha]]) - window.classe_icone:SetTexCoord(unpack(_detalhes.class_specs_coords [actorObject.spec])) - --esta_barra.icone_classe:SetVertexColor(1, 1, 1) - else - local coords = CLASS_ICON_TCOORDS[class] - if (coords) then - info.classe_icone:SetTexture([[Interface\Glues\CHARACTERCREATE\UI-CHARACTERCREATE-CLASSES]]) - local l, r, t, b = unpack(coords) - info.classe_icone:SetTexCoord(l+0.01953125, r-0.01953125, t+0.01953125, b-0.01953125) - else - - local c = _detalhes.class_coords ["MONSTER"] - info.classe_icone:SetTexture("Interface\\AddOns\\Details\\images\\classes") - info.classe_icone:SetTexCoord(c[1], c[2], c[3], c[4]) - end - end - end -end - - - --search key: ~create ~inicio ~start -function gump:CriaJanelaInfo() - local breakdownFrame = info - table.insert(UISpecialFrames, breakdownFrame:GetName()) - breakdownFrame.extra_frames = {} - breakdownFrame.Loaded = true - Details.playerDetailWindow = breakdownFrame +function Details:CreateBreakdownWindow() + table.insert(UISpecialFrames, breakdownWindow:GetName()) + breakdownWindow.extra_frames = {} + breakdownWindow.Loaded = true + Details.playerDetailWindow = breakdownWindow - --stopped: started the skin merge with the window creation - - breakdownFrame:SetWidth(PLAYER_DETAILS_WINDOW_WIDTH) - breakdownFrame:SetHeight(PLAYER_DETAILS_WINDOW_HEIGHT) - breakdownFrame:SetFrameStrata("HIGH") - breakdownFrame:SetToplevel(true) - breakdownFrame:EnableMouse(true) - breakdownFrame:SetResizable(false) - breakdownFrame:SetMovable(true) + breakdownWindow:SetWidth(PLAYER_DETAILS_WINDOW_WIDTH) + breakdownWindow:SetHeight(PLAYER_DETAILS_WINDOW_HEIGHT) + breakdownWindow:SetFrameStrata("HIGH") + breakdownWindow:SetToplevel(true) + breakdownWindow:EnableMouse(true) + breakdownWindow:SetResizable(true) + breakdownWindow:SetMovable(true) --host the textures and fontstring of the default frame of the player breakdown window - breakdownFrame.SummaryWindowWidgets = CreateFrame("frame", "DetailsBreakdownWindowSummaryWidgets", breakdownFrame, "BackdropTemplate") - local SWW = breakdownFrame.SummaryWindowWidgets + --what is the summary window: is the frame where all the widgets for the summary tab are created + breakdownWindow.SummaryWindowWidgets = CreateFrame("frame", "DetailsBreakdownWindowSummaryWidgets", breakdownWindow, "BackdropTemplate") + local SWW = breakdownWindow.SummaryWindowWidgets SWW:SetAllPoints() table.insert(SummaryWidgets, SWW) --where SummaryWidgets is declared: at the header of the file, what is the purpose of this table? - --what is the summary window: is the frame where all the widgets for the summary tab are created + breakdownWindow.SummaryWindowWidgets:Hide() - DetailsFramework:CreateScaleBar(breakdownFrame, Details.player_details_window) - breakdownFrame:SetScale(Details.player_details_window.scale) + DetailsFramework:CreateScaleBar(breakdownWindow, Details.player_details_window) + breakdownWindow:SetScale(Details.player_details_window.scale) --class icon - breakdownFrame.classe_icone = breakdownFrame:CreateTexture(nil, "BACKGROUND", nil, 1) - breakdownFrame.classe_icone:SetPoint("TOPLEFT", breakdownFrame, "TOPLEFT", 4, 0) - breakdownFrame.classe_icone:SetSize(64, 64) + breakdownWindow.classIcon = breakdownWindow:CreateTexture(nil, "BACKGROUND", nil, 1) + breakdownWindow.classIcon:SetPoint("topleft", breakdownWindow, "topleft", 4, 0) + breakdownWindow.classIcon:SetSize(64, 64) - --background topleft? - breakdownFrame.bg1 = breakdownFrame:CreateTexture("DetailsPSWBackground", "BORDER", nil, 1) - breakdownFrame.bg1:SetPoint("TOPLEFT", breakdownFrame, "TOPLEFT", 0, 0) + --background + breakdownWindow.backgroundTexture = breakdownWindow:CreateTexture("$parent", "background", nil, -3) + breakdownWindow.backgroundTexture:SetAllPoints() --close button - breakdownFrame.close_button = CreateFrame("Button", nil, breakdownFrame, "UIPanelCloseButton") - breakdownFrame.close_button:SetSize(32, 32) - breakdownFrame.close_button:SetPoint("TOPRIGHT", breakdownFrame, "TOPRIGHT", 5, -8) - breakdownFrame.close_button:SetText("X") - breakdownFrame.close_button:SetFrameLevel(breakdownFrame:GetFrameLevel()+5) - breakdownFrame.close_button:SetScript("OnClick", function(self) + breakdownWindow.closeButton = CreateFrame("Button", nil, breakdownWindow, "UIPanelCloseButton") + breakdownWindow.closeButton:SetSize(32, 32) + breakdownWindow.closeButton:SetPoint("TOPRIGHT", breakdownWindow, "TOPRIGHT", 5, -8) + breakdownWindow.closeButton:SetText("X") + breakdownWindow.closeButton:SetFrameLevel(breakdownWindow:GetFrameLevel()+5) + breakdownWindow.closeButton:SetScript("OnClick", function(self) Details:CloseBreakdownWindow() end) - --�cone da magia selecionada para mais detalhes (is this a window thing or tab thing?) - --or this is even in use? - --title - DetailsFramework:NewLabel(breakdownFrame, breakdownFrame, nil, "title_string", Loc ["STRING_PLAYER_DETAILS"] .. " (|cFFFF8811Under Maintenance|r)", "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255}) - breakdownFrame.title_string:SetPoint("center", breakdownFrame, "center") - breakdownFrame.title_string:SetPoint("top", breakdownFrame, "top", 0, -18) - - breakdownFrame.topright_text1 = breakdownFrame:CreateFontString(nil, "overlay", "GameFontNormal") - breakdownFrame.topright_text1:SetPoint("bottomright", breakdownFrame, "topright", -18 - (94 * (1-1)), -36) - breakdownFrame.topright_text1:SetJustifyH("right") - DetailsFramework:SetFontSize(breakdownFrame.topright_text1, 10) - - breakdownFrame.topright_text2 = breakdownFrame:CreateFontString(nil, "overlay", "GameFontNormal") - breakdownFrame.topright_text2:SetPoint("bottomright", breakdownFrame, "topright", -18 - (94 * (1-1)), -48) - breakdownFrame.topright_text2:SetJustifyH("right") - DetailsFramework:SetFontSize(breakdownFrame.topright_text2, 10) - - --what goes in the top right text? - looks like it's not in use - function breakdownFrame:SetTopRightTexts(text1, text2, size, color, font) - if (text1) then - breakdownFrame.topright_text1:SetText(text1) - else - breakdownFrame.topright_text1:SetText("") - end - - if (text2) then - breakdownFrame.topright_text2:SetText(text2) - else - breakdownFrame.topright_text2:SetText("") - end - - if (size and type(size) == "number") then - DetailsFramework:SetFontSize(breakdownFrame.topright_text1, size) - DetailsFramework:SetFontSize(breakdownFrame.topright_text2, size) - end - - if (color) then - DetailsFramework:SetFontColor(breakdownFrame.topright_text1, color) - DetailsFramework:SetFontColor(breakdownFrame.topright_text2, color) - end - - if (font) then - DetailsFramework:SetFontFace (breakdownFrame.topright_text1, font) - DetailsFramework:SetFontFace (breakdownFrame.topright_text2, font) - end - end + DetailsFramework:NewLabel(breakdownWindow, breakdownWindow, nil, "titleText", Loc ["STRING_PLAYER_DETAILS"] .. " (|cFFFF8811Under Maintenance|r)", "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255}) + breakdownWindow.titleText:SetPoint("center", breakdownWindow, "center") + breakdownWindow.titleText:SetPoint("top", breakdownWindow, "top", 0, -18) --create the texts shown on the window - breakdownWindow.CreateTexts(SWW) + do + breakdownWindow.actorName = breakdownWindow:CreateFontString(nil, "OVERLAY", "QuestFont_Large") + breakdownWindow.actorName:SetPoint("TOPLEFT", breakdownWindow, "TOPLEFT", 105, -54) - breakdownFrame.SetClassIcon = default_icon_change + breakdownWindow.attributeName = breakdownWindow:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall") + + breakdownWindow.avatar = breakdownWindow:CreateTexture(nil, "overlay") + breakdownWindow.avatar_bg = breakdownWindow:CreateTexture(nil, "overlay") + breakdownWindow.avatar_attribute = breakdownWindow:CreateFontString(nil, "overlay", "GameFontHighlightSmall") + breakdownWindow.avatar_nick = breakdownWindow:CreateFontString(nil, "overlay", "QuestFont_Large") + breakdownWindow.avatar:SetDrawLayer("overlay", 3) + breakdownWindow.avatar_bg:SetDrawLayer("overlay", 2) + breakdownWindow.avatar_nick:SetDrawLayer("overlay", 4) + + breakdownWindow.avatar:SetPoint("TOPLEFT", breakdownWindow, "TOPLEFT", 60, -10) + breakdownWindow.avatar_bg:SetPoint("TOPLEFT", breakdownWindow, "TOPLEFT", 60, -12) + breakdownWindow.avatar_bg:SetSize(275, 60) + + breakdownWindow.avatar_nick:SetPoint("TOPLEFT", breakdownWindow, "TOPLEFT", 195, -54) + + breakdownWindow.avatar:Hide() + breakdownWindow.avatar_bg:Hide() + breakdownWindow.avatar_nick:Hide() + end + + --create the gradients in the top and bottom side of the breakdown window + do + local gradientStartColor = Details222.ColorScheme.GetColorFor("gradient-background") + local gradientUp = DetailsFramework:CreateTexture(breakdownWindow, {gradient = "vertical", fromColor = "transparent", toColor = gradientStartColor}, 1, 300, "artwork", {0, 1, 0, 1}) + gradientUp:SetPoint("tops", 1, 1) + local gradientDown = DetailsFramework:CreateTexture(breakdownWindow, {gradient = "vertical", fromColor = gradientStartColor, toColor = "transparent"}, 1, 50, "artwork", {0, 1, 0, 1}) + gradientDown:SetPoint("bottoms") + end --statusbar - local statusBar = CreateFrame("frame", nil, breakdownFrame, "BackdropTemplate") - statusBar:SetPoint("bottomleft", breakdownFrame, "bottomleft") - statusBar:SetPoint("bottomright", breakdownFrame, "bottomright") + local statusBar = CreateFrame("frame", nil, breakdownWindow, "BackdropTemplate") + statusBar:SetPoint("bottomleft", breakdownWindow, "bottomleft") + statusBar:SetPoint("bottomright", breakdownWindow, "bottomright") statusBar:SetHeight(PLAYER_DETAILS_STATUSBAR_HEIGHT) DetailsFramework:ApplyStandardBackdrop(statusBar) statusBar:SetAlpha(PLAYER_DETAILS_STATUSBAR_ALPHA) @@ -1111,9 +542,9 @@ function gump:CriaJanelaInfo() statusBar.Text = DetailsFramework:CreateLabel(statusBar) statusBar.Text:SetPoint("left", 2, 0) - function breakdownFrame:SetStatusbarText(text, fontSize, fontColor) + function breakdownWindow:SetStatusbarText(text, fontSize, fontColor) if (not text) then - breakdownFrame:SetStatusbarText("Details! Damage Meter | Use '/details stats' for statistics", 10, "gray") + breakdownWindow:SetStatusbarText("Details! Damage Meter | Use '/details stats' for statistics", 10, "gray") return end statusBar.Text.text = text @@ -1122,14 +553,11 @@ function gump:CriaJanelaInfo() end --set default text - breakdownFrame:SetStatusbarText() - - --apply default skin - --_detalhes:ApplyPDWSkin() + breakdownWindow:SetStatusbarText() -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --tabs ~tabs - function breakdownFrame:ShowTabs() + function breakdownWindow:ShowTabs() local tabsShown = 0 local secondRowIndex = 1 local breakLine = 6 --the tab it'll start the second line @@ -1139,14 +567,14 @@ function gump:CriaJanelaInfo() for index = 1, #tablePool do local tab = tablePool[index] - if (tab:condition(info.jogador, info.atributo, info.sub_atributo) and not tab.replaced) then + if (tab:condition(breakdownWindow.jogador, breakdownWindow.atributo, breakdownWindow.sub_atributo) and not tab.replaced) then --test if can show the tutorial for the comparison tab if (tab.tabname == "Compare") then - --_detalhes:SetTutorialCVar ("DETAILS_INFO_TUTORIAL1", false) - if (not _detalhes:GetTutorialCVar("DETAILS_INFO_TUTORIAL1")) then - _detalhes:SetTutorialCVar ("DETAILS_INFO_TUTORIAL1", true) + --Details:SetTutorialCVar ("DETAILS_INFO_TUTORIAL1", false) + if (not Details:GetTutorialCVar("DETAILS_INFO_TUTORIAL1")) then + Details:SetTutorialCVar ("DETAILS_INFO_TUTORIAL1", true) - local alert = CreateFrame("frame", "DetailsInfoPopUp1", info, "DetailsHelpBoxTemplate") + local alert = CreateFrame("frame", "DetailsInfoPopUp1", breakdownWindow, "DetailsHelpBoxTemplate") alert.ArrowUP:Show() alert.ArrowGlowUP:Show() alert.Text:SetText(Loc ["STRING_INFO_TUTORIAL_COMPARISON1"]) @@ -1168,18 +596,18 @@ function gump:CriaJanelaInfo() if (PixelUtil) then PixelUtil.SetSize(tab, buttonTemplate.width, buttonTemplate.height) if (tabsShown >= breakLine) then --next row of icons - PixelUtil.SetPoint(tab, "bottomright", info, "topright", -514 + (buttonWidth * (secondRowIndex)), -50) + PixelUtil.SetPoint(tab, "bottomright", breakdownWindow, "topright", -514 + (buttonWidth * (secondRowIndex)), -50) secondRowIndex = secondRowIndex + 1 else - PixelUtil.SetPoint(tab, "bottomright", info, "topright", -514 + (buttonWidth * tabsShown), -72) + PixelUtil.SetPoint(tab, "bottomright", breakdownWindow, "topright", -514 + (buttonWidth * tabsShown), -72) end else tab:SetSize(buttonTemplate.width, buttonTemplate.height) if (tabsShown >= breakLine) then --next row of icons - tab:SetPoint("bottomright", info, "topright", -514 + (buttonWidth * (secondRowIndex)), -50) + tab:SetPoint("bottomright", breakdownWindow, "topright", -514 + (buttonWidth * (secondRowIndex)), -50) secondRowIndex = secondRowIndex + 1 else - tab:SetPoint("bottomright", info, "topright", -514 + (buttonWidth * tabsShown), -72) + tab:SetPoint("bottomright", breakdownWindow, "topright", -514 + (buttonWidth * tabsShown), -72) end end @@ -1191,34 +619,34 @@ function gump:CriaJanelaInfo() end if (tabsShown < 2) then - tablePool[1]:SetPoint("BOTTOMLEFT", info.container_barras, "TOPLEFT", 490 - (94 * (1-0)), 1) + tablePool[1]:SetPoint("BOTTOMLEFT", breakdownWindow.container_barras, "TOPLEFT", 490 - (94 * (1-0)), 1) end --selected by default tablePool[1]:Click() end - breakdownFrame:SetScript("OnHide", function(self) - _detalhes:FechaJanelaInfo() - for _, tab in ipairs(_detalhes.player_details_tabs) do + breakdownWindow:SetScript("OnHide", function(self) + Details:CloseBreakdownWindow() + for _, tab in ipairs(Details.player_details_tabs) do tab:Hide() tab.frame:Hide() end end) - breakdownFrame.tipo = 1 --tipo da janela // 1 = janela normal - return breakdownFrame + breakdownWindow.tipo = 1 --tipo da janela // 1 = janela normal + return breakdownWindow end -info.selectedTab = "Summary" +breakdownWindow.selectedTab = "Summary" -function _detalhes:CreatePlayerDetailsTab(tabName, locName, conditionFunc, fillFunc, tabOnClickFunc, onCreateFunc, iconSettings, replace, bIsDefaultTab) --~tab +function Details:CreatePlayerDetailsTab(tabName, locName, conditionFunc, fillFunc, tabOnClickFunc, onCreateFunc, iconSettings, replace, bIsDefaultTab) --~tab if (not tabName) then tabName = "unnamed" end --create a button for the tab --tabOnClickFunc - local newTabButton = gump:CreateButton(info, function()end, 20, 20, nil, nil, nil, nil, nil, breakdownWindow:GetName() .. "TabButton" .. tabName .. math.random(1, 1000)) + local newTabButton = gump:CreateButton(breakdownWindow, function()end, 20, 20, nil, nil, nil, nil, nil, breakdownWindow:GetName() .. "TabButton" .. tabName .. math.random(1, 1000)) newTabButton:SetTemplate("DETAILS_TAB_BUTTON_TEMPLATE") if (tabName == "Summary") then newTabButton:SetTemplate("DETAILS_TAB_BUTTONSELECTED_TEMPLATE") @@ -1228,7 +656,7 @@ function _detalhes:CreatePlayerDetailsTab(tabName, locName, conditionFunc, fillF newTabButton:SetText(locName) newTabButton:SetFrameStrata("HIGH") - newTabButton:SetFrameLevel(info:GetFrameLevel()+1) + newTabButton:SetFrameLevel(breakdownWindow:GetFrameLevel()+1) newTabButton:Hide() newTabButton.condition = conditionFunc @@ -1240,13 +668,12 @@ function _detalhes:CreatePlayerDetailsTab(tabName, locName, conditionFunc, fillF ---@type tabframe local tabFrame = CreateFrame("frame", breakdownWindow:GetName() .. "TabFrame" .. tabName .. math.random(1, 1000), UIParent, "BackdropTemplate") - DetailsFramework:ApplyStandardBackdrop(tabFrame) newTabButton.tabFrame = tabFrame newTabButton.frame = tabFrame - tabFrame:SetParent(info) + tabFrame:SetParent(breakdownWindow) tabFrame:SetFrameStrata("HIGH") - tabFrame:SetFrameLevel(info:GetFrameLevel()+5) + tabFrame:SetFrameLevel(breakdownWindow:GetFrameLevel()+5) tabFrame:EnableMouse(true) tabFrame:SetPoint("topleft", breakdownWindow, "topleft", 0, -70) tabFrame:SetPoint("bottomright", breakdownWindow, "bottomright", 0, 20) @@ -1268,11 +695,11 @@ function _detalhes:CreatePlayerDetailsTab(tabName, locName, conditionFunc, fillF if (newTabButton.fillfunction) then tabFrame:SetScript("OnShow", function() - if (newTabButton.last_actor == info.jogador) then + if (newTabButton.last_actor == breakdownWindow.jogador) then return end - newTabButton.last_actor = info.jogador - newTabButton:fillfunction(info.jogador, info.instancia.showing) + newTabButton.last_actor = breakdownWindow.jogador + newTabButton:fillfunction(breakdownWindow.jogador, breakdownWindow.instancia.showing) end) end @@ -1281,7 +708,7 @@ function _detalhes:CreatePlayerDetailsTab(tabName, locName, conditionFunc, fillF end newTabButton.replaces = replace - _detalhes.player_details_tabs[#_detalhes.player_details_tabs+1] = newTabButton + Details.player_details_tabs[#Details.player_details_tabs+1] = newTabButton local onTabClickCallback = function(self) self = self.MyObject or self @@ -1292,7 +719,7 @@ function _detalhes:CreatePlayerDetailsTab(tabName, locName, conditionFunc, fillF end self:SetTemplate("DETAILS_TAB_BUTTONSELECTED_TEMPLATE") - info.selectedTab = self.tabname + breakdownWindow.selectedTab = self.tabname end if (not tabOnClickFunc) then diff --git a/frames/window_playerbreakdown_list.lua b/frames/window_playerbreakdown_list.lua index 448420e8..8f3d6da5 100644 --- a/frames/window_playerbreakdown_list.lua +++ b/frames/window_playerbreakdown_list.lua @@ -57,8 +57,8 @@ end local lineOnClick = function(self) - if (self.playerObject ~= Details:GetPlayerObjectFromBreakdownWindow()) then - Details:OpenPlayerBreakdown(Details:GetActiveWindowFromBreakdownWindow(), self.playerObject) + if (self.playerObject ~= Details:GetActorObjectFromBreakdownWindow()) then + Details:OpenBreakdownWindow(Details:GetActiveWindowFromBreakdownWindow(), self.playerObject) f.playerScrollBox:Refresh() end end @@ -80,7 +80,7 @@ end local updatePlayerLine = function(self, topResult, encounterId, difficultyId) --~update - local playerSelected = Details:GetPlayerObjectFromBreakdownWindow() + local playerSelected = Details:GetActorObjectFromBreakdownWindow() if (playerSelected and playerSelected == self.playerObject) then self:SetBackdropColor(unpack(scrollbox_line_backdrop_color_selected)) self.isSelected = true diff --git a/frames/window_playerbreakdown_spells.lua b/frames/window_playerbreakdown_spells.lua index 82e94f5b..12995095 100644 --- a/frames/window_playerbreakdown_spells.lua +++ b/frames/window_playerbreakdown_spells.lua @@ -31,11 +31,6 @@ local spellBlockContainerSettings = { local spellBreakdownSettings = {} -local row_backdrop = {bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", - insets = {left = 0, right = 0, top = 0, bottom = 0}} -local row_backdrop_onleave = {bgFile = "", edgeFile = "", tile = true, tileSize = 16, edgeSize = 32, - insets = {left = 1, right = 1, top = 0, bottom = 1}} - local CONST_BAR_HEIGHT = 20 local CONST_TARGET_HEIGHT = 18 @@ -82,13 +77,13 @@ local columnInfo = { {name = "amount", label = "total", width = 50, align = "left", enabled = true}, {name = "persecond", label = "ps", width = 50, align = "left", enabled = true}, {name = "percent", label = "%", width = 50, align = "left", enabled = true}, - {name = "casts", label = "casts", width = 40, align = "left", enabled = true}, - {name = "critpercent", label = "crit %", width = 40, align = "left", enabled = true}, - {name = "hits", label = "hits", width = 40, align = "left", enabled = true}, - {name = "castavg", label = "cast avg", width = 50, align = "left", enabled = true}, - {name = "uptime", label = "uptime", width = 45, align = "left", enabled = true}, - {name = "overheal", label = "overheal", width = 45, align = "left", enabled = true, attribute = DETAILS_ATTRIBUTE_HEAL}, - {name = "absorbed", label = "absorbed", width = 45, align = "left", enabled = true, attribute = DETAILS_ATTRIBUTE_HEAL}, + {name = "casts", label = "casts", width = 40, align = "left", enabled = false}, + {name = "critpercent", label = "crit %", width = 40, align = "left", enabled = false}, + {name = "hits", label = "hits", width = 40, align = "left", enabled = false}, + {name = "castavg", label = "cast avg", width = 50, align = "left", enabled = false}, + {name = "uptime", label = "uptime", width = 45, align = "left", enabled = false}, + {name = "overheal", label = "overheal", width = 45, align = "left", enabled = false, attribute = DETAILS_ATTRIBUTE_HEAL}, + {name = "absorbed", label = "absorbed", width = 45, align = "left", enabled = false, attribute = DETAILS_ATTRIBUTE_HEAL}, } function spellsTab.BuildHeaderTable() @@ -187,6 +182,7 @@ end --called when the tab is getting created function spellsTab.OnCreateTabCallback(tabButton, tabFrame) spellBreakdownSettings = Details.breakdown_spell_tab + DetailsFramework:ApplyStandardBackdrop(tabFrame) --create the scrollbar to show the spells in the breakdown window ---@type breakdownspellscrollframe @@ -209,13 +205,10 @@ function spellsTab.OnCreateTabCallback(tabButton, tabFrame) spellsTab.CreateReportButtons(tabFrame) --these bars table are kinda deprecated now: - --store the spell bars for the spell container - tabFrame.barras1 = {} - --store the target bars for the target container - tabFrame.barras2 = {} + tabFrame.barras1 = {} --deprecated --store the special bars shown in the right side of the breakdown window, this is only shown when spellBlocks aren't in use - tabFrame.barras3 = {} + tabFrame.barras3 = {} --deprecated spellsTab.TabFrame = tabFrame end @@ -332,15 +325,6 @@ do --hide bars functions - to be refactored for index = 1, #allBars, 1 do allBars[index]:Hide() allBars[index].textura:SetStatusBarColor(1, 1, 1, 1) - allBars[index].on_focus = false - end - end - - --hide all the bars of the player's targets - function spellsTab.HidaAllBarrasAlvo() - local allBars = _detalhes.playerDetailWindow.barras2 - for index = 1, #allBars, 1 do - allBars[index]:Hide() end end @@ -604,11 +588,11 @@ local onEnterBreakdownSpellBar = function(spellBar) --parei aqui: precisa por no blockLine1.leftText:SetText(Loc ["STRING_CAST"] .. ": " .. spellBar.amountCasts) --total amount of casts blockLine1.rightText:SetText(Loc ["STRING_HITS"]..": " .. totalHits) --hits and uptime - blockLine2.leftText:SetText(Loc ["STRING_DAMAGE"]..": " .. Details:Format(spellTable.total)) --total damage + blockLine2.leftText:SetText(Loc ["STRING_HEAL"]..": " .. Details:Format(spellTable.total)) --total damage blockLine2.rightText:SetText(Details:GetSpellSchoolFormatedName(spellTable.spellschool)) --spell school blockLine3.leftText:SetText(Loc ["STRING_AVERAGE"] .. ": " .. Details:Format(spellBar.average)) --average damage - blockLine3.rightText:SetText(Loc ["STRING_DPS"] .. ": " .. Details:CommaValue(spellBar.perSecond)) --dps + blockLine3.rightText:SetText(Loc ["STRING_HPS"] .. ": " .. Details:CommaValue(spellBar.perSecond)) --dps end --check if there's normal hits and build the block @@ -639,7 +623,7 @@ local onEnterBreakdownSpellBar = function(spellBar) --parei aqui: precisa por no local tempo = (elapsedTime * spellTable.n_total) / math.max(spellTable.total, 0.001) local normalAveragePercent = spellBar.average / normalAverage * 100 local normalTempoPercent = normalAveragePercent * tempo / 100 - blockLine3.rightText:SetText(Loc ["STRING_DPS"] .. ": " .. Details:CommaValue(spellTable.n_total / normalTempoPercent)) + blockLine3.rightText:SetText(Loc ["STRING_HPS"] .. ": " .. Details:CommaValue(spellTable.n_total / normalTempoPercent)) end ---@type number @@ -668,7 +652,36 @@ local onEnterBreakdownSpellBar = function(spellBar) --parei aqui: precisa por no local tempo = (elapsedTime * spellTable.c_total) / math.max(spellTable.total, 0.001) local critAveragePercent = spellBar.average / critAverage * 100 local critTempoPercent = critAveragePercent * tempo / 100 - blockLine3.rightText:SetText(Loc ["STRING_DPS"] .. ": " .. Details:CommaValue(spellTable.c_total / critTempoPercent)) + blockLine3.rightText:SetText(Loc ["STRING_HPS"] .. ": " .. Details:CommaValue(spellTable.c_total / critTempoPercent)) + end + + ---@type number + local overheal = spellTable.overheal + if (overheal > 0) then + blockIndex = blockIndex + 1 --skip one block + ---@type breakdownspellblock + local critHitsBlock = spellBlockContainer:GetBlock(blockIndex) + critHitsBlock:Show() + blockIndex = blockIndex + 1 + + local blockName + if (spellTable.is_shield) then + blockName = Loc ["STRING_SHIELD_OVERHEAL"] + else + blockName = Loc ["STRING_OVERHEAL"] + end + + local percent = overheal / (overheal + spellTable.total) * 100 + critHitsBlock:SetValue(percent) + critHitsBlock.sparkTexture:SetPoint("left", critHitsBlock, "left", percent / 100 * critHitsBlock:GetWidth() + spellBreakdownSettings.blockspell_spark_offset, 0) + critHitsBlock:SetStatusBarColor(1, 1, 1, .5) + + local blockLine1, blockLine2, blockLine3 = critHitsBlock:GetLines() + blockLine1.leftText:SetText(blockName) + + local overhealString = Details:CommaValue(overheal) + local overhealText = overhealString .. " / " .. string.format("%.1f", percent) .. "%" + blockLine1.rightText:SetText(overhealText) end end @@ -682,74 +695,56 @@ end ---run this function when the mouse leaves a breakdownspellbar ---@param spellBar breakdownspellbar local onLeaveBreakdownSpellBar = function(spellBar) - --diminui o tamanho da barra + --remove effects on entering the bar line spellBar:SetHeight(CONST_SPELLSCROLL_LINEHEIGHT) - --volta com o alfa antigo da barra que era de 0.9 spellBar:SetAlpha(0.9) - --volto o background ao normal - spellBar:SetBackdrop(row_backdrop_onleave) - spellBar:SetBackdropBorderColor(0, 0, 0, 0) - spellBar:SetBackdropColor(0, 0, 0, 0) - GameTooltip:Hide() GameCooltip:Hide() - - if (spellBar.isMain) then - --retira o zoom no icone - spellBar.spellIcon:SetSize(CONST_SPELLSCROLL_LINEHEIGHT, CONST_SPELLSCROLL_LINEHEIGHT) - spellBar.spellIcon:SetAlpha(1) - - --remover o conte�do que estava sendo mostrado na direita - if (breakdownWindow.mostrando_mouse_over) then - breakdownWindow.mostrando = nil - breakdownWindow.mostrando_mouse_over = false - breakdownWindow.showing = nil - breakdownWindow.jogador.detalhes = nil - spellsTab.HidaAllDetalheInfo() - end - - elseif (spellBar.isAlvo) then - spellBar:SetHeight(CONST_TARGET_HEIGHT) - - elseif (spellBar.isDetalhe) then - spellBar:SetHeight(16) - end end ---on mouse down a breakdownspellbar in the breakdown window ---@param spellBar breakdownspellbar ---@param button string local onMouseDownBreakdownSpellBar = function(spellBar, button) - local x, y = _G.GetCursorPosition() - spellBar.cursorPosX = math.floor(x) - spellBar.cursorPosY = math.floor(y) - Details222.PlayerBreakdown.OnMouseDown(spellBar, button) + print(1, spellBar:GetName()) + if false then + local x, y = _G.GetCursorPosition() + spellBar.cursorPosX = math.floor(x) + spellBar.cursorPosY = math.floor(y) + Details222.PlayerBreakdown.OnMouseDown(spellBar, button) + end end ---on mouse up a breakdownspellbar in the breakdown window ---@param spellBar breakdownspellbar ---@param button string local onMouseUpBreakdownSpellBar = function(spellBar, button) - if (spellBar.onMouseUpTime == GetTime()) then - return + print(2, spellBar:GetName()) + if false then + if (spellBar.onMouseUpTime == GetTime()) then + return + end + + spellBar.onMouseUpTime = GetTime() + + ---@type number, number + local x, y = _G.GetCursorPosition() + x = math.floor(x) + y = math.floor(y) + + ---@type boolean + local bIsMouseInTheSamePosition = (x == spellBar.cursorPosX) and (y == spellBar.cursorPosY) + + --if the mouse is in the same position, then the user clicked the bar + --clicking the bar activate the lock mechanism + if (bIsMouseInTheSamePosition) then + spellsTab.SelectSpellBar(spellBar) + end end - spellBar.onMouseUpTime = GetTime() - - ---@type number, number - local x, y = _G.GetCursorPosition() - x = math.floor(x) - y = math.floor(y) - - ---@type boolean - local bIsMouseInTheSamePosition = (x == spellBar.cursorPosX) and (y == spellBar.cursorPosY) - - --if the mouse is in the same position, then the user clicked the bar - --clicking the bar activate the lock mechanism - if (bIsMouseInTheSamePosition) then - spellsTab.SelectSpellBar(spellBar) - end + --print("selecting spell bar") + --spellsTab.SelectSpellBar(spellBar) end @@ -1340,7 +1335,7 @@ function spellsTab.CreateSpellScrollContainer(tabFrame) local headerTable = {} - scrollFrame.Header = DetailsFramework:CreateHeader(scrollFrame, headerTable, headerOptions) + scrollFrame.Header = DetailsFramework:CreateHeader(tabFrame, headerTable, headerOptions) scrollFrame.Header:SetPoint("topleft", scrollFrame, "topleft", 0, 0) --create the scroll lines @@ -1375,7 +1370,7 @@ local onEnterSpellTarget = function(targetFrame) local spellId = targetFrame.spellId ---@type actor - local actorObject = Details:GetPlayerObjectFromBreakdownWindow() + local actorObject = Details:GetActorObjectFromBreakdownWindow() local targets if (targetFrame.bIsMainLine) then @@ -1549,16 +1544,45 @@ end ---@param index number ---@return breakdownspellbar function spellsTab.CreateSpellBar(self, index) --~spellbar ~spellline ~spell ~create ~createline + + if (index == 1) then + --on this debug the onmousedown and onmouseup are working properly because is parented to the breakdownWindow + --but not on the spellbar which is parented to the spellscrollframe + local b = CreateFrame("button", nil, breakdownWindow, "BackdropTemplate") + b:SetSize(64, 64) + b:EnableMouse(true) + b:RegisterForClicks("AnyUp", "AnyDown") + b:SetPoint("topleft", breakdownWindow, "topleft", 50, -30) + b:SetScript("OnMouseDown", function() print("hi") end) + b:SetScript("OnMouseUp", function() print("bye") end) + DF:ApplyStandardBackdrop(b) + end + + local buttonTest = CreateFrame("button", self:GetName() .. "SpellBarTest" .. index, self, "BackdropTemplate") + buttonTest:SetSize(64, 64) + buttonTest:EnableMouse(true) + buttonTest:RegisterForClicks("AnyUp", "AnyDown") + buttonTest:SetFrameStrata("TOOLTIP") + buttonTest:SetScript("OnMouseDown", function() print("hi") end) + buttonTest:SetScript("OnMouseUp", function() print("bye") end) + DF:ApplyStandardBackdrop(buttonTest) + ---@type breakdownspellbar local spellBar = CreateFrame("button", self:GetName() .. "SpellBar" .. index, self, "BackdropTemplate") - spellBar:SetHeight(CONST_SPELLSCROLL_LINEHEIGHT) spellBar.index = index + + --size and positioning + spellBar:SetHeight(CONST_SPELLSCROLL_LINEHEIGHT) local y = (index-1) * CONST_SPELLSCROLL_LINEHEIGHT * -1 + (1 * -index) - 15 spellBar:SetPoint("topleft", self, "topleft", 0, y) spellBar:SetPoint("topright", self, "topright", 0, y) - spellBar:SetFrameLevel(self:GetFrameLevel() + 1) + + buttonTest:SetPoint("topleft", self, "topleft", 0, y) + spellBar:EnableMouse(true) - spellBar:RegisterForClicks("LeftButtonDown", "RightButtonUp") + spellBar:RegisterForClicks("AnyUp", "AnyDown") + spellBar:SetAlpha(0.9) + spellBar:SetFrameStrata("HIGH") spellBar:SetScript("OnEnter", onEnterBreakdownSpellBar) spellBar:SetScript("OnLeave", onLeaveBreakdownSpellBar) spellBar:SetScript("OnMouseDown", onMouseDownBreakdownSpellBar) @@ -1567,9 +1591,11 @@ function spellsTab.CreateSpellBar(self, index) --~spellbar ~spellline ~spell ~cr spellBar.ExpandedChildren = {} DF:Mixin(spellBar, DF.HeaderFunctions) + DF:Mixin(buttonTest, DF.HeaderFunctions) ---@type statusbar local statusBar = CreateFrame("StatusBar", "$parentStatusBar", spellBar, "BackdropTemplate") + statusBar:EnableMouse(false) statusBar:SetFrameLevel(spellBar:GetFrameLevel()-1) statusBar:SetAllPoints() statusBar:SetAlpha(0.5) @@ -1672,91 +1698,9 @@ function spellsTab.CreateSpellBar(self, index) --~spellbar ~spellline ~spell ~cr end spellBar:AlignWithHeader(self.Header, "left") - - spellBar.on_focus = false - return spellBar end - ---[=[ -function gump:CriaNovaBarraInfo2(instance, index) --not used on this file, used on class damage, heal, etc - if (_detalhes.playerDetailWindow.barras2[index]) then - return - end - - local janela = info.container_alvos.gump - - local newBar = CreateFrame("Button", "Details_infobox2_bar_" .. index, info.container_alvos.gump, "BackdropTemplate") - newBar:SetHeight(CONST_TARGET_HEIGHT) - - local y = (index-1) * (CONST_TARGET_HEIGHT + 1) - y = y* - 1 - - newBar:SetPoint("LEFT", janela, "LEFT", CONST_TARGET_HEIGHT, 0) - newBar:SetPoint("RIGHT", janela, "RIGHT", 0, 0) - newBar:SetPoint("TOP", janela, "TOP", 0, y) - newBar:SetFrameLevel(janela:GetFrameLevel() + 1) - newBar:EnableMouse(true) - newBar:RegisterForClicks("LeftButtonDown","RightButtonUp") - - --icon - newBar.icone = newBar:CreateTexture(nil, "OVERLAY") - newBar.icone:SetWidth(CONST_TARGET_HEIGHT) - newBar.icone:SetHeight(CONST_TARGET_HEIGHT) - newBar.icone:SetPoint("RIGHT", newBar, "LEFT", 0, 0) - - CriaTexturaBarra(newBar) - - newBar:SetAlpha(ALPHA_BLEND_AMOUNT) - newBar.icone:SetAlpha(1) - - newBar.isAlvo = true - - SetBarraScripts(newBar, instance, index) - - info.barras2[index] = newBar --barra adicionada - - return newBar -end - -function gump:CriaNovaBarraInfo3(instance, index) --not used on this file, used on class damage, heal, etc - if (_detalhes.playerDetailWindow.barras3[index]) then - return - end - - local janela = info.container_detalhes - - local newBar = CreateFrame("button", "Details_infobox3_bar_" .. index, janela, "BackdropTemplate") - newBar:SetHeight(16) - - local y = (index-1) * 17 - y = y*-1 - - container3_bars_pointFunc(newBar, index) --what this fun does? - newBar:EnableMouse(true) - - --icon - newBar.icone = newBar:CreateTexture(nil, "OVERLAY") - newBar.icone:SetWidth(14) - newBar.icone:SetHeight(14) - newBar.icone:SetPoint("LEFT", newBar, "LEFT", 0, 0) - - CriaTexturaBarra(newBar) - - newBar:SetAlpha(0.9) - newBar.icone:SetAlpha(1) - - newBar.isDetalhe = true - - SetBarraScripts(newBar, instance, index) - - info.barras3[index] = newBar - - return newBar -end ---]=] - ----------------------------------------------------------------------------------------------------------------------- --> report data diff --git a/functions/macros.lua b/functions/macros.lua index 10e66774..a208ddeb 100644 --- a/functions/macros.lua +++ b/functions/macros.lua @@ -9,9 +9,9 @@ function Details:OpenPlayerDetails(window) if (instance) then local display, subDisplay = instance:GetDisplay() if (display == 1) then - instance:AbreJanelaInfo (Details:GetPlayer(false, 1)) + Details:OpenBreakdownWindow(instance, Details:GetPlayer(false, 1)) elseif (display == 2) then - instance:AbreJanelaInfo (Details:GetPlayer(false, 2)) + Details:OpenBreakdownWindow(instance, Details:GetPlayer(false, 2)) end end end \ No newline at end of file diff --git a/functions/mixin.lua b/functions/mixin.lua index cc3f4937..5234e09e 100644 --- a/functions/mixin.lua +++ b/functions/mixin.lua @@ -146,6 +146,10 @@ local spellTable_FieldsToSum = { ["b_dmg"] = true, ["a_amt"] = true, ["a_dmg"] = true, + ["totalabsorb"] = true, + ["absorbed"] = true, + ["overheal"] = true, + ["totaldenied"] = true, } ---get the array of spelltables and sum each spellTable with the first spellTable found or on targetTable diff --git a/functions/profiles.lua b/functions/profiles.lua index 81d9e161..f4afb2a8 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -471,9 +471,6 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy) --update tooltip settings _detalhes:SetTooltipBackdrop() - --update player detail window - _detalhes:ApplyPDWSkin() - --update the numerical system _detalhes:SelectNumericalSystem() diff --git a/startup.lua b/startup.lua index b9450a2c..9ccb9d65 100644 --- a/startup.lua +++ b/startup.lua @@ -94,7 +94,7 @@ function Details:StartMeUp() Details.MicroButtonAlert:Hide() --actor details window - Details.playerDetailWindow = Details.gump:CriaJanelaInfo() + Details.playerDetailWindow = Details:CreateBreakdownWindow() Details.FadeHandler.Fader(Details.playerDetailWindow, 1) --copy and paste window