From ebdfebe20a5144ee6573baed82b0fe8ab4cc62ff Mon Sep 17 00:00:00 2001 From: Taken Date: Thu, 11 Sep 2025 00:35:46 +0200 Subject: [PATCH] finished woolgames progress --- .../[ign]/_stats/woolgames/progress.tsx | 25 +++++++++++++++++++ .../[ign]/_stats/woolgames/woolgames.tsx | 2 ++ 2 files changed, 27 insertions(+) create mode 100644 src/app/(stats)/player/[ign]/_stats/woolgames/progress.tsx diff --git a/src/app/(stats)/player/[ign]/_stats/woolgames/progress.tsx b/src/app/(stats)/player/[ign]/_stats/woolgames/progress.tsx new file mode 100644 index 0000000..b450338 --- /dev/null +++ b/src/app/(stats)/player/[ign]/_stats/woolgames/progress.tsx @@ -0,0 +1,25 @@ +import { formatNumber } from "@/lib/formatters" +import { getWoolGamesPrestige, getWoolGamesXPForLevel } from "@/lib/hypixel/woolgames/general" +import { GenericProgress } from "../../_components/GenericProgress" + +export default function WoolGamesProgress({ xp, level }: { xp: number, level: number }) { + const pres = getWoolGamesPrestige(Math.floor(level)) + const next = getWoolGamesPrestige(Math.floor(level) + 1) + const percent = (level - Math.floor(level)) * 100 + + const xpProgress = formatNumber(Math.floor(xp - getWoolGamesXPForLevel(Math.floor(level)))) + const ceilingXp = formatNumber(Math.floor(getWoolGamesXPForLevel(Math.floor(level) + 1) - getWoolGamesXPForLevel(Math.floor(level)))) + + return ( +
+

{Math.floor(level)}

+ +

{Math.floor(level) + 1}

+
+ ) +} diff --git a/src/app/(stats)/player/[ign]/_stats/woolgames/woolgames.tsx b/src/app/(stats)/player/[ign]/_stats/woolgames/woolgames.tsx index a39a672..4cb9273 100644 --- a/src/app/(stats)/player/[ign]/_stats/woolgames/woolgames.tsx +++ b/src/app/(stats)/player/[ign]/_stats/woolgames/woolgames.tsx @@ -4,6 +4,7 @@ import { getWoolGamesLevel, getWoolGamesPrestige, getWoolGamesPretigeIcon } from import { NonNullStats } from "@/lib/schema/player" import Multicolored from "../../_components/Multicolored" import GeneralStats from "../GeneralStats" +import WoolGamesProgress from "./progress" export default function WoolGamesStats({ stats }: { stats: NonNullStats["WoolGames"] }) { if (!stats) return null @@ -34,6 +35,7 @@ export default function WoolGamesStats({ stats }: { stats: NonNullStats["WoolGam ]} > + ) }