2023-11-11 22:04:11 +01:00
@page "/Users/{baid:int}/Profile"
2022-09-05 17:01:54 +02:00
@inject HttpClient Client
2022-09-15 07:18:50 +02:00
@inject IGameDataService GameDataService
2022-09-15 11:47:46 +02:00
@inject IDialogService DialogService
2024-05-17 00:32:46 +02:00
@inject AuthService AuthService
@inject IJSRuntime JsRuntime
2024-03-09 20:13:56 +01:00
@inject NavigationManager NavigationManager
2022-09-05 06:52:29 +02:00
2022-09-05 17:01:54 +02:00
@if (response is not null)
{
2024-05-17 00:32:46 +02:00
@if (AuthService.LoginRequired && (!AuthService.IsLoggedIn || (AuthService.GetLoggedInBaid() != Baid && !AuthService.IsAdmin)))
2023-10-16 11:38:27 +02:00
{
2024-05-17 00:32:46 +02:00
if (!AuthService.IsLoggedIn)
2024-03-09 20:13:56 +01:00
{
NavigationManager.NavigateTo("/Login");
}
else
{
NavigationManager.NavigateTo("/");
}
2023-10-16 11:38:27 +02:00
}
else
{
2024-03-09 20:13:56 +01:00
<MudBreadcrumbs Items="breadcrumbs" Class="p-0 mb-2"></MudBreadcrumbs>
<MudText Typo="Typo.h4">@Localizer["Profile"]</MudText>
2023-10-16 11:38:27 +02:00
<MudGrid Class="my-4 pb-10">
<MudItem xs="12" md="8">
<MudPaper Elevation="0" Outlined="true">
<MudTabs Rounded="true" Border="true" PanelClass="pa-8">
2024-01-28 07:35:26 +01:00
<MudTabPanel Text="@Localizer["Profile"]">
2023-10-16 11:38:27 +02:00
<MudStack Spacing="4">
2024-03-08 09:06:08 +01:00
<MudText Typo="Typo.h6">@Localizer["Profile Options"]</MudText>
2023-10-16 11:38:27 +02:00
<MudGrid>
<MudItem xs="12" md="8">
2024-03-09 07:07:34 +01:00
<MudTextField TextChanged="UpdateMyDonName" Required="true" @bind-Value="@response.MyDonName" Label=@Localizer["Name"]></MudTextField>
2023-10-16 11:38:27 +02:00
</MudItem>
<MudItem xs="12" md="4">
2024-01-28 07:35:26 +01:00
<MudSelect @bind-Value="@response.MyDonNameLanguage" Label=@Localizer["Language"]>
2023-10-16 11:38:27 +02:00
@for (uint i = 0; i < LanguageStrings.Length; i++)
2023-09-18 11:54:02 +02:00
{
var index = i;
2023-10-16 11:38:27 +02:00
<MudSelectItem Value="@i">@LanguageStrings[index]</MudSelectItem>
2023-09-18 11:54:02 +02:00
}
</MudSelect>
2023-10-16 11:38:27 +02:00
</MudItem>
</MudGrid>
2023-11-02 12:40:38 +01:00
2023-10-16 11:38:27 +02:00
<MudGrid>
<MudItem xs="12" md="8">
2024-05-17 00:32:46 +02:00
@if (AuthService.AllowFreeProfileEditing)
2023-11-13 00:12:54 +01:00
{
2024-06-05 14:19:02 +02:00
<MudTextField TextChanged="UpdateTitle" @bind-Value="@response.Title" Label=@Localizer["Title"] />
2023-11-13 00:12:54 +01:00
}
else
{
2024-06-05 14:19:02 +02:00
<MudTextField ReadOnly="true" @bind-Value="@response.Title" Label=@Localizer["Title"] />
2023-11-13 00:12:54 +01:00
}
2024-05-17 00:32:46 +02:00
<MudButton Color="Color.Primary" Class="mt-1" Size="Size.Small" OnClick="@(_ => OpenChooseTitleDialog())">
2024-01-28 07:35:26 +01:00
@Localizer["Select a Title"]
2023-10-16 11:38:27 +02:00
</MudButton>
</MudItem>
2024-05-17 00:32:46 +02:00
@if (AuthService.AllowFreeProfileEditing)
2023-11-13 00:12:54 +01:00
{
<MudItem xs="12" md="4">
2024-01-28 07:35:26 +01:00
<MudSelect @bind-Value="@response.TitlePlateId" Label=@Localizer["Title Plate"]>
2024-05-17 00:32:46 +02:00
@foreach (var index in titlePlateIdList)
2023-11-13 00:12:54 +01:00
{
2024-05-17 00:32:46 +02:00
<MudSelectItem Value="@index">@TitlePlateStrings[index]</MudSelectItem>
2023-11-13 00:12:54 +01:00
}
</MudSelect>
</MudItem>
}
2023-10-16 11:38:27 +02:00
</MudGrid>
2023-11-02 12:40:38 +01:00
2024-01-28 07:35:26 +01:00
<MudSelect T="Difficulty" ValueChanged=@UpdateScoreboard Value=@response.AchievementDisplayDifficulty Label=@Localizer["Achievement Panel Difficulty"]>
2023-10-16 11:38:27 +02:00
@foreach (var item in Enum.GetValues<Difficulty>())
2022-09-15 06:08:19 +02:00
{
2023-10-16 11:38:27 +02:00
<MudSelectItem Value="@item" />
2022-09-15 06:08:19 +02:00
}
2022-09-15 07:18:50 +02:00
</MudSelect>
2023-11-02 12:40:38 +01:00
2023-10-16 11:38:27 +02:00
<MudGrid>
<MudItem xs="12" md="4">
<MudStack Spacing="4">
2024-06-05 14:19:02 +02:00
<MudSwitch @bind-Value="@response.IsDisplayAchievement" Label=@Localizer["Display Achievement Panel"] Color="Color.Primary" />
<MudSwitch @bind-Value="@response.IsDisplayDanOnNamePlate" Label=@Localizer["Display Dan Rank on Name Plate"] Color="Color.Primary" />
2023-10-16 11:38:27 +02:00
</MudStack>
</MudItem>
<MudItem xs="12" md="8">
<MudStack Spacing="4">
2024-01-28 07:35:26 +01:00
<MudSelect @bind-Value="@response.DifficultySettingCourse" Label=@Localizer["Difficulty Setting Course"]>
2023-10-16 11:38:27 +02:00
@for (uint i = 0; i < DifficultySettingCourseStrings.Length; i++)
{
var index = i;
<MudSelectItem Value="@i">@DifficultySettingCourseStrings[index]</MudSelectItem>
}
</MudSelect>
2023-11-02 12:40:38 +01:00
2024-01-28 07:35:26 +01:00
<MudSelect @bind-Value="@response.DifficultySettingStar" Label=@Localizer["Difficulty Setting Star"]>
2023-10-16 11:38:27 +02:00
@for (uint i = 0; i < DifficultySettingStarStrings.Length; i++)
{
var index = i;
<MudSelectItem Value="@i">@DifficultySettingStarStrings[index]</MudSelectItem>
}
</MudSelect>
2023-11-02 12:40:38 +01:00
2024-01-28 07:35:26 +01:00
<MudSelect @bind-Value="@response.DifficultySettingSort" Label=@Localizer["Difficulty Setting Sort"]>
2023-10-16 11:38:27 +02:00
@for (uint i = 0; i < DifficultySettingSortStrings.Length; i++)
{
var index = i;
<MudSelectItem Value="@i">@DifficultySettingSortStrings[index]</MudSelectItem>
}
</MudSelect>
</MudStack>
</MudItem>
</MudGrid>
</MudStack>
</MudTabPanel>
2023-11-02 12:40:38 +01:00
2024-01-28 07:35:26 +01:00
<MudTabPanel Text="@Localizer["Costume"]">
2023-10-16 11:38:27 +02:00
<MudStack Spacing="4">
2024-03-08 09:06:08 +01:00
<MudText Typo="Typo.h6">@Localizer["Costume Options"]</MudText>
2023-10-16 11:38:27 +02:00
<MudGrid>
<MudItem xs="12">
<MudStack Spacing="4" Class="mb-8">
2024-05-01 17:13:47 +02:00
<MudSelect @bind-Value="@response.Head" Label=@Localizer["Head"]>
@foreach (var index in headUniqueIdList)
{
2024-06-05 14:19:02 +02:00
var costumeTitle = GameDataService.GetHeadTitle(costumeList, index);
<MudSelectItem Value="@index">@index - @costumeTitle</MudSelectItem>
2024-05-01 17:13:47 +02:00
}
</MudSelect>
<MudSelect @bind-Value="@response.Body" Label=@Localizer["Body"]>
@foreach (var index in bodyUniqueIdList)
{
2024-06-05 14:19:02 +02:00
var costumeTitle = GameDataService.GetBodyTitle(costumeList, index);
<MudSelectItem Value="@index">@index - @costumeTitle</MudSelectItem>
2024-05-01 17:13:47 +02:00
}
</MudSelect>
<MudSelect @bind-Value="@response.Face" Label=@Localizer["Face"]>
@foreach (var index in faceUniqueIdList)
{
2024-06-05 14:19:02 +02:00
var costumeTitle = GameDataService.GetFaceTitle(costumeList, index);
<MudSelectItem Value="@index">@index - @costumeTitle</MudSelectItem>
2024-05-01 17:13:47 +02:00
}
</MudSelect>
<MudSelect @bind-Value="@response.Kigurumi" Label=@Localizer["Kigurumi"]>
@foreach (var index in kigurumiUniqueIdList)
{
2024-06-05 14:19:02 +02:00
var costumeTitle = GameDataService.GetKigurumiTitle(costumeList, index);
<MudSelectItem Value="@index">@index - @costumeTitle</MudSelectItem>
2024-05-01 17:13:47 +02:00
}
</MudSelect>
<MudSelect @bind-Value="@response.Puchi" Label=@Localizer["Puchi"]>
@foreach (var index in puchiUniqueIdList)
{
2024-06-05 14:19:02 +02:00
var costumeTitle = GameDataService.GetPuchiTitle(costumeList, index);
<MudSelectItem Value="@index">@index - @costumeTitle</MudSelectItem>
2024-05-01 17:13:47 +02:00
}
</MudSelect>
2023-10-16 11:38:27 +02:00
</MudStack>
2023-11-02 12:40:38 +01:00
2023-10-16 11:38:27 +02:00
<MudStack Row="true">
2024-01-28 07:35:26 +01:00
<MudSelect @bind-Value="@response.BodyColor" Label=@Localizer["Body Color"]>
2023-10-16 11:38:27 +02:00
@for (uint i = 0; i < Constants.COSTUME_COLOR_MAX; i++)
{
var index = i;
<MudSelectItem Value="@index">
<div class="color-box" style=@($"background: {CostumeColors[index]}")></div>
@index
</MudSelectItem>
}
</MudSelect>
2024-01-28 07:35:26 +01:00
<MudSelect @bind-Value="@response.FaceColor" Label=@Localizer["Face Color"]>
2023-10-16 11:38:27 +02:00
@for (uint i = 0; i < Constants.COSTUME_COLOR_MAX; i++)
{
var index = i;
<MudSelectItem Value="@index">
<div class="color-box" style=@($"background: {CostumeColors[index]}")></div>
@index
</MudSelectItem>
}
</MudSelect>
2024-01-28 07:35:26 +01:00
<MudSelect @bind-Value="@response.LimbColor" Label=@Localizer["Limb Color"]>
2023-10-16 11:38:27 +02:00
@for (uint i = 0; i < Constants.COSTUME_COLOR_MAX; i++)
{
var index = i;
<MudSelectItem Value="@index">
<div class="color-box" style=@($"background: {CostumeColors[index]}")></div>
@index
</MudSelectItem>
}
</MudSelect>
</MudStack>
</MudItem>
</MudGrid>
</MudStack>
</MudTabPanel>
2023-11-02 12:40:38 +01:00
2024-01-28 07:35:26 +01:00
<MudTabPanel Text="@Localizer["Song Options"]">
2023-10-16 11:38:27 +02:00
<MudStack Spacing="4">
2024-03-08 09:06:08 +01:00
<MudText Typo="Typo.h6">@Localizer["Song Options"]</MudText>
2023-10-16 11:38:27 +02:00
<MudGrid>
<MudItem xs="12" md="4">
<MudStack Spacing="4">
2024-06-05 14:19:02 +02:00
<MudSwitch @bind-Value="@response.PlaySetting.IsVanishOn" Label=@Localizer["Vanish"] Color="Color.Primary" />
<MudSwitch @bind-Value="@response.PlaySetting.IsInverseOn" Label=@Localizer["Inverse"] Color="Color.Primary" />
<MudSwitch @bind-Value="@response.IsSkipOn" Label=@Localizer["Give Up"] Color="Color.Primary" />
<MudSwitch @bind-Value="@response.IsVoiceOn" Label=@Localizer["Voice"] Color="Color.Primary" />
2023-10-16 11:38:27 +02:00
</MudStack>
</MudItem>
<MudItem xs="12" md="8">
<MudStack Spacing="4">
2024-01-28 07:35:26 +01:00
<MudSelect @bind-Value="@response.PlaySetting.Speed" Label=@Localizer["Speed"]>
2023-10-16 11:38:27 +02:00
@for (uint i = 0; i < SpeedStrings.Length; i++)
{
var index = i;
<MudSelectItem Value="@i">@SpeedStrings[index]</MudSelectItem>
}
</MudSelect>
2023-11-02 12:40:38 +01:00
2023-10-16 11:38:27 +02:00
<MudSelect @bind-Value="@response.PlaySetting.RandomType"
2024-01-28 07:35:26 +01:00
Label=@Localizer["Random"]>
2023-10-16 11:38:27 +02:00
@foreach (var item in Enum.GetValues<RandomType>())
{
<MudSelectItem Value="@item" />
}
</MudSelect>
2023-11-02 12:40:38 +01:00
2024-01-28 07:35:26 +01:00
<MudSelect @bind-Value="@response.ToneId" Label=@Localizer["Tone"]>
2023-10-16 11:38:27 +02:00
@for (uint i = 0; i < ToneStrings.Length; i++)
{
var index = i;
<MudSelectItem Value="@i">@ToneStrings[index]</MudSelectItem>
}
</MudSelect>
2023-11-02 12:40:38 +01:00
2023-10-16 11:38:27 +02:00
<MudSlider Class="mb-8" @bind-Value="@response.NotesPosition" Size="Size.Medium" Min="-5" Max="5" Step="1" TickMarks="true" TickMarkLabels="@NotePositionStrings">
2024-01-28 07:35:26 +01:00
<MudText Typo="Typo.caption">@Localizer["Notes Position"]</MudText>
2023-10-16 11:38:27 +02:00
</MudSlider>
</MudStack>
</MudItem>
</MudGrid>
</MudStack>
</MudTabPanel>
</MudTabs>
</MudPaper>
</MudItem>
2023-11-02 12:40:38 +01:00
<MudItem md="4" xs="12" Class="py-3 px-3">
2023-10-16 11:38:27 +02:00
<MudStack Spacing="4" Class="sticky" Style="top:100px">
2023-11-02 17:25:43 +01:00
<MudPaper Elevation="0" Outlined="true">
<MudTabs Rounded="true" Border="true" PanelClass="pa-8">
2024-05-01 17:13:47 +02:00
<MudTabPanel Text=@Localizer["Player"]>
2023-11-02 17:25:43 +01:00
<MudItem style="height: auto">
@* Player Visualizer *@
<MudItem style="text-align: center;">
<MudItem style="position:relative">
@if (response.Kigurumi == 0)
{
<MudImage Fluid="true" style=@($"position: relative; top: 0; left: 0; filter: {CostumeColorFilters[response.BodyColor]}") Src=@CostumeOrDefault("masks/body-bodymask", response.Body, "masks/body-bodymask-0000") />
<MudImage Fluid="true" style=@($"position:absolute; top: 0; left: 0; right: 0; margin: 0 auto; filter: {CostumeColorFilters[response.FaceColor]}") Src=@CostumeOrDefault("masks/body-facemask", response.Body, "masks/body-facemask-0000") />
<MudImage Fluid="true" style="position:absolute; top: 0; left: 0; right: 0; margin: 0 auto;" onerror="this.src='images/Costumes/body/body-0000.png'" Src=@($"images/Costumes/body/body-{response.Body.ToString().PadLeft(4, '0')}.png") />
<MudImage Fluid="true" style="position:absolute; top: 0; left: 0; right: 0; margin: 0 auto;" onerror="this.src='images/Costumes/face/face-0000.png'" Src=@($"images/Costumes/face/face-{response.Face.ToString().PadLeft(4, '0')}.png") />
<MudImage Fluid="true" style=@($"position:absolute; top: 0; left: 0; right: 0; margin: 0 auto; filter: {CostumeColorFilters[response.BodyColor]}") Src=@CostumeOrDefault("masks/head-bodymask", response.Head, "head/head-0000") />
<MudImage Fluid="true" style=@($"position:absolute; top: 0; left: 0; right: 0; margin: 0 auto; filter: {CostumeColorFilters[response.FaceColor]}") Src=@CostumeOrDefault("masks/head-facemask", response.Head, "head/head-0000") />
<MudImage Fluid="true" style="position:absolute; top: 0; left: 0; right: 0; margin: 0 auto;" onerror="this.src='images/Costumes/head/head-0000.png'" Src=@($"images/Costumes/head/head-{response.Head.ToString().PadLeft(4, '0')}.png") />
}
else
{
<MudImage Fluid="true" style=@($"position: relative; top: 0; left: 0; filter: {CostumeColorFilters[response.BodyColor]}") Src=@CostumeOrDefault("masks/kigurumi-bodymask", response.Kigurumi, "masks/body-bodymask-0000") />
<MudImage Fluid="true" style=@($"position:absolute; top: 0; left: 0; right: 0; margin: 0 auto; filter: {CostumeColorFilters[response.FaceColor]}") Src=@CostumeOrDefault("masks/kigurumi-facemask", response.Kigurumi, "masks/body-facemask-0000") />
<MudImage Fluid="true" style="position:absolute; top: 0; left: 0; right: 0; margin: 0 auto;" onerror="this.src='images/Costumes/kigurumi/kigurumi-0000.png'" Src=@($"images/Costumes/kigurumi/kigurumi-{response.Kigurumi.ToString().PadLeft(4, '0')}.png") />
}
2024-06-05 14:19:02 +02:00
<MudImage Fluid="true" style="position:absolute; top: 0; left: 0; right: 0; margin: 0 auto;" onerror="this.src='images/Costumes/puchi/puchi-9999.png'" Src=@($"images/Costumes/puchi/puchi-{response.Puchi.ToString().PadLeft(4, '0')}.png") />
</MudItem>
2023-11-02 17:25:43 +01:00
</MudItem>
2022-09-15 07:18:50 +02:00
2023-11-02 17:25:43 +01:00
@* Player Nameplate *@
<MudItem style="text-align: center; position:relative;">
@* Title text *@
2024-06-05 14:19:02 +02:00
<MudItem style="position:absolute; top: 5.5%; left:0; right:1.1%; height:38%; width:min(96%, 320px); margin: 0 auto; z-index:2; vertical-align: middle;">
<MudItem Style=@($"position:absolute; height:100%; {(response.TitlePlateId <= 7 ? "width:80%; right: 10%;" : "width:68%; right: 26%;")}")>
2023-11-02 17:25:43 +01:00
<MudText Id="nameplate-title" Style="position:absolute; height:100%; top: 0; left: 0; right: 0; margin: auto auto; font-family: 'Nijiiro', sans-serif; color:black">@response.Title</MudText>
</MudItem>
</MudItem>
@* Name text *@
2024-06-05 14:19:02 +02:00
<MudItem Style="position:absolute; top: 42.5%; left:0; right:1.1%; height:41%; width:min(96%, 320px); margin: 0 auto; z-index:2">
2023-11-02 17:25:43 +01:00
@* Name textoffset to the right for Dan Rank *@
<MudItem Style=@($"position:absolute; height:100%; right: 10%; {(response.IsDisplayDanOnNamePlate ? "width:46%;" : "width:80%;")}")>
2024-05-01 17:13:47 +02:00
<MudText Id="nameplate-name-outline" Style="position:absolute; height:100%; top: 0; left: 0; right: 0; margin: auto auto; font-family: 'Nijiiro', sans-serif; -webkit-text-stroke-width: 5px; -webkit-text-stroke-color: black">@response.MyDonName</MudText>
2023-11-02 17:25:43 +01:00
<MudText Id="nameplate-name" Style="position:absolute; height:100%; top: 0; left: 0; right: 0; margin: auto auto; font-family: 'Nijiiro', sans-serif; color:white">@response.MyDonName</MudText>
</MudItem>
</MudItem>
2024-05-01 17:13:47 +02:00
<MudImage onload="nameplateLoaded()" Id="nameplate" Fluid="true" Style="position: relative; bottom: 0; left: 0;" Src="images/Nameplates/nameplate.png" />
@* Check if image does not exist, use nameplate_Wood.png *@
2024-06-05 14:19:02 +02:00
<MudImage Fluid="true" Style="position:absolute; bottom: 6px; left: 0; right: 0; margin: 0 auto;" onerror="this.src='images/Nameplates/nameplate_Wood.png'" Src=@($"images/Nameplates/nameplate_{TitlePlateStrings[response.TitlePlateId].Replace(' ', '_')}.png") />
2023-11-02 17:25:43 +01:00
@if (response.IsDisplayDanOnNamePlate)
{
<MudImage Fluid="true" Style="position:absolute; top: 0; left: 0; right: 0; margin: 0 auto;" Src="images/Nameplates/nameplate_dan.png" />
}
2023-11-02 12:40:38 +01:00
</MudItem>
</MudItem>
2023-11-02 17:25:43 +01:00
</MudTabPanel>
@if (response.IsDisplayAchievement)
{
2024-01-28 07:35:26 +01:00
<MudTabPanel Text="@Localizer["Achievement Panel"]">
2023-11-02 17:25:43 +01:00
<MudItem style="text-align: center; position:relative;">
@* Achievement panel Text *@
2023-11-03 16:54:56 +01:00
<MudItem Id="scoreboard" Style="position:absolute; top: 0; left:0; right:0; height:100%; width:min(96%, 320px); margin: 0 auto; z-index:2; vertical-align: middle;">
2023-12-11 17:30:47 +01:00
@* First row *@
2023-11-02 17:25:43 +01:00
<MudItem Style="position:absolute; height:18%; width:100%; top:11%">
2023-12-11 17:30:47 +01:00
<MudItem Class="nameplateTextRight">
2023-11-03 16:54:56 +01:00
<MudText Class="nameplateText nameplateTextOutline">@scoresArray[0]</MudText>
2024-06-05 14:19:02 +02:00
<MudText Class="nameplateText">@scoresArray[0]</MudText>
2023-11-03 16:54:56 +01:00
</MudItem>
2023-11-02 17:25:43 +01:00
</MudItem>
2023-12-11 17:30:47 +01:00
@* Second row *@
2023-11-02 17:25:43 +01:00
<MudItem Style="position:absolute; height:18%; width:100%; top:30%">
2023-12-11 17:30:47 +01:00
<MudItem Class="nameplateTextLeft">
2023-11-03 16:54:56 +01:00
<MudText Class="nameplateText nameplateTextOutline">@scoresArray[1]</MudText>
<MudText Class="nameplateText">@scoresArray[1]</MudText>
</MudItem>
2023-12-11 17:30:47 +01:00
<MudItem Class="nameplateTextCenter">
2023-11-03 16:54:56 +01:00
<MudText Class="nameplateText nameplateTextOutline">@scoresArray[2]</MudText>
<MudText Class="nameplateText">@scoresArray[2]</MudText>
</MudItem>
2023-12-11 17:30:47 +01:00
<MudItem Class="nameplateTextRight">
2023-11-03 16:54:56 +01:00
<MudText Class="nameplateText nameplateTextOutline">@scoresArray[3]</MudText>
<MudText Class="nameplateText">@scoresArray[3]</MudText>
</MudItem>
2023-11-02 17:25:43 +01:00
</MudItem>
2023-12-11 17:30:47 +01:00
@* Third row *@
2023-11-02 17:25:43 +01:00
<MudItem Style="position:absolute; height:18%; width:100%; top:49%">
2023-12-11 17:30:47 +01:00
<MudItem Class="nameplateTextLeft">
2023-11-03 16:54:56 +01:00
<MudText Class="nameplateText nameplateTextOutline">@scoresArray[4]</MudText>
<MudText Class="nameplateText">@scoresArray[4]</MudText>
</MudItem>
2023-12-11 17:30:47 +01:00
<MudItem Class="nameplateTextCenter">
2023-11-03 16:54:56 +01:00
<MudText Class="nameplateText nameplateTextOutline">@scoresArray[5]</MudText>
<MudText Class="nameplateText">@scoresArray[5]</MudText>
</MudItem>
2023-12-11 17:30:47 +01:00
<MudItem Class="nameplateTextRight">
2023-11-03 16:54:56 +01:00
<MudText Class="nameplateText nameplateTextOutline">@scoresArray[6]</MudText>
<MudText Class="nameplateText">@scoresArray[6]</MudText>
</MudItem>
2023-11-02 17:25:43 +01:00
</MudItem>
2023-12-11 17:30:47 +01:00
@* Fourth row (Crowns) *@
2023-11-02 17:25:43 +01:00
<MudItem Style="position:absolute; height:18%; width:100%; top:69%">
2023-12-11 17:30:47 +01:00
<MudItem Class="nameplateTextLeft">
2023-11-03 16:54:56 +01:00
<MudText Class="nameplateText nameplateTextOutline">@scoresArray[7]</MudText>
<MudText Class="nameplateText">@scoresArray[7]</MudText>
</MudItem>
2023-12-11 17:30:47 +01:00
<MudItem Class="nameplateTextCenter">
2023-11-03 16:54:56 +01:00
<MudText Class="nameplateText nameplateTextOutline">@scoresArray[8]</MudText>
<MudText Class="nameplateText">@scoresArray[8]</MudText>
</MudItem>
2023-12-11 17:30:47 +01:00
<MudItem Class="nameplateTextRight">
2023-11-03 16:54:56 +01:00
<MudText Class="nameplateText nameplateTextOutline">@scoresArray[9]</MudText>
<MudText Class="nameplateText">@scoresArray[9]</MudText>
</MudItem>
2023-11-02 17:25:43 +01:00
</MudItem>
</MudItem>
2024-06-05 14:19:02 +02:00
@* Forbidden one-liner : Changes the AchievementDisplayDifficulty image asset. When "Difficulty.None" is selected, Defaults to highest difficulty the player currently has crowns / Ranks for. *@
<MudImage Fluid="true" style="position: relative; top: 0;" Src=@($"images/rank_panel_{DifficultySettingCourseStrings[response.AchievementDisplayDifficulty != Difficulty.None ? (int)response.AchievementDisplayDifficulty + 1 : (int)highestDifficulty + 1].Replace(' ', '_')}.png") />
2023-11-02 12:40:38 +01:00
</MudItem>
2023-11-02 17:25:43 +01:00
</MudTabPanel>
}
</MudTabs>
</MudPaper>
2023-10-16 11:38:27 +02:00
<MudButton Disabled="@isSavingOptions"
OnClick="SaveOptions"
Variant="Variant.Filled"
Color="Color.Primary">
@if (isSavingOptions)
{
<MudProgressCircular Class="ms-n1" Size="Size.Small" Indeterminate="true" />
<MudText Class="ms-2">Saving...</MudText>
}
else
{
<MudIcon Icon="@Icons.Material.Filled.Save" Class="mx-2"></MudIcon>
2024-01-28 07:35:26 +01:00
<MudText>@Localizer["Save"]</MudText>
2023-10-16 11:38:27 +02:00
}
</MudButton>
</MudStack>
</MudItem>
</MudGrid>
}
2023-11-02 12:40:38 +01:00
}
2024-03-09 20:13:56 +01:00
else
{
2024-06-05 14:19:02 +02:00
<MudContainer Style="display:flex;margin:50px 0;align-items:center;justify-content:center;">
2024-03-09 20:13:56 +01:00
<MudProgressCircular Indeterminate="true" Size="Size.Large" Color="Color.Primary" />
</MudContainer>
}
2023-11-02 12:40:38 +01:00
@code {
private async Task UpdateMyDonName()
{
2024-05-17 00:32:46 +02:00
@if (response is not null) await JsRuntime.InvokeVoidAsync("updateMyDonNameText", response.MyDonName);
2023-11-02 12:40:38 +01:00
}
private async Task UpdateTitle()
{
2024-05-17 00:32:46 +02:00
@if (response is not null) await JsRuntime.InvokeVoidAsync("updateTitleText", response.Title);
2023-12-11 17:30:47 +01:00
}
private async Task UpdateScoreboard(Difficulty difficulty)
{
UpdateScores(difficulty);
2024-05-17 00:32:46 +02:00
await JsRuntime.InvokeVoidAsync("updateScoreboardText", scoresArray);
2023-11-02 12:40:38 +01:00
}
2022-09-05 06:52:29 +02:00
}