From c6527f56a0efbca0ee3e778db4e51d6a1466eade Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Sat, 6 May 2023 15:49:05 -0300 Subject: [PATCH] Framework update --- Definitions.lua | 5 +++++ Libs/DF/containers.lua | 5 +++-- Libs/DF/fw.lua | 2 +- classes/class_damage.lua | 3 +++ frames/window_playerbreakdown_spells.lua | 22 +++++++++++++++++++--- 5 files changed, 31 insertions(+), 6 deletions(-) diff --git a/Definitions.lua b/Definitions.lua index 0a028cfa..d00f955f 100644 --- a/Definitions.lua +++ b/Definitions.lua @@ -381,6 +381,11 @@ ---@field b_dmg number ---@field a_amt number --absorved ---@field a_dmg number +---@field e_total number +---@field e_amt number +---@field e_lvl table +---@field e_dmg table +---@field e_heal table ---@field isReflection boolean ---@field totalabsorb number healing absorbed ---@field absorbed number damage absorbed by shield | healing absorbed by buff or debuff diff --git a/Libs/DF/containers.lua b/Libs/DF/containers.lua index 06692c55..fa8b62f8 100644 --- a/Libs/DF/containers.lua +++ b/Libs/DF/containers.lua @@ -322,11 +322,12 @@ detailsFramework.FrameContainerMixin = { frameContainer:CheckResizeLockedState() frameContainer:CheckMovableLockedState() - if (DF.IsClassicWow()) then + + if (frameContainer.SetMinResize) then --old versions of the game uses this method frameContainer:SetMinResize(50, 50) frameContainer:SetMaxResize(1000,1000) else - frameContainer:SetResizeBounds(50, 50, 1000, 1000) + frameContainer:SetResizeBounds(50, 50, 1000, 1000) --new versions has this method end end, diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua index 6cf9d6d3..bf2b5cca 100644 --- a/Libs/DF/fw.lua +++ b/Libs/DF/fw.lua @@ -1,6 +1,6 @@ -local dversion = 425 +local dversion = 426 local major, minor = "DetailsFramework-1.0", dversion local DF, oldminor = LibStub:NewLibrary(major, minor) diff --git a/classes/class_damage.lua b/classes/class_damage.lua index dbfdf44b..80ebd9e4 100644 --- a/classes/class_damage.lua +++ b/classes/class_damage.lua @@ -4251,6 +4251,9 @@ end ------ Damage Taken function atributo_damage:MontaInfoDamageTaken() + --build the code for the new breakdown window + + local damage_taken = self.damage_taken local agressores = self.damage_from local instancia = info.instancia diff --git a/frames/window_playerbreakdown_spells.lua b/frames/window_playerbreakdown_spells.lua index 92669bf7..b1fbb68b 100644 --- a/frames/window_playerbreakdown_spells.lua +++ b/frames/window_playerbreakdown_spells.lua @@ -274,6 +274,10 @@ function spellsTab.BuildHeaderTable(containerType) containerColumnData = targetContainerColumnData end + ---result of the sum of all columns width + ---@type number + local totalWidth = 0 + for i = 1, #containerColumnData do local columnData = containerColumnData[i] ---@type {enabled: boolean, width: number, align: string} @@ -304,11 +308,19 @@ function spellsTab.BuildHeaderTable(containerType) key = columnData.key, } + totalWidth = totalWidth + headerColumnData.width headerTable[#headerTable+1] = headerColumnData end end end + if (containerType == "spells") then + --set the spell contaner width to the sum of all columns width + -- spellsTab.GetSpellScrollContainer():SetWidth(totalWidth) + --save the width of the spell container in Details settings + -- Details.breakdown_spell_tab.spellcontainer_width = totalWidth + end + return headerTable end @@ -719,7 +731,11 @@ local onEnterSpellBar = function(spellBar, motion) --parei aqui: precisa por nom blockLine1.leftText:SetText("Trinket Info") blockLine1.rightText:SetText("PPM: " .. string.format("%.2f", average / 60)) - blockLine2.leftText:SetText("Min Time: " .. math.floor(minTime)) + if (minTime == 9999999) then + blockLine2.leftText:SetText("Min Time: " .. _G["UNKNOWN"]) + else + blockLine2.leftText:SetText("Min Time: " .. math.floor(minTime)) + end blockLine2.rightText:SetText("Max Time: " .. math.floor(maxTime)) end @@ -1106,7 +1122,7 @@ local spellBlockContainerMixin = { ---create the spell blocks which shows the critical hits, normal hits, etc ---@param tabFrame tabframe ---@return breakdownspellblockframe -function spellsTab.CreateSpellBlockContainer(tabFrame) --~create +function spellsTab.CreateSpellBlockContainer(tabFrame) --~create ~createblock ~spellblock ~block ~container --create a container for the scrollframe local options = { width = Details.breakdown_spell_tab.blockcontainer_width, @@ -1893,7 +1909,7 @@ end ---creates a scrollframe which show breakdownspellbar to show the spells used by an actor ---@param tabFrame tabframe ---@return breakdownspellscrollframe -function spellsTab.CreateSpellScrollContainer(tabFrame) --~scroll ~create +function spellsTab.CreateSpellScrollContainer(tabFrame) --~scroll ~create ~spell ~container ---@type width local width = Details.breakdown_spell_tab.spellcontainer_width ---@type height