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

Add title plate field

This commit is contained in:
shiibe 2022-09-06 22:38:42 -04:00
parent 03656e6284
commit 32191187fe
3 changed files with 36 additions and 22 deletions

View File

@ -23,4 +23,6 @@ public class UserSetting
public string MyDonName { get; set; } = String.Empty; public string MyDonName { get; set; } = String.Empty;
public string Title { get; set; } = String.Empty; public string Title { get; set; } = String.Empty;
public uint TitlePlateId { get; set; }
} }

View File

@ -37,7 +37,8 @@ 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,
Title = user.Title Title = user.Title,
TitlePlateId = user.TitlePlateId
}; };
return Ok(response); return Ok(response);
} }
@ -62,6 +63,7 @@ public class UserSettingsController : BaseController<UserSettingsController>
user.OptionSetting = PlaySettingConverter.PlaySettingToShort(userSetting.PlaySetting); user.OptionSetting = PlaySettingConverter.PlaySettingToShort(userSetting.PlaySetting);
user.MyDonName = userSetting.MyDonName; user.MyDonName = userSetting.MyDonName;
user.Title = userSetting.Title; user.Title = userSetting.Title;
user.TitlePlateId = userSetting.TitlePlateId;
context.Update(user); context.Update(user);
await context.SaveChangesAsync(); await context.SaveChangesAsync();

View File

@ -13,40 +13,45 @@
<MudGrid> <MudGrid>
<MudItem xs="12" md="8"> <MudItem xs="12" md="8">
<MudPaper Class="py-8 px-8 my-8" Outlined="true"> <MudPaper Class="py-8 px-8 my-8" Outlined="true">
<MudStack Spacing="6"> <MudStack Spacing="4">
<h2>Profile Options</h2> <h2>Profile Options</h2>
<MudTextField @bind-Value="@response.MyDonName" Label="Name" Variant="Variant.Outlined"></MudTextField> <MudTextField @bind-Value="@response.MyDonName" Label="Name"></MudTextField>
<MudTextField @bind-Value="@response.Title" Label="Title" Variant="Variant.Outlined"></MudTextField>
<MudGrid> <MudGrid>
<MudItem xs="12" md="6"> <MudItem xs="12" md="8">
<MudStack Spacing="2" Class="mt-5"> <MudTextField @bind-Value="@response.Title" Label="Title"></MudTextField>
<MudSwitch @bind-Checked="@response.IsDisplayAchievement" Label="Display Achievement Panel" Color="Color.Primary" />
<MudSwitch @bind-Checked="@response.IsDisplayDanOnNamePlate" Label="Display Dan Rank on Name Plate" Color="Color.Primary" />
</MudStack>
</MudItem> </MudItem>
<MudItem xs="12" md="6"> <MudItem xs="12" md="4">
<MudStack Spacing="6"> <MudSelect @bind-Value="@response.TitlePlateId" Label="Title Plate">
<MudSelect @bind-Value="@response.AchievementDisplayDifficulty" @for (uint i = 0; i < 8; i++)
Label="Achievement Panel Difficulty">
@foreach (var item in Enum.GetValues<Difficulty>())
{ {
<MudSelectItem Value="@item" /> var index = i;
<MudSelectItem Value="@i">@titlePlateStrings[index]</MudSelectItem>
} }
</MudSelect> </MudSelect>
</MudStack>
</MudItem> </MudItem>
</MudGrid> </MudGrid>
<MudSelect @bind-Value="@response.AchievementDisplayDifficulty"
Label="Achievement Panel Difficulty">
@foreach (var item in Enum.GetValues<Difficulty>())
{
<MudSelectItem Value="@item" />
}
</MudSelect>
<MudSwitch @bind-Checked="@response.IsDisplayAchievement" Label="Display Achievement Panel" Color="Color.Primary" />
<MudSwitch @bind-Checked="@response.IsDisplayDanOnNamePlate" Label="Display Dan Rank on Name Plate" Color="Color.Primary" />
</MudStack> </MudStack>
</MudPaper> </MudPaper>
<MudPaper Class="py-8 px-8 my-8" Outlined="true"> <MudPaper Class="py-8 px-8 my-8" Outlined="true">
<MudStack Spacing="6"> <MudStack Spacing="4">
<h2>Song Options</h2> <h2>Song Options</h2>
<MudGrid> <MudGrid>
<MudItem xs="12" md="4"> <MudItem xs="12" md="4">
<MudStack Spacing="6"> <MudStack Spacing="4">
<MudSwitch @bind-Checked="@response.PlaySetting.IsVanishOn" Label="Vanish" Color="Color.Primary"/> <MudSwitch @bind-Checked="@response.PlaySetting.IsVanishOn" Label="Vanish" Color="Color.Primary"/>
<MudSwitch @bind-Checked="@response.PlaySetting.IsInverseOn" Label="Inverse" Color="Color.Primary"/> <MudSwitch @bind-Checked="@response.PlaySetting.IsInverseOn" Label="Inverse" Color="Color.Primary"/>
<MudSwitch @bind-Checked="@response.IsSkipOn" Label="Give Up" Color="Color.Primary"/> <MudSwitch @bind-Checked="@response.IsSkipOn" Label="Give Up" Color="Color.Primary"/>
@ -54,7 +59,7 @@
</MudStack> </MudStack>
</MudItem> </MudItem>
<MudItem xs="12" md="8"> <MudItem xs="12" md="8">
<MudStack Spacing="6"> <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 < 15; i++)
{ {
@ -89,7 +94,7 @@
</MudPaper> </MudPaper>
</MudItem> </MudItem>
<MudItem md="4" xs="12" Class="py-8 px-8 my-4 pt-8"> <MudItem md="4" xs="12" Class="py-8 px-8 my-4 pt-8">
<MudStack Spacing="6" Style="top:100px" Class="sticky"> <MudStack Spacing="4" Style="top:100px" Class="sticky">
<MudButton Disabled="@isSavingOptions" <MudButton Disabled="@isSavingOptions"
OnClick="SaveOptions" OnClick="SaveOptions"
Variant="Variant.Filled" Variant="Variant.Filled"
@ -140,9 +145,14 @@
"Synth Drum", "Shuriken", "Bubble Pop", "Electric Guitar" "Synth Drum", "Shuriken", "Bubble Pop", "Electric Guitar"
}; };
private readonly string[] titlePlateStrings = {
"Wood", "Rainbow", "Gold", "Purple",
"AI 1", "AI 2", "AI 3", "AI 4"
};
private List<BreadcrumbItem> breadcrumbs = new() private List<BreadcrumbItem> breadcrumbs = new()
{ {
new BreadcrumbItem("Dashboard", href: "Dashboard"), new BreadcrumbItem("Dashboard", href: ""),
}; };
protected override async Task OnInitializedAsync() protected override async Task OnInitializedAsync()