Added sorting to all headers to ascending and descending

This commit is contained in:
Tercio Jose
2023-04-21 21:46:36 -03:00
parent 36e5d2978f
commit c9b801e7f0
6 changed files with 160 additions and 151 deletions
+7 -27
View File
@@ -361,7 +361,7 @@
---@field Tempo fun(actor: actor) : number get the activity or effective time of the actor
---@field GetPets fun(actor: actor) : table<number, string> get a table with all pet names that belong to the player
---@field GetSpellList fun(actor: actor) : table<number, spelltable>
---@field BuildSpellTargetFromBreakdownSpellData fun(actor: actor, bkSpellData: breakdownspelldata) : table
---@field BuildSpellTargetFromBreakdownSpellData fun(actor: actor, bkSpellData: spelltableadv) : table
---@field BuildSpellTargetFromSpellTable fun(actor: actor, spellTable: spelltable) : table
---@field debuff_uptime_spells table
---@field buff_uptime_spells table
@@ -419,7 +419,7 @@
---@class breakdownscrolldata : table
---@field totalValue number total done by the actor
---@field combatTime number
---@field [breakdownspelldata] breakdownspelldata indexed part of the table
---@field [spelltableadv] spelltableadv indexed part of the table
---@class breakdownexpandbutton : button
---@field texture texture
@@ -444,7 +444,7 @@
---@field cursorPosX number mouse position when the spellbar got OnMouseDown event
---@field cursorPosY number mouse position when the spellbar got OnMouseDown event
---@field spellTable spelltable
---@field bkSpellData breakdownspelldata
---@field bkSpellData spelltableadv
---@field statusBar statusbar
---@field expandButton breakdownexpandbutton
---@field spellIconFrame frame
@@ -458,11 +458,8 @@
---@field AddFrameToHeaderAlignment fun(self: breakdownspellbar, frame: uiobject)
---@field AlignWithHeader fun(self: breakdownspellbar, header: table, align: string|"left")
---@class breakdownspelldata : table, spelltablemixin
---@field id number main spellId to be used on the tooltip, name and icon
---@field total number total done by the spell
---@field counter number amount of hits
---@field spellschool number the school of the spell
---spelltableadv is similar to spelltable but allow custom members, methods and any modification isn't save to saved variables
---@class spelltableadv : spelltable, spelltablemixin
---@field expanded boolean if is true the show the nested spells
---@field spellTables spelltable[]
---@field spellIds number[]
@@ -470,32 +467,15 @@
---@field bCanExpand boolean
---@field expandedIndex number
---@field bIsExpanded boolean
---@field c_amt number critical hits
---@field c_min number
---@field c_max number
---@field c_total number
---@field n_amt number normal hits
---@field n_total number total damage made by normal hits
---@field n_min number min damage made by normal hits
---@field n_max number max damage made by normal hits
---@field successful_casted number successful casted times (only for enemies)
---@field g_amt number glacing hits
---@field g_dmg number
---@field r_amt number --resisted
---@field r_dmg number
---@field b_amt number --blocked
---@field b_dmg number
---@field a_amt number --absorved
---@field a_dmg number
---@class breakdowntargetframe : frame
---@field spellId number
---@field bkSpellData breakdownspelldata
---@field bkSpellData spelltableadv
---@field spellTable spelltable
---@field texture texture
---@field bIsMainLine boolean
---@class breakdownspelldatalist : breakdownspelldata[]
---@class breakdownspelldatalist : spelltableadv[]
---@field totalValue number
---@field combatTime number
+6 -6
View File
@@ -4551,14 +4551,14 @@ function atributo_damage:MontaInfoDamageDone() --I guess this fills the list of
---@type number in which index the spell with the same name was stored
local index = alreadyAdded[spellName]
if (index) then
---@type breakdownspelldata
---@type spelltableadv
local bkSpellData = breakdownSpellDataList[index]
bkSpellData.spellIds[#bkSpellData.spellIds+1] = spellId
bkSpellData.spellTables[#bkSpellData.spellTables+1] = spellTable
bkSpellData.petNames[#bkSpellData.petNames+1] = ""
bkSpellData.bCanExpand = true
else
---@type breakdownspelldata
---@type spelltableadv
local bkSpellData = {
id = spellId,
spellschool = spellTable.spellschool,
@@ -4596,14 +4596,14 @@ function atributo_damage:MontaInfoDamageDone() --I guess this fills the list of
---@type number in which index the spell with the same name was stored
local index = alreadyAdded[spellName]
if (index) then --PET
---@type breakdownspelldata
---@type spelltableadv
local bkSpellData = breakdownSpellDataList[index]
bkSpellData.spellIds[#bkSpellData.spellIds+1] = spellId
bkSpellData.spellTables[#bkSpellData.spellTables+1] = spellTable
bkSpellData.petNames[#bkSpellData.petNames+1] = petName
bkSpellData.bCanExpand = true
else --PET
---@type breakdownspelldata
---@type spelltableadv
local bkSpellData = {
id = spellId,
spellschool = spellTable.spellschool,
@@ -4624,10 +4624,10 @@ function atributo_damage:MontaInfoDamageDone() --I guess this fills the list of
end
end
--copy the keys from the spelltable and add them to the breakdownspelldata
--copy the keys from the spelltable and add them to the spelltableadv
--repeated spells will be summed
for i = 1, #breakdownSpellDataList do
---@type breakdownspelldata
---@type spelltableadv
local bkSpellData = breakdownSpellDataList[i]
Details.SpellTableMixin.SumSpellTables(bkSpellData.spellTables, bkSpellData)
end
+8 -5
View File
@@ -1902,14 +1902,14 @@ function atributo_heal:MontaInfoHealingDone()
---@type number in which index the spell with the same name was stored
local index = alreadyAdded[spellName]
if (index) then
---@type breakdownspelldata
---@type spelltableadv
local bkSpellData = actorSpellsSorted[index]
bkSpellData.spellIds[#bkSpellData.spellIds+1] = spellId
bkSpellData.spellTables[#bkSpellData.spellTables+1] = spellTable
bkSpellData.petNames[#bkSpellData.petNames+1] = ""
bkSpellData.bCanExpand = true
else
---@type breakdownspelldata
---@type spelltableadv
local bkSpellData = {
id = spellId,
spellschool = spellTable.spellschool,
@@ -1920,6 +1920,7 @@ function atributo_heal:MontaInfoHealingDone()
spellTables = {spellTable}, --sub spell tables to show if the spell is expanded
petNames = {""},
}
detailsFramework:Mixin(bkSpellData, Details.SpellTableMixin)
actorSpellsSorted[#actorSpellsSorted+1] = bkSpellData
alreadyAdded[spellName] = #actorSpellsSorted
@@ -1946,14 +1947,14 @@ function atributo_heal:MontaInfoHealingDone()
---@type number in which index the spell with the same name was stored
local index = alreadyAdded[spellName]
if (index) then --PET
---@type breakdownspelldata
---@type spelltableadv
local bkSpellData = actorSpellsSorted[index]
bkSpellData.spellIds[#bkSpellData.spellIds+1] = spellId
bkSpellData.spellTables[#bkSpellData.spellTables+1] = spellTable
bkSpellData.petNames[#bkSpellData.petNames+1] = petName
bkSpellData.bCanExpand = true
else --PET
---@type breakdownspelldata
---@type spelltableadv
local bkSpellData = {
id = spellId,
spellschool = spellTable.spellschool,
@@ -1964,6 +1965,8 @@ function atributo_heal:MontaInfoHealingDone()
spellTables = {spellTable},
petNames = {petName},
}
detailsFramework:Mixin(bkSpellData, Details.SpellTableMixin)
actorSpellsSorted[#actorSpellsSorted+1] = bkSpellData
alreadyAdded[spellName] = #actorSpellsSorted
end
@@ -1973,7 +1976,7 @@ function atributo_heal:MontaInfoHealingDone()
end
for i = 1, #actorSpellsSorted do
---@type breakdownspelldata
---@type spelltableadv
local bkSpellData = actorSpellsSorted[i]
Details.SpellTableMixin.SumSpellTables(bkSpellData.spellTables, bkSpellData)
end
+14 -2
View File
@@ -33,8 +33,9 @@ local spellTable_FieldsToSum = {
---@class spelltablemixin
---@field GetCritPercent fun(spellTable: spelltable) : number
---@field GetCritAverage fun(spellTable: spelltable) : number
---@field GetCastAmount fun(spellTable: spelltable, actorName: string, combatObject: combat)
---@field GetCastAverage fun(spellTable: spelltable, castAmount: number)
---@field SumSpellTables fun(spellTables: spelltable[], targetTable: table)
---@field GetCastsAmount fun(spellTable: spelltable, actorName: string, combatObject: combat)
Details.SpellTableMixin = {
---return the critical hits percent
@@ -56,10 +57,21 @@ Details.SpellTableMixin = {
---@param actorName string
---@param combatObject combat
---@return number
GetCastsAmount = function(spellTable, actorName, combatObject)
GetCastAmount = function(spellTable, actorName, combatObject)
return combatObject:GetSpellCastAmount(actorName, spellTable.id)
end,
---return the average damage per cast
---@param spellTable spelltable
---@param castAmount number
---@return number
GetCastAverage = function(spellTable, castAmount)
if (castAmount > 0) then
return spellTable.total / castAmount
end
return 0
end,
---get the array of spelltables and sum each spellTable with the first spellTable found or on targetTable
---only sum the keys found in the spellTable_FieldsToSum table
---@param spellTables spelltable[]
+123 -109
View File
@@ -34,7 +34,7 @@ local spellBreakdownSettings = {}
local CONST_BAR_HEIGHT = 20
local CONST_TARGET_HEIGHT = 18
local CONST_SPELLSCROLL_WIDTH = 435
local CONST_SPELLSCROLL_WIDTH = 535
local CONST_SPELLSCROLL_HEIGHT = 311
local CONST_SPELLSCROLL_AMTLINES = 14
local CONST_SPELLSCROLL_LINEHEIGHT = 20
@@ -108,10 +108,10 @@ local spellContainerColumnInfo = {
{name = "casts", label = "casts", key = "casts", width = 40, align = "left", enabled = true, canSort = true, offset = columnOffset, order = "DESC", dataType = "number"},
{name = "critpercent", label = "crit %", key = "critpercent", width = 40, align = "left", enabled = true, canSort = true, offset = columnOffset, order = "DESC", dataType = "number"},
{name = "hits", label = "hits", key = "counter", width = 40, align = "left", enabled = true, canSort = true, offset = columnOffset, order = "DESC", dataType = "number"},
{name = "castavg", label = "cast avg", key = "total", width = 50, align = "left", enabled = true, canSort = true, offset = columnOffset, order = "DESC", dataType = "number"},
{name = "uptime", label = "uptime", key = "total", width = 45, align = "left", enabled = true, canSort = true, offset = columnOffset, order = "DESC", dataType = "number"},
{name = "overheal", label = "overheal", key = "total", width = 45, align = "left", enabled = false, canSort = true, order = "DESC", dataType = "number", attribute = DETAILS_ATTRIBUTE_HEAL, offset = columnOffset},
{name = "absorbed", label = "absorbed", key = "total", width = 45, align = "left", enabled = false, canSort = true, order = "DESC", dataType = "number", attribute = DETAILS_ATTRIBUTE_HEAL, offset = columnOffset},
{name = "castavg", label = "cast avg", key = "castavg", width = 50, align = "left", enabled = true, canSort = true, offset = columnOffset, order = "DESC", dataType = "number"},
{name = "uptime", label = "uptime", key = "uptime", width = 45, align = "left", enabled = true, canSort = true, offset = columnOffset, order = "DESC", dataType = "number"},
{name = "overheal", label = "overheal", key = "overheal", width = 55, align = "left", enabled = false, canSort = true, order = "DESC", dataType = "number", attribute = DETAILS_ATTRIBUTE_HEAL, offset = columnOffset},
{name = "absorbed", label = "absorbed", key = "healabsorbed", width = 55, align = "left", enabled = false, canSort = true, order = "DESC", dataType = "number", attribute = DETAILS_ATTRIBUTE_HEAL, offset = columnOffset},
}
---callback for when the user resizes a column on the header
@@ -141,17 +141,12 @@ end
---@param headerFrame df_headerframe
---@param columnHeader df_headercolumnframe
local onColumnHeaderClickCallback = function(headerFrame, columnHeader)
print("column header clicked!")
---@type string
local containerType = headerContainerType[headerFrame]
if (containerType == "spells") then
spellsTab.TabFrame.SpellScrollFrame:Refresh()
end
--tab:fillfunction(Details:GetPlayerObjectFromBreakdownWindow(), Details:GetCombatFromBreakdownWindow())
end
---update details profile
@@ -383,24 +378,6 @@ function spellsTab.OnCreateTabCallback(tabButton, tabFrame)
--]=]
end
function spellsTab.CreateReportButtons(tabFrame)
--spell list report button
tabFrame.report_esquerda = Details.gump:NewDetailsButton(tabFrame, tabFrame, nil, _detalhes.Reportar, tabFrame, 1, 16, 16, "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", nil, "DetailsJanelaInfoReport2")
tabFrame.report_esquerda:SetPoint("bottomleft", tabFrame.SpellScrollFrame, "TOPLEFT", 33, 3)
tabFrame.report_esquerda:SetFrameLevel(tabFrame:GetFrameLevel()+2)
tabFrame.topleft_report = tabFrame.report_esquerda
--targets report button
tabFrame.report_alvos = Details.gump:NewDetailsButton(tabFrame, tabFrame, nil, _detalhes.Reportar, tabFrame, 3, 16, 16, "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", nil, "DetailsJanelaInfoReport3")
tabFrame.report_alvos:SetPoint("bottomright", tabFrame.container_alvos, "TOPRIGHT", -2, -1)
tabFrame.report_alvos:SetFrameLevel(3) --solved inactive problem
--special barras in the right report button
tabFrame.report_direita = Details.gump:NewDetailsButton(tabFrame, tabFrame, nil, _detalhes.Reportar, tabFrame, 2, 16, 16, "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", nil, "DetailsJanelaInfoReport4")
tabFrame.report_direita:SetPoint("TOPRIGHT", tabFrame, "TOPRIGHT", -10, -70)
tabFrame.report_direita:Show()
end
----------------------------------------------------------------------
--> scripts
@@ -645,7 +622,7 @@ local onEnterBreakdownSpellBar = function(spellBar) --parei aqui: precisa por no
end
---@type number
local overheal = spellTable.overheal
local overheal = spellTable.overheal or 0
if (overheal > 0) then
blockIndex = blockIndex + 1 --skip one block
---@type breakdownspellblock
@@ -994,7 +971,7 @@ end
---@param combatObject combat
---@param scrollFrame table
---@param headerTable table
---@param bkSpellData breakdownspelldata
---@param bkSpellData spelltableadv
---@param bkSpellStableIndex number
---@param totalValue number
---@param maxValue number
@@ -1051,7 +1028,12 @@ local updateSpellBar = function(spellBar, index, actorName, combatObject, scroll
spellBar.spellIconFrame.spellId = spellId
--statusbar size by percent, statusbar color by school
spellBar.statusBar:SetValue(value / maxValue * 100)
if (maxValue > 0) then
spellBar.statusBar:SetValue(value / maxValue * 100)
else
spellBar.statusBar:SetValue(0)
end
local r, g, b = Details:GetSpellSchoolColor(spellTable.spellschool or 1)
spellBar.statusBar:SetStatusBarColor(r, g, b, 1)
@@ -1130,12 +1112,12 @@ local updateSpellBar = function(spellBar, index, actorName, combatObject, scroll
spellBar:AddFrameToHeaderAlignment(text)
textIndex = textIndex + 1
elseif (header.name == "casts") then --the tab doesn't have information about the amount of casts
elseif (header.name == "casts") then
text:SetText(amtCasts)
spellBar:AddFrameToHeaderAlignment(text)
textIndex = textIndex + 1
elseif (header.name == "critpercent") then --the tab does not have this information
elseif (header.name == "critpercent") then
text:SetText(string.format("%.1f", spellTable.c_amt / (spellTable.counter) * 100) .. "%")
spellBar:AddFrameToHeaderAlignment(text)
textIndex = textIndex + 1
@@ -1146,8 +1128,12 @@ local updateSpellBar = function(spellBar, index, actorName, combatObject, scroll
textIndex = textIndex + 1
elseif (header.name == "castavg") then
spellBar.castAverage = value / amtCasts
text:SetText(Details:Format(spellBar.castAverage))
if (amtCasts > 0) then
spellBar.castAverage = value / amtCasts
text:SetText(Details:Format(spellBar.castAverage))
else
text:SetText("0")
end
spellBar:AddFrameToHeaderAlignment(text)
textIndex = textIndex + 1
@@ -1226,7 +1212,7 @@ local refreshFunc = function(scrollFrame, scrollData, offset, totalLines) --~ref
for i = 1, totalLines do
local index = i + offset
---@type breakdownspelldata
---@type spelltableadv
local bkSpellData = scrollData[index]
if (bkSpellData) then
@@ -1349,37 +1335,48 @@ function spellsTab.CreateSpellScrollContainer(tabFrame)
--get which column is currently selected and the sort order
local columnIndex, order, key = scrollFrame.Header:GetSelectedColumn()
--examples of values from key: "casts", "percent", "total"
---@type combat
local combatObject = spellsTab.GetCombat()
---@type number, number
local mainAttribute, subAttribute = spellsTab.GetInstance():GetDisplay()
---@type string
local keyToSort = key
if (keyToSort == "critpercent") then
for i = 1, #data do
---@type breakdownspelldata
local bkSpellData = data[i]
--as the bkSpellData is a copy from the actual spelltable from the actor spell, it can have methods inherited from spelltablemixin
bkSpellData.critpercent = bkSpellData:GetCritPercent()
end
--filling necessary information to sort the data in the order the header wants
for i = 1, #data do
---@type spelltableadv
local bkSpellData = data[i]
elseif (keyToSort == "casts") then
for i = 1, #data do
---@type breakdownspelldata
local bkSpellData = data[i]
bkSpellData.casts = bkSpellData:GetCastsAmount(spellsTab.GetActor():Name(), spellsTab.GetCombat())
--crit percent
bkSpellData.critpercent = bkSpellData:GetCritPercent()
--cast amount
bkSpellData.casts = bkSpellData:GetCastAmount(spellsTab.GetActor():Name(), combatObject)
--cast avg
bkSpellData.castavg = bkSpellData:GetCastAverage(bkSpellData.casts)
--uptime
local uptime = combatObject:GetSpellUptime(spellsTab:GetActor():Name(), bkSpellData.id)
bkSpellData.uptime = uptime
if (mainAttribute == DETAILS_ATTRIBUTE_HEAL) then
bkSpellData.healabsorbed = bkSpellData.absorbed
end
end
---@type string
local keyToSort = key
if (order == "DESC") then
table.sort(data,
---@param t1 breakdownspelldata
---@param t2 breakdownspelldata
---@param t1 spelltableadv
---@param t2 spelltableadv
function(t1, t2)
return t1[keyToSort] > t2[keyToSort]
end)
else
table.sort(data,
---@param t1 breakdownspelldata
---@param t2 breakdownspelldata
---@param t1 spelltableadv
---@param t2 spelltableadv
function(t1, t2)
return t1[keyToSort] < t2[keyToSort]
end)
@@ -1404,7 +1401,7 @@ local onEnterSpellTarget = function(targetFrame)
local targets
if (targetFrame.bIsMainLine) then
---@type breakdownspelldata
---@type spelltableadv
local bkSpellData = targetFrame.bkSpellData
targets = actorObject:BuildSpellTargetFromBreakdownSpellData(bkSpellData)
else
@@ -1705,10 +1702,79 @@ function spellsTab.CreateSpellBar(self, index) --~spellbar ~spellline ~spell ~cr
return spellBar
end
-----------------------------------------------------------------------------------------------------------------------
--> create the new tab
function Details.InitializeSpellBreakdownTab()
local tabButton, tabFrame = Details:CreatePlayerDetailsTab(
"Summary", --[1] tab name
Loc ["STRING_SPELLS"], --[2] localized name
function(tabOBject, playerObject) --[3] condition
if (playerObject) then
return true
else
return false
end
end,
function() --[4] fill function | passing a fill function, it'll set a OnShow() script on the tabFrame | only run if the actor is different
spellsTab.OnShownTab()
end,
function(tabButton, tabFrame) --[5] onclick
tabFrame:Show()
end,
spellsTab.OnCreateTabCallback, --[6] oncreate
iconTableSummary, --[7] icon table
nil, --[8] replace tab
true --[9] is default tab
)
spellsTab.TabButton = tabButton
spellsTab.TabFrame = tabFrame
---on receive data from a class
---@param data breakdownspelldatalist
---@param actorObject actor
---@param combatObject combat
---@param instance instance
function tabButton.OnReceiveSpellData(data, actorObject, combatObject, instance)
spellsTab.currentActor = actorObject
spellsTab.combatObject = combatObject
spellsTab.instance = instance
spellsTab.TabFrame.SpellScrollFrame:RefreshMe(data)
end
---@type detailseventlistener
local eventListener = Details:CreateEventListener()
eventListener:RegisterEvent("DETAILS_PROFILE_APPLYED", function()
--this event don't trigger at details startup
spellsTab.OnProfileChange()
end)
end
-----------------------------------------------------------------------------------------------------------------------
--> report data
function spellsTab.monta_relatorio(botao)
function spellsTab.CreateReportButtons(tabFrame)
--spell list report button
tabFrame.report_esquerda = Details.gump:NewDetailsButton(tabFrame, tabFrame, nil, _detalhes.Reportar, tabFrame, 1, 16, 16, "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", nil, "DetailsJanelaInfoReport2")
tabFrame.report_esquerda:SetPoint("bottomleft", tabFrame.SpellScrollFrame, "TOPLEFT", 33, 3)
tabFrame.report_esquerda:SetFrameLevel(tabFrame:GetFrameLevel()+2)
tabFrame.topleft_report = tabFrame.report_esquerda
--targets report button
tabFrame.report_alvos = Details.gump:NewDetailsButton(tabFrame, tabFrame, nil, _detalhes.Reportar, tabFrame, 3, 16, 16, "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", nil, "DetailsJanelaInfoReport3")
tabFrame.report_alvos:SetPoint("bottomright", tabFrame.container_alvos, "TOPRIGHT", -2, -1)
tabFrame.report_alvos:SetFrameLevel(3) --solved inactive problem
--special barras in the right report button
tabFrame.report_direita = Details.gump:NewDetailsButton(tabFrame, tabFrame, nil, _detalhes.Reportar, tabFrame, 2, 16, 16, "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", nil, "DetailsJanelaInfoReport4")
tabFrame.report_direita:SetPoint("TOPRIGHT", tabFrame, "TOPRIGHT", -10, -70)
tabFrame.report_direita:Show()
end
function spellsTab.monta_relatorio(botao) --deprecated?
---@type attributeid
local mainSection = breakdownWindow.atributo
---@type attributeid
@@ -1914,55 +1980,3 @@ function spellsTab.monta_relatorio(botao)
return instance:envia_relatorio(report_lines)
end
-----------------------------------------------------------------------------------------------------------------------
--> create the new tab
function Details.InitializeSpellBreakdownTab()
local tabButton, tabFrame = Details:CreatePlayerDetailsTab(
"Summary", --[1] tab name
Loc ["STRING_SPELLS"], --[2] localized name
function(tabOBject, playerObject) --[3] condition
if (playerObject) then
return true
else
return false
end
end,
function() --[4] fill function | passing a fill function, it'll set a OnShow() script on the tabFrame | only run if the actor is different
spellsTab.OnShownTab()
end,
function(tabButton, tabFrame) --[5] onclick
tabFrame:Show()
end,
spellsTab.OnCreateTabCallback, --[6] oncreate
iconTableSummary, --[7] icon table
nil, --[8] replace tab
true --[9] is default tab
)
spellsTab.TabButton = tabButton
spellsTab.TabFrame = tabFrame
---on receive data from a class
---@param data breakdownspelldatalist
---@param actorObject actor
---@param combatObject combat
---@param instance instance
function tabButton.OnReceiveSpellData(data, actorObject, combatObject, instance)
spellsTab.currentActor = actorObject
spellsTab.combatObject = combatObject
spellsTab.instance = instance
spellsTab.TabFrame.SpellScrollFrame:RefreshMe(data)
end
---@type detailseventlistener
local eventListener = Details:CreateEventListener()
eventListener:RegisterEvent("DETAILS_PROFILE_APPLYED", function()
--this event don't trigger at details startup
spellsTab.OnProfileChange()
end)
end
+2 -2
View File
@@ -53,9 +53,9 @@ Details222.Mixins.ActorMixin = {
return actor.spells._ActorTable
end,
---this function sums all the targets of all spellTables conteining on a 'breakdownspelldata'
---this function sums all the targets of all spellTables conteining on a 'spelltableadv'
---@param actor actor
---@param bkSpellData breakdownspelldata
---@param bkSpellData spelltableadv
---@param targetTableName string
---@return table<string, number>
BuildSpellTargetFromBreakdownSpellData = function(actor, bkSpellData, targetTableName)