1
0
mirror of synced 2024-11-24 06:50:15 +01:00

Fix exceptions

This commit is contained in:
asesidaa 2022-09-24 16:31:13 +08:00
parent ec4338bdb9
commit 0bcf60da31
2 changed files with 12 additions and 8 deletions

View File

@ -43,7 +43,7 @@ public class SongBestData
public uint DrumrollCount { get; set; } public uint DrumrollCount { get; set; }
public List<AiSectionBestData> AiSectionBestData { get; set; } public List<AiSectionBestData> AiSectionBestData { get; set; } = new();
public bool ShowAiData { get; set; } = false; public bool ShowAiData { get; set; }
} }

View File

@ -29,7 +29,7 @@
Icon="@GetDifficultyIcon(difficulty)"> Icon="@GetDifficultyIcon(difficulty)">
@if (songBestDataMap.ContainsKey(difficulty)) @if (songBestDataMap.ContainsKey(difficulty))
{ {
<MudDataGrid Items="@songBestDataMap[difficulty]" <MudDataGrid Items="@songBestDataMap[difficulty]" RowClick="(DataGridRowClickEventArgs<SongBestData> _) => { return;}"
ColumnResizeMode="ResizeMode.None" RowsPerPage="25" Elevation="0"> ColumnResizeMode="ResizeMode.None" RowsPerPage="25" Elevation="0">
<Columns> <Columns>
<Column T="SongBestData" Field="@nameof(SongBestData.SongId)" Title="Song" StickyLeft="true"> <Column T="SongBestData" Field="@nameof(SongBestData.SongId)" Title="Song" StickyLeft="true">
@ -89,7 +89,11 @@
<Column T="SongBestData" Field="@nameof(SongBestData.ComboCount)" Title="MAX Combo" 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"> <Column T="SongBestData" Field="@nameof(SongBestData.ShowAiData)" Title="AI Battle Data">
<CellTemplate> <CellTemplate>
<MudButton Variant="Variant.Outlined" Size="Size.Small" OnClick="@(()=> ToggleShowAiData(context.Item))" Disabled="@(!IsAiDataPresent(context.Item))">@(context.Item.ShowAiData ? "Hide" : "Show")</MudButton> <MudButton Variant="Variant.Outlined" Size="Size.Small"
OnClick="@(() => ToggleShowAiData(context.Item))"
Disabled="@(!IsAiDataPresent(context.Item))">
@(context.Item.ShowAiData ? "Hide" : "Show")
</MudButton>
</CellTemplate> </CellTemplate>
</Column> </Column>
<Column T="SongBestData" Field="@nameof(SongBestData.LastPlayTime)" Title="Last Played" Hideable="true" /> <Column T="SongBestData" Field="@nameof(SongBestData.LastPlayTime)" Title="Last Played" Hideable="true" />
@ -101,7 +105,7 @@
<ChildRowContent> <ChildRowContent>
@if (context.Item.ShowAiData) @if (context.Item.ShowAiData)
{ {
<MudTr> <tr>
<td colspan="1" class="pa-3 ai-battle-td"> <td colspan="1" class="pa-3 ai-battle-td">
<MudText Typo="Typo.body2" Style="font-weight: bold"> <MudText Typo="Typo.body2" Style="font-weight: bold">
AI Battle Data AI Battle Data
@ -142,7 +146,7 @@
</RowTemplate> </RowTemplate>
</MudTable> </MudTable>
</td> </td>
</MudTr> </tr>
} }
</ChildRowContent> </ChildRowContent>
<PagerContent> <PagerContent>