function SSOverlay_SortAll() activeTimers = SSOverlay_SortList( activeTimers, false ); SSOverlay_UpdateRows(); end -- Text > Categories > Counting up timers > Counting down timers > item count timers function SSOverlay_SortList( sortList, disableSort ) if( sortList == nil ) then return nil; end local countDown = {}; local countUp = {}; local itemCount = {}; local categoryTimers = {}; local sortedTimers = {}; for id, row in sortList do if( row.category == nil or disableSort ) then if( row.type == "down" ) then table.insert( countDown, row ); elseif( row.type == "up" ) then table.insert( countUp, row ); elseif( row.type == "item" ) then table.insert( itemCount, row ); elseif( row.type == "text" ) then table.insert( sortedTimers, row ); end else if( categoryTimers[ row.category ] == nil ) then categoryTimers[ row.category ] = {}; end table.insert( categoryTimers[ row.category ], row ); end end for cat in categoryTimers do for id, row in SSOverlay_SortList( categoryTimers[ cat ], true ) do table.insert( sortedTimers, row ); end end for id, row in countUp do table.insert( sortedTimers, row ); end for id, row in countDown do table.insert( sortedTimers, row ); end for id, row in itemCount do table.insert( sortedTimers, row ); end return sortedTimers; end