1
0
mirror of synced 2024-11-15 02:47:35 +01:00
TaikoLocalServer/TaikoWebUI/Pages/TaikoMode.razor

114 lines
7.8 KiB
Plaintext
Raw Normal View History

2022-09-11 18:28:12 +02:00
@inject IGameDataService GameDataService
@inject HttpClient Client
2022-09-10 23:56:48 +02:00
@page "/Cards/{baid:int}/TaikoMode"
<MudBreadcrumbs Items="breadcrumbs" Class="px-0"></MudBreadcrumbs>
<h1>Taiko Mode</h1>
<MudText Typo="Typo.caption">Card: @Baid</MudText>
<MudGrid Class="my-8">
@if (response is null)
{
<MudItem xs="12">
<MudText Align="Align.Center">
No data.
</MudText>
</MudItem>
}
else
{
<MudItem xs="12">
<MudTabs Elevation="0" Border="true" Rounded="true" ApplyEffectsToContainer="true" Outlined="true" Class="mb-10">
@foreach (var difficulty in Enum.GetValues<Difficulty>())
{
@if (difficulty is not Difficulty.None)
{
2022-09-11 18:28:12 +02:00
<MudTabPanel Text="@GetDifficultyTitle(difficulty)"
Icon="@GetDifficultyIcon(difficulty)">
2022-09-11 18:28:12 +02:00
@if (songBestDataMap.ContainsKey(difficulty))
2022-09-11 02:12:56 +02:00
{
2022-09-11 18:28:12 +02:00
<MudDataGrid Items="@songBestDataMap[difficulty]"
ColumnResizeMode="ResizeMode.Container" RowsPerPage="25" Elevation="0">
<Columns>
<Column T="SongBestData" Field="@nameof(SongBestData.SongId)" Title="Song" StickyLeft="true" Class="clm-row-large">
<CellTemplate>
<MudGrid Justify="Justify.Center">
<MudItem xs="10">
<MudStack Spacing="0">
<MudText Typo="Typo.body2" Style="font-weight:bold">@GameDataService.GetMusicNameBySongId(context.Item.SongId)</MudText>
<MudText Typo="Typo.caption">@GameDataService.GetMusicArtistBySongId(context.Item.SongId)</MudText>
</MudStack>
</MudItem>
<MudItem xs="2">
<MudStack Justify="Justify.Center" AlignItems="AlignItems.End" Style="height:100%">
<MudTooltip Text="@(context.Item.IsFavorite ? "Remove from favorites" : "Add to favorites")" Arrow="true" Placement="Placement.Top">
<MudToggleIconButton Toggled="@context.Item.IsFavorite"
ToggledChanged="@(async () => await OnFavoriteToggled(context.Item))"
Icon="@Icons.Material.Filled.FavoriteBorder" Color="@Color.Secondary"
ToggledIcon="@Icons.Material.Filled.Favorite" ToggledColor="@Color.Secondary"
Size="Size.Small"
ToggledSize="Size.Small"/>
</MudTooltip>
</MudStack>
</MudItem>
</MudGrid>
</CellTemplate>
</Column>
<Column T="SongBestData" Field="@nameof(SongBestData.SongId)" Title="Genre"
Sortable="false" Filterable="true">
<CellTemplate>
<MudChip Style="@GetGenreStyle(GameDataService.GetMusicGenreBySongId(context.Item.SongId))"
Size="Size.Small">
@GetGenreTitle(GameDataService.GetMusicGenreBySongId(context.Item.SongId))
</MudChip>
</CellTemplate>
</Column>
<Column T="SongBestData" Field="@nameof(SongBestData.BestScore)" Title="Best Score"/>
<Column T="SongBestData" Field="@nameof(SongBestData.BestCrown)" Title="Best Crown">
<CellTemplate>
<MudTooltip Text="@(GetCrownText(context.Item.BestCrown))" Arrow="true" Placement="Placement.Top">
<img src="@($"/images/crown_{context.Item.BestCrown}.png")" alt="@(context.Item.BestCrown)" style="@IconStyle"/>
</MudTooltip>
2022-09-11 18:28:12 +02:00
</CellTemplate>
</Column>
<Column T="SongBestData" Field="@nameof(SongBestData.BestScoreRank)" Title="Best Rank" Sortable="false">
<CellTemplate>
@if (context.Item.BestScoreRank is not ScoreRank.None)
{
<MudTooltip Text="@(GetRankText(context.Item.BestScoreRank))" Arrow="true" Placement="Placement.Top">
<img src="@($"/images/rank_{context.Item.BestScoreRank}.png")" alt="@(context.Item.BestScoreRank)" style="@IconStyle"/>
</MudTooltip>
}
</CellTemplate>
</Column>
<Column T="SongBestData" Field="@nameof(SongBestData.GoodCount)" Title="Good" Sortable="false"/>
<Column T="SongBestData" Field="@nameof(SongBestData.OkCount)" Title="OK" Sortable="false"/>
2022-09-11 18:28:12 +02:00
<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"/>
2022-09-11 18:28:12 +02:00
<Column T="SongBestData" Field="@nameof(SongBestData.LastPlayTime)" Title="Last Played"/>
</Columns>
<PagerContent>
<MudDataGridPager T="SongBestData"/>
</PagerContent>
</MudDataGrid>
}
else
{
2022-09-11 02:12:56 +02:00
<MudGrid>
<MudItem xs="12">
2022-09-11 23:32:24 +02:00
<MudText Align="Align.Center" Class="my-16">
2022-09-11 02:12:56 +02:00
No data for selected difficulty.
</MudText>
</MudItem>
</MudGrid>
}
2022-09-10 22:10:01 +02:00
</MudTabPanel>
}
}
</MudTabs>
</MudItem>
}
2022-09-11 18:28:12 +02:00
</MudGrid>