1
0
mirror of synced 2024-11-23 22:41:01 +01:00

Merge remote-tracking branch 'origin/master'

This commit is contained in:
asesidaa 2022-10-20 02:30:44 +08:00
commit e30d362e63
3 changed files with 190 additions and 78 deletions

View File

@ -17,4 +17,6 @@ public class DanBestStageData
public uint TotalHitCount { get; set; }
public uint ComboCount { get; set; }
public uint HighScore { get; set; }
}

View File

@ -20,7 +20,7 @@
<MudTabPanel Text="@GetDanTitle(danData.Title)" Icon="@GetDanResultIcon(danId)">
<MudText Typo="Typo.h5" Class="mb-4">Details</MudText>
<MudGrid Class="d-flex">
<MudItem xs="12" sm="12" md="3" Class="pb-1">
<MudItem xs="12" sm="12" md="4" Class="pb-1">
<MudCard Outlined="true" Style="height:100%;">
<MudCardHeader Class="pb-0">
<CardHeaderContent>
@ -39,7 +39,76 @@
</MudCardContent>
</MudCard>
</MudItem>
<MudItem xs="12" sm="12" md="9">
<MudItem xs="12" sm="12" md="8" Class="pb-1">
<MudStack>
<MudCard Outlined="true">
<MudCardHeader Class="pb-0">
<CardHeaderContent>
<MudText Typo="Typo.h6">High Score</MudText>
</CardHeaderContent>
</MudCardHeader>
<MudCardContent Class="d-flex py-10" Style="justify-content:center">
@{
var totalScore = GetTotalScore(danId);
}
<MudStack Row="true" Spacing="4" Justify="Justify.SpaceEvenly" Style="width:100%">
<MudText Typo="Typo.h4">@totalScore</MudText>
</MudStack>
</MudCardContent>
</MudCard>
<MudCard Outlined="true">
<MudCardHeader Class="pb-0">
<CardHeaderContent>
<MudText Typo="Typo.h6">Totals</MudText>
</CardHeaderContent>
</MudCardHeader>
<MudCardContent Class="d-flex py-10" Style="justify-content:center">
@{
var totalGoods = GetTotalGoodHits(danId);
var totalOks = GetTotalOkHits(danId);
var totalBads = GetTotalBadHits(danId);
var totalDrumroll = GetTotalDrumrollHits(danId);
var totalMaxCombo = GetTotalMaxCombo(danId);
var totalHits = GetTotalHits(danId);
}
<MudStack Row="true" Spacing="4" Justify="Justify.SpaceEvenly" Style="width:100%">
<MudCard Elevation="0">
<MudText Typo="Typo.caption">Good</MudText>
<MudText Typo="Typo.body1" Style="font-weight: bold;">@totalGoods</MudText>
</MudCard>
<MudCard Elevation="0">
<MudText Typo="Typo.caption">OK</MudText>
<MudText Typo="Typo.body1" Style="font-weight: bold;">@totalOks</MudText>
</MudCard>
<MudCard Elevation="0">
<MudText Typo="Typo.caption">Bad</MudText>
<MudText Typo="Typo.body1" Style="font-weight: bold;">@totalBads</MudText>
</MudCard>
<MudCard Elevation="0">
<MudText Typo="Typo.caption">Drumroll</MudText>
<MudText Typo="Typo.body1" Style="font-weight: bold;">@totalDrumroll</MudText>
</MudCard>
<MudCard Elevation="0">
<MudText Typo="Typo.caption">MAX Combo</MudText>
<MudText Typo="Typo.body1" Style="font-weight: bold;">@totalMaxCombo</MudText>
</MudCard>
<MudCard Elevation="0">
<MudText Typo="Typo.caption">Total Hits</MudText>
<MudText Typo="Typo.body1" Style="font-weight: bold;">@totalHits</MudText>
</MudCard>
</MudStack>
</MudCardContent>
</MudCard>
</MudStack>
</MudItem>
</MudGrid>
<MudText Typo="Typo.h5" Class="mt-10 mb-4">Songs</MudText>
<MudGrid>
<MudItem xs="12">
<MudGrid Class="d-block">
@for (uint j = 0; j <= 2; j++)
{
@ -77,6 +146,7 @@
if (danBestData.DanBestStageDataList.Count > index)
{
var bestStage = danBestData.DanBestStageDataList[index];
<MudItem xs="12" md="6" Style="display:flex;flex-direction:column;">
<MudStack Row="true" Spacing="4" Justify="Justify.SpaceEvenly">
<MudCard Elevation="0">
@ -227,8 +297,11 @@
resultText = "Gold";
}
<MudProgressLinear Class="@barClass" Rounded="true" Size="Size.Large" Max="@redRequirement" Value="@(redRequirement - bestData)">
<MudText Typo="Typo.caption">@(redRequirement - bestData)</MudText>
var resultValue = redRequirement - bestData;
if (resultValue < 0) resultValue = 0;
<MudProgressLinear Class="@barClass" Rounded="true" Size="Size.Large" Max="@redRequirement" Value="@resultValue">
<MudText Typo="Typo.caption">@resultValue</MudText>
</MudProgressLinear>
<MudText Typo="Typo.caption" Style="text-align: right">@resultText</MudText>
}
@ -316,9 +389,11 @@
barClass = "bar-pass-gold";
resultText = "Gold";
}
var resultValue = redRequirement - bestData;
if (resultValue < 0) resultValue = 0;
<MudProgressLinear Class="@barClass" Rounded="true" Size="Size.Large" Max="@redRequirement" Value="@(redRequirement - bestData)">
<MudText Typo="Typo.caption">@(redRequirement - bestData)</MudText>
<MudProgressLinear Class="@barClass" Rounded="true" Size="Size.Large" Max="@redRequirement" Value="@resultValue">
<MudText Typo="Typo.caption">@resultValue</MudText>
</MudProgressLinear>
<MudText Typo="Typo.caption" Style="text-align: right">@resultText</MudText>
}

View File

@ -7,7 +7,7 @@ public partial class DaniDojo
private DanBestDataResponse? response;
private Dictionary<uint, DanBestData> bestDataMap = new();
private static Dictionary<uint, DanBestData> bestDataMap = new();
private readonly List<BreadcrumbItem> breadcrumbs = new()
{
@ -191,4 +191,39 @@ public partial class DaniDojo
return conditionOperator;
}
private static long GetTotalScore(uint danId)
{
return bestDataMap.ContainsKey(danId) ? bestDataMap[danId].DanBestStageDataList.Sum(stageData => stageData.HighScore) : 0;
}
private static long GetTotalGoodHits(uint danId)
{
return bestDataMap.ContainsKey(danId) ? bestDataMap[danId].DanBestStageDataList.Sum(stageData => stageData.GoodCount) : 0;
}
private static long GetTotalOkHits(uint danId)
{
return bestDataMap.ContainsKey(danId) ? bestDataMap[danId].DanBestStageDataList.Sum(stageData => stageData.OkCount) : 0;
}
private static long GetTotalBadHits(uint danId)
{
return bestDataMap.ContainsKey(danId) ? bestDataMap[danId].DanBestStageDataList.Sum(stageData => stageData.BadCount) : 0;
}
private static long GetTotalDrumrollHits(uint danId)
{
return bestDataMap.ContainsKey(danId) ? bestDataMap[danId].DanBestStageDataList.Sum(stageData => stageData.DrumrollCount) : 0;
}
private static long GetTotalMaxCombo(uint danId)
{
return bestDataMap.ContainsKey(danId) ? bestDataMap[danId].DanBestStageDataList.Sum(stageData => stageData.ComboCount) : 0;
}
private static long GetTotalHits(uint danId)
{
return bestDataMap.ContainsKey(danId) ? bestDataMap[danId].DanBestStageDataList.Sum(stageData => stageData.TotalHitCount) : 0;
}
}