mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
Merge pull request #2157 from fwannmacher/master
Removed "CARD ZONE" from tooltip when it is not necessary
This commit is contained in:
commit
a2a540c2b4
4 changed files with 14 additions and 9 deletions
|
@ -144,7 +144,7 @@ public class CardView extends SimpleCardView {
|
||||||
* the card
|
* the card
|
||||||
*/
|
*/
|
||||||
public CardView(Card card, Game game, boolean controlled) {
|
public CardView(Card card, Game game, boolean controlled) {
|
||||||
this(card, game, controlled, false);
|
this(card, game, controlled, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -156,22 +156,27 @@ public class CardView extends SimpleCardView {
|
||||||
* the card
|
* the card
|
||||||
* @param showFaceDownCard if true and the card is not on the battlefield,
|
* @param showFaceDownCard if true and the card is not on the battlefield,
|
||||||
* also a face down card is shown in the view, face down cards will be shown
|
* also a face down card is shown in the view, face down cards will be shown
|
||||||
|
* @param storeZone if true the card zone will be set in the zone attribute.
|
||||||
*/
|
*/
|
||||||
public CardView(Card card, Game game, boolean controlled, boolean showFaceDownCard) {
|
public CardView(Card card, Game game, boolean controlled, boolean showFaceDownCard, boolean storeZone) {
|
||||||
super(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.getUsesVariousArt(), card.getTokenSetCode(), game != null);
|
super(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.getUsesVariousArt(), card.getTokenSetCode(), game != null);
|
||||||
// no information available for face down cards as long it's not a controlled face down morph card
|
// no information available for face down cards as long it's not a controlled face down morph card
|
||||||
// TODO: Better handle this in Framework (but currently I'm not sure how to do it there) LevelX2
|
// TODO: Better handle this in Framework (but currently I'm not sure how to do it there) LevelX2
|
||||||
boolean showFaceUp = true;
|
boolean showFaceUp = true;
|
||||||
if (game != null) {
|
if (game != null) {
|
||||||
zone = game.getState().getZone(card.getId());
|
Zone cardZone = game.getState().getZone(card.getId());
|
||||||
if (card.isFaceDown(game)) {
|
if (card.isFaceDown(game)) {
|
||||||
showFaceUp = false;
|
showFaceUp = false;
|
||||||
if (!Zone.BATTLEFIELD.equals(zone)) {
|
if (!Zone.BATTLEFIELD.equals(cardZone)) {
|
||||||
if (showFaceDownCard) {
|
if (showFaceDownCard) {
|
||||||
showFaceUp = true;
|
showFaceUp = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (storeZone) {
|
||||||
|
this.zone = cardZone;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// boolean showFaceUp = game == null || !card.isFaceDown(game) || (!game.getState().getZone(card.getId()).equals(Zone.BATTLEFIELD) && showFaceDownCard);
|
// boolean showFaceUp = game == null || !card.isFaceDown(game) || (!game.getState().getZone(card.getId()).equals(Zone.BATTLEFIELD) && showFaceDownCard);
|
||||||
|
|
||||||
|
|
|
@ -66,9 +66,9 @@ public class CardsView extends LinkedHashMap<UUID, CardView> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public CardsView(Game game, Collection<? extends Card> cards, boolean showFaceDown) {
|
public CardsView(Game game, Collection<? extends Card> cards, boolean showFaceDown, boolean storeZone) {
|
||||||
for (Card card : cards) {
|
for (Card card : cards) {
|
||||||
this.put(card.getId(), new CardView(card, game, false, showFaceDown));
|
this.put(card.getId(), new CardView(card, game, false, showFaceDown, storeZone));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -109,9 +109,9 @@ public class GameView implements Serializable {
|
||||||
if (object != null) {
|
if (object != null) {
|
||||||
if (object instanceof Permanent) {
|
if (object instanceof Permanent) {
|
||||||
boolean controlled = ((Permanent) object).getControllerId().equals(createdForPlayerId);
|
boolean controlled = ((Permanent) object).getControllerId().equals(createdForPlayerId);
|
||||||
stack.put(stackObject.getId(), new StackAbilityView(game, (StackAbility) stackObject, ((Permanent) object).getName(), new CardView(((Permanent) object), game, controlled, false)));
|
stack.put(stackObject.getId(), new StackAbilityView(game, (StackAbility) stackObject, ((Permanent) object).getName(), new CardView(((Permanent) object), game, controlled, false, false)));
|
||||||
} else {
|
} else {
|
||||||
stack.put(stackObject.getId(), new StackAbilityView(game, (StackAbility) stackObject, card.getName(), new CardView(card, game, false, false)));
|
stack.put(stackObject.getId(), new StackAbilityView(game, (StackAbility) stackObject, card.getName(), new CardView(card, game, false, false, false)));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
stack.put(stackObject.getId(), new StackAbilityView(game, (StackAbility) stackObject, "", new CardView(card)));
|
stack.put(stackObject.getId(), new StackAbilityView(game, (StackAbility) stackObject, "", new CardView(card)));
|
||||||
|
|
|
@ -836,7 +836,7 @@ public class GameController implements GameCallback {
|
||||||
// So always show face up for selection
|
// So always show face up for selection
|
||||||
// boolean showFaceDown = targetZone != null && targetZone.equals(Zone.PICK);
|
// boolean showFaceDown = targetZone != null && targetZone.equals(Zone.PICK);
|
||||||
boolean showFaceDown = true;
|
boolean showFaceDown = true;
|
||||||
getGameSession(playerId).target(question, new CardsView(game, cards.getCards(game), showFaceDown), targets, required, options);
|
getGameSession(playerId).target(question, new CardsView(game, cards.getCards(game), showFaceDown, true), targets, required, options);
|
||||||
} else if (perms != null) {
|
} else if (perms != null) {
|
||||||
CardsView permsView = new CardsView();
|
CardsView permsView = new CardsView();
|
||||||
for (Permanent perm : perms) {
|
for (Permanent perm : perms) {
|
||||||
|
|
Loading…
Reference in a new issue