1
0
mirror of synced 2025-01-19 00:04:05 +01:00

Fixed song play history page displaying only one difficulty, made choosing title update the title text

This commit is contained in:
S-Sebb 2024-05-03 22:46:27 +01:00
parent 650552e403
commit f4cbee2e29
11 changed files with 313 additions and 75 deletions

View File

@ -275,6 +275,15 @@ namespace TaikoWebUI.Localization {
}
}
/// <summary>
/// Looks up a localized string similar to .
/// </summary>
internal static string Easy {
get {
return ResourceManager.GetString("Easy", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to .
/// </summary>
@ -392,6 +401,15 @@ namespace TaikoWebUI.Localization {
}
}
/// <summary>
/// Looks up a localized string similar to .
/// </summary>
internal static string Hard {
get {
return ResourceManager.GetString("Hard", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to .
/// </summary>
@ -509,6 +527,15 @@ namespace TaikoWebUI.Localization {
}
}
/// <summary>
/// Looks up a localized string similar to .
/// </summary>
internal static string Normal {
get {
return ResourceManager.GetString("Normal", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to .
/// </summary>
@ -527,6 +554,15 @@ namespace TaikoWebUI.Localization {
}
}
/// <summary>
/// Looks up a localized string similar to .
/// </summary>
internal static string Oni {
get {
return ResourceManager.GetString("Oni", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to .
/// </summary>
@ -626,6 +662,15 @@ namespace TaikoWebUI.Localization {
}
}
/// <summary>
/// Looks up a localized string similar to .
/// </summary>
internal static string Rows_Per_Page_ {
get {
return ResourceManager.GetString("Rows Per Page:", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to .
/// </summary>
@ -788,6 +833,15 @@ namespace TaikoWebUI.Localization {
}
}
/// <summary>
/// Looks up a localized string similar to .
/// </summary>
internal static string Ura_Oni {
get {
return ResourceManager.GetString("Ura Oni", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to .
/// </summary>

View File

@ -576,4 +576,22 @@
<data name="Success" xml:space="preserve">
<value>Success</value>
</data>
<data name="Ura Oni" xml:space="preserve">
<value>Ura</value>
</data>
<data name="Oni" xml:space="preserve">
<value>Extreme</value>
</data>
<data name="Hard" xml:space="preserve">
<value>Hard</value>
</data>
<data name="Normal" xml:space="preserve">
<value>Normal</value>
</data>
<data name="Easy" xml:space="preserve">
<value>Easy</value>
</data>
<data name="Rows Per Page:" xml:space="preserve">
<value>Rows Per Page:</value>
</data>
</root>

View File

@ -576,4 +576,22 @@
<data name="Success" xml:space="preserve">
<value>成功</value>
</data>
<data name="Ura Oni" xml:space="preserve">
<value>おに裏</value>
</data>
<data name="Oni" xml:space="preserve">
<value>おに</value>
</data>
<data name="Hard" xml:space="preserve">
<value>むずかしい</value>
</data>
<data name="Normal" xml:space="preserve">
<value>ふつう</value>
</data>
<data name="Easy" xml:space="preserve">
<value>かんたん</value>
</data>
<data name="Rows Per Page:" xml:space="preserve">
<value>1ページ当たりの行数</value>
</data>
</root>

View File

@ -369,4 +369,22 @@
<data name="Success" xml:space="preserve">
<value />
</data>
<data name="Ura Oni" xml:space="preserve">
<value />
</data>
<data name="Oni" xml:space="preserve">
<value />
</data>
<data name="Hard" xml:space="preserve">
<value />
</data>
<data name="Normal" xml:space="preserve">
<value />
</data>
<data name="Easy" xml:space="preserve">
<value />
</data>
<data name="Rows Per Page:" xml:space="preserve">
<value />
</data>
</root>

View File

@ -573,4 +573,22 @@
<data name="Success" xml:space="preserve">
<value>成功</value>
</data>
<data name="Ura Oni" xml:space="preserve">
<value>里譜面</value>
</data>
<data name="Oni" xml:space="preserve">
<value>魔王</value>
</data>
<data name="Hard" xml:space="preserve">
<value>困难</value>
</data>
<data name="Normal" xml:space="preserve">
<value>普通</value>
</data>
<data name="Easy" xml:space="preserve">
<value>简单</value>
</data>
<data name="Rows Per Page:" xml:space="preserve">
<value>每页行数</value>
</data>
</root>

View File

@ -573,4 +573,22 @@
<data name="Success" xml:space="preserve">
<value>成功</value>
</data>
<data name="Ura Oni" xml:space="preserve">
<value>裏譜面</value>
</data>
<data name="Oni" xml:space="preserve">
<value>魔王</value>
</data>
<data name="Hard" xml:space="preserve">
<value>困難</value>
</data>
<data name="Normal" xml:space="preserve">
<value>普通</value>
</data>
<data name="Easy" xml:space="preserve">
<value>簡單</value>
</data>
<data name="Rows Per Page:" xml:space="preserve">
<value>每頁行數</value>
</data>
</root>

View File

@ -45,7 +45,7 @@ public partial class DaniDojo
{
return danClearState switch
{
DanClearState.NotClear => Localizer["Failed"],
DanClearState.NotClear => Localizer["Not Cleared"],
DanClearState.RedNormalClear => Localizer["Red"],
DanClearState.RedFullComboClear => Localizer["Red Full Combo"],
DanClearState.RedPerfectClear => Localizer["Red Donderful Combo"],

View File

@ -1,6 +1,7 @@
@using TaikoWebUI.Shared.Models
@using System.Collections.Immutable
@inject IGameDataService GameDataService
@inject IJSRuntime Js
<MudDialog>
<DialogContent>
@ -38,7 +39,7 @@
}
</RowTemplate>
<PagerContent>
<MudTablePager />
<MudTablePager RowsPerPageString=@Localizer["Rows Per Page"] />
</PagerContent>
</MudTable>
<MudText Class="mt-4 d-block" Typo="Typo.caption"> <b>@Localizer["Selected Title:"]</b> @selectedTitle?.TitleName</MudText>
@ -103,13 +104,15 @@
title.TitleName.Contains(searchString, StringComparison.InvariantCultureIgnoreCase);
}
private void Submit()
private async Task Submit()
{
if (selectedTitle is not null)
{
UserSetting.Title = selectedTitle.TitleName;
UserSetting.TitlePlateId = selectedTitle.TitleRarity;
}
await Js.InvokeVoidAsync("updateTitleText", UserSetting.Title);
MudDialog.Close(DialogResult.Ok(true));
}

View File

@ -3,7 +3,7 @@
@inject LoginService LoginService
@inject IJSRuntime JSRuntime
@inject NavigationManager NavigationManager
@inject Blazored.LocalStorage.ILocalStorageService localStorage
@inject Blazored.LocalStorage.ILocalStorageService LocalStorage
@using TaikoWebUI.Utilities;
@page "/Users/{baid:int}/HighScores"
@ -39,80 +39,171 @@
{
@if (difficulty is not Difficulty.None)
{
<MudTabPanel Text="@ScoreUtils.GetDifficultyTitle(difficulty)"
<MudTabPanel Text="@Localizer[ScoreUtils.GetDifficultyTitle(difficulty)]"
Icon="@ScoreUtils.GetDifficultyIconSvg(difficulty)">
@if (songBestDataMap.TryGetValue(difficulty, out var value))
{
<MudDataGrid Items="@value"
ColumnResizeMode="ResizeMode.None" RowsPerPage="25" Elevation="0">
<Columns>
<TemplateColumn T="SongBestData" Title=@Localizer["Song"] StickyLeft="true">
<CellTemplate>
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
<div style="width:300px">
<a href="@($"/Users/{Baid}/Songs/{context.Item.SongId}")">
<MudText Typo="Typo.body2" Style="font-weight:bold">@context.Item.MusicName</MudText>
<MudText Typo="Typo.caption">@context.Item.MusicArtist</MudText>
</a>
</div>
<div>
<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"
Title="Add to favorites" ToggledTitle="Remove from favorites" />
</div>
</MudStack>
</CellTemplate>
</TemplateColumn>
<TemplateColumn T="SongBestData" Title=@Localizer["Level"] Sortable="false">
<CellTemplate>
<MudStack Row="true" Spacing="1" AlignItems="AlignItems.Center">
<MudIcon Icon="@Icons.Material.Filled.Star" Size="Size.Small" />
<MudText Typo="Typo.caption" Style="line-height:1;margin-top:2px;margin-right:2px;">@GameDataService.GetMusicStarLevel(@context.Item.SongId, difficulty)</MudText>
</MudStack>
</CellTemplate>
</TemplateColumn>
<TemplateColumn T="SongBestData" Title=@Localizer["Genre"]
Sortable="false" Filterable="true">
<CellTemplate>
<MudChip Style="@ScoreUtils.GetGenreStyle(context.Item.Genre)"
Size="Size.Small">
@ScoreUtils.GetGenreTitle(context.Item.Genre)
</MudChip>
</CellTemplate>
</TemplateColumn>
<PropertyColumn Property="data => data.BestScore" Title=@Localizer["Best Score"] />
<TemplateColumn T="SongBestData" Title=@Localizer["Best Crown"]>
<CellTemplate>
<img src="@($"/images/crown_{context.Item.BestCrown}.png")" alt="@(ScoreUtils.GetCrownText(context.Item.BestCrown))" title="@(ScoreUtils.GetCrownText(context.Item.BestCrown))" style="@Constants.ICON_STYLE" />
</CellTemplate>
</TemplateColumn>
<TemplateColumn T="SongBestData" Title=@Localizer["Best Rank"] Sortable="false">
<CellTemplate>
@if (context.Item.BestScoreRank is not ScoreRank.None)
{
<img src="@($"/images/rank_{context.Item.BestScoreRank}.png")" alt="@(ScoreUtils.GetRankText(context.Item.BestScoreRank))" title="@(ScoreUtils.GetRankText(context.Item.BestScoreRank))" style="@Constants.ICON_STYLE" />
}
</CellTemplate>
</TemplateColumn>
<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.DrumrollCount" Title=@Localizer["Drumroll"] Sortable="false" />
<PropertyColumn Property="data => data.ComboCount" Title=@Localizer["MAX Combo"] Sortable="false" />
<PropertyColumn Property="data => data.LastPlayTime" Title=@Localizer["Last Played"] Hideable="true" />
<PropertyColumn Property="data => data.PlayCount" Title=@Localizer["Total Plays"] Hideable="true" />
<PropertyColumn Property="data => data.ClearCount" Title=@Localizer["Total Clears"] Hideable="true" />
<PropertyColumn Property="data => data.FullComboCount" Title=@Localizer["Total Full Combos"] Hideable="true" />
<PropertyColumn Property="data => data.PerfectCount" Title=@Localizer["Total Donderful Combos"] Hideable="true" />
</Columns>
// Rows per page 25
<MudTable Items="@value" Elevation="0" Striped="true" RowsPerPage="25">
<HeaderContent>
<MudTh>
<MudText Typo="Typo.body2" Style="font-weight:bold">@Localizer["Song Name"]</MudText>
</MudTh>
<MudTh>
<MudTableSortLabel T="SongBestData" SortBy="x => GameDataService.GetMusicStarLevel(x.SongId, difficulty)">
<MudText>@Localizer["Level"]</MudText>
</MudTableSortLabel>
</MudTh>
<MudTh>
<MudTableSortLabel T="SongBestData" SortBy="x => x.Genre">
<MudText>@Localizer["Genre"]</MudText>
</MudTableSortLabel>
</MudTh>
<MudTh>
<MudTableSortLabel T="SongBestData" SortBy="x => x.BestScore">
<MudText>@Localizer["Best Score"]</MudText>
</MudTableSortLabel>
</MudTh>
<MudTh>
<MudTableSortLabel T="SongBestData" SortBy="x => x.BestCrown">
<MudText>@Localizer["Best Crown"]</MudText>
</MudTableSortLabel>
</MudTh>
<MudTh>
<MudTableSortLabel T="SongBestData" SortBy="x => x.BestScoreRank">
<MudText>@Localizer["Best Rank"]</MudText>
</MudTableSortLabel>
</MudTh>
<MudTh>
<MudTableSortLabel T="SongBestData" SortBy="x => x.GoodCount">
<MudText>@Localizer["Good"]</MudText>
</MudTableSortLabel>
</MudTh>
<MudTh>
<MudTableSortLabel T="SongBestData" SortBy="x => x.OkCount">
<MudText>@Localizer["OK"]</MudText>
</MudTableSortLabel>
</MudTh>
<MudTh>
<MudTableSortLabel T="SongBestData" SortBy="x => x.MissCount">
<MudText>@Localizer["Bad"]</MudText>
</MudTableSortLabel>
</MudTh>
<MudTh>
<MudTableSortLabel T="SongBestData" SortBy="x => x.DrumrollCount">
<MudText>@Localizer["Drumroll"]</MudText>
</MudTableSortLabel>
</MudTh>
<MudTh>
<MudTableSortLabel T="SongBestData" SortBy="x => x.ComboCount">
<MudText>@Localizer["MAX Combo"]</MudText>
</MudTableSortLabel>
</MudTh>
<MudTh>
<MudTableSortLabel T="SongBestData" SortBy="x => x.LastPlayTime">
<MudText>@Localizer["Last Played"]</MudText>
</MudTableSortLabel>
</MudTh>
<MudTh>
<MudTableSortLabel T="SongBestData" SortBy="x => x.PlayCount">
<MudText>@Localizer["Total Plays"]</MudText>
</MudTableSortLabel>
</MudTh>
<MudTh>
<MudTableSortLabel T="SongBestData" SortBy="x => x.ClearCount">
<MudText>@Localizer["Total Clears"]</MudText>
</MudTableSortLabel>
</MudTh>
<MudTh>
<MudTableSortLabel T="SongBestData" SortBy="x => x.FullComboCount">
<MudText>@Localizer["Total Full Combos"]</MudText>
</MudTableSortLabel>
</MudTh>
<MudTh>
<MudTableSortLabel T="SongBestData" SortBy="x => x.PerfectCount">
<MudText>@Localizer["Total Donderful Combos"]</MudText>
</MudTableSortLabel>
</MudTh>
</HeaderContent>
<RowTemplate>
<MudTd>
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
<div style="width:300px">
<a href="@($"/Users/{Baid}/Songs/{context.SongId}")">
<MudText Typo="Typo.body2" Style="font-weight:bold">@context.MusicName</MudText>
<MudText Typo="Typo.caption">@context.MusicArtist</MudText>
</a>
</div>
<div>
<MudToggleIconButton Toggled="@context.IsFavorite"
ToggledChanged="@(async () => await OnFavoriteToggled(context))"
Icon="@Icons.Material.Filled.FavoriteBorder" Color="@Color.Secondary"
ToggledIcon="@Icons.Material.Filled.Favorite" ToggledColor="@Color.Secondary"
Size="Size.Small"
ToggledSize="Size.Small"
Title="Add to favorites" ToggledTitle="Remove from favorites" />
</div>
</MudStack>
</MudTd>
<MudTd>
<MudStack Row="true" Spacing="1" AlignItems="AlignItems.Center">
<MudIcon Icon="@Icons.Material.Filled.Star" Size="Size.Small" />
<MudText Typo="Typo.caption" Style="line-height:1;margin-top:2px;margin-right:2px;">@GameDataService.GetMusicStarLevel(context.SongId, difficulty)</MudText>
</MudStack>
</MudTd>
<MudTd>
<MudChip Style="@ScoreUtils.GetGenreStyle(context.Genre)"
Size="Size.Small">
@ScoreUtils.GetGenreTitle(context.Genre)
</MudChip>
</MudTd>
<MudTd>
<MudText>@context.BestScore</MudText>
</MudTd>
<MudTd>
<img src="@($"/images/crown_{context.BestCrown}.png")" alt="@(ScoreUtils.GetCrownText(context.BestCrown))" title="@(ScoreUtils.GetCrownText(context.BestCrown))" style="@Constants.ICON_STYLE" />
</MudTd>
<MudTd>
@if (context.BestScoreRank is not ScoreRank.None)
{
<img src="@($"/images/rank_{context.BestScoreRank}.png")" alt="@(ScoreUtils.GetRankText(context.BestScoreRank))" title="@(ScoreUtils.GetRankText(context.BestScoreRank))" style="@Constants.ICON_STYLE" />
}
</MudTd>
<MudTd>
<MudText>@context.GoodCount</MudText>
</MudTd>
<MudTd>
<MudText>@context.OkCount</MudText>
</MudTd>
<MudTd>
<MudText>@context.MissCount</MudText>
</MudTd>
<MudTd>
<MudText>@context.DrumrollCount</MudText>
</MudTd>
<MudTd>
<MudText>@context.ComboCount</MudText>
</MudTd>
<MudTd>
<MudText>@context.LastPlayTime</MudText>
</MudTd>
<MudTd>
<MudText>@context.PlayCount</MudText>
</MudTd>
<MudTd>
<MudText>@context.ClearCount</MudText>
</MudTd>
<MudTd>
<MudText>@context.FullComboCount</MudText>
</MudTd>
<MudTd>
<MudText>@context.PerfectCount</MudText>
</MudTd>
</RowTemplate>
<PagerContent>
<MudDataGridPager T="SongBestData" />
<MudTablePager RowsPerPageString=@Localizer["Rows Per Page:"] />
</PagerContent>
</MudDataGrid>
</MudTable>
}
else
{

View File

@ -135,7 +135,7 @@
</MudTable>
</ChildRowContent>
<PagerContent>
<MudTablePager />
<MudTablePager RowsPerPageString=@Localizer["Rows Per Page"] />
</PagerContent>
</MudTable>
</MudItem>

View File

@ -138,7 +138,7 @@
}
</RowTemplate>
<PagerContent>
<MudTablePager />
<MudTablePager RowsPerPageString=@Localizer["Rows Per Page"] />
</PagerContent>
</MudTable>
</MudItem>