- Added a way to visually rotate split cards in card zoomer in Desktop Forge.

git-svn-id: http://svn.slightlymagic.net/forge/trunk@35826 269b9781-a132-4a9b-9d4e-f004f1b56b58
This commit is contained in:
Agetian 2017-09-29 08:20:51 +00:00
parent e91041a931
commit 2a21fa93f6
2 changed files with 24 additions and 17 deletions

View File

@ -19,20 +19,6 @@
package forge.toolbox.special;
import forge.StaticData;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;
import java.awt.image.BufferedImage;
import javax.swing.JPanel;
import javax.swing.Timer;
import net.miginfocom.swing.MigLayout;
import forge.assets.FSkinProp;
import forge.game.card.Card;
import forge.game.card.CardView.CardStateView;
@ -44,6 +30,11 @@ import forge.toolbox.FSkin.SkinnedLabel;
import forge.toolbox.imaging.FImagePanel;
import forge.toolbox.imaging.FImagePanel.AutoSizeImageMode;
import forge.toolbox.imaging.FImageUtil;
import net.miginfocom.swing.MigLayout;
import javax.swing.*;
import java.awt.event.*;
import java.awt.image.BufferedImage;
/**
* Displays card image at its original size and correct orientation.
@ -66,6 +57,7 @@ public enum CardZoomer {
// Details about the current card being displayed.
private CardStateView thisCard;
private boolean mayFlip, isInAltState;
private boolean isSplitRotated = false;
// The zoomer is in button mode when it is activated by holding down the
// middle mouse button or left and right mouse buttons simultaneously.
@ -240,7 +232,7 @@ public enum CardZoomer {
PaperCard pc = StaticData.instance().getCommonCards().getCard(cardName);
boolean isAftermath = pc != null && Card.getCardForUi(pc).hasKeyword("Aftermath");
return thisCard.getCard().isFaceDown() ? 0 : isAftermath ? 270 : 90; // rotate Aftermath splits the other way to correctly show the right split (graveyard) half
return thisCard.getCard().isFaceDown() || isSplitRotated ? 0 : isAftermath ? 270 : 90; // rotate Aftermath splits the other way to correctly show the right split (graveyard) half
}
return thisCard.getType().isPlane() || thisCard.getType().isPhenomenon() ? 90 : 0;
@ -298,8 +290,12 @@ public enum CardZoomer {
* Toggles between primary and alternate image associated with card if applicable.
*/
private void toggleCardImage() {
if (thisCard != null && mayFlip) {
toggleFlipCard();
if (thisCard != null) {
if (mayFlip) {
toggleFlipCard();
} else if (thisCard.getCard().isSplitCard()) {
toggleSplitCardRotation();
}
}
}
@ -316,4 +312,12 @@ public enum CardZoomer {
setImage();
}
/**
* Controls the rotation of a split card.
*/
private void toggleSplitCardRotation() {
isSplitRotated = !isSplitRotated;
setImage();
}
}

View File

@ -8,6 +8,9 @@ NOTE: in Mobile Forge, this option is called "Order Graveyard" due to space cons
- Desktop Forge: Personal Card Ratings in Quest Mode -
In Desktop Forge, it is now possible to assign personal ratings (from 1 star to 5 stars) to cards in Quest Mode by right clicking them and choosing the relevant context menu entry. It is then possible to filter cards by rating in both the deck editor and the quest shop, which should simplify managing bigger inventories. This patch was provided by Seravy.
- Desktop Forge: Rotate Split Card when Zoomed -
It is now possible to visually rotate the split card (visualize it vertically or horizontally) when zooming in on it either with the help of a mouse wheel or by pressing the Control button on your keyboard. This may be useful for Aftermath cards. There is a limitation right now: this will not work if a split card is manifested or otherwise face down (a card like that will always be visualized vertically).
- Mobile Forge: Partner Commander support -
It is now possible to set partner commanders through the user interface in mobile Forge, both in Constructed EDH and in Planar Conquest. When you have a commander that can be a legal partner for your current commander, you will have a new option "Set as Partner Commander" available to you in the dropdown menu that you get when you tap the card in the deck editor.