Merge branch 'master' into 'master'

[Mobile] Add support for viewing both sides of facedown DFC

See merge request core-developers/forge!4102
This commit is contained in:
Michael Kamensky
2021-03-04 18:02:25 +00:00
2 changed files with 12 additions and 0 deletions

View File

@@ -36,6 +36,7 @@ import java.util.Set;
public class CardView extends GameEntityView {
private static final long serialVersionUID = -3624090829028979255L;
private Card cardbackup;
public static CardView get(Card c) {
return c == null ? null : c.getView();
@@ -46,6 +47,7 @@ public class CardView extends GameEntityView {
return s == null ? null : s.getView();
}
public CardView getBackup() { return cardbackup == null ? null : getCardForUi(cardbackup.getPaperCard()); }
public static CardView getCardForUi(IPaperCard pc) {
return Card.getCardForUi(pc).getView();
}
@@ -765,6 +767,10 @@ public class CardView extends GameEntityView {
updateZoneText(c);
updateDamage(c);
if (cardbackup == null && !c.isFaceDown() && c.hasBackSide()) {
cardbackup = c.getCardForUi();
}
boolean isSplitCard = c.isSplitCard();
set(TrackableProperty.Cloned, c.isCloned());
set(TrackableProperty.SplitCard, isSplitCard);

View File

@@ -180,6 +180,12 @@ public class CardZoom extends FOverlay {
return true;
}
if (flipIconBounds != null && flipIconBounds.contains(x, y)) {
if (currentCard.isFaceDown() && currentCard.getBackup() != null) {
if (currentCard.getBackup().hasBackSide()) {
show(currentCard.getBackup());
return true;
}
}
if (!showBackSide)
showAltState = !showAltState;
else