-
Notifications
You must be signed in to change notification settings - Fork 883
Add card info tooltips with keyword explanations and related cards #9806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MostCromulent
wants to merge
48
commits into
Card-Forge:master
Choose a base branch
from
MostCromulent:hoveroptions
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 42 commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
ec1c136
Add card info popup with card image, spellbook, and size controls
MostCromulent 51cff1d
Improve card info popup: single-instance enforcement, focus handling,…
MostCromulent 4aa4a40
Constrain CardInfoPopup to Forge window bounds instead of screen bounds
MostCromulent 8573d9a
Improve card info popup: layout, sizing, and related card categories
MostCromulent c2527b0
Restyle card info popup with dark pill panels and proper text rendering
MostCromulent 41e8057
Add keyword actions to card info popup and improve layout
MostCromulent 5ac627c
Merge branch 'Card-Forge:master' into hoveroptions
MostCromulent f9f51c1
Clean up card info popup: remove dead code and duplicate state
MostCromulent 24a7fab
Fix popup during zoom and related card rendering without art
MostCromulent 80af802
Improve keyword popup text and ordering
MostCromulent 27bf7f1
Add keyword and related card info to card zoom view
MostCromulent 6f5e495
Fix granted keyword detection and clean up popup labels
MostCromulent f47e697
Improve zoom view layout and fix related card image loading
MostCromulent 5db88c6
Add translation keys for keyword action names and reminder text
MostCromulent 59b0115
Remove duplicate English strings from KeywordAction enum
MostCromulent 6709ad0
Move keyword detection logic to shared forge-gui module
MostCromulent a54d3dc
Fix Assemble/Set In Motion descriptions and mark scheme actions as basic
MostCromulent be48e91
Handle scry conjugation in keyword matching and fix zoom scroll layout
MostCromulent c79e6f6
Address PR reviewer feedback on keyword display and zoom view
MostCromulent 8a2ce7d
Fix tooltip flickering on tapped cards by using component bounds for …
MostCromulent bc46a36
Improve hover tooltip and zoom view layout and fix keyword display is…
MostCromulent b1e6ca3
Fix specialize face rendering and Scryfall download for hover tooltip
MostCromulent c9da360
Add dynamic keyword count annotations to hover tooltips and zoom view
MostCromulent 4f15496
Improve Affinity keyword matching and add stack hover tooltips
MostCromulent adfee29
Add card overlay painting to hover tooltip image
MostCromulent b2b0498
Remove dead code from CardInfoPopup
MostCromulent efc1247
Merge branch 'Card-Forge:master' into hoveroptions
MostCromulent 9f1f468
Add menu options to hide card picture and detail panels
MostCromulent 6600fe0
Fix card panel re-enable to create right column instead of stacking i…
MostCromulent f1b0fd9
Fix face-down info leak, enable keyword popup by default, and cleanup…
MostCromulent 7e52afd
Adjust tooltip overlay positions and hide popup on game end
MostCromulent 150c7d7
Merge upstream/master into hoveroptions
MostCromulent cfcd562
Show hover tooltip on game log inline card images
MostCromulent 6820fbf
Add Card Overlay Settings dialog with independent hover overlay prefs
MostCromulent 2843e96
Improve hover tooltip keywords, related cards, and preference handling
MostCromulent 5af05ac
Show Amass Army tokens as related cards in hover tooltip
MostCromulent cbdfa8e
Merge upstream/master into hoveroptions
MostCromulent 2ce6e02
Minor comment cleanup
MostCromulent e415e74
Rework tooltip preferences: master toggles, hotkeys, and updated defa…
MostCromulent 3b990c0
Fix devotion tooltip: support dual-color devotion and immediate hotke…
MostCromulent 2d8d828
Remove dead code: unused JSeparator and unreachable overload
MostCromulent 985075c
Address PR review feedback: keyword display and layout fixes
MostCromulent 00f5230
Merge upstream/master into hoveroptions
MostCromulent 7c6552f
Fix Escape/Craft keyword headers: wrapping and full cost display
MostCromulent da9e502
Hover/zoom tooltip: 1-card-wide keywords + compact multi-group relate…
MostCromulent 9fbd234
Fix Support false positives, suppress Manifest when Manifest Dread pr…
MostCromulent e18a9f0
Add graveyard count tooltips for Tarmogoyf/Lhurgoyf-family cards
MostCromulent cde78be
Merge upstream/master into hoveroptions
MostCromulent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
168 changes: 168 additions & 0 deletions
168
forge-game/src/main/java/forge/game/keyword/KeywordAction.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,168 @@ | ||
| package forge.game.keyword; | ||
|
|
||
| import forge.util.Localizer; | ||
|
|
||
| /** | ||
| * Keyword actions — verbs that appear in rules text but aren't keyword abilities. | ||
| * Descriptions are based on the MTG comprehensive rules (section 701). | ||
| * | ||
| * <p>Unlike {@link Keyword} (keyword abilities that grant continuous effects or | ||
| * triggered/static abilities), keyword actions are one-shot game actions performed | ||
| * when instructed by a spell or ability.</p> | ||
| * | ||
| * <p>Actions marked {@code basic=true} are fundamental game actions (destroy, exile, | ||
| * sacrifice, etc.) that every player knows — UI code may choose to omit these from | ||
| * tooltips to avoid clutter.</p> | ||
| * | ||
| * <p>Display names and reminder text are stored in {@code en-US.properties} under | ||
| * keys derived from the enum name (e.g. {@code lblKwActionActivate}, | ||
| * {@code lblKwActionActivateReminder}).</p> | ||
| */ | ||
| public enum KeywordAction { | ||
| // 701.2 – 701.13: Basic game actions | ||
| ACTIVATE(true), | ||
| ATTACH(true), | ||
| BEHOLD(false), | ||
| CAST(true), | ||
| COUNTER(true), | ||
| CREATE(true), | ||
| DESTROY(true), | ||
| DISCARD(true), | ||
| DOUBLE(true), | ||
| TRIPLE(true), | ||
| EXCHANGE(true), | ||
| EXILE(true), | ||
|
|
||
| // 701.14 – 701.17: Combat & graveyard actions | ||
| FIGHT(false), | ||
| GOAD(false), | ||
| INVESTIGATE(false), | ||
| MILL(false), | ||
|
|
||
| // 701.18 – 701.21: More basic actions | ||
| PLAY(true), | ||
| REGENERATE(false), | ||
| REVEAL(true), | ||
| SACRIFICE(true), | ||
|
|
||
| // 701.22 – 701.28: Library & transform actions | ||
| SCRY(false), | ||
| SEARCH(true), | ||
| SHUFFLE(true), | ||
| SURVEIL(false), | ||
| TAP_UNTAP(true), | ||
| TRANSFORM(false), | ||
| CONVERT(false), | ||
|
|
||
| // 701.29 – 701.30: Opponent manipulation | ||
| FATESEAL(false), | ||
| CLASH(false), | ||
|
|
||
| // 701.31 – 701.33: Supplemental format actions | ||
| PLANESWALK(false), | ||
| SET_IN_MOTION(true), | ||
| ABANDON(true), | ||
|
|
||
| // 701.34 – 701.36: Counter & token actions | ||
| PROLIFERATE(false), | ||
| DETAIN(false), | ||
| POPULATE(false), | ||
|
|
||
| // 701.37 – 701.39: Creature enhancement | ||
| MONSTROSITY(false), | ||
| VOTE(false), | ||
| BOLSTER(false), | ||
|
|
||
| // 701.40 – 701.44: Face-down & explore | ||
| MANIFEST(false), | ||
| SUPPORT(false), | ||
| MELD(false), | ||
| EXERT(false), | ||
| EXPLORE(false), | ||
|
|
||
| // 701.45 – 701.48: Un-set & learning | ||
| ASSEMBLE(false), | ||
| ADAPT(false), | ||
| AMASS(false), | ||
| LEARN(false), | ||
|
|
||
| // 701.49 – 701.50: Dungeon & connive | ||
| VENTURE(false), | ||
| CONNIVE(false), | ||
|
|
||
| // 701.51 – 701.52: Attraction actions | ||
| OPEN_AN_ATTRACTION(false), | ||
| ROLL_TO_VISIT(false), | ||
|
|
||
| // 701.53 – 701.54: Incubate & ring | ||
| INCUBATE(false), | ||
| THE_RING_TEMPTS_YOU(false), | ||
|
|
||
| // 701.55 – 701.56: Villainous choice & time travel | ||
| FACE_A_VILLAINOUS_CHOICE(false), | ||
| TIME_TRAVEL(false), | ||
|
|
||
| // 701.57 – 701.60: Discover, cloak, evidence, suspect | ||
| DISCOVER(false), | ||
| CLOAK(false), | ||
| COLLECT_EVIDENCE(false), | ||
| SUSPECT(false), | ||
|
|
||
| // 701.61 – 701.64: Bloomburrow & beyond | ||
| FORAGE(false), | ||
| MANIFEST_DREAD(false), | ||
| ENDURE(false), | ||
| HARNESS(false), | ||
|
|
||
| // 701.65 – 701.68: Avatar & Lorwyn Eclipsed | ||
| AIRBEND(false), | ||
| EARTHBEND(false), | ||
| WATERBEND(false), | ||
| BLIGHT(false), | ||
|
|
||
| // Game concepts (not 701.x actions, but useful to explain) | ||
| DEVOTION(false), | ||
| DOMAIN(false), | ||
| METALCRAFT(false), | ||
| THRESHOLD(false), | ||
| DELIRIUM(false); | ||
|
|
||
| /** True for fundamental game actions (destroy, exile, sacrifice, etc.) that don't need tooltip explanations. */ | ||
| public final boolean basic; | ||
| /** Translation key prefix derived from enum name, e.g. "lblKwActionActivate". */ | ||
| private final String translationKey; | ||
|
|
||
| KeywordAction(boolean basic) { | ||
| this.basic = basic; | ||
| this.translationKey = "lblKwAction" + toCamelCase(name()); | ||
| } | ||
|
|
||
| private static String toCamelCase(String enumName) { | ||
| StringBuilder sb = new StringBuilder(); | ||
| boolean capitalize = true; | ||
| for (char c : enumName.toCharArray()) { | ||
| if (c == '_') { | ||
| capitalize = true; | ||
| } else { | ||
| sb.append(capitalize ? c : Character.toLowerCase(c)); | ||
| capitalize = false; | ||
| } | ||
| } | ||
| return sb.toString(); | ||
| } | ||
|
|
||
| /** Returns the localized display name. */ | ||
| public String getDisplayName() { | ||
| return Localizer.getInstance().getMessage(translationKey); | ||
| } | ||
|
|
||
| /** Returns the localized reminder text. */ | ||
| public String getReminderText() { | ||
| return Localizer.getInstance().getMessage(translationKey + "Reminder"); | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return getDisplayName(); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.