mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-24 03:40:07 +02:00
feat: player achievements view
This commit is contained in:
1 parent
3767ff6a71
commit
fff699faf1
12 files changed
+210
-58
No files matched your search
@@ -0,0 +1,41 @@
|
||||
@using WotBlitzStatisticsPro.Blazor.Model
|
||||
|
||||
<RadzenCard class="m-3">
|
||||
<div class="d-flex flex-column align-items-center">
|
||||
<RadzenImage Path="@MedalInfo.Image" Class="mr-3" Style="width: 100px; height: 100px;" />
|
||||
<div>
|
||||
<div>
|
||||
<b>@MedalInfo.Description</b>
|
||||
@if(MedalInfo.MaxSeriesValue != null)
|
||||
{
|
||||
@($" ({MedalInfo.MaxSeriesValue})")
|
||||
}
|
||||
</div>
|
||||
<div class="mt-3" style="margin-top: 20px;">
|
||||
@if(conditions != null)
|
||||
{
|
||||
@foreach (var conditionRow in conditions)
|
||||
{
|
||||
<p>@conditionRow</p>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</RadzenCard>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public IMedal MedalInfo { get; set; }
|
||||
|
||||
string[] conditions;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
if(MedalInfo.Condition != null)
|
||||
{
|
||||
conditions = MedalInfo.Condition.Split(Environment.NewLine);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,30 @@
|
||||
<h3>PlayerInfoAchievements</h3>
|
||||
@using MediatR
|
||||
@using WotBlitzStatisticsPro.Blazor.Messages
|
||||
@using WotBlitzStatisticsPro.Blazor.Helpers
|
||||
@inject IMediator Mediator
|
||||
<RadzenAccordion>
|
||||
<Items>
|
||||
@foreach (var section in AchievementsBySection.OrderBy(s => s.Order))
|
||||
{
|
||||
<RadzenAccordionItem Text="@section.Name">
|
||||
<div class="medals-section">
|
||||
@foreach (var medal in section.Medals.OrderBy(m => m.Order))
|
||||
{
|
||||
<div class="medal-box" @onclick="@(async (e) => { await Mediator.Publish(new OpenMedalDescriptionMessage(medal)); })">
|
||||
<img class="achievement-image" src="@medal.Image" />
|
||||
<div class="achievement-badge translate-middle badge rounded-pill bg-secondary text-dark">
|
||||
@((section.SectionId =="step" || (medal.MaxSeriesValue != null && section.SectionId != "title")) ? medal.AchievementValue.RomanNumber() : medal.AchievementValue)
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</RadzenAccordionItem>
|
||||
}
|
||||
</Items>
|
||||
</RadzenAccordion>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public IReadOnlyList<ISection> AchievementsBySection { get; set; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
.medals-section {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.medal-box {
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.achievement-image {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
.achievement-badge {
|
||||
position: absolute;
|
||||
left: 30px;
|
||||
top: 30px;
|
||||
}
|
||||
@@ -47,7 +47,7 @@
|
||||
}
|
||||
</RadzenTabsItem>
|
||||
<RadzenTabsItem Icon="military_tech">
|
||||
<PlayerInfoAchievements></PlayerInfoAchievements>
|
||||
<PlayerInfoAchievements AchievementsBySection = "@AchievementsBySection"></PlayerInfoAchievements>
|
||||
</RadzenTabsItem>
|
||||
</Tabs>
|
||||
</RadzenTabs>
|
||||
|
||||
Reference in new issue
Block a user