From 18a933e32747c11afc4bffcdc36f3d6fc76dd738 Mon Sep 17 00:00:00 2001 From: shiibe <82057235+shiibe@users.noreply.github.com> Date: Wed, 13 Mar 2024 11:00:18 -0400 Subject: [PATCH] Play History fixes --- TaikoWebUI/Pages/Song.razor | 16 ++++++++++++---- TaikoWebUI/Pages/Song.razor.cs | 2 ++ TaikoWebUI/Pages/Songs.razor | 3 ++- TaikoWebUI/Utilities/ScoreUtils.cs | 7 ++++++- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/TaikoWebUI/Pages/Song.razor b/TaikoWebUI/Pages/Song.razor index bf783b6..5d155e7 100644 --- a/TaikoWebUI/Pages/Song.razor +++ b/TaikoWebUI/Pages/Song.razor @@ -6,6 +6,8 @@ @inject NavigationManager NavigationManager @inject IJSRuntime JSRuntime +@using TaikoWebUI.Utilities; + @if (LoginService.LoginRequired && (!LoginService.IsLoggedIn || (LoginService.GetLoggedInUser().Baid != Baid && !LoginService.IsAdmin))) { if (!LoginService.IsLoggedIn) @@ -28,7 +30,7 @@ else - Recent Plays + Play History @if (SongBestData is not null && SongBestData.RecentPlayData is not null && SongBestData.RecentPlayData.Count > 0) @@ -49,9 +51,15 @@ else @context.PlayTime - @context.Difficulty - @context.Crown - @context.ScoreRank + + @context.Difficulty + + + @(ScoreUtils.GetCrownText(context.Crown)) + + + @(ScoreUtils.GetRankText(context.ScoreRank)) + @context.Score @context.GoodCount @context.OkCount diff --git a/TaikoWebUI/Pages/Song.razor.cs b/TaikoWebUI/Pages/Song.razor.cs index 72f8df0..ee17c07 100644 --- a/TaikoWebUI/Pages/Song.razor.cs +++ b/TaikoWebUI/Pages/Song.razor.cs @@ -18,6 +18,8 @@ namespace TaikoWebUI.Pages private string SongTitle = string.Empty; private string SongArtist = string.Empty; + private const string IconStyle = "width:25px; height:25px;"; + protected override async Task OnInitializedAsync() { await base.OnInitializedAsync(); diff --git a/TaikoWebUI/Pages/Songs.razor b/TaikoWebUI/Pages/Songs.razor index b620ae3..f406a7b 100644 --- a/TaikoWebUI/Pages/Songs.razor +++ b/TaikoWebUI/Pages/Songs.razor @@ -41,7 +41,7 @@ @if (difficulty is not Difficulty.None) { + Icon="@ScoreUtils.GetDifficultyIconSvg(difficulty)"> @if (songBestDataMap.TryGetValue(difficulty, out var value)) { + diff --git a/TaikoWebUI/Utilities/ScoreUtils.cs b/TaikoWebUI/Utilities/ScoreUtils.cs index c3ea454..0efe505 100644 --- a/TaikoWebUI/Utilities/ScoreUtils.cs +++ b/TaikoWebUI/Utilities/ScoreUtils.cs @@ -43,11 +43,16 @@ namespace TaikoWebUI.Utilities }; } - public static string GetDifficultyIcon(Difficulty difficulty) + public static string GetDifficultyIconSvg(Difficulty difficulty) { return $"{difficulty}"; } + public static string GetDifficultyIcon(Difficulty difficulty) + { + return $"/images/difficulty_{difficulty}.png"; + } + public static string GetGenreTitle(SongGenre genre) { return genre switch