mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
* Select card window - Fixed a bug that the window (also if reqiured) was closed, if you clicked on the frame of the window (e.g. to resize). Now the window is not closed in this case and can also be resized (fixes #100). However if the target is not set to required, the window is not modal and clicking anywhere beside the window, will still close the window without having made a selection.
This commit is contained in:
parent
856dd35686
commit
c40dd7fb4b
4 changed files with 23 additions and 10 deletions
|
@ -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
|
||||
|
|
|
@ -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<UUID> targets, boolean required, Map<String, Serializable> options, int messageId) {
|
||||
ShowCardsDialog dialog = null;
|
||||
updateGame(gameView);
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -90,10 +90,10 @@ public class GameState implements Serializable, Copyable<GameState> {
|
|||
private final Turn turn;
|
||||
// revealed cards <Name, <Cards>>, will be reset if all players pass priority
|
||||
private final Revealed revealed;
|
||||
private final Map<UUID, LookedAt> lookedAt = new HashMap<UUID, LookedAt>();
|
||||
private final Map<UUID, LookedAt> lookedAt = new HashMap<>();
|
||||
private final DelayedTriggeredAbilities delayed;
|
||||
private final SpecialActions specialActions;
|
||||
private final Map<UUID, Abilities<ActivatedAbility>> otherAbilities = new HashMap<UUID, Abilities<ActivatedAbility>>();
|
||||
private final Map<UUID, Abilities<ActivatedAbility>> otherAbilities = new HashMap<>();
|
||||
private final TurnMods turnMods;
|
||||
private final Watchers watchers;
|
||||
|
||||
|
@ -111,11 +111,11 @@ public class GameState implements Serializable, Copyable<GameState> {
|
|||
private boolean paused;
|
||||
private ContinuousEffects effects;
|
||||
private TriggeredAbilities triggers;
|
||||
private List<TriggeredAbility> triggered = new ArrayList<TriggeredAbility>();
|
||||
private List<TriggeredAbility> triggered = new ArrayList<>();
|
||||
private Combat combat;
|
||||
private Map<String, Object> values = new HashMap<String, Object>();
|
||||
private Map<UUID, Zone> zones = new HashMap<UUID, Zone>();
|
||||
private List<GameEvent> simultaneousEvents = new ArrayList<GameEvent>();
|
||||
private Map<String, Object> values = new HashMap<>();
|
||||
private Map<UUID, Zone> zones = new HashMap<>();
|
||||
private List<GameEvent> simultaneousEvents = new ArrayList<>();
|
||||
|
||||
public GameState() {
|
||||
players = new Players();
|
||||
|
@ -246,7 +246,7 @@ public class GameState implements Serializable, Copyable<GameState> {
|
|||
}
|
||||
|
||||
sb.append("permanents");
|
||||
List<String> perms = new ArrayList<String>();
|
||||
List<String> perms = new ArrayList<>();
|
||||
for (Permanent permanent: battlefield.getAllPermanents()) {
|
||||
perms.add(permanent.getValue());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue