Added report to breakdown window

This commit is contained in:
Tercio Jose
2024-02-26 13:53:27 -03:00
parent 937e167327
commit c4040ac4de
4 changed files with 205 additions and 53 deletions
@@ -12,6 +12,7 @@ local _GetSpellInfo = Details.GetSpellInfo
local GameTooltip = GameTooltip
local IsShiftKeyDown = IsShiftKeyDown
local DF = DetailsFramework
local detailsFramework = DetailsFramework
local tinsert = table.insert
local spellsTab = DetailsSpellBreakdownTab
@@ -246,6 +247,34 @@ function spellsTab.CreatePhasesContainer(tabFrame) --~phase ~createphasecontaine
local phaseScrollFrame = DF:CreateScrollBox(container, "$parentPhaseScroll", refreshPhaseFunc, {}, width, height, defaultAmountOfLines, CONST_SPELLSCROLL_LINEHEIGHT)
DF:ReskinSlider(phaseScrollFrame)
---@param self breakdownphasescrollframe
---@return breakdownreporttable
function phaseScrollFrame:GetReportData()
local instance = spellsTab.GetInstance()
local data = phaseScrollFrame:GetData()
local formatFunc = Details:GetCurrentToKFunction()
local actorObject = spellsTab.GetActor()
local displayId, subDisplayId = instance:GetDisplay()
local subDisplayName = Details:GetSubAttributeName(displayId, subDisplayId)
local combatName = instance:GetCombat():GetCombatName()
---@type breakdownreporttable
local reportData = {
title = "Phases for " .. detailsFramework:RemoveRealmName(actorObject:Name()) .. " | " .. subDisplayName .. " | " .. combatName
}
for i = 1, #data do
local dataTable = data[i]
reportData[#reportData+1] = {
name = "Phase:" .. dataTable.phaseName,
amount = formatFunc(nil, dataTable.amountDone),
percent = string.format("%.1f", dataTable.percentDone) .. "%",
}
end
return reportData
end
phaseScrollFrame:SetBackdrop({})
phaseScrollFrame:SetAllPoints()