1
0
mirror of synced 2025-01-18 15:54:06 +01:00

Play History fixes

This commit is contained in:
shiibe 2024-03-13 11:00:18 -04:00
parent e8f3d50942
commit 18a933e327
4 changed files with 22 additions and 6 deletions

View File

@ -6,6 +6,8 @@
@inject NavigationManager NavigationManager
@inject IJSRuntime JSRuntime
@using TaikoWebUI.Utilities;
@if (LoginService.LoginRequired && (!LoginService.IsLoggedIn || (LoginService.GetLoggedInUser().Baid != Baid && !LoginService.IsAdmin)))
{
if (!LoginService.IsLoggedIn)
@ -28,7 +30,7 @@ else
<MudItem xs="12">
<MudCard Outlined="true" Elevation="0">
<MudCardHeader>
<MudText Typo="Typo.h6">Recent Plays</MudText>
<MudText Typo="Typo.h6">Play History</MudText>
</MudCardHeader>
@if (SongBestData is not null && SongBestData.RecentPlayData is not null && SongBestData.RecentPlayData.Count > 0)
@ -49,9 +51,15 @@ else
</HeaderContent>
<RowTemplate>
<MudTd>@context.PlayTime</MudTd>
<MudTd>@context.Difficulty</MudTd>
<MudTd>@context.Crown</MudTd>
<MudTd>@context.ScoreRank</MudTd>
<MudTd>
<img src="@ScoreUtils.GetDifficultyIcon(context.Difficulty)" alt="@context.Difficulty" title="@context.Difficulty" style="@IconStyle" />
</MudTd>
<MudTd>
<img src="@($"/images/crown_{context.Crown}.png")" alt="@(ScoreUtils.GetCrownText(context.Crown))" title="@(ScoreUtils.GetCrownText(context.Crown))" style="@IconStyle" />
</MudTd>
<MudTd>
<img src="@($"/images/rank_{context.ScoreRank}.png")" alt="@(ScoreUtils.GetRankText(context.ScoreRank))" title="@(ScoreUtils.GetRankText(context.ScoreRank))" style="@IconStyle" />
</MudTd>
<MudTd>@context.Score</MudTd>
<MudTd>@context.GoodCount</MudTd>
<MudTd>@context.OkCount</MudTd>

View File

@ -18,6 +18,8 @@ namespace TaikoWebUI.Pages
private string SongTitle = string.Empty;
private string SongArtist = string.Empty;
private const string IconStyle = "width:25px; height:25px;";
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();

View File

@ -41,7 +41,7 @@
@if (difficulty is not Difficulty.None)
{
<MudTabPanel Text="@ScoreUtils.GetDifficultyTitle(difficulty)"
Icon="@ScoreUtils.GetDifficultyIcon(difficulty)">
Icon="@ScoreUtils.GetDifficultyIconSvg(difficulty)">
@if (songBestDataMap.TryGetValue(difficulty, out var value))
{
<MudDataGrid Items="@value"
@ -102,6 +102,7 @@
<PropertyColumn Property="data => data.GoodCount" Title=@Localizer["Good"] Sortable="false" />
<PropertyColumn Property="data => data.OkCount" Title=@Localizer["OK"] Sortable="false" />
<PropertyColumn Property="data => data.MissCount" Title=@Localizer["Bad"] Sortable="false" />
<PropertyColumn Property="data => data.MissCount" Title=@Localizer["Bad"] Sortable="false" />
<PropertyColumn Property="data => data.DrumrollCount" Title=@Localizer["Drumroll"] Sortable="false"/>
<PropertyColumn Property="data => data.ComboCount" Title=@Localizer["MAX Combo"] Sortable="false" />
<TemplateColumn T="SongBestData" Title=@Localizer["AI Battle Data"]>

View File

@ -43,11 +43,16 @@ namespace TaikoWebUI.Utilities
};
}
public static string GetDifficultyIcon(Difficulty difficulty)
public static string GetDifficultyIconSvg(Difficulty difficulty)
{
return $"<image href='/images/difficulty_{difficulty}.png' alt='{difficulty}' width='24' height='24'/>";
}
public static string GetDifficultyIcon(Difficulty difficulty)
{
return $"/images/difficulty_{difficulty}.png";
}
public static string GetGenreTitle(SongGenre genre)
{
return genre switch