Dev menu improvements: "Add Token to Battlefield" + search + quantity select#9748
Dev menu improvements: "Add Token to Battlefield" + search + quantity select#9748MostCromulent wants to merge 4 commits intoCard-Forge:masterfrom
Conversation
…menu option - Add inline search field to ListChooser for lists >25 items with starts-with-first priority sorting by name length for closer matches - Add "Add Token to Battlefield" dev menu option with quantity selector and summoning sickness prompt - Fix race condition in card/token quantity loops by wrapping in single invoke() call instead of per-iteration invoke() - Clean up manual search/filter code in PlayerControllerHuman Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
probably need to add PT to the Name select if its not a named token |
Show power/toughness in brackets for all tokens in the "Add Token to Battlefield" chooser. Deduplication key now includes P/T so tokens with the same name but different stats (e.g. 16 Elemental Token variants) appear as separate entries. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Filter out dungeon cards from token list - Show P/T using string values (fixes */* displaying as 0/0) - Include color in display to distinguish same-named tokens - Only append oracle text when needed to disambiguate tokens that share the same name, color, and P/T - Rename dialog title from "Name the card" to "Name the token" - Fix potential NPE when token has no color defined Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
All 3 issues addressed on latest commit (code was previously trying to assign power/toughness to non-creature tokens). Also improved the de-duplication logic so it doesn't collapse same-named creature tokens into one entry if they have different colors or different abilities. Will now disambiguate same-name tokens by P/T, color and, if necessary, oracle text. |
forge-gui/src/main/java/forge/player/PlayerControllerHuman.java
Outdated
Show resolved
Hide resolved
Only apply oracle-text disambiguation to generic tokens (names ending in " Token"). Named tokens are unique by definition and don't need it. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
These issues have been adequately addressed.
I was going to ask about this, so good show on it for the most part. I did notice that while the
|
|
Any thoughts on adding this to the mobile/adventure UI's dev menu as well? |





3 additions to dev menu functionality to make it easier to work with tokens:
Add Token to Battlefield: Adds a new "Add Token to Battlefield" option to the dev panel, wired through the same CDev/VDev/DevModeMenu/IDevModeCheats pattern as existing cheats. Tokens are deduplicated by name and lazy-loaded from TokenDb on first use. Creature tokens prompt for summoning sickness (or auto-set it for tokens with haste).
Quantity selector for card additions: The existing "Add Card to Zone" dev cheats (hand, battlefield, library, graveyard, exile) now prompt for a quantity after selecting a card, allowing multiple copies to be added at once. Prompts that depend on the card (summoning sickness, top/bottom of library) are asked once and reused for all copies. The entire quantity loop runs within a single invoke() call to avoid race conditions from concurrent zone modifications.
ListChooser search field: Adds an inline search/filter text field to the ListChooser dialog for lists with more than 25 items, matching the existing mobile ListChooser behavior. Search results prioritize starts-with matches (sorted by name length for closer matches first), followed by contains matches.
This has broader application than just the dev menu, but there are few dialogs that often have more than 25 entries so in practice this is only likely to affect:
- Dev menu card/token selection (10,000+ card faces, 1,000+ tokens)
- Card naming during gameplay (e.g. Pithing Needle, Cabal Therapy — all legal card names)
In any event this aligns with list functionality in mobile, and is probably a QOL improvement anyway.
🤖 Generated with Claude Code