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

@ -57,18 +57,35 @@ const badges: ScoreBadge[] = [
} }
const failed = score.modifiers.includes("No Fail" as Modifier); const failed = score.modifiers.includes("No Fail" as Modifier);
const modCount = score.modifiers.length;
return ( return (
<> <>
<Tooltip <Tooltip
display={ display={
<div> <div className="flex flex-col gap-2">
<p>{accDetails}</p> <div>
{failed && <p className="text-red-500">Failed</p>} <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> </div>
} }
> >
<p className="cursor-default"> <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> </p>
</Tooltip> </Tooltip>
</> </>