From b2299d661ed31d59c2206e597c36073b7c65a79e Mon Sep 17 00:00:00 2001 From: Agetian Date: Fri, 29 Sep 2017 11:33:19 +0000 Subject: [PATCH] - A better way to detect whether a player can look at the card for the purpose of identifying valid split rotation. git-svn-id: http://svn.slightlymagic.net/forge/trunk@35833 269b9781-a132-4a9b-9d4e-f004f1b56b58 --- .../src/forge/card/CardImageRenderer.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/forge-gui-mobile/src/forge/card/CardImageRenderer.java b/forge-gui-mobile/src/forge/card/CardImageRenderer.java index 9a758d20..9efd623e 100644 --- a/forge-gui-mobile/src/forge/card/CardImageRenderer.java +++ b/forge-gui-mobile/src/forge/card/CardImageRenderer.java @@ -4,7 +4,6 @@ import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment; import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; import forge.Graphics; import forge.assets.*; import forge.card.CardDetailUtil.DetailColors; @@ -13,7 +12,6 @@ import forge.card.mana.ManaCost; import forge.game.GameView; import forge.game.card.CardView; import forge.game.card.CardView.CardStateView; -import forge.game.player.PlayerView; import forge.game.zone.ZoneType; import forge.model.FModel; import forge.properties.ForgeConstants; @@ -332,7 +330,7 @@ public class CardImageRenderer { return; } - boolean canLook = card.getController() != null && card.canBeShownToAny(Lists.newArrayList(card.getController())); + boolean canLook = MatchController.instance.mayView(card); if (image == ImageCache.defaultImage) { //support drawing card image manually if card image not found drawCardImage(g, card, altState, x, y, w, h, CardStackPosition.Top); @@ -345,12 +343,15 @@ public class CardImageRenderer { float new_y = ForgeConstants.isGdxPortLandscape && isCurrentCard ? (dispH - new_h) / 2:y; boolean rotateSplit = FModel.getPreferences().getPrefBoolean(ForgePreferences.FPref.UI_ROTATE_SPLIT_CARDS); boolean rotatePlane = FModel.getPreferences().getPrefBoolean(ForgePreferences.FPref.UI_ROTATE_PLANE_OR_PHENOMENON); - if (rotatePlane && (card.getCurrentState().isPhenomenon() || card.getCurrentState().isPlane())) + if (rotatePlane && (card.getCurrentState().isPhenomenon() || card.getCurrentState().isPlane())) { g.drawRotatedImage(image, new_x, new_y, new_w, new_h, new_x + new_w / 2, new_y + new_h / 2, -90); - else if (rotateSplit && isCurrentCard && card.isSplitCard() && canLook) - g.drawRotatedImage(image, new_x, new_y, new_w, new_h, new_x + new_w / 2, new_y + new_h / 2, card.getText().contains("Aftermath") || card.getAlternateState().getOracleText().contains("Aftermath") ? 90:-90); - else + } else if (rotateSplit && isCurrentCard && card.isSplitCard() && canLook) { + boolean isAftermath = card.getText().contains("Aftermath") || card.getAlternateState().getOracleText().contains("Aftermath"); + g.drawRotatedImage(image, new_x, new_y, new_w, new_h, new_x + new_w / 2, new_y + new_h / 2, isAftermath ? 90 : -90); + } + else { g.drawImage(image, x, y, w, h); + } } CardRenderer.drawFoilEffect(g, card, x, y, w, h, isCurrentCard && canLook); }