1
0
mirror of synced 2024-11-23 22:41:01 +01:00

Add MyDonNameLanguage to WebUI

This commit is contained in:
esuo1198 2023-09-18 19:26:08 +09:00
parent 07772b4dbb
commit fd38cc6808
4 changed files with 26 additions and 4 deletions

View File

@ -28,6 +28,8 @@ public class UserSetting
public string MyDonName { get; set; } = string.Empty; public string MyDonName { get; set; } = string.Empty;
public uint MyDonNameLanguage { get; set; }
public string Title { get; set; } = string.Empty; public string Title { get; set; } = string.Empty;
public uint TitlePlateId { get; set; } public uint TitlePlateId { get; set; }

View File

@ -45,6 +45,7 @@ public class UserSettingsController : BaseController<UserSettingsController>
PlaySetting = PlaySettingConverter.ShortToPlaySetting(user.OptionSetting), PlaySetting = PlaySettingConverter.ShortToPlaySetting(user.OptionSetting),
ToneId = user.SelectedToneId, ToneId = user.SelectedToneId,
MyDonName = user.MyDonName, MyDonName = user.MyDonName,
MyDonNameLanguage = user.MyDonNameLanguage,
Title = user.Title, Title = user.Title,
TitlePlateId = user.TitlePlateId, TitlePlateId = user.TitlePlateId,
Kigurumi = costumeData[0], Kigurumi = costumeData[0],
@ -100,6 +101,7 @@ public class UserSettingsController : BaseController<UserSettingsController>
user.AchievementDisplayDifficulty = userSetting.AchievementDisplayDifficulty; user.AchievementDisplayDifficulty = userSetting.AchievementDisplayDifficulty;
user.OptionSetting = PlaySettingConverter.PlaySettingToShort(userSetting.PlaySetting); user.OptionSetting = PlaySettingConverter.PlaySettingToShort(userSetting.PlaySetting);
user.MyDonName = userSetting.MyDonName; user.MyDonName = userSetting.MyDonName;
user.MyDonNameLanguage = userSetting.MyDonNameLanguage;
user.Title = userSetting.Title; user.Title = userSetting.Title;
user.TitlePlateId = userSetting.TitlePlateId; user.TitlePlateId = userSetting.TitlePlateId;
user.ColorBody = userSetting.BodyColor; user.ColorBody = userSetting.BodyColor;

View File

@ -18,7 +18,20 @@
<MudStack Spacing="4"> <MudStack Spacing="4">
<h2>Profile Options</h2> <h2>Profile Options</h2>
<MudTextField @bind-Value="@response.MyDonName" Label="Name"></MudTextField> <MudGrid>
<MudItem xs="12" md="8">
<MudTextField @bind-Value="@response.MyDonName" Label="Name"></MudTextField>
</MudItem>
<MudItem xs="12" md="4">
<MudSelect @bind-Value="@response.MyDonNameLanguage" Label="Language">
@for (uint i = 0; i < LanguageStrings.Length; i++)
{
var index = i;
<MudSelectItem Value="@i">@LanguageStrings[index]</MudSelectItem>
}
</MudSelect>
</MudItem>
</MudGrid>
<MudGrid> <MudGrid>
<MudItem xs="12" md="8"> <MudItem xs="12" md="8">
@ -29,7 +42,7 @@
</MudItem> </MudItem>
<MudItem xs="12" md="4"> <MudItem xs="12" md="4">
<MudSelect @bind-Value="@response.TitlePlateId" Label="Title Plate"> <MudSelect @bind-Value="@response.TitlePlateId" Label="Title Plate">
@for (uint i = 0; i < 8; i++) @for (uint i = 0; i < TitlePlateStrings.Length; i++)
{ {
var index = i; var index = i;
<MudSelectItem Value="@i">@TitlePlateStrings[index]</MudSelectItem> <MudSelectItem Value="@i">@TitlePlateStrings[index]</MudSelectItem>
@ -188,7 +201,7 @@
<MudItem xs="12" md="8"> <MudItem xs="12" md="8">
<MudStack Spacing="4"> <MudStack Spacing="4">
<MudSelect @bind-Value="@response.PlaySetting.Speed" Label="Speed"> <MudSelect @bind-Value="@response.PlaySetting.Speed" Label="Speed">
@for (uint i = 0; i < 15; i++) @for (uint i = 0; i < SpeedStrings.Length; i++)
{ {
var index = i; var index = i;
<MudSelectItem Value="@i">@SpeedStrings[index]</MudSelectItem> <MudSelectItem Value="@i">@SpeedStrings[index]</MudSelectItem>
@ -204,7 +217,7 @@
</MudSelect> </MudSelect>
<MudSelect @bind-Value="@response.ToneId" Label="Tone"> <MudSelect @bind-Value="@response.ToneId" Label="Tone">
@for (uint i = 0; i < 19; i++) @for (uint i = 0; i < ToneStrings.Length; i++)
{ {
var index = i; var index = i;
<MudSelectItem Value="@i">@ToneStrings[index]</MudSelectItem> <MudSelectItem Value="@i">@ToneStrings[index]</MudSelectItem>

View File

@ -44,6 +44,11 @@ public partial class Profile
"Synth Drum", "Shuriken", "Bubble Pop", "Electric Guitar" "Synth Drum", "Shuriken", "Bubble Pop", "Electric Guitar"
}; };
private static readonly string[] LanguageStrings =
{
"Japanese", "English", "Chinese (Traditional)", "Korean", "Chinese (Simplified)"
};
private static readonly string[] TitlePlateStrings = private static readonly string[] TitlePlateStrings =
{ {
"Wood", "Rainbow", "Gold", "Purple", "Wood", "Rainbow", "Gold", "Purple",