Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
bee9982
Fix Yedora and morph cards
Jmlundeen Mar 24, 2025
b2b71b3
Refactor BecomesFaceDownCreatureAllEffect
Jmlundeen Mar 24, 2025
c4daef9
Refactor CardView
Jmlundeen Mar 27, 2025
1c2b09a
Refactor day/night button on card panel
Jmlundeen Mar 27, 2025
c28f2e1
Add foretell image back to CardView
Jmlundeen Mar 28, 2025
c5ebcab
Track players that can see face-down cards in exile
Jmlundeen Mar 28, 2025
dbc846b
Update Gonti, Night Minister
Jmlundeen Mar 28, 2025
ee91011
Update Ixidron
Jmlundeen Mar 28, 2025
1051ea7
Update Bane Alley Broker
Jmlundeen Mar 28, 2025
c03c6c6
Copy card visibility when moving between exile zones
Jmlundeen Mar 30, 2025
1c5c3a8
Update ExileFaceDownYouMayPlayAsLongAsExiledTargetEffect with exile z…
Jmlundeen Mar 30, 2025
215d8ba
Update Arvinox, the Mind Flail
Jmlundeen Mar 30, 2025
9060f8e
Update Colfenor's Plan
Jmlundeen Mar 30, 2025
53c2459
Update Ethereal Valkyrie
Jmlundeen Mar 30, 2025
a1f3529
Update Grimoire Thief
Jmlundeen Mar 30, 2025
3fa3a76
Update Gustha's Scepter
Jmlundeen Mar 30, 2025
44a61ef
Update Headliner Scarlett
Jmlundeen Mar 30, 2025
54ef335
Update Hoarding Broodlord
Jmlundeen Mar 30, 2025
2821a5b
Update Hoarding Broodlord
Jmlundeen Mar 30, 2025
aa777bb
Update Jacob Hauken, Inspector // Hauken's Insight
Jmlundeen Mar 30, 2025
3e9e379
Cleanup moveCardsToExileFaceDown Constructors
Jmlundeen Mar 30, 2025
9922720
Update Jester's Scepter
Jmlundeen Mar 30, 2025
e773be6
Update Kayla's Music Box
Jmlundeen Mar 31, 2025
51d4254
Create common look at and may play effects
Jmlundeen Mar 31, 2025
c622f21
Merge branch 'refs/heads/master' into rework-face-down-cards
Jmlundeen Mar 31, 2025
fb606fa
Update LookAtAndPlayExiledWithThisEffect
Jmlundeen Apr 1, 2025
a487ff4
Update ExileZone letPlayerSeeCards
Jmlundeen Apr 1, 2025
64459a9
Fix Arvinox the Mind Flail
Jmlundeen Apr 2, 2025
ab64658
Update Lobelia, Defender of Bag End
Jmlundeen Apr 2, 2025
60ade25
Update Card Panel
Jmlundeen Apr 2, 2025
8490e73
Update Rogue Class
Jmlundeen Apr 2, 2025
78681eb
Update Shared Fate
Jmlundeen Apr 2, 2025
3b35d43
Update Summoner's Egg
Jmlundeen Apr 2, 2025
02b0127
Update Three Wishes
Jmlundeen Apr 2, 2025
36e0cfa
Update Ugin, the Ineffable
Jmlundeen Apr 2, 2025
866eee5
Update Vivien, Champion of the Wilds
Jmlundeen Apr 2, 2025
7cd3f96
Merge remote-tracking branch 'Xmage/master' into rework-face-down-cards
Jmlundeen Apr 2, 2025
f8d44e9
Update Hideaway Ability
Jmlundeen Apr 2, 2025
aec5eb0
Update Becomes Face Down Creature Effect
Jmlundeen Apr 2, 2025
d6275b6
Update BecomesFaceDownCreatureAllEffect
Jmlundeen Apr 2, 2025
758af60
Update CardView
Jmlundeen Apr 2, 2025
e471e97
Update ContinuousEffects
Jmlundeen Apr 2, 2025
9de857f
Merge remote-tracking branch 'Xmage/master' into rework-face-down-cards
Jmlundeen Apr 3, 2025
26178e9
Remove Look at effect from Foretell
Jmlundeen Apr 5, 2025
c4c1df1
Hide face down info from targeting spell on stack
Jmlundeen Apr 5, 2025
2d4cee0
CardView missing other end of span
Jmlundeen Apr 6, 2025
d60f69d
Revert "Hide face down info from targeting spell on stack"
Jmlundeen Apr 6, 2025
d6ff4da
Fix cascade and face down spells
Jmlundeen Apr 6, 2025
7c56153
Hide spell target in UI
Jmlundeen Apr 6, 2025
4341549
Create linked object name for face down spell on stack
Jmlundeen Apr 6, 2025
146df7e
Create linked object name for face down permanents
Jmlundeen Apr 6, 2025
b025f5e
Merge branch 'refs/heads/master' into rework-face-down-cards
Jmlundeen Apr 29, 2025
01942ad
Merge branch 'master' into rework-face-down-cards
Jmlundeen Sep 1, 2025
e0de7e4
remove unused imports
Jmlundeen Sep 1, 2025
34a94d9
add Gonti, Night Minister test
Jmlundeen Sep 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 41 additions & 27 deletions Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,32 +150,7 @@ public void focusLost(FocusEvent e) {

// Both card rendering implementations have a transform button
if (this.getGameCard().canTransform()) {
// Create the day night button
dayNightButton = new JButton("");
dayNightButton.setSize(32, 32);
dayNightButton.setToolTipText("This permanent is a double faced card. To see the card's other face, push this button or move mouse wheel down while hovering over it.");
BufferedImage day = ImageManagerImpl.instance.getDayImage();
dayNightButton.setIcon(new ImageIcon(day));
dayNightButton.addActionListener(e -> {
// if card is rotating then ignore it
if (animationInProgress) {
return;
}

// if card is tapped then no visual transforming is possible, so switch it immediately
if (isTapped()) {
// toggle without animation
this.getTopPanelRef().toggleTransformed();
this.getTopPanelRef().repaint();
return;
}

// normal animation
Animation.transformCard(this);
});

// Add it
buttonPanel.add(dayNightButton);
createDayNightButton();
}

// Both card rendering implementations have a view copy source button
Expand Down Expand Up @@ -217,6 +192,35 @@ public void focusLost(FocusEvent e) {
setFlippedAngle(isFlipped() ? CardPanel.FLIPPED_ANGLE : 0);
}

private void createDayNightButton() {
// Create the day night button
dayNightButton = new JButton("");
dayNightButton.setSize(32, 32);
dayNightButton.setToolTipText("This permanent is a double faced card. To see the card's other face, push this button or move mouse wheel down while hovering over it.");
BufferedImage day = ImageManagerImpl.instance.getDayImage();
dayNightButton.setIcon(new ImageIcon(day));
dayNightButton.addActionListener(e -> {
// if card is rotating then ignore it
if (animationInProgress) {
return;
}

// if card is tapped then no visual transforming is possible, so switch it immediately
if (isTapped()) {
// toggle without animation
this.getTopPanelRef().toggleTransformed();
this.getTopPanelRef().repaint();
return;
}

// normal animation
Animation.transformCard(this);
});

// Add it
buttonPanel.add(dayNightButton);
}

@Override
public void doLayout() {
// Position transform and show source buttons
Expand Down Expand Up @@ -585,6 +589,14 @@ public void update(CardView card) {
dayNightButton.setVisible(true); // show T button for any cards and permanents
dayNightButton.setIcon(new ImageIcon(transformIcon));
}
// Card became transformable
if (card.canTransform() && dayNightButton == null) {
createDayNightButton();
}
// Card became non-transformable
if (!card.canTransform() && !this.cardSideMain.canTransform() && dayNightButton != null) {
dayNightButton.setVisible(false);
}
}

@Override
Expand Down Expand Up @@ -944,7 +956,9 @@ private void setGameCardSides(CardView gameCard) {
this.cardSideOther = gameCard.getSecondCardFace();
} else {
// updated card
if (this.cardSideMain.getName().equals(gameCard.getName())) {
if (this.cardSideMain.getName().equals(gameCard.getName())
|| (!(this.cardSideMain instanceof PermanentView) && !gameCard.getName().equals(this.cardSideMain.getName()) && gameCard.getSecondCardFace() != null)
|| (gameCard instanceof PermanentView && !(gameCard.getName().equals(this.cardSideMain.getName())))) {
// from main side
this.cardSideMain = gameCard;
this.cardSideOther = gameCard.getSecondCardFace();
Expand Down
Loading