1
0
mirror of synced 2024-11-30 17:24:33 +01:00
TaikoLocalServer/TaikoWebUI/Pages/DaniDojo.razor

404 lines
33 KiB
Plaintext
Raw Normal View History

2022-09-11 18:28:12 +02:00
@inject IGameDataService GameDataService
2022-09-10 23:56:48 +02:00
@inject HttpClient Client
@page "/Cards/{baid:int}/DaniDojo"
<MudBreadcrumbs Items="breadcrumbs" Class="px-0"></MudBreadcrumbs>
<h1>Dani Dojo</h1>
<MudText Typo="Typo.caption">Card: @Baid</MudText>
2022-09-12 19:33:13 +02:00
<MudGrid Class="my-4 pb-10">
2022-09-11 23:32:24 +02:00
<MudItem xs="12">
<MudPaper Elevation="0" Outlined="true">
<MudTabs ActivePanelIndex="0" Rounded="true" Border="true" PanelClass="pa-8">
2022-09-11 23:32:24 +02:00
@for (uint i = 1; i <= 19; i++)
2022-09-11 18:28:12 +02:00
{
2022-09-11 23:32:24 +02:00
var danId = i;
var danData = GameDataService.GetDanDataById(danId);
2022-09-12 00:12:11 +02:00
2022-09-12 04:15:03 +02:00
<MudTabPanel Text="@GetDanTitle(danData.Title)" Icon="@GetDanResultIcon(danId)">
<MudText Typo="Typo.h5" Class="mb-4">Details</MudText>
<MudGrid Class="d-flex">
2022-09-12 23:15:27 +02:00
<MudItem xs="12" sm="12" md="3" Class="pb-1">
<MudCard Outlined="true" Style="height:100%;">
<MudCardHeader Class="pb-0">
<CardHeaderContent>
<MudText Typo="Typo.h6">Result</MudText>
</CardHeaderContent>
</MudCardHeader>
<MudCardContent Class="d-flex py-10" Style="justify-content:center;">
<MudStack Justify="Justify.Center" AlignItems="AlignItems.Center" Spacing="6">
@{
var danResultState = GetDanResultState(danId);
var danClearStateString = GetDanClearStateString(danResultState);
2022-09-12 23:15:27 +02:00
}
<img src=@($"/images/dani_{danResultState.ToString()}.png") style="max-width:150px; width:100%;" alt="danResultState.ToString()"/>
2022-09-12 23:15:27 +02:00
<MudText Typo="Typo.body1">@danClearStateString</MudText>
</MudStack>
</MudCardContent>
</MudCard>
</MudItem>
<MudItem xs="12" sm="12" md="9">
<MudGrid Class="d-block">
@for (uint j = 0; j <= 2; j++)
{
var index = (int)j;
var danDataOdaiSong = danData.OdaiSongList[index];
var stageNumber = j + 1;
var difficulty = (Difficulty)danDataOdaiSong.Level;
2022-09-12 00:12:11 +02:00
2022-09-12 23:15:27 +02:00
<MudItem xs="12" Class="pb-1">
<MudCard Outlined="true" Class="pa-4">
<MudGrid Style="display:flex; align-items: center; justify-content: flex-start;">
<MudItem xs="1" md="1" Style="display:flex;flex-direction:column;align-items:center;">
<h3>@stageNumber</h3>
</MudItem>
2022-09-12 00:12:11 +02:00
2022-09-12 23:15:27 +02:00
<MudItem xs="2" md="1" Style="display:flex;flex-direction:column;align-items:center;">
<MudTooltip Text="@difficulty.ToString()" Placement="Placement.Top" Arrow="true">
<img src=@($"/images/difficulty_{difficulty}.png") style="width:40px;height:40px;margin-bottom:2px;" alt="@difficulty" />
</MudTooltip>
2022-09-13 03:55:57 +02:00
<MudStack Row="true" Spacing="1" Justify="Justify.Center" AlignItems="AlignItems.Center">
2022-09-12 23:15:27 +02:00
<MudIcon Icon="@Icons.Filled.Star" Size="Size.Small" />
<MudText Typo="Typo.caption" Style="line-height:1;margin-top:2px;margin-right:2px;">@GameDataService.GetMusicStarLevel(danDataOdaiSong.SongNo, difficulty)</MudText>
</MudStack>
</MudItem>
<MudItem xs="9" md="4" Style="display:flex;flex-direction:column;" Class="pl-4">
<MudText Typo="Typo.body1" Style="font-weight: bold;">@GameDataService.GetMusicNameBySongId(danDataOdaiSong.SongNo)</MudText>
<MudText Typo="Typo.caption">@GameDataService.GetMusicArtistBySongId(danDataOdaiSong.SongNo)</MudText>
</MudItem>
2022-09-12 16:17:15 +02:00
2022-09-12 23:15:27 +02:00
@if (bestDataMap.ContainsKey(danId))
2022-09-12 16:17:15 +02:00
{
2022-09-12 23:15:27 +02:00
var danBestData = bestDataMap[danId];
if (danBestData.DanBestStageDataList.Count > index)
{
var bestStage = danBestData.DanBestStageDataList[index];
2022-09-12 16:17:15 +02:00
<MudItem xs="12" md="6" Style="display:flex;flex-direction:column;">
2022-09-12 23:15:27 +02:00
<MudStack Row="true" Spacing="4" Justify="Justify.SpaceEvenly">
<MudCard Elevation="0">
<MudText Typo="Typo.caption">Good</MudText>
<MudText Typo="Typo.body1" Style="font-weight: bold;">@bestStage.GoodCount</MudText>
</MudCard>
<MudCard Elevation="0">
<MudText Typo="Typo.caption">OK</MudText>
<MudText Typo="Typo.body1" Style="font-weight: bold;">@bestStage.OkCount</MudText>
</MudCard>
<MudCard Elevation="0">
<MudText Typo="Typo.caption">Bad</MudText>
<MudText Typo="Typo.body1" Style="font-weight: bold;">@bestStage.BadCount</MudText>
</MudCard>
<MudCard Elevation="0">
<MudText Typo="Typo.caption">Drumroll</MudText>
<MudText Typo="Typo.body1" Style="font-weight: bold;">@bestStage.DrumrollCount</MudText>
</MudCard>
<MudCard Elevation="0">
<MudText Typo="Typo.caption">MAX Combo</MudText>
<MudText Typo="Typo.body1" Style="font-weight: bold;">@bestStage.ComboCount</MudText>
</MudCard>
<MudCard Elevation="0">
<MudText Typo="Typo.caption">Total Hits</MudText>
<MudText Typo="Typo.body1" Style="font-weight: bold;">@bestStage.TotalHitCount</MudText>
</MudCard>
</MudStack>
</MudItem>
}
2022-09-12 16:17:15 +02:00
}
2022-09-12 23:15:27 +02:00
</MudGrid>
</MudCard>
</MudItem>
}
</MudGrid>
</MudItem>
</MudGrid>
2022-09-12 00:12:11 +02:00
<MudText Typo="Typo.h5" Class="mt-10 mb-4">Conditions</MudText>
<MudGrid>
2022-09-12 18:34:36 +02:00
<MudItem xs="12" Class="dani-results">
2022-09-12 00:12:11 +02:00
<MudGrid>
<MudItem xs="12" md="3">
2022-09-12 17:49:28 +02:00
<MudCard Outlined="true" Class="pa-2">
<MudCardHeader>
2022-09-12 16:17:15 +02:00
<CardHeaderContent>
<MudText Typo="Typo.h6">Soul Gauge</MudText>
</CardHeaderContent>
</MudCardHeader>
<MudCardContent>
2022-09-12 18:34:36 +02:00
<MudStack Spacing="8">
2022-09-12 17:49:28 +02:00
@{
var redRequirement = GetSoulGauge(danData, false);
var goldRequirement = GetSoulGauge(danData, true);
2022-09-12 18:34:36 +02:00
var barClass = "bar-default";
var resultText = "Failed";
2022-09-12 17:49:28 +02:00
}
<MudStack Spacing="1">
2022-09-12 18:34:36 +02:00
<MudText Typo="Typo.subtitle2" Style="font-weight:bold;">Result</MudText>
2022-09-12 17:49:28 +02:00
@if (bestDataMap.ContainsKey(danId))
{
var danBestData = bestDataMap[danId];
if (danBestData.SoulGaugeTotal >= redRequirement) {
2022-09-12 18:34:36 +02:00
barClass = "bar-pass-red";
2022-09-13 03:12:40 +02:00
resultText = "Pass";
2022-09-12 17:49:28 +02:00
}
if (danBestData.SoulGaugeTotal >= goldRequirement) {
2022-09-12 18:34:36 +02:00
barClass = "bar-pass-gold";
resultText = "Gold";
2022-09-12 17:49:28 +02:00
}
2022-09-12 18:34:36 +02:00
<MudProgressLinear Class="@barClass" Rounded="true" Size="Size.Large" Max="100" Value="@danBestData.SoulGaugeTotal">
<MudText Typo="Typo.caption">@(danBestData.SoulGaugeTotal)%</MudText>
2022-09-12 17:49:28 +02:00
</MudProgressLinear>
2022-09-12 18:34:36 +02:00
<MudText Typo="Typo.caption" Style="text-align: right">@resultText</MudText>
2022-09-12 17:49:28 +02:00
} else {
2022-09-12 18:34:36 +02:00
<MudProgressLinear Class="@barClass" Rounded="true" Size="Size.Large" Max="100" Value="0">
2022-09-12 17:49:28 +02:00
<MudText Typo="Typo.caption">0%</MudText>
</MudProgressLinear>
2022-09-12 18:34:36 +02:00
<MudText Typo="Typo.caption" Style="text-align: right">N/A</MudText>
2022-09-12 17:49:28 +02:00
}
</MudStack>
<MudStack Spacing="1">
2022-09-12 23:15:27 +02:00
<MudText Typo="Typo.subtitle2" Style="font-weight:bold">Conditions</MudText>
2022-09-13 03:55:57 +02:00
<MudStack Row="true" Spacing="16">
2022-09-12 18:34:36 +02:00
<MudStack Spacing="0">
<MudText Typo="Typo.caption">Red</MudText>
2022-09-12 23:15:27 +02:00
<MudText Typo="Typo.body1" Style="font-weight: bold">> @redRequirement%</MudText>
2022-09-12 17:49:28 +02:00
</MudStack>
2022-09-12 18:34:36 +02:00
<MudStack Spacing="0">
<MudText Typo="Typo.caption">Gold</MudText>
2022-09-12 23:15:27 +02:00
<MudText Typo="Typo.body1" Style="font-weight: bold">> @goldRequirement%</MudText>
2022-09-12 17:49:28 +02:00
</MudStack>
2022-09-12 18:34:36 +02:00
</MudStack>
2022-09-12 17:49:28 +02:00
</MudStack>
</MudStack>
2022-09-12 16:17:15 +02:00
</MudCardContent>
2022-09-12 00:12:11 +02:00
</MudCard>
</MudItem>
<MudItem xs="12" md="9">
2022-09-12 18:34:36 +02:00
<MudStack Spacing="4">
2022-09-12 16:17:15 +02:00
@for (var j = 1; j < danData.OdaiBorderList.Count; j++)
2022-09-11 23:32:24 +02:00
{
2022-09-12 16:17:15 +02:00
var border = danData.OdaiBorderList[j];
2022-09-12 18:34:36 +02:00
<MudCard Outlined="true" Class="pa-2">
<MudCardHeader>
<CardHeaderContent>
<MudText Typo="Typo.h6">
@GetDanRequirementTitle(border)
</MudText>
</CardHeaderContent>
</MudCardHeader>
<MudCardContent>
@{
var borderType = (DanBorderType)border.BorderType;
}
@if (borderType == DanBorderType.All)
{
<MudStack Spacing="8">
@{
var redRequirement = border.RedBorderTotal;
var goldRequirement = border.GoldBorderTotal;
var barClass = "bar-default";
var resultText = "Failed";
}
<MudStack Spacing="1">
<MudText Typo="Typo.subtitle2" Style="font-weight:bold;">Result</MudText>
@if (bestDataMap.ContainsKey(danId))
2022-09-12 16:17:15 +02:00
{
var danBestData = bestDataMap[danId];
var bestData = GetAllBestFromData((DanConditionType)border.OdaiType, danBestData);
if ((DanConditionType)border.OdaiType is DanConditionType.BadCount)
{
if (bestData <= redRequirement)
{
barClass = "bar-pass-red";
2022-09-13 03:12:40 +02:00
resultText = "Pass";
}
if (bestData <= goldRequirement)
{
barClass = "bar-pass-gold";
resultText = "Gold";
}
<MudProgressLinear Class="@barClass" Rounded="true" Size="Size.Large" Max="@redRequirement" Value="@(redRequirement - bestData)">
2022-09-13 03:12:40 +02:00
<MudText Typo="Typo.caption">@(redRequirement - bestData)</MudText>
</MudProgressLinear>
<MudText Typo="Typo.caption" Style="text-align: right">@resultText</MudText>
}
else
{
if (bestData >= redRequirement)
{
barClass = "bar-pass-red";
2022-09-13 03:12:40 +02:00
resultText = "Pass";
}
if (bestData >= goldRequirement)
{
barClass = "bar-pass-gold";
resultText = "Gold";
}
2022-09-13 02:50:33 +02:00
<MudProgressLinear Class="@barClass" Rounded="true" Size="Size.Large" Max="@goldRequirement" Value="@bestData">
<MudText Typo="Typo.caption">@bestData</MudText>
</MudProgressLinear>
<MudText Typo="Typo.caption" Style="text-align: right">@resultText</MudText>
}
}
else
{
<MudProgressLinear Class="@barClass" Rounded="true" Size="Size.Large" Max="100" Value="0">
<MudText Typo="Typo.caption">0</MudText>
</MudProgressLinear>
<MudText Typo="Typo.caption" Style="text-align: right">N/A</MudText>
2022-09-12 16:17:15 +02:00
}
</MudStack>
@{
var conditionOperator = ">";
if ((DanConditionType)border.OdaiType is DanConditionType.BadCount)
2022-09-12 16:17:15 +02:00
{
conditionOperator = "<";
2022-09-12 16:17:15 +02:00
}
}
<MudStack Spacing="1">
<MudText Typo="Typo.subtitle2" Style="font-weight:bold">Conditions</MudText>
<MudStack Row="true" Spacing="16">
<MudStack Spacing="0">
<MudText Typo="Typo.caption">Red</MudText>
<MudText Typo="Typo.body1" Style="font-weight: bold">@conditionOperator @redRequirement</MudText>
</MudStack>
<MudStack Spacing="0">
<MudText Typo="Typo.caption">Gold</MudText>
<MudText Typo="Typo.body1" Style="font-weight: bold">@conditionOperator @goldRequirement</MudText>
</MudStack>
</MudStack>
</MudStack>
2022-09-12 16:17:15 +02:00
</MudStack>
}
else
{
2022-09-13 02:50:33 +02:00
<MudGrid>
@for (var k = 0; k < 3; k++)
{
var songNumber = k;
2022-09-13 03:12:40 +02:00
var redRequirement = GetSongBorderCondition(border, songNumber, false);
2022-09-13 03:55:57 +02:00
var goldRequirement = GetSongBorderCondition(border, songNumber, true);
2022-09-13 02:50:33 +02:00
var barClass = "bar-default";
var resultText = "Failed";
<MudItem xs="12" md="4">
<MudCard Outlined="true">
<MudCardHeader>
<CardHeaderContent>
<MudText Typo="Typo.body1" Style="font-weight:bold">Stage @(songNumber + 1)</MudText>
</CardHeaderContent>
</MudCardHeader>
<MudCardContent>
<MudText Typo="Typo.subtitle2" Style="font-weight:bold;">Result</MudText>
@if (bestDataMap.ContainsKey(danId))
{
var danBestData = bestDataMap[danId];
var bestData = GetSongBestFromData((DanConditionType)border.OdaiType, danBestData, songNumber);
if ((DanConditionType)border.OdaiType is DanConditionType.BadCount)
{
if (bestData <= redRequirement)
{
barClass = "bar-pass-red";
2022-09-13 03:12:40 +02:00
resultText = "Pass";
2022-09-13 02:50:33 +02:00
}
if (bestData <= goldRequirement)
{
barClass = "bar-pass-gold";
resultText = "Gold";
}
<MudProgressLinear Class="@barClass" Rounded="true" Size="Size.Large" Max="@redRequirement" Value="@(redRequirement - bestData)">
2022-09-13 03:12:40 +02:00
<MudText Typo="Typo.caption">@(redRequirement - bestData)</MudText>
2022-09-13 02:50:33 +02:00
</MudProgressLinear>
<MudText Typo="Typo.caption" Style="text-align: right">@resultText</MudText>
}
else
{
if (bestData >= redRequirement)
{
barClass = "bar-pass-red";
2022-09-13 03:12:40 +02:00
resultText = "Pass";
2022-09-13 02:50:33 +02:00
}
if (bestData >= goldRequirement)
{
barClass = "bar-pass-gold";
resultText = "Gold";
}
2022-09-13 03:12:40 +02:00
<MudProgressLinear Class="@barClass" Rounded="true" Size="Size.Large" Max="@(goldRequirement > 0 ? goldRequirement : 1)" Value="@(goldRequirement > 0 ? bestData : 1)">
2022-09-13 02:50:33 +02:00
<MudText Typo="Typo.caption">@bestData</MudText>
</MudProgressLinear>
2022-09-13 03:12:40 +02:00
<MudStack Class="mt-1" AlignItems="AlignItems.End">
<MudText Typo="Typo.caption">@resultText</MudText>
</MudStack>
2022-09-13 02:50:33 +02:00
}
}
else
{
<MudProgressLinear Class="@barClass" Rounded="true" Size="Size.Large" Max="100" Value="0">
<MudText Typo="Typo.caption">0</MudText>
</MudProgressLinear>
2022-09-13 03:12:40 +02:00
<MudStack Class="mt-1" AlignItems="AlignItems.End">
<MudText Typo="Typo.caption">N/A</MudText>
</MudStack>
2022-09-13 02:50:33 +02:00
}
2022-09-13 03:12:40 +02:00
@{
var conditionOperator = ">";
2022-09-13 03:12:40 +02:00
if ((DanConditionType)border.OdaiType is DanConditionType.BadCount)
{
conditionOperator = "<";
}
if (redRequirement == 0) {
conditionOperator = "";
}
}
<MudStack Spacing="1" Class="mt-8">
<MudText Typo="Typo.subtitle2" Style="font-weight:bold">Conditions</MudText>
<MudStack Row="true" Spacing="16">
<MudStack Spacing="0">
<MudText Typo="Typo.caption">Red</MudText>
<MudText Typo="Typo.body1" Style="font-weight: bold">@conditionOperator @redRequirement</MudText>
</MudStack>
<MudStack Spacing="0">
<MudText Typo="Typo.caption">Gold</MudText>
<MudText Typo="Typo.body1" Style="font-weight: bold">@conditionOperator @goldRequirement</MudText>
</MudStack>
</MudStack>
</MudStack>
2022-09-13 02:50:33 +02:00
</MudCardContent>
</MudCard>
</MudItem>
}
2022-09-13 02:50:33 +02:00
</MudGrid>
}
</MudCardContent>
</MudCard>
2022-09-12 16:17:15 +02:00
}
2022-09-12 18:34:36 +02:00
</MudStack>
2022-09-12 16:17:15 +02:00
</MudItem>
</MudGrid>
2022-09-11 23:32:24 +02:00
</MudItem>
</MudGrid>
</MudTabPanel>
2022-09-11 18:28:12 +02:00
}
2022-09-11 23:32:24 +02:00
</MudTabs>
</MudPaper>
</MudItem>
</MudGrid>