Spare/rarity filters, owned-only suggestions, and a Game night tab
Library filters: - "Only spare copies" quick filter (Library): cards with more copies owned than the decks' main boards use, the opposite of the ⚠ over-assignment warning. Rows show "N spare" while it's on. - Rarity toggles (C/U/R/M) in the shared criteria panel, so Library, Card Search and the set browser all get them. Any printing counts, since the library tracks cards rather than printings; within a set it's that set's printing. Arena-only printings don't count for a card that also exists on paper, so a digital re-rarity can't make a paper common read as rare. Suggestions: - "From my collection" toggle (remembered) narrows candidates to owned cards before scoring and paging, so "Suggest more" keeps finding them. - Each suggestion reports copies other decks already use, shown as "N spare" / "all in other decks". suggest_cards now takes a SuggestOptions struct instead of a bare `unusual` flag. Game tab: a life counter for 2-6 players with tap/hold ±1/±10, a running change bubble, poison and per-opponent commander damage (which also comes off life), out-of-the-game markers, dice and a coin, and a random first player. A seat's deck puts its commander's art behind the life total. On phones the board fills the screen with the far row turned to face across the table, and asks to keep the screen awake. The game is per-device scratch state in localStorage, not synced. Plain filter chips now show an accent background when active; before, "Unusual picks" only changed its text colour.
This commit is contained in:
@@ -7,7 +7,7 @@ use std::sync::Mutex;
|
||||
|
||||
use mtgc_core::{
|
||||
CardRef, CardSuggestion, Deck, DeckEntry, LibraryCard, LibraryFacets, LibraryFilter,
|
||||
LibraryStats,
|
||||
LibraryStats, SuggestOptions,
|
||||
};
|
||||
use serde::Serialize;
|
||||
use tauri::{AppHandle, Emitter, State};
|
||||
@@ -211,10 +211,15 @@ pub fn deck_contents(db: Db, deck_id: i64) -> Res<Vec<DeckEntry>> {
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn suggest_cards(db: Db, deck_id: i64, offset: i64, unusual: bool) -> Res<Vec<CardSuggestion>> {
|
||||
pub fn suggest_cards(
|
||||
db: Db,
|
||||
deck_id: i64,
|
||||
offset: i64,
|
||||
options: SuggestOptions,
|
||||
) -> Res<Vec<CardSuggestion>> {
|
||||
let s = db.lock().unwrap();
|
||||
s.catalog()?
|
||||
.suggest_cards(deck_id, 50, offset.max(0) as usize, unusual)
|
||||
.suggest_cards(deck_id, 50, offset.max(0) as usize, options)
|
||||
.map_err(|e| e.to_string())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user