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

View File

@ -1,4 +1,6 @@
namespace TaikoWebUI.Pages;
using System.Net.NetworkInformation;
namespace TaikoWebUI.Pages;
public partial class DaniDojo
{
@ -27,13 +29,32 @@ public partial class DaniDojo
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)
{
var danConditionType = (DanConditionType)data.OdaiType;
string danConditionTitle = GetDanRequirementString(danConditionType);
return (DanBorderType)data.BorderType switch
{
DanBorderType.All => $"{danConditionType}, All song",
DanBorderType.PerSong => $"{danConditionType}, Per song",
DanBorderType.All => $"{danConditionTitle} (All stages)",
DanBorderType.PerSong => $"{danConditionTitle} (Per stage)",
_ => throw new ArgumentOutOfRangeException(nameof(data))
};
}
@ -161,7 +182,7 @@ public partial class DaniDojo
return icon;
}
private static string GetSoulGauge(DanData data, bool isGold)
private static uint GetSoulGauge(DanData data, bool isGold)
{
var borders = data.OdaiBorderList;
var soulBorder =
@ -170,9 +191,9 @@ public partial class DaniDojo
if (isGold)
{
return $"{soulBorder.GoldBorderTotal}%";
return soulBorder.GoldBorderTotal;
}
return $"{soulBorder.RedBorderTotal}%";
return soulBorder.RedBorderTotal;
}
}

View File

@ -56,6 +56,14 @@
</MudGrid>
</CellTemplate>
</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"
Sortable="false" Filterable="true">
<CellTemplate>

View File

@ -8,6 +8,7 @@
<base href="/" />
<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="style.overrides.css" rel="stylesheet" />
</head>
<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;
}