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
+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