Updating game data to mid season patch and made card gallery nicer
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
@page "/deck-builder"
|
||||
@page "/deck-builder/{Id:guid}"
|
||||
@using Model
|
||||
@rendermode InteractiveServer
|
||||
@inject NavigationManager Nav
|
||||
@inject AppDbContext Db
|
||||
@@ -11,8 +10,10 @@
|
||||
<a href="/my-decks" class="btn btn-sm btn-outline-secondary">
|
||||
<i class="bi bi-arrow-left"></i> My Decks
|
||||
</a>
|
||||
<input @bind="deckName" @bind:event="oninput" class="form-control deck-name-input" placeholder="Deck name..." maxlength="80"/>
|
||||
<input @bind="deckSeason" @bind:event="oninput" class="form-control season-input" placeholder="Season (e.g. S1)" maxlength="20"/>
|
||||
<input @bind="deckName" @bind:event="oninput" class="form-control deck-name-input" placeholder="Deck name..."
|
||||
maxlength="80"/>
|
||||
<input @bind="deckSeason" @bind:event="oninput" class="form-control season-input" placeholder="Season (e.g. S1)"
|
||||
maxlength="20"/>
|
||||
<span class="validity-badge @(IsValid ? "badge-valid" : "badge-invalid")">
|
||||
<i class="bi @(IsValid ? "bi-check-circle-fill" : "bi-exclamation-circle-fill")"></i>
|
||||
@ValidationMessage
|
||||
@@ -42,13 +43,16 @@
|
||||
<button class="tab @(categoryFilter == "" ? "active" : "")" @onclick='() => categoryFilter = ""'>
|
||||
<i class="bi bi-grid-3x3-gap-fill"></i> All
|
||||
</button>
|
||||
<button class="tab agent @(categoryFilter == "Agent" ? "active" : "")" @onclick='() => categoryFilter = "Agent"'>
|
||||
<button class="tab agent @(categoryFilter == "Agent" ? "active" : "")"
|
||||
@onclick='() => categoryFilter = "Agent"'>
|
||||
<i class="bi bi-person-fill"></i> Agents
|
||||
</button>
|
||||
<button class="tab agent @(categoryFilter == "Immortalized" ? "active" : "")" @onclick='() => categoryFilter = "Immortalized"'>
|
||||
<button class="tab agent @(categoryFilter == "Immortalized" ? "active" : "")"
|
||||
@onclick='() => categoryFilter = "Immortalized"'>
|
||||
<i class="bi bi-star-fill"></i> Immortalized
|
||||
</button>
|
||||
<button class="tab spell @(categoryFilter == "Spell" ? "active" : "")" @onclick='() => categoryFilter = "Spell"'>
|
||||
<button class="tab spell @(categoryFilter == "Spell" ? "active" : "")"
|
||||
@onclick='() => categoryFilter = "Spell"'>
|
||||
<i class="bi bi-wand"></i> Spells
|
||||
</button>
|
||||
</div>
|
||||
@@ -56,7 +60,8 @@
|
||||
<div class="filter-bar">
|
||||
<div class="search-wrapper">
|
||||
<i class="bi bi-search search-icon"></i>
|
||||
<input @bind="search" @bind:event="oninput" class="form-control search-input" placeholder="Search cards..."/>
|
||||
<input @bind="search" @bind:event="oninput" class="form-control search-input"
|
||||
placeholder="Search cards..."/>
|
||||
@if (search.Length > 0)
|
||||
{
|
||||
<button class="search-clear" @onclick='() => search = ""'><i class="bi bi-x-lg"></i></button>
|
||||
@@ -73,7 +78,8 @@
|
||||
@for (var c = 1; c <= 6; c++)
|
||||
{
|
||||
var cols = c;
|
||||
<button class="col-btn @(gridColumns == cols ? "active" : "")" @onclick="() => gridColumns = cols">@cols</button>
|
||||
<button class="col-btn @(gridColumns == cols ? "active" : "")"
|
||||
@onclick="() => gridColumns = cols">@cols</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@@ -108,7 +114,8 @@
|
||||
<div class="deck-panel">
|
||||
|
||||
<div class="deck-status-bar">
|
||||
<span class="card-count @(deckCards.Count == 40 ? "count-ok" : deckCards.Count > 40 ? "count-over" : "count-under")">
|
||||
<span
|
||||
class="card-count @(deckCards.Count == 40 ? "count-ok" : deckCards.Count > 40 ? "count-over" : "count-under")">
|
||||
<i class="bi bi-stack"></i> @deckCards.Count<span class="count-denom">/40</span>
|
||||
</span>
|
||||
<button class="btn btn-sm btn-outline-danger ms-auto" @onclick="ClearDeck" title="Clear deck">
|
||||
@@ -158,7 +165,8 @@
|
||||
<div class="deck-row-controls">
|
||||
<button class="count-btn" @onclick="() => RemoveCard(cardData.Name)">−</button>
|
||||
<span class="count-display">@group.Count</span>
|
||||
<button class="count-btn" @onclick="() => AddCard(cardData)" disabled="@(group.Count >= 3)">+</button>
|
||||
<button class="count-btn" @onclick="() => AddCard(cardData)" disabled="@(group.Count >= 3)">+
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@@ -182,6 +190,7 @@
|
||||
<img src="@diverCard.ImagePath" class="diver-thumb" alt="@diver"
|
||||
onerror="this.style.display='none'"/>
|
||||
}
|
||||
|
||||
<span class="diver-name">@diver</span>
|
||||
<button class="diver-remove" @onclick:stopPropagation="true" @onclick="() => RemoveDiver(idx)">
|
||||
<i class="bi bi-x"></i>
|
||||
@@ -216,7 +225,8 @@
|
||||
<div class="filter-bar mb-2">
|
||||
<div class="search-wrapper">
|
||||
<i class="bi bi-search search-icon"></i>
|
||||
<input @bind="diverSearch" @bind:event="oninput" class="form-control search-input" placeholder="Search..."/>
|
||||
<input @bind="diverSearch" @bind:event="oninput" class="form-control search-input"
|
||||
placeholder="Search..."/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="diver-picker-grid">
|
||||
@@ -287,8 +297,8 @@
|
||||
{
|
||||
var inDeck = deckCards.ToHashSet();
|
||||
var otherDiverSlot = activeDiverSlot == 0
|
||||
? (divers.Count > 1 ? divers[1] : null)
|
||||
: (divers.Count > 0 ? divers[0] : null);
|
||||
? divers.Count > 1 ? divers[1] : null
|
||||
: divers.Count > 0 ? divers[0] : null;
|
||||
|
||||
return AllCards
|
||||
.Where(c => c.Category is "Agent" or "Spell" or "Immortalized")
|
||||
@@ -310,17 +320,22 @@
|
||||
var bucket = Math.Min(card.Cost ?? 0, 10);
|
||||
result[bucket] = result.GetValueOrDefault(bucket) + 1;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
private Dictionary<string, int> _deckCounts = new();
|
||||
|
||||
private void RebuildDeckCounts() =>
|
||||
private void RebuildDeckCounts()
|
||||
{
|
||||
_deckCounts = deckCards.GroupBy(n => n).ToDictionary(g => g.Key, g => g.Count());
|
||||
}
|
||||
|
||||
private int CountInDeck(string name) =>
|
||||
_deckCounts.TryGetValue(name, out var c) ? c : 0;
|
||||
private int CountInDeck(string name)
|
||||
{
|
||||
return _deckCounts.TryGetValue(name, out var c) ? c : 0;
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
@@ -375,7 +390,10 @@
|
||||
showDiverPicker = true;
|
||||
}
|
||||
|
||||
private void CloseDiverPicker() => showDiverPicker = false;
|
||||
private void CloseDiverPicker()
|
||||
{
|
||||
showDiverPicker = false;
|
||||
}
|
||||
|
||||
private void SelectDiver(string name)
|
||||
{
|
||||
@@ -449,4 +467,5 @@
|
||||
isSaving = false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user