From 1ce7d4c599e18dd933dda5951c6172dd070b7b71 Mon Sep 17 00:00:00 2001 From: "nise.moe" Date: Sun, 18 Feb 2024 12:45:17 +0100 Subject: [PATCH] Added "Open in Circleguard" button on scores --- .../src/app/view-score/view-score.component.html | 1 + .../src/app/view-score/view-score.component.ts | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/nise-frontend/src/app/view-score/view-score.component.html b/nise-frontend/src/app/view-score/view-score.component.html index 94ed76b..7d66b81 100644 --- a/nise-frontend/src/app/view-score/view-score.component.html +++ b/nise-frontend/src/app/view-score/view-score.component.html @@ -45,6 +45,7 @@ diff --git a/nise-frontend/src/app/view-score/view-score.component.ts b/nise-frontend/src/app/view-score/view-score.component.ts index f3226ea..581943d 100644 --- a/nise-frontend/src/app/view-score/view-score.component.ts +++ b/nise-frontend/src/app/view-score/view-score.component.ts @@ -76,6 +76,20 @@ export class ViewScoreComponent implements OnInit { }); } + buildCircleguardUrl(): string { + if(!this.replayData) { + return ""; + } + + let url = "circleguard://m=" + this.replayData.beatmap_id + "&u=" + this.replayData.user_id; + + if (this.replayData.mods.length > 0) { + url += "&m1=" + this.replayData.mods.join(''); + } + + return url; + } + private loadScoreData(): void { this.isLoading = true; this.http.get(`${environment.apiUrl}/score/${this.replayId}`).pipe(