From 00eecb8ebd3dc824da50979e8437f6c382d1ea04 Mon Sep 17 00:00:00 2001 From: shiibe Date: Sat, 10 Sep 2022 15:43:01 -0400 Subject: [PATCH] Change tabs from genre to difficulty, add genre column --- TaikoWebUI/Pages/PlayResults.razor | 140 ++++++++++++++++++----------- 1 file changed, 90 insertions(+), 50 deletions(-) diff --git a/TaikoWebUI/Pages/PlayResults.razor b/TaikoWebUI/Pages/PlayResults.razor index 88b71e2..6077671 100644 --- a/TaikoWebUI/Pages/PlayResults.razor +++ b/TaikoWebUI/Pages/PlayResults.razor @@ -26,61 +26,64 @@ else { - - @foreach (var genre in Enum.GetValues()) + + @foreach (var difficulty in Enum.GetValues()) { - - + - - - - - - - @GameDataService.GetMusicNameBySongId(context.Item.SongId) - @GameDataService.GetMusicArtistBySongId(context.Item.SongId) - - - - - - + + + + + + @GameDataService.GetMusicNameBySongId(context.Item.SongId) + @GameDataService.GetMusicArtistBySongId(context.Item.SongId) + + + + + + - - - - - - - - - - @(context.Item.Difficulty) - - - - - - - - @(context.Item.BestCrown) - - - - - - @if (context.Item.BestScoreRank is not ScoreRank.None) - { - - @(context.Item.BestScoreRank) + + + + + + + + + + @getGenreTitle(GameDataService.GetMusicGenreBySongId(context.Item.SongId)) + + + + + + + + @(context.Item.BestCrown) - } - + + + + + @if (context.Item.BestScoreRank is not ScoreRank.None) + { + + @(context.Item.BestScoreRank) + + } + @@ -94,6 +97,7 @@ + } } @@ -108,7 +112,7 @@ private SongBestResponse? response; - private const string ICON_STYLE = "width:25px; height:25px;"; + private const string ICON_STYLE = "width:25px; height:25px;"; private readonly List breadcrumbs = new() { @@ -154,7 +158,7 @@ CrownType.Gold => "Full Combo", CrownType.Dondaful => "Donderful Combo", _ => "" - }; + }; } private string getRankText(ScoreRank rank) @@ -170,7 +174,43 @@ ScoreRank.Purple => "Graceful (Purple)", ScoreRank.Dondaful => "Top Class (Donderful)", _ => "" - }; + }; } + private string getDifficultyIcon(Difficulty difficulty) + { + return $"{difficulty}"; + } + + private string getGenreTitle(SongGenre genre) + { + return genre switch + { + SongGenre.Pop => "Pop", + SongGenre.Anime => "Anime", + SongGenre.Kids => "Kids", + SongGenre.Vocaloid => "Vocaloid", + SongGenre.GameMusic => "Game Music", + SongGenre.NamcoOriginal => "NAMCO Original", + SongGenre.Variety => "Variety", + SongGenre.Classical => "Classical", + _ => "" + }; + } + + private string getGenreStyle(SongGenre genre) + { + return genre switch + { + SongGenre.Pop => "background: #42c0d2; color: #fff", + SongGenre.Anime => "background: #ff90d3; color: #fff", + SongGenre.Kids => "background: #fec000; color: #fff", + SongGenre.Vocaloid => "background: #ddd", + SongGenre.GameMusic => "background: #cc8aea; color: #fff", + SongGenre.NamcoOriginal => "background: #ff7027; color: #fff", + SongGenre.Variety => "background: #1dc83b; color: #fff", + SongGenre.Classical => "background: #bfa356", + _ => "" + }; + } } \ No newline at end of file