Adding deck disclaimer and removing hallucinated buttons
This commit is contained in:
@@ -19,9 +19,6 @@
|
||||
<button class="tab spell @(categoryFilter == "Spell" ? "active" : "")" @onclick='@(() => SetCategory("Spell"))'>
|
||||
<i class="bi bi-wand"></i> Spells
|
||||
</button>
|
||||
<button class="tab token @(categoryFilter == "Token" ? "active" : "")" @onclick='@(() => SetCategory("Token"))'>
|
||||
<i class="bi bi-coin"></i> Tokens
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="filter-bar">
|
||||
@@ -43,7 +40,7 @@
|
||||
</select>
|
||||
<select @bind="costFilter" class="form-select filter-select">
|
||||
<option value="">All Costs</option>
|
||||
@for (var i = 0; i <= 12; i++)
|
||||
@for (var i = 0; i <= 13; i++)
|
||||
{
|
||||
<option value="@i">@i</option>
|
||||
}
|
||||
@@ -65,10 +62,6 @@
|
||||
@onclick="() => showDetailedView = !showDetailedView" title="Toggle Detailed View">
|
||||
<i class="bi bi-list-ul"></i>
|
||||
</button>
|
||||
<button class="btn btn-outline-warning random-deck-btn" @onclick="GenerateRandomDeck"
|
||||
title="Generate Random Deck">
|
||||
<i class="bi bi-dice-5-fill"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@if (HasActiveFilters)
|
||||
@@ -386,27 +379,4 @@
|
||||
factionFilter = "";
|
||||
costFilter = "";
|
||||
}
|
||||
|
||||
private void GenerateRandomDeck()
|
||||
{
|
||||
var random = new Random();
|
||||
var pool = allCards.Where(c => !c.IsToken && !string.IsNullOrEmpty(c.Faction)).ToList();
|
||||
if (pool.Count < 40) return;
|
||||
|
||||
var selectedFaction = factions[random.Next(factions.Count)];
|
||||
var factionPool = pool.Where(c => c.Faction == selectedFaction || c.Faction == "Neutral").ToList();
|
||||
|
||||
// Simple logic: pick 40 cards
|
||||
var deckCards = factionPool.OrderBy(x => random.Next()).Take(40).Select(c => c.Name).ToList();
|
||||
|
||||
// For now, let's just log it or we could navigate to a "Create Deck" page if it existed.
|
||||
// Since we don't have a create deck page in the context, let's just show a notification or similar.
|
||||
// Actually, I'll just clear filters and search for these cards to "show" them.
|
||||
search = string.Join(" | ", deckCards.Take(3)); // Just show a few to demonstrate
|
||||
categoryFilter = "";
|
||||
factionFilter = selectedFaction;
|
||||
|
||||
// In a real app, this would save to a new DeckData object.
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user