show all modifiers now
All checks were successful
Deploy Backend / docker (ubuntu-latest) (push) Successful in 45s
Deploy Website / docker (ubuntu-latest) (push) Successful in 2m11s

This commit is contained in:
Lee 2024-10-19 15:12:06 +01:00
parent d2be3d833b
commit 670f2047a0
2 changed files with 26 additions and 10 deletions

@ -2,19 +2,18 @@
* The score modifiers.
*/
export enum Modifier {
DA = "Disappearing Arrows",
NF = "No Fail",
PM = "Pro Mode",
FS = "Faster Song",
SF = "Super Fast Song",
SS = "Slower Song",
GN = "Ghost Notes",
NA = "No Arrows",
NO = "No Obstacles",
DA = "Disappearing Arrows",
SA = "Strict Angles",
SC = "Small Notes",
PM = "Pro Mode",
CS = "Fail on Saber Clash",
IF = "One Life",
NO = "No Obstacles",
BE = "Battery Energy",
NF = "No Fail",
NB = "No Bombs",
NA = "No Arrows",
}

@ -57,18 +57,35 @@ const badges: ScoreBadge[] = [
}
const failed = score.modifiers.includes("No Fail" as Modifier);
const modCount = score.modifiers.length;
return (
<>
<Tooltip
display={
<div className="flex flex-col gap-2">
<div>
<p>{accDetails}</p>
{failed && <p className="text-red-500">Failed</p>}
</div>
{modCount > 0 && (
<div>
<p className="font-semibold">Modifiers</p>
<p>{score.modifiers.join(", ")}</p>
</div>
)}
</div>
}
>
<p className="cursor-default">
{acc.toFixed(2)}% {failed && <span>NF</span>}
{acc.toFixed(2)}%
{modCount > 0
? ` ${Object.entries(Modifier)
.filter(mod => score.modifiers.includes(mod[1] as Modifier))
.map(mod => mod[0])
.splice(0, Object.entries(Modifier).length - 1)
.join("")}`
: ""}
</p>
</Tooltip>
</>