@page "/Users/{baid:int}/Profile"
@inject HttpClient Client
@inject IGameDataService GameDataService
@inject IDialogService DialogService
@inject AuthService AuthService
@inject IJSRuntime JsRuntime
@inject NavigationManager NavigationManager
@if (response is not null)
{
@if (AuthService.LoginRequired && (!AuthService.IsLoggedIn || (AuthService.GetLoggedInBaid() != Baid && !AuthService.IsAdmin)))
{
if (!AuthService.IsLoggedIn)
{
NavigationManager.NavigateTo("/Login");
}
else
{
NavigationManager.NavigateTo("/");
}
}
else
{
@Localizer["Profile"]
@Localizer["Profile Options"]
@for (uint i = 0; i < LanguageStrings.Length; i++)
{
var index = i;
@Localizer[LanguageStrings[index]]
}
@if (AuthService.AllowFreeProfileEditing)
{
}
else
{
}
@Localizer["Select a Title"]
@if (AuthService.AllowFreeProfileEditing)
{
@foreach (var index in titlePlateIdList)
{
@TitlePlateStrings[index]
}
}
@foreach (var item in Enum.GetValues())
{
@Localizer[item.ToString()]
}
@for (uint i = 0; i < DifficultySettingCourseStrings.Length; i++)
{
var index = i;
@Localizer[DifficultySettingCourseStrings[index]]
}
@for (uint i = 0; i < DifficultySettingStarStrings.Length; i++)
{
var index = i;
@Localizer[DifficultySettingStarStrings[index]]
}
@for (uint i = 0; i < DifficultySettingSortStrings.Length; i++)
{
var index = i;
@Localizer[DifficultySettingSortStrings[index]]
}
@Localizer["Costume Options"]
@foreach (var index in headUniqueIdList)
{
var costumeTitle = GameDataService.GetHeadTitle(costumeList, index);
@index - @costumeTitle
}
@foreach (var index in bodyUniqueIdList)
{
var costumeTitle = GameDataService.GetBodyTitle(costumeList, index);
@index - @costumeTitle
}
@foreach (var index in faceUniqueIdList)
{
var costumeTitle = GameDataService.GetFaceTitle(costumeList, index);
@index - @costumeTitle
}
@foreach (var index in kigurumiUniqueIdList)
{
var costumeTitle = GameDataService.GetKigurumiTitle(costumeList, index);
@index - @costumeTitle
}
@foreach (var index in puchiUniqueIdList)
{
var costumeTitle = GameDataService.GetPuchiTitle(costumeList, index);
@index - @costumeTitle
}
@for (uint i = 0; i < Constants.COSTUME_COLOR_MAX; i++)
{
var index = i;
@index
}
@for (uint i = 0; i < Constants.COSTUME_COLOR_MAX; i++)
{
var index = i;
@index
}
@for (uint i = 0; i < Constants.COSTUME_COLOR_MAX; i++)
{
var index = i;
@index
}
@Localizer["Song Options"]
@for (uint i = 0; i < SpeedStrings.Length; i++)
{
var index = i;
@SpeedStrings[index]
}
@foreach (var item in Enum.GetValues())
{
@Localizer[item.ToString()]
}
@for (uint i = 0; i < ToneStrings.Length; i++)
{
var index = i;
@Localizer[ToneStrings[index]]
}
@Localizer["Notes Position"]
@* Player Visualizer *@
@if (response.Kigurumi == 0)
{
}
else
{
}
@* Player Nameplate *@
@* Title text *@
@response.Title
@* Name text *@
@* Name textoffset to the right for Dan Rank *@
@response.MyDonName
@response.MyDonName
@* Check if image does not exist, use nameplate_Wood.png *@
@if (response.IsDisplayDanOnNamePlate)
{
}
@if (response.IsDisplayAchievement)
{
@* Achievement panel Text *@
@* First row *@
@scoresArray[0]
@scoresArray[0]
@* Second row *@
@scoresArray[1]
@scoresArray[1]
@scoresArray[2]
@scoresArray[2]
@scoresArray[3]
@scoresArray[3]
@* Third row *@
@scoresArray[4]
@scoresArray[4]
@scoresArray[5]
@scoresArray[5]
@scoresArray[6]
@scoresArray[6]
@* Fourth row (Crowns) *@
@scoresArray[7]
@scoresArray[7]
@scoresArray[8]
@scoresArray[8]
@scoresArray[9]
@scoresArray[9]
@* Forbidden one-liner : Changes the AchievementDisplayDifficulty image asset. When "Difficulty.None" is selected, Defaults to highest difficulty the player currently has crowns / Ranks for. *@
}
@if (isSavingOptions)
{
Saving...
}
else
{
@Localizer["Save"]
}
}
}
else
{
}
@code {
private async Task UpdateMyDonName()
{
@if (response is not null) await JsRuntime.InvokeVoidAsync("updateMyDonNameText", response.MyDonName);
}
private async Task UpdateTitle()
{
@if (response is not null) await JsRuntime.InvokeVoidAsync("updateTitleText", response.Title);
}
private async Task UpdateScoreboard(Difficulty difficulty)
{
UpdateScores(difficulty);
await JsRuntime.InvokeVoidAsync("updateScoreboardText", scoresArray);
}
}