Added option to move buffs/debuffs with no duration to the end (#56)

* Added option to move buffs/debuffs with no duration to the end of the list

* Forgot to remove some testing code
This commit is contained in:
bhhandley
2024-12-22 12:03:57 -06:00
committed by GitHub
parent 223f377b4c
commit 37b1697dc5
13 changed files with 59 additions and 3 deletions
+12
View File
@@ -584,6 +584,18 @@ function A:UpdateHeader(header)
local sortMethod = (sorters[db.sortMethod] or sorters.INDEX)[db.sortDir == "-"][db.seperateOwn]
tsort(sortingTable, sortMethod)
if db.noDurationLast then
local tempAuras = {}
for i = 1, #sortingTable do
if sortingTable[i].duration == 0 then
table.insert(tempAuras, 1, sortingTable[i])
else
table.insert(tempAuras, sortingTable[i])
end
end
sortingTable = tempAuras
end
self:ConfigureAuras(header, sortingTable, weaponPosition)
while sortingTable[1] do
releaseTable(tremove(sortingTable))
+15 -1
View File
@@ -440,6 +440,20 @@ function UF:SortAuras()
sort(self, SortAurasByCaster)
end
if self.db.noDurationLast and self[1] then
local tempAuras = {}
for i = 1, #self do
if self[i].duration == 0 then
table.insert(tempAuras, self[i])
else
table.insert(tempAuras, 1, self[i])
end
end
for i = 1, #tempAuras do
self[i] = tempAuras[i]
end
end
--Look into possibly applying filter priorities for auras here.
return 1, #self --from/to range needed for the :SetPosition call in oUF aura element. Without this aura icon position gets all whacky when not sorted by index
@@ -510,7 +524,7 @@ function UF:AuraFilter(unit, button, name, _, _, _, debuffType, duration, expira
else
db = parent.db and parent.db[self.type]
end
if not db then
return true
end