show mods in correct order
This commit is contained in:
@@ -54,6 +54,8 @@
|
|||||||
TB: 'bg-pink-500/20 text-pink-400 border-pink-500/30'
|
TB: 'bg-pink-500/20 text-pink-400 border-pink-500/30'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const MOD_ORDER = ['NM', 'HD', 'HR', 'DT', 'FM', 'TB'];
|
||||||
|
|
||||||
// Group mappool slots by category
|
// Group mappool slots by category
|
||||||
const groupedSlots = $derived(() => {
|
const groupedSlots = $derived(() => {
|
||||||
if (!m.mappool?.slots) return {};
|
if (!m.mappool?.slots) return {};
|
||||||
@@ -65,7 +67,10 @@
|
|||||||
for (const cat of Object.keys(groups)) {
|
for (const cat of Object.keys(groups)) {
|
||||||
groups[cat].sort((a: any, b: any) => a.orderInCategory - b.orderInCategory);
|
groups[cat].sort((a: any, b: any) => a.orderInCategory - b.orderInCategory);
|
||||||
}
|
}
|
||||||
return groups;
|
// Return entries sorted by canonical mod order
|
||||||
|
return Object.fromEntries(
|
||||||
|
MOD_ORDER.filter((cat) => groups[cat]).map((cat) => [cat, groups[cat]])
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Match duration
|
// Match duration
|
||||||
|
|||||||
Reference in New Issue
Block a user