1
0
mirror of synced 2024-11-27 16:10:53 +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 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)">
@if (songBestDataMap.ContainsKey(difficulty))
{
<MudDataGrid Items="@songBestDataMap[difficulty]"
<MudDataGrid Items="@songBestDataMap[difficulty]" RowClick="(DataGridRowClickEventArgs<SongBestData> _) => { return;}"
ColumnResizeMode="ResizeMode.None" RowsPerPage="25" Elevation="0">
<Columns>
<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.ShowAiData)" Title="AI Battle Data">
<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>
</Column>
<Column T="SongBestData" Field="@nameof(SongBestData.LastPlayTime)" Title="Last Played" Hideable="true" />
@ -101,7 +105,7 @@
<ChildRowContent>
@if (context.Item.ShowAiData)
{
<MudTr>
<tr>
<td colspan="1" class="pa-3 ai-battle-td">
<MudText Typo="Typo.body2" Style="font-weight: bold">
AI Battle Data
@ -142,7 +146,7 @@
</RowTemplate>
</MudTable>
</td>
</MudTr>
</tr>
}
</ChildRowContent>
<PagerContent>