mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
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:
@@ -36,6 +36,7 @@ import java.util.Set;
|
|||||||
|
|
||||||
public class CardView extends GameEntityView {
|
public class CardView extends GameEntityView {
|
||||||
private static final long serialVersionUID = -3624090829028979255L;
|
private static final long serialVersionUID = -3624090829028979255L;
|
||||||
|
private Card cardbackup;
|
||||||
|
|
||||||
public static CardView get(Card c) {
|
public static CardView get(Card c) {
|
||||||
return c == null ? null : c.getView();
|
return c == null ? null : c.getView();
|
||||||
@@ -46,6 +47,7 @@ public class CardView extends GameEntityView {
|
|||||||
return s == null ? null : s.getView();
|
return s == null ? null : s.getView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CardView getBackup() { return cardbackup == null ? null : getCardForUi(cardbackup.getPaperCard()); }
|
||||||
public static CardView getCardForUi(IPaperCard pc) {
|
public static CardView getCardForUi(IPaperCard pc) {
|
||||||
return Card.getCardForUi(pc).getView();
|
return Card.getCardForUi(pc).getView();
|
||||||
}
|
}
|
||||||
@@ -765,6 +767,10 @@ public class CardView extends GameEntityView {
|
|||||||
updateZoneText(c);
|
updateZoneText(c);
|
||||||
updateDamage(c);
|
updateDamage(c);
|
||||||
|
|
||||||
|
if (cardbackup == null && !c.isFaceDown() && c.hasBackSide()) {
|
||||||
|
cardbackup = c.getCardForUi();
|
||||||
|
}
|
||||||
|
|
||||||
boolean isSplitCard = c.isSplitCard();
|
boolean isSplitCard = c.isSplitCard();
|
||||||
set(TrackableProperty.Cloned, c.isCloned());
|
set(TrackableProperty.Cloned, c.isCloned());
|
||||||
set(TrackableProperty.SplitCard, isSplitCard);
|
set(TrackableProperty.SplitCard, isSplitCard);
|
||||||
|
|||||||
@@ -180,6 +180,12 @@ public class CardZoom extends FOverlay {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (flipIconBounds != null && flipIconBounds.contains(x, y)) {
|
if (flipIconBounds != null && flipIconBounds.contains(x, y)) {
|
||||||
|
if (currentCard.isFaceDown() && currentCard.getBackup() != null) {
|
||||||
|
if (currentCard.getBackup().hasBackSide()) {
|
||||||
|
show(currentCard.getBackup());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!showBackSide)
|
if (!showBackSide)
|
||||||
showAltState = !showAltState;
|
showAltState = !showAltState;
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user