diff --git a/Mage.Client/src/main/java/mage/client/dialog/ShowCardsDialog.java b/Mage.Client/src/main/java/mage/client/dialog/ShowCardsDialog.java index 0117224d4f..8be8b52c63 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/ShowCardsDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/ShowCardsDialog.java @@ -154,7 +154,10 @@ public class ShowCardsDialog extends MageDialog implements MouseListener { @Override public void mousePressed(MouseEvent e) { - this.hideDialog(); + // only hide dialog, if a cardPanel was selected + if (e.getSource() instanceof CardPanel) { + this.hideDialog(); + } } @Override diff --git a/Mage.Client/src/main/java/mage/client/game/GamePanel.java b/Mage.Client/src/main/java/mage/client/game/GamePanel.java index eeec6b82f3..4502e3d92b 100644 --- a/Mage.Client/src/main/java/mage/client/game/GamePanel.java +++ b/Mage.Client/src/main/java/mage/client/game/GamePanel.java @@ -661,7 +661,17 @@ public final class GamePanel extends javax.swing.JPanel { updateGame(gameView); this.feedbackPanel.getFeedback(FeedbackMode.QUESTION, question, false, null, messageId); } - + /** + * Shows a pick target dialog and allows the player to pick a target (e.g. the pick triggered ability) + * + * @param message + * @param cardView + * @param gameView + * @param targets + * @param required + * @param options + * @param messageId + */ public void pickTarget(String message, CardsView cardView, GameView gameView, Set targets, boolean required, Map options, int messageId) { ShowCardsDialog dialog = null; updateGame(gameView); diff --git a/Mage.Client/src/main/java/mage/client/remote/CallbackClientImpl.java b/Mage.Client/src/main/java/mage/client/remote/CallbackClientImpl.java index 8c019ffb82..4f0a325b97 100644 --- a/Mage.Client/src/main/java/mage/client/remote/CallbackClientImpl.java +++ b/Mage.Client/src/main/java/mage/client/remote/CallbackClientImpl.java @@ -208,7 +208,7 @@ public class CallbackClientImpl implements CallbackClient { panel.ask(message.getMessage(), message.getGameView(), callback.getMessageId()); } break; } - case "gameTarget": + case "gameTarget": // e.g. Pick triggered ability { GameClientMessage message = (GameClientMessage) callback.getData(); GamePanel panel = MageFrame.getGame(callback.getObjectId()); diff --git a/Mage/src/mage/game/GameState.java b/Mage/src/mage/game/GameState.java index 918bd00062..015c3b0657 100644 --- a/Mage/src/mage/game/GameState.java +++ b/Mage/src/mage/game/GameState.java @@ -90,10 +90,10 @@ public class GameState implements Serializable, Copyable { private final Turn turn; // revealed cards >, will be reset if all players pass priority private final Revealed revealed; - private final Map lookedAt = new HashMap(); + private final Map lookedAt = new HashMap<>(); private final DelayedTriggeredAbilities delayed; private final SpecialActions specialActions; - private final Map> otherAbilities = new HashMap>(); + private final Map> otherAbilities = new HashMap<>(); private final TurnMods turnMods; private final Watchers watchers; @@ -111,11 +111,11 @@ public class GameState implements Serializable, Copyable { private boolean paused; private ContinuousEffects effects; private TriggeredAbilities triggers; - private List triggered = new ArrayList(); + private List triggered = new ArrayList<>(); private Combat combat; - private Map values = new HashMap(); - private Map zones = new HashMap(); - private List simultaneousEvents = new ArrayList(); + private Map values = new HashMap<>(); + private Map zones = new HashMap<>(); + private List simultaneousEvents = new ArrayList<>(); public GameState() { players = new Players(); @@ -246,7 +246,7 @@ public class GameState implements Serializable, Copyable { } sb.append("permanents"); - List perms = new ArrayList(); + List perms = new ArrayList<>(); for (Permanent permanent: battlefield.getAllPermanents()) { perms.add(permanent.getValue()); }