Display DDR player counts

This commit is contained in:
Trenton Zimmer
2024-07-19 23:37:39 -04:00
parent d07df6f410
commit 5d4a806be3

View File

@@ -188,14 +188,6 @@ function returnNumber(stat, profile) {
return profile.stats[stat.key];
}
function formatNumber(number, tenth) {
if (!tenth) {
return number / 100;
} else {
return number / 10;
}
}
function formatProfile(profile) {
if (profile.stats) {
if (profile.stats.first_play_timestamp) {
@@ -217,6 +209,45 @@ function formatProfile(profile) {
return profile;
}
function formatCounts(profile) {
const stats = profile.stats[`count_${versionForm.currentVersion}`];
return stats
? [
stats.mfc != null
? {
label: "MFCs",
value: stats.mfc,
}
: 0,
stats.pfc != null
? {
label: "PFCs",
value: stats.pfc,
}
: 0,
stats.fc != null
? {
label: "GFCs",
value: stats.fc,
}
: 0,
stats.gfc != null
? {
label: "FCs",
value: stats.gfc,
}
: 0,
stats.life4 != null
? {
label: "Life-4 Clears",
value: stats.life4,
}
: 0,
]
: [];
}
</script>
<template>
@@ -304,7 +335,7 @@ function formatProfile(profile) {
<CardBoxWidget
v-if="myProfile.skill"
label="Skill Points"
:number="formatNumber(myProfile.skill, false)"
:number="myProfile.skill / 100"
:num-color="getGitadoraColor(myProfile.skill)"
/>
<CardBoxWidget v-if="myProfile.profile_skill" label="Skill Level">{{
@@ -341,6 +372,19 @@ function formatProfile(profile) {
}}</CardBoxWidget>
</div>
<div
v-if="myProfile.stats[`count_${versionForm.currentVersion}`]"
class="my-6 grid grid-cols-2 md:grid-cols-5 xl:grid-cols-6 gap-6"
>
<template v-for="stat of formatCounts(myProfile)" :key="stat">
<CardBoxWidget
v-if="stat.value"
:label="stat.label"
:number="stat.value"
/>
</template>
</div>
<template v-if="myProfile.jubility">
<SectionTitleLine
:icon="mdiChartBarStacked"