Add total score and hits to dan dojo page
This commit is contained in:
parent
059d053ea7
commit
30df91771e
@ -17,4 +17,6 @@ public class DanBestStageData
|
||||
public uint TotalHitCount { get; set; }
|
||||
|
||||
public uint ComboCount { get; set; }
|
||||
|
||||
public uint HighScore { get; set; }
|
||||
}
|
@ -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>
|
||||
@ -34,12 +34,80 @@
|
||||
var danClearStateString = GetDanClearStateString(danResultState);
|
||||
}
|
||||
<img src=@($"/images/dani_{danResultState.ToString()}.png") style="max-width:150px; width:100%;" alt="danResultState.ToString()"/>
|
||||
<MudText Typo="Typo.body1">@danClearStateString</MudText>
|
||||
</MudStack>
|
||||
</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 +145,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">
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user