From 19e48b1e799c4674d993ef8e2747fb55e6c594c4 Mon Sep 17 00:00:00 2001 From: "nise.moe" Date: Sun, 10 Mar 2024 15:59:33 +0100 Subject: [PATCH] Calculate actual timing windows --- nise-replay-viewer/src/osu/Drawer.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/nise-replay-viewer/src/osu/Drawer.ts b/nise-replay-viewer/src/osu/Drawer.ts index f6cc2f4..3787305 100644 --- a/nise-replay-viewer/src/osu/Drawer.ts +++ b/nise-replay-viewer/src/osu/Drawer.ts @@ -1,7 +1,7 @@ -import { Vector2 } from "osu-classes"; +import {Vector2} from "osu-classes"; import p5 from "p5"; -import { loadImageAsync } from "@/utils"; -import { Md5 } from "ts-md5"; +import {loadImageAsync} from "@/utils"; +import {Md5} from "ts-md5"; import {Judgements, OsuRenderer} from "@/osu/OsuRenderer"; export class Drawer { @@ -69,11 +69,10 @@ export class Drawer { let width = 512; let height = 384; - // TODO: Calculate real values // @https://osu.ppy.sh/wiki/en/Beatmap/Overall_difficulty - let hitWindow300 = 50; - let hitWindow100 = 100; - let hitWindow50 = 150; + let hitWindow300 = 80 - 6 * OsuRenderer.beatmap.difficulty.overallDifficulty; + let hitWindow100 = 140 - 8 * OsuRenderer.beatmap.difficulty.overallDifficulty; + let hitWindow50 = 200 - 10 * OsuRenderer.beatmap.difficulty.overallDifficulty; let barWidth = 512 * 0.8; // Width of the error bar, 80% of canvas width let barHeight = 20; // The height of the error bar