1
0
mirror of synced 2025-02-17 11:18:32 +01:00

Merge remote-tracking branch 'origin/master'

This commit is contained in:
asesidaa 2022-09-13 00:52:01 +08:00
commit 1019a27b6b
5 changed files with 118 additions and 30 deletions

View File

@ -33,9 +33,11 @@
</MudItem> </MudItem>
<MudItem xs="2" md="1" Style="display:flex;flex-direction:column;align-items:center;"> <MudItem xs="2" md="1" Style="display:flex;flex-direction:column;align-items:center;">
<img src=@($"/images/difficulty_{difficulty}.png") style="width:40px;height:40px;" alt="@difficulty"/> <img src=@($"/images/difficulty_{difficulty}.png") style="width:40px;height:40px;margin-bottom:2px;" alt="@difficulty"/>
<MudText Typo="Typo.caption">@difficulty</MudText> <MudStack Row="true" Spacing="0" Justify="Justify.Center" AlignItems="AlignItems.Center">
<MudText Typo="Typo.caption">Level star: @GameDataService.GetMusicStarLevel(danDataOdaiSong.SongNo, difficulty)</MudText> <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>
<MudItem xs="9" md="4" Style="display:flex;flex-direction:column;" Class="pl-4"> <MudItem xs="9" md="4" Style="display:flex;flex-direction:column;" Class="pl-4">
@ -85,48 +87,83 @@
</MudItem> </MudItem>
} }
<MudItem xs="12"> <MudItem xs="12" Class="dani-results">
<MudGrid> <MudGrid>
<MudItem xs="12" md="3"> <MudItem xs="12" md="3">
<MudCard Outlined="true" Class="pa-4"> <MudCard Outlined="true" Class="pa-2">
<MudCardHeader> <MudCardHeader Class="pb-0">
<CardHeaderContent> <CardHeaderContent>
<MudText Typo="Typo.h6">Soul Gauge</MudText> <MudText Typo="Typo.h6">Soul Gauge</MudText>
</CardHeaderContent> </CardHeaderContent>
</MudCardHeader> </MudCardHeader>
<MudCardContent> <MudCardContent>
<MudText> <MudStack Spacing="8">
Soul gauge needed to pass: @GetSoulGauge(danData, false) @{
</MudText> var redRequirement = GetSoulGauge(danData, false);
<MudText> var goldRequirement = GetSoulGauge(danData, true);
Soul gauge needed to gold clear: @GetSoulGauge(danData, true) var barClass = "bar-default";
</MudText> var resultText = "Failed";
}
<MudStack Spacing="1">
<MudText Typo="Typo.subtitle2" Style="font-weight:bold;">Result</MudText>
@if (bestDataMap.ContainsKey(danId)) @if (bestDataMap.ContainsKey(danId))
{ {
var danBestData = bestDataMap[danId]; var danBestData = bestDataMap[danId];
<MudText>
Best Soul gauge: @(danBestData.SoulGaugeTotal)% if (danBestData.SoulGaugeTotal >= redRequirement) {
</MudText> barClass = "bar-pass-red";
resultText = "Passed";
} }
if (danBestData.SoulGaugeTotal >= goldRequirement) {
barClass = "bar-pass-gold";
resultText = "Gold";
}
<MudProgressLinear Class="@barClass" Rounded="true" Size="Size.Large" Max="100" Value="@danBestData.SoulGaugeTotal">
<MudText Typo="Typo.caption">@(danBestData.SoulGaugeTotal)%</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>
}
</MudStack>
<MudStack Spacing="1">
<MudText Typo="Typo.subtitle2" Style="font-weight:bold;">Conditions</MudText>
<MudStack Row="true" Justify="Justify.SpaceBetween">
<MudStack Spacing="0">
<MudText Typo="Typo.caption">Red</MudText>
<MudText Typo="Typo.body1">> @redRequirement%</MudText>
</MudStack>
<MudStack Spacing="0">
<MudText Typo="Typo.caption">Gold</MudText>
<MudText Typo="Typo.body1">> @goldRequirement%</MudText>
</MudStack>
</MudStack>
</MudStack>
</MudStack>
</MudCardContent> </MudCardContent>
</MudCard> </MudCard>
</MudItem> </MudItem>
<MudItem xs="12" md="9"> <MudItem xs="12" md="9">
<MudStack Spacing="4">
@for (var j = 1; j < danData.OdaiBorderList.Count; j++) @for (var j = 1; j < danData.OdaiBorderList.Count; j++)
{ {
var border = danData.OdaiBorderList[j]; var border = danData.OdaiBorderList[j];
<MudStack>
<MudCard Outlined="true" Class="pa-4"> <MudCard Outlined="true" Class="pa-2">
<MudCardHeader> <MudCardHeader>
<CardHeaderContent> <CardHeaderContent>
<MudText Typo="Typo.h4"> <MudText Typo="Typo.h6">
@GetDanRequirementTitle(border) @GetDanRequirementTitle(border)
</MudText> </MudText>
</CardHeaderContent> </CardHeaderContent>
</MudCardHeader> </MudCardHeader>
<MudCardContent> <MudCardContent>
@{ @{
var borderType = (DanBorderType)border.BorderType; var borderType = (DanBorderType)border.BorderType;
} }
@ -167,8 +204,8 @@
} }
</MudCardContent> </MudCardContent>
</MudCard> </MudCard>
</MudStack>
} }
</MudStack>
</MudItem> </MudItem>
</MudGrid> </MudGrid>
</MudItem> </MudItem>

View File

@ -1,4 +1,6 @@
namespace TaikoWebUI.Pages; using System.Net.NetworkInformation;
namespace TaikoWebUI.Pages;
public partial class DaniDojo public partial class DaniDojo
{ {
@ -27,13 +29,32 @@ public partial class DaniDojo
breadcrumbs.Add(new BreadcrumbItem("Dani Dojo", href: $"/Cards/{Baid}/DaniDojo", disabled: false)); breadcrumbs.Add(new BreadcrumbItem("Dani Dojo", href: $"/Cards/{Baid}/DaniDojo", disabled: false));
} }
private static string GetDanRequirementString(DanConditionType danConditionType)
{
return danConditionType switch
{
DanConditionType.TotalHitCount => "Total Hits",
DanConditionType.GoodCount => "Good Notes",
DanConditionType.OkCount => "OK Notes",
DanConditionType.BadCount => "Bad Notes",
DanConditionType.SoulGauge => "Soul Gauge",
DanConditionType.DrumrollCount => "Drumroll Hits",
DanConditionType.Score => "Score",
DanConditionType.ComboCount => "MAX Combo",
_ => ""
};
}
private static string GetDanRequirementTitle(DanData.OdaiBorder data) private static string GetDanRequirementTitle(DanData.OdaiBorder data)
{ {
var danConditionType = (DanConditionType)data.OdaiType; var danConditionType = (DanConditionType)data.OdaiType;
string danConditionTitle = GetDanRequirementString(danConditionType);
return (DanBorderType)data.BorderType switch return (DanBorderType)data.BorderType switch
{ {
DanBorderType.All => $"{danConditionType}, All song", DanBorderType.All => $"{danConditionTitle} (All stages)",
DanBorderType.PerSong => $"{danConditionType}, Per song", DanBorderType.PerSong => $"{danConditionTitle} (Per stage)",
_ => throw new ArgumentOutOfRangeException(nameof(data)) _ => throw new ArgumentOutOfRangeException(nameof(data))
}; };
} }
@ -161,7 +182,7 @@ public partial class DaniDojo
return icon; return icon;
} }
private static string GetSoulGauge(DanData data, bool isGold) private static uint GetSoulGauge(DanData data, bool isGold)
{ {
var borders = data.OdaiBorderList; var borders = data.OdaiBorderList;
var soulBorder = var soulBorder =
@ -170,9 +191,9 @@ public partial class DaniDojo
if (isGold) if (isGold)
{ {
return $"{soulBorder.GoldBorderTotal}%"; return soulBorder.GoldBorderTotal;
} }
return $"{soulBorder.RedBorderTotal}%"; return soulBorder.RedBorderTotal;
} }
} }

View File

@ -56,6 +56,14 @@
</MudGrid> </MudGrid>
</CellTemplate> </CellTemplate>
</Column> </Column>
<Column T="SongBestData" Field="@nameof(SongBestData.SongId)" Title="Level" Sortable="false">
<CellTemplate>
<MudStack Row="true" Spacing="0" AlignItems="AlignItems.Center">
<MudIcon Icon="@Icons.Filled.Star" Size="Size.Small" />
<MudText Typo="Typo.caption" Style="line-height:1;margin-top:2px;margin-right:2px;">@GameDataService.GetMusicStarLevel(@context.Item.SongId, difficulty)</MudText>
</MudStack>
</CellTemplate>
</Column>
<Column T="SongBestData" Field="@nameof(SongBestData.Genre)" Title="Genre" <Column T="SongBestData" Field="@nameof(SongBestData.Genre)" Title="Genre"
Sortable="false" Filterable="true"> Sortable="false" Filterable="true">
<CellTemplate> <CellTemplate>

View File

@ -8,6 +8,7 @@
<base href="/" /> <base href="/" />
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet" /> <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet" />
<link href="_content/MudBlazor/MudBlazor.min.css" rel="stylesheet" /> <link href="_content/MudBlazor/MudBlazor.min.css" rel="stylesheet" />
<link href="style.overrides.css" rel="stylesheet" />
</head> </head>
<body> <body>

View File

@ -0,0 +1,21 @@
.dani-results .mud-progress-linear {
height: 25px !important;
}
.mud-progress-linear.bar-pass-gold .mud-progress-linear-bars .mud-progress-linear-bar {
background: linear-gradient( 90deg, rgb(255,83,147) 0%, rgb(255,248,6) 15%, rgb(122,255,79) 30%, rgb(122,244,255) 50%, rgb(149,104,255) 65%, rgb(255,98,244) 85%, rgb(255,83,147) 100% );
}
.mud-progress-linear.bar-pass-red .mud-progress-linear-bars .mud-progress-linear-bar {
background-color: #FF3C05;
}
.mud-progress-linear.bar-default .mud-progress-linear-bars .mud-progress-linear-bar {
background-color: lightgrey;
}
.mud-progress-linear.bar-pass-gold .mud-typography,
.mud-progress-linear.bar-pass-red .mud-typography {
font-weight: bold;
color: white;
}