[+] Add ongeki b55

pull/34/head
Becods 2024-05-13 10:13:17 +08:00
parent fb72317c6f
commit e7b5991dbf
4 changed files with 77 additions and 9 deletions

View File

@ -16,7 +16,15 @@
let mapData = g.split(":").map(Number)
let mult = getMult(mapData[3], game)
let mapRank: number | undefined = meta?.notes?.[mapData[1] === 10 ? 0 : mapData[1]]?.lv
</script>
let gameIndexMap = {
'mai2': 3,
'ongeki': 2,
'chu3': 2
};
let gameIndex = gameIndexMap[game as keyof typeof gameIndexMap];
</script>
<div class="map-detail-container" transition:slide>
<div class="scores">
@ -30,11 +38,11 @@
</span>
</div>
<div class="second-line">
<span class={`rank-${getMult(mapData[3], game)[2].toString()[0]}`}>
<span class={`rank-${getMult(mapData[gameIndex], game)[2].toString()[0]}`}>
<span class="rank-text">{("" + getMult(mapData[3], game)[2]).replace("p", "+")}</span>
<span class="rank-num" use:tooltip={(mapData[3] / 10000).toFixed(4)}>
{roundFloor(mapData[3], game, 1)}%
<span class="rank-text">{("" + getMult(mapData[gameIndex], game)[2]).replace("p", "+")}</span>
<span class="rank-num" use:tooltip={(mapData[gameIndex] / 10000).toFixed(4)}>
{roundFloor(mapData[gameIndex], game, 1)}%
</span>
</span>
{#if game === 'mai2'}

View File

@ -0,0 +1,24 @@
import type { GenericGamePlaylog } from "./generalTypes";
export interface OngekiUserSummaryEntry {
name: string
iconId: number
serverRank: number
accuracy: number
rating: number
ratingHighest: number
ranks: { name: string, count: number }[]
maxCombo: number
fullCombo: number
allPerfect: number
totalDxScore: number
plays: number
totalPlayTime: number
joined: string
lastSeen: string
lastVersion: string
best30: string
best15: string
recent10: string
recent: GenericGamePlaylog[]
}

View File

@ -231,6 +231,19 @@
</div>
</div>
{#if d.user.ratingComposition.best30}
<div>
<h2>B30</h2>
<div class="rating-composition">
{#each d.user.ratingComposition.best30.split(",") as map}
<div>
<MapDetails g={map} meta={allMusics[map.split(":")[0]]} game={game}/>
</div>
{/each}
</div>
</div>
{/if}
{#if d.user.ratingComposition.best35}
<div>
<h2>B35</h2>
@ -257,6 +270,19 @@
</div>
{/if}
{#if d.user.ratingComposition.recent10}
<div>
<h2>R10</h2>
<div class="rating-composition-2">
{#each d.user.ratingComposition.recent10.split(",") as map}
<div>
<MapDetails g={map} meta={allMusics[map.split(":")[0]]} game={game}/>
</div>
{/each}
</div>
</div>
{/if}
<div class="recent">
<h2>{t('UserHome.RecentScores')}</h2>
<div class="scores">
@ -550,4 +576,10 @@
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr))
gap: $gap
.rating-composition-2
display: grid
// 2 columns
grid-template-columns: repeat(auto-fill, minmax(290px, 1fr))
gap: $gap
</style>

View File

@ -29,11 +29,15 @@ class Ongeki(
) }
override suspend fun userSummary(username: String) = us.cardByName(username) { card ->
// val extra = userGeneralDataRepository.findByUser_Card_ExtId(u.ghostCard.extId)
// .associate { it.propertyKey to it.propertyValue }
val extra = userGeneralDataRepository.findByUser_Card_ExtId(card.extId)
.associate { it.propertyKey to it.propertyValue }
// TODO: Rating composition
val ratingComposition = mapOf(
"best30" to (extra["rating_base_best"] ?: ""),
"best15" to (extra["rating_base_new_best"] ?: ""),
"recent10" to (extra["rating_base_hot_best"] ?: "")
)
genericUserSummary(card, mapOf())
genericUserSummary(card, ratingComposition)
}
}