mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
- Some updates to visualization of Aftermath split cards in desktop Forge: ensure that mana cost is not flipped compared to the card image, use a more in-depth mechanism for checking the Aftermath keyword.
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package forge.toolbox.special;
|
package forge.toolbox.special;
|
||||||
|
|
||||||
|
import forge.StaticData;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
import java.awt.event.KeyAdapter;
|
import java.awt.event.KeyAdapter;
|
||||||
@@ -33,8 +34,10 @@ import javax.swing.Timer;
|
|||||||
|
|
||||||
import net.miginfocom.swing.MigLayout;
|
import net.miginfocom.swing.MigLayout;
|
||||||
import forge.assets.FSkinProp;
|
import forge.assets.FSkinProp;
|
||||||
|
import forge.game.card.Card;
|
||||||
import forge.game.card.CardView.CardStateView;
|
import forge.game.card.CardView.CardStateView;
|
||||||
import forge.gui.SOverlayUtils;
|
import forge.gui.SOverlayUtils;
|
||||||
|
import forge.item.PaperCard;
|
||||||
import forge.toolbox.FOverlay;
|
import forge.toolbox.FOverlay;
|
||||||
import forge.toolbox.FSkin;
|
import forge.toolbox.FSkin;
|
||||||
import forge.toolbox.FSkin.SkinnedLabel;
|
import forge.toolbox.FSkin.SkinnedLabel;
|
||||||
@@ -226,10 +229,14 @@ public enum CardZoomer {
|
|||||||
if (thisCard == null) {
|
if (thisCard == null) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (thisCard.getCard().isSplitCard() && thisCard.getCard().getText().contains("Aftermath")) {
|
if (thisCard.getCard().isSplitCard()) {
|
||||||
return 270; // rotate Aftermath splits the other way to correctly show the right split (graveyard) half
|
PaperCard pc = StaticData.instance().getCommonCards().getCard(thisCard.getName());
|
||||||
|
boolean isAftermath = pc != null && Card.getCardForUi(pc).hasKeyword("Aftermath");
|
||||||
|
|
||||||
|
return isAftermath ? 270 : 90; // rotate Aftermath splits the other way to correctly show the right split (graveyard) half
|
||||||
}
|
}
|
||||||
return thisCard.getCard().isSplitCard() || thisCard.getType().isPlane() || thisCard.getType().isPhenomenon() ? 90 : 0;
|
|
||||||
|
return thisCard.getType().isPlane() || thisCard.getType().isPhenomenon() ? 90 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setLayout() {
|
private void setLayout() {
|
||||||
|
|||||||
@@ -36,11 +36,14 @@ import javax.swing.SwingUtilities;
|
|||||||
|
|
||||||
import forge.CachedCardImage;
|
import forge.CachedCardImage;
|
||||||
import forge.FThreads;
|
import forge.FThreads;
|
||||||
|
import forge.StaticData;
|
||||||
import forge.card.CardEdition;
|
import forge.card.CardEdition;
|
||||||
import forge.card.mana.ManaCost;
|
import forge.card.mana.ManaCost;
|
||||||
|
import forge.game.card.Card;
|
||||||
import forge.game.card.CardView;
|
import forge.game.card.CardView;
|
||||||
import forge.game.card.CardView.CardStateView;
|
import forge.game.card.CardView.CardStateView;
|
||||||
import forge.gui.CardContainer;
|
import forge.gui.CardContainer;
|
||||||
|
import forge.item.PaperCard;
|
||||||
import forge.model.FModel;
|
import forge.model.FModel;
|
||||||
import forge.properties.ForgePreferences.FPref;
|
import forge.properties.ForgePreferences.FPref;
|
||||||
import forge.screens.match.CMatchUI;
|
import forge.screens.match.CMatchUI;
|
||||||
@@ -368,8 +371,11 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
|
|||||||
if (!showSplitMana) {
|
if (!showSplitMana) {
|
||||||
drawManaCost(g, card.getCurrentState().getManaCost(), 0);
|
drawManaCost(g, card.getCurrentState().getManaCost(), 0);
|
||||||
} else {
|
} else {
|
||||||
drawManaCost(g, card.getCurrentState().getManaCost(), +12);
|
PaperCard pc = StaticData.instance().getCommonCards().getCard(card.getName());
|
||||||
drawManaCost(g, card.getAlternateState().getManaCost(), -12);
|
int ofs = pc != null && Card.getCardForUi(pc).hasKeyword("Aftermath") ? -12 : 12;
|
||||||
|
|
||||||
|
drawManaCost(g, card.getCurrentState().getManaCost(), ofs);
|
||||||
|
drawManaCost(g, card.getAlternateState().getManaCost(), -ofs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user