From bc16918d49e32bad241a6439ee14f815796fe377 Mon Sep 17 00:00:00 2001 From: shiibe Date: Thu, 22 Sep 2022 22:53:35 -0400 Subject: [PATCH] Add AI battle sub-table (wip) --- SharedProject/Models/SongBestData.cs | 2 ++ TaikoWebUI/Pages/TaikoMode.razor | 46 +++++++++++++++++++--------- TaikoWebUI/Pages/TaikoMode.razor.cs | 12 ++++++-- 3 files changed, 43 insertions(+), 17 deletions(-) diff --git a/SharedProject/Models/SongBestData.cs b/SharedProject/Models/SongBestData.cs index 55c50d4..4872661 100644 --- a/SharedProject/Models/SongBestData.cs +++ b/SharedProject/Models/SongBestData.cs @@ -44,4 +44,6 @@ public class SongBestData public uint DrumrollCount { get; set; } public List AiSectionBestData { get; set; } + + public bool ShowAiData { get; set; } = false; } \ No newline at end of file diff --git a/TaikoWebUI/Pages/TaikoMode.razor b/TaikoWebUI/Pages/TaikoMode.razor index e300bc2..375f727 100644 --- a/TaikoWebUI/Pages/TaikoMode.razor +++ b/TaikoWebUI/Pages/TaikoMode.razor @@ -30,7 +30,7 @@ @if (songBestDataMap.ContainsKey(difficulty)) { + ColumnResizeMode="ResizeMode.None" RowsPerPage="25" Elevation="0"> @@ -51,7 +51,7 @@ - + @@ -60,7 +60,7 @@ + Sortable="false" Filterable="true"> @@ -68,13 +68,13 @@ - - + + @(GetCrownText(context.Item.BestCrown)) - + @if (context.Item.BestScoreRank is not ScoreRank.None) { @@ -82,17 +82,33 @@ } - - - - - - - - - + + + + + + + + @((context.Item.ShowAiData == true) ? "Hide" : "Show") + + + + + + + + @if (context.Item.ShowAiData) + { + + + + + + + } + diff --git a/TaikoWebUI/Pages/TaikoMode.razor.cs b/TaikoWebUI/Pages/TaikoMode.razor.cs index b0024d7..1a3d3d9 100644 --- a/TaikoWebUI/Pages/TaikoMode.razor.cs +++ b/TaikoWebUI/Pages/TaikoMode.razor.cs @@ -1,4 +1,7 @@ -namespace TaikoWebUI.Pages; +using static MudBlazor.Colors; +using System; + +namespace TaikoWebUI.Pages; public partial class TaikoMode { @@ -133,7 +136,12 @@ public partial class TaikoMode SongGenre.Variety => "background: #1dc83b; color: #fff", SongGenre.Classical => "background: #bfa356", _ => "" - }; + }; + } + + private static void ToggleShowAiData(SongBestData data) + { + data.ShowAiData = !data.ShowAiData; } }