[WIP] Group identical permanents into numbered stacks#9751
[WIP] Group identical permanents into numbered stacks#9751MostCromulent wants to merge 7 commits intoCard-Forge:masterfrom
Conversation
Visually groups identical permanents into stacks with count badges. Groups of 5+ show a ×N badge; clicking it selects all for batch attack/block. Configurable via Game > Card Overlays menu with three modes: Off, Tokens & Creatures, All Permanents. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
isBadgeHit() was comparing container-relative mouse coordinates against panel-internal badge coordinates, so the hit test always failed. Use getCardX()/getCardY() to convert to the correct coordinate space. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ation UX - Group blockers by which attacker they're assigned to block (separate piles per attacker) - Split cards from groups for attacker/blocker declaration with proper regrouping - Only allow splitting cards the game accepts (skip summoning-sick creatures) - Cards regroup with other tapped attackers after declaration via deferred layout - Move Group Permanents menu from Card Overlays submenu to Game menu - Group Permanents menu immediately refreshes the play area layout Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Lower the split threshold from 5 to 2 when grouping is enabled, so cards can be individually split from groups that have dropped below 5. Mark solo cards as split when declared as attackers so they merge with other split attackers from the same group. Track un-split state to prevent re-adding cards to splitCardIds when un-declaring attackers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
It respects the token row preference (i.e. it will group both creatures and tokens but place them in separate rows). It overrides the existing stack preference if its enabled, since it's kind of built on top of it. The preferences could probably be integrated together since they are doing a similar sort of thing, so you end up with a "Group and Stack Permanents" option with:
Is the "group" vs "stack" naming intuitive? When I think of a "stack" I think more along the lines of what this PR does where it puts everything in one big pile than what the existing stack preference does, but I don't want to go and re-label existing functionality since people are used to it. |
Replace separate "Stack Creatures" checkbox and "Group Permanents" submenu with a single "Stack/Group Permanents" submenu offering four options: Default, Stack Creatures, Group Creatures/Tokens, Group All Permanents. Add "Tokens in Separate Row" checkbox. All options include descriptive tooltips and trigger immediate layout updates. PlayArea now derives all layout flags from the single UI_GROUP_PERMANENTS preference. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
I note current default behavior with the existing "stack creatures" preference turned on is that creatures + enchantments + artifacts are in stacks of 4, while lands + tokens are in stacks of 5. Is there a reason for that difference? If we integrate the stack/group functions together should we replace with a default stack size of 5 for everything, or should we flow this on and maintain the 4 vs 5 stack size for the new grouping function as well? |
Right-clicking the count badge on a group of 5+ identical permanents now prompts for how many to select, then declares that many as attackers/blockers and splits them into a separate visual pile. - Add manual constructor to MouseTriggerEvent for synthetic triggers - Gate prompt on active input (getActivateDescription) to prevent showing during opponent's turn - Skip selectCard for already-declared cards to avoid toggling them off - Clear stale splitCardIds before marking selected subset to ensure correct visual separation after repeated split/merge cycles Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Right-click badge on a group of all-attackers/blockers now undeclares N cards (button=3 trigger) instead of doing a visual-only split. Prompt text adapts to game phase: "declare as attackers", "assign as blockers", or "remove from combat". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>



WORK IN PROGRESS!
This is a preliminary and not-at-all-bug-free implementation of numbered creature/token stacking to make large board states more manageable.
Any group of identical permanents larger than 4 can be automatically grouped into a numbered stack - rather than rendering every card only 4 will render and the rest will be counted in a badge on in the top-left corner. Grouping operates for the purpose of UI rendering only - as far as the engine is concerned all of the grouped creatures/tokens/etc are still processed individually.
Click on the badge number to declare the entire group, click on an individual card to split it off and declare one-by-one.
Welcome any testing or feedback from others.
Summary
Details
Grouping criteria — cards group only when they share the same name and have matching state (counters, P/T, summoning sickness, cloned status, and when grouping is enabled: tapped state, damage, rules text).
Combat interaction — during attacker declaration, splitting a card from a group declares it as an attacker. Split attackers regroup with each other. When the last card in a group is declared as an attacker, it merges with the existing attacker group. Un-clicking a split attacker un-declares and re-merges it. During blocker declaration, blockers assigned to different attackers remain in separate visual groups.
🤖 Generated with Claude Code