zenno: nicer lobby conversation page

This commit is contained in:
2026-03-31 01:04:27 -04:00
parent 86b769d7ed
commit 08deedea8f
2 changed files with 61 additions and 15 deletions

View File

@@ -62,3 +62,21 @@ export const locations: Record<Conversation['location'], {name: RegionalName, gr
520: {name: {en: 'left side school map'}, group: 5},
530: {name: {en: 'left side school map'}, group: 5},
}
function locCharas(convos: Conversation[], locGroup: 1 | 2 | 3 | 4 | 5) {
const m = convos
.filter((c) => locations[c.location].group === locGroup)
.flatMap((c) => [c.chara_1, c.chara_2, c.chara_3].filter((x) => x != null))
.reduce((m, id) => m.set(id, 1 + (m.get(id) ?? 0)), new Map<number, number>())
return [...m].toSorted((a, b) => b[1] - a[1]) // descending
}
export const groupPopulars = {
global: {
1: locCharas(conversation.global, 1),
2: locCharas(conversation.global, 2),
3: locCharas(conversation.global, 3),
4: locCharas(conversation.global, 4),
5: locCharas(conversation.global, 5),
},
}