Add card info tooltips with keyword explanations and related cards#9806
Add card info tooltips with keyword explanations and related cards#9806MostCromulent wants to merge 42 commits intoCard-Forge:masterfrom
Conversation
- Card image panel on left side of popup (toggle-able, Arena-style) - Spellbook/related cards extracted from Spellbook$ ability parameters - Image size slider (100-500px) in Game > Card Info Popup menu - Auto-download missing card images via CachedCardImage.fetcher - Flip card images rotated 180 degrees for correct display - Popup hidden when Forge window loses focus or is minimized - Large groups (>5 cards) shown at half size in wrapped grid rows Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… and width constraints Add static activePopup tracker to ensure only one popup is visible at a time. Hide popup when owner window loses focus and skip showing when window is inactive. Constrain related card thumbnails to fit available screen space next to hovered card. Always show related cards including placeholder images for un-downloaded cards. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Arrange related cards and keywords side by side (cards left, keywords right) instead of stacking vertically - Cap keyword text width to match the selected card image width - Related card sizing: 1-2 cards at full size, 3+ scale to half with max 4 per row - Add meld partner and partner-with as related card categories - Group meld partner and meld result together in one row - Stay-open behavior for popup menu checkboxes (menu no longer closes on toggle) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace FHtmlViewer-based keyword/related card rendering with custom pill panels using dark overlay styling. Fix keyword reminder text not appearing (double <html> wrapping) and text clipping (use HTML View for wrapped height calculation). Reduce card-to-popup gap. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Scan oracle text for keyword actions (goad, scry, surveil, etc.) and display them alongside keyword abilities in the popup. Keyword actions are defined in a new KeywordAction enum in forge-game for reuse across modules. Also top-align keyword pills, center-justify incomplete card rows, and increase reminder text font to 12pt. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove unused CMatchUI parameter from CardInfoPopupMenu constructor, eliminate duplicate addedNames set in buildKeywords() by having the caller pass its set directly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Understand what you say about avoiding too much similarity. I'm happy to re-work this to integrate with the scroll-up card zoom view if that's the consensus, though that perhaps makes the functionality less obvious to the kind of less experienced users who the tooltips and related cards are most useful for? (Also personally I basically never use the scroll-up function, hence why I missed the conflict when zoomed in. I should at least be able to sort that out.) Will look into the other issues. The image downloader for the related cards box was at least working for me earlier today. |
|
in theory, SpellAbilityEffect represents KeywordActions for KeywordInterfaces, checkout |
Hide card info popup when zoomer is open (scroll-wheel or middle-click) and use correct image keys so related cards (spellbook, tokens, partner, specialize) render with Forge's card renderer instead of showing blank when card art is not downloaded. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Parse Protection keyword details so title shows "Protection from Red" instead of bare "Protection from " (Protection.java) - Use CardStateView.getOracleText() instead of StaticData/CardRules lookup - Strip card name from oracle text to avoid false positive keyword action matches (e.g. "Boseiju, Who Endures" matching Endure) - Sort keyword actions by oracle text position instead of enum order - Resolve N in keyword action reminders (scry 2, mill 3) and singularize "counters" when N=1 - Use inst.getTitle() with color-to-mana-symbol conversion for keyword names - Filter out Enchant keyword - Clear stale preferred size before recomputing keywords panel layout Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Show keywords and related cards (spellbook, tokens, transforms) in a side-by-side panel when zooming a card, with separate preference toggles from the hover tooltip. Refactor CardInfoPopup building methods to public static for reuse. Reorganize the Card Info Popups menu with section headers for hover tooltip vs zoom view settings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use CardStateView boolean flags as a fallback to catch granted abilities (e.g. Intimidate from static effects) that keywordKey parsing misses. Unify zoom menu keyword label to "Keyword Explanations" and remove two dead locale strings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@dracontes, I'll test this more extensively tomorrow but latest commits should hopefully address many of the issues you had above including card rendering and initial implementation of seperate preference toggles to enable/disable showing related cards/keyword tips in the card zoom view. Still working on getting it to more accurately pick up granted abilities/solve a few layout problems.
|
Jetz72
left a comment
There was a problem hiding this comment.
Ideally we could identify KeywordActions by inspecting the card's abilities and their parameters rather than the Oracle text. But I'm not sure how well that works with everything. Something like Scry might be a straightforward spot check for a ScryEffect or a ReplaceScry, but I think there are some that are implemented purely through card script.
forge-gui-desktop/src/main/java/forge/view/arcane/CardInfoPopup.java
Outdated
Show resolved
Hide resolved
- Fix related card images always showing Forge-rendered cards instead of downloaded art by using ImageCache.getCardOriginalImageInfo placeholder flag to trigger auto-download correctly - Dynamically size zoom view side panel to match actual content width instead of fixed 40% column, keeping scrollbar adjacent to content - Use FScrollPane instead of JScrollPane for themed scrollbar styling - Render spellbook cards 3 per row in zoom view for better readability - Size pill to actual thumbnail width instead of full column width - Scale thumbnails to fill available space up to user preference cap Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract KeywordInfoUtil from CardInfoPopup (forge-gui-desktop) into forge-gui so keyword detection is available to mobile UI. Desktop callers now apply FSkin symbol encoding at display time instead of during keyword building. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Jetz72, I've asked the AI to assess the feasability of this for each of the KeywordActions. Here's the response:
|
|
Well, 34 out of 50 (not counting the 17 trivial ones) isn't too bad of a start. Digging into it a bit more -
I think we could get away without a hybrid approach, but it'd still be a pretty huge overhaul to what you currently have. Each keyword would need one or more cues to check against an ability, trigger, or replacement effect, for their API, parameters, sub-abilities, and any associated costs. Instead of threading ability data to the view layer we'd probably just compute the keyword action list on the game layer. Possibly within the abilities/triggers/REs themselves before compiling them in the On second thought, if we ever wanted tooltips to work outside of a game we'd have to do it even earlier, with less tools. Possibly while as part of the ...I think it's probably fine for now. I don't think the current implementation will usually be an issue as long as the card name isn't included in the text matching. |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Match "scries" when scanning oracle text for scry keyword action (y → ies conjugation fallback) - Wrap entire zoom side panel (keywords + related cards) in a single scroll pane instead of only the related cards section - Add spacing between keyword boxes and related cards section Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…n log cell When card picture/detail panels are re-enabled via the layout menu, they now appear in their own right-side column (detail on top, picture on bottom) instead of being added as tabs to the stack/log cell. Also fixes removeHiddenCardPanel to properly fill gaps when cells become empty. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… improvements - Hide hover popup and zoom side panel for face-down cards to prevent revealing hidden keyword and related card information - Default UI_POPUP_KEYWORD_INFO to true for feature discoverability - Dispose CardInfoPopup JWindow on match end in both CardPanelContainer and VStack to prevent resource leaks - Trigger auto-download for missing related card images in zoom view Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
I will do some cleanup with Landwalk and Affinity later that day |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Introduces a dual-column settings dialog where each overlay option (name, P/T, mana cost, etc.) has separate "Card Overlays" and "Hover Tooltip Overlays" checkboxes for independent control. Also fixes Protection reminder text and keyword merge/display logic. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@Jetz72 if you're still comfortable with the KeywordActions detection working based the oracle text (at least for time being), I've tested this and it seems to be functioning properly and ready for review. (With as many cards as MTG has I expect there will be edge cases where certain syntax still trips it up, but I haven't encountered any glaring errors in latest testing). One outstanding design question is what should the default preference for this be? I think the keyword tooltips in particular are very useful , but they don't make a heap of sense without the card popup next to them - so I lean to enabling both by default but this isn't a super strong view. If it's all off by default I think there's a risk it just gets missed in the menu settings. |
|
Good show so far 👍 A few more comments after a bit more testing.
‣ I would expect "Amass [creature type] [N]" ‣ A bit confused/confusing with equip abilities of a different character |
|
@dracontes thanks for feedback, this is very helpful and I will investigate. |
- Show The Ring emblem as related card for "the ring tempts you" cards, with numbered levels (1-4) in oracle text and current level annotation - Fix LTR edition collector number 13 → H13 to match Scryfall download URL - Add ChooseFromList related card entries (e.g. Garth One-Eye) - Include UI_DISABLE_CARD_IMAGES in tooltip cache key so toggling the preference forces tooltip rebuild instead of showing stale images - Improve keyword display: Craft shows just mana cost, Equip shows type qualifiers, amass includes type word, "a"/"an" parsed as numeric 1 - Capitalize "The Ring Tempts You" keyword action display name - Fix game log tooltip positioning to use full entry bounds Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@dracontes all of the issues above should now be fixed. Game log overlap - now renders outside of the log entirely. Garth One-Eye / Cards naming other cards The Ring Tempts You - took some slightly ugly Ring-related hard coding within the tooltip file, but have got this working. Have also got it to track your current ring level in the header and tooltip. |
Detect "amass {Type}" in oracle text and look up the corresponding
Army token (Zombie, Orc, Sliver) since Amass cards don't declare
tokens via TokenScript$.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Devotion is a bit tricky because the gods have "Devotion for X and Y", would be best if you check for SVar X = contains Devotion like this: |
I apologize: I somehow must have convinced myself during the testing I did for my 2026-02-21 review of that version of the PR there was a checkbox implemented to disable the zoom-in view altogether, either from the Game dropdown menu or on Preferences. Just fired up that version of this PR and I can't find it. Still, I would like that to be available for the reasons I stated. if it isn't too much trouble to implement. |
…ults - Add master toggle prefs (UI_SHOW_HOVER_TOOLTIPS, UI_SHOW_ZOOM_TOOLTIPS) with Ctrl+H and Ctrl+I keyboard shortcuts - Replace individual pref checkboxes in Preferences with master toggles that gate all tooltip display; individual options configured via in-game menu - Rename menu from "Card Info Popups" to "Card Info Tooltips" throughout - Merge overlay options into hover tooltip section, remove separate header - Update defaults: all tooltip content enabled, image size 375px, hover overlays limited to power/toughness and ability icons - Fix NPE in KeywordInfoUtil.annotateDevotion when battlefield/graveyard null Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…y refresh
- Rewrite annotateDevotion() to look up devotion colors from card SVars
(Count$Devotion / Count$DevotionDual) instead of parsing oracle text,
correctly handling dual-color devotion (e.g. Iroas, God of Victory)
- Use ManaCostShard.isColor() instead of getShardCount() so hybrid mana
symbols (e.g. {R/W}) count once toward dual devotion, not twice
- CTRL-H now immediately hides card info tooltips when toggled off
- CTRL-I now immediately refreshes the zoom view side panel when toggled
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Hanmac have re-worked this on latest commits, seems to be working well.
@dracontes have re-worked master enable/disable hotkeys and preferences similar to CTRL-O for overlays.
|
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
I'm sorry, I should have been clearer: what I am asking for is a checkbox to disable the image itself showing up when you scroll up when hovering a card. Could certainly be that checkbox you set up is what's reworked to do that. Ran down the discussion, verifying relevant items. Here are some salient enough issues. The rest were addressed well enough.
|
- Recognize "X" in keyword tooltips (Monstrosity X, Collect Evidence X) - Fix Trample and Trample Over Planeswalkers merging into one tooltip - Fix convert reminder text (convert and transform are interchangeable) - Fix waterbend reminder text to match official rules (generic mana only) - Title-case multi-word keyword action names - Lay out single-card related groups side by side when total fits in a row Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
I think the CTRL-I shortcut should do what you're looking for: completely disable the tooltip functionality in zoom view. Disabling the "Enable Card Information Tooltips in Zoom View" preference will do the same thing.
These should now be fixed. |




































Summary
Adds Arena-style card info popups to desktop UI including selected card, related cards (tokens created, spellbooks etc), and keyword explanations. Includes menu options to enable/disable each section and scale card image size. Addresses #9705.
(I can imagine some people choosing to use this instead of default card view/card details panels).
Features
New files
Note
Original feature request in #9705 also wanted to include flavour text for alchemy cards. This is not currently included in Forge card data so cannot be easily extracted. I have not included in this PR as I don't think significant extra diff to achieve this is worth the benefit.
🤖 Generated with Claude Code