Add AI battle sub-table (wip)
This commit is contained in:
parent
5d904c1ed7
commit
bc16918d49
@ -44,4 +44,6 @@ public class SongBestData
|
||||
public uint DrumrollCount { get; set; }
|
||||
|
||||
public List<AiSectionBestData> AiSectionBestData { get; set; }
|
||||
|
||||
public bool ShowAiData { get; set; } = false;
|
||||
}
|
@ -30,7 +30,7 @@
|
||||
@if (songBestDataMap.ContainsKey(difficulty))
|
||||
{
|
||||
<MudDataGrid Items="@songBestDataMap[difficulty]"
|
||||
ColumnResizeMode="ResizeMode.None" RowsPerPage="25" Elevation="0" ShowMenuIcon="true">
|
||||
ColumnResizeMode="ResizeMode.None" RowsPerPage="25" Elevation="0">
|
||||
<Columns>
|
||||
<Column T="SongBestData" Field="@nameof(SongBestData.SongId)" Title="Song" StickyLeft="true">
|
||||
<CellTemplate>
|
||||
@ -51,7 +51,7 @@
|
||||
</MudStack>
|
||||
</CellTemplate>
|
||||
</Column>
|
||||
<Column T="SongBestData" Field="@nameof(SongBestData.SongId)" Title="Level" Sortable="false" Hideable="true">
|
||||
<Column T="SongBestData" Field="@nameof(SongBestData.SongId)" Title="Level" Sortable="false">
|
||||
<CellTemplate>
|
||||
<MudStack Row="true" Spacing="1" AlignItems="AlignItems.Center">
|
||||
<MudIcon Icon="@Icons.Filled.Star" Size="Size.Small" />
|
||||
@ -60,7 +60,7 @@
|
||||
</CellTemplate>
|
||||
</Column>
|
||||
<Column T="SongBestData" Field="@nameof(SongBestData.Genre)" Title="Genre"
|
||||
Sortable="false" Filterable="true" Hideable="true">
|
||||
Sortable="false" Filterable="true">
|
||||
<CellTemplate>
|
||||
<MudChip Style="@GetGenreStyle(context.Item.Genre)"
|
||||
Size="Size.Small">
|
||||
@ -68,13 +68,13 @@
|
||||
</MudChip>
|
||||
</CellTemplate>
|
||||
</Column>
|
||||
<Column T="SongBestData" Field="@nameof(SongBestData.BestScore)" Title="Best Score" Hideable="true" />
|
||||
<Column T="SongBestData" Field="@nameof(SongBestData.BestCrown)" Title="Best Crown" Hideable="true">
|
||||
<Column T="SongBestData" Field="@nameof(SongBestData.BestScore)" Title="Best Score" />
|
||||
<Column T="SongBestData" Field="@nameof(SongBestData.BestCrown)" Title="Best Crown">
|
||||
<CellTemplate>
|
||||
<img src="@($"/images/crown_{context.Item.BestCrown}.png")" alt="@(GetCrownText(context.Item.BestCrown))" title="@(GetCrownText(context.Item.BestCrown))" style="@IconStyle" />
|
||||
</CellTemplate>
|
||||
</Column>
|
||||
<Column T="SongBestData" Field="@nameof(SongBestData.BestScoreRank)" Title="Best Rank" Sortable="false" Hideable="true">
|
||||
<Column T="SongBestData" Field="@nameof(SongBestData.BestScoreRank)" Title="Best Rank" Sortable="false">
|
||||
<CellTemplate>
|
||||
@if (context.Item.BestScoreRank is not ScoreRank.None)
|
||||
{
|
||||
@ -82,17 +82,33 @@
|
||||
}
|
||||
</CellTemplate>
|
||||
</Column>
|
||||
<Column T="SongBestData" Field="@nameof(SongBestData.GoodCount)" Title="Good" Sortable="false" Hideable="true" />
|
||||
<Column T="SongBestData" Field="@nameof(SongBestData.OkCount)" Title="OK" Sortable="false" Hideable="true" />
|
||||
<Column T="SongBestData" Field="@nameof(SongBestData.MissCount)" Title="Bad" Sortable="false" Hideable="true" />
|
||||
<Column T="SongBestData" Field="@nameof(SongBestData.DrumrollCount)" Title="Drumroll" Sortable="false"Hideable="true"/>
|
||||
<Column T="SongBestData" Field="@nameof(SongBestData.ComboCount)" Title="MAX Combo" Sortable="false" Hideable="true" />
|
||||
<Column T="SongBestData" Field="@nameof(SongBestData.GoodCount)" Title="Good" Sortable="false" />
|
||||
<Column T="SongBestData" Field="@nameof(SongBestData.OkCount)" Title="OK" Sortable="false" />
|
||||
<Column T="SongBestData" Field="@nameof(SongBestData.MissCount)" Title="Bad" Sortable="false" />
|
||||
<Column T="SongBestData" Field="@nameof(SongBestData.DrumrollCount)" Title="Drumroll" Sortable="false"/>
|
||||
<Column T="SongBestData" Field="@nameof(SongBestData.ComboCount)" Title="MAX Combo" Sortable="false" />
|
||||
<Column T="SongBestData" Field="@nameof(SongBestData.ShowAiData)" Title="AI Battle Data">
|
||||
<CellTemplate>
|
||||
<MudButton Variant="Variant.Outlined" Size="Size.Small" OnClick="@(()=> ToggleShowAiData(context.Item))">@((context.Item.ShowAiData == true) ? "Hide" : "Show")</MudButton>
|
||||
</CellTemplate>
|
||||
</Column>
|
||||
<Column T="SongBestData" Field="@nameof(SongBestData.LastPlayTime)" Title="Last Played" Hideable="true" />
|
||||
<Column T="SongBestData" Field="@nameof(SongBestData.PlayCount)" Title="Total Plays" Hideable="true" />
|
||||
<Column T="SongBestData" Field="@nameof(SongBestData.ClearCount)" Title="Total Clears" Hideable="true" />
|
||||
<Column T="SongBestData" Field="@nameof(SongBestData.FullComboCount)" Title="Total Full Combos" Hideable="true" />
|
||||
<Column T="SongBestData" Field="@nameof(SongBestData.PerfectCount)" Title="Total Donderful Combos" Hideable="true" />
|
||||
</Columns>
|
||||
<ChildRowContent>
|
||||
@if (context.Item.ShowAiData)
|
||||
{
|
||||
<MudTr>
|
||||
<td colspan="1" />
|
||||
<td colspan="16">
|
||||
<MudTable Elevation="0" ReadOnly="true" Items="@context.Item.AiSectionBestData" Context="AiSectionBestData" />
|
||||
</td>
|
||||
</MudTr>
|
||||
}
|
||||
</ChildRowContent>
|
||||
<PagerContent>
|
||||
<MudDataGridPager T="SongBestData"/>
|
||||
</PagerContent>
|
||||
|
@ -1,4 +1,7 @@
|
||||
namespace TaikoWebUI.Pages;
|
||||
using static MudBlazor.Colors;
|
||||
using System;
|
||||
|
||||
namespace TaikoWebUI.Pages;
|
||||
|
||||
public partial class TaikoMode
|
||||
{
|
||||
@ -135,5 +138,10 @@ public partial class TaikoMode
|
||||
_ => ""
|
||||
};
|
||||
}
|
||||
|
||||
private static void ToggleShowAiData(SongBestData data)
|
||||
{
|
||||
data.ShowAiData = !data.ShowAiData;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user