1
0
mirror of synced 2024-11-23 22:41:01 +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

@ -42,8 +42,8 @@ public class SongBestData
public uint HitCount { get; set; }
public uint DrumrollCount { get; set; }
public List<AiSectionBestData> AiSectionBestData { get; set; }
public bool ShowAiData { get; set; } = false;
public List<AiSectionBestData> AiSectionBestData { get; set; } = new();
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,14 +105,14 @@
<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
</MudText>
</td>
<td colspan="16">
<MudTable Elevation="0" ReadOnly="true"
<MudTable Elevation="0" ReadOnly="true"
Items="@context.Item.AiSectionBestData" Context="aiSectionContext">
<HeaderContent>
<MudTh>Section No.</MudTh>
@ -142,7 +146,7 @@
</RowTemplate>
</MudTable>
</td>
</MudTr>
</tr>
}
</ChildRowContent>
<PagerContent>