diff --git a/Mage.Client/src/main/java/mage/client/MageFrame.java b/Mage.Client/src/main/java/mage/client/MageFrame.java index 8a9e3a95f5..641ba54ddb 100644 --- a/Mage.Client/src/main/java/mage/client/MageFrame.java +++ b/Mage.Client/src/main/java/mage/client/MageFrame.java @@ -739,14 +739,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient { } public void setUserPrefsToConnection(Connection connection) { - int avatarId = PreferencesDialog.getSelectedAvatar(); - connection.setAvatarId(avatarId); - boolean showAbilityPickerForced = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_SHOW_ABILITY_PICKER_FORCED, "true").equals("true"); - connection.setShowAbilityPickerForced(showAbilityPickerForced); - connection.setAllowRequestShowHandCards(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS, "true").equals("true")); - connection.setConfirmEmptyManaPool(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_CONFIRM_EMPTY_MANA_POOL, "true").equals("true")); - connection.setUserSkipPrioritySteps(PreferencesDialog.getUserSkipPrioritySteps()); - connection.setFlagName(MageFrame.getPreferences().get(KEY_CONNECT_FLAG, "world.png")); + connection.setUserData(PreferencesDialog.getUserData()); } /** diff --git a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.form b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.form index 0625371846..cfc3e9c036 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.form +++ b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.form @@ -82,10 +82,10 @@ - + - + @@ -201,23 +201,17 @@ - - - - - - - - - - - - - - - + + + + + + + + + @@ -235,6 +229,9 @@ + + + @@ -307,6 +304,17 @@ + + + + + + + + + + + diff --git a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java index a55dee9d98..1a92477f2f 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java @@ -66,6 +66,7 @@ import mage.client.util.gui.BufferedImageBuilder; import mage.players.net.UserSkipPrioritySteps; import mage.remote.Connection; import mage.remote.Connection.ProxyType; +import mage.view.UserDataView; import org.apache.log4j.Logger; /** @@ -86,6 +87,7 @@ public class PreferencesDialog extends javax.swing.JDialog { public static final String KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS = "gameAllowRequestShowHandCards"; public static final String KEY_GAME_SHOW_STORM_COUNTER = "gameShowStormCounter"; public static final String KEY_GAME_CONFIRM_EMPTY_MANA_POOL = "gameConfirmEmptyManaPool"; + public static final String KEY_GAME_ASK_MOVE_TO_GRAVE_ORDER = "gameAskMoveToGraveORder"; public static final String KEY_GAME_LOG_AUTO_SAVE = "gameLogAutoSave"; @@ -346,6 +348,7 @@ public class PreferencesDialog extends javax.swing.JDialog { cbAllowRequestToShowHandCards = new javax.swing.JCheckBox(); cbShowStormCounter = new javax.swing.JCheckBox(); cbConfirmEmptyManaPool = new javax.swing.JCheckBox(); + cbAskMoveToGraveOrder = new javax.swing.JCheckBox(); main_gamelog = new javax.swing.JPanel(); cbGameLogAutoSave = new javax.swing.JCheckBox(); tabPhases = new javax.swing.JPanel(); @@ -570,6 +573,16 @@ public class PreferencesDialog extends javax.swing.JDialog { } }); + cbAskMoveToGraveOrder.setSelected(true); + cbAskMoveToGraveOrder.setText("Ask player for setting order cards go to graveyard"); + cbAskMoveToGraveOrder.setToolTipText("If activated and multiple cards go to the graveyard at the same time
\nthe player is asked to set the order of the cards."); + cbAskMoveToGraveOrder.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); + cbAskMoveToGraveOrder.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + cbAskMoveToGraveOrderActionPerformed(evt); + } + }); + javax.swing.GroupLayout main_gameLayout = new javax.swing.GroupLayout(main_game); main_game.setLayout(main_gameLayout); main_gameLayout.setHorizontalGroup( @@ -577,18 +590,15 @@ public class PreferencesDialog extends javax.swing.JDialog { .addGroup(main_gameLayout.createSequentialGroup() .addContainerGap() .addGroup(main_gameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(main_gameLayout.createSequentialGroup() - .addComponent(cbAllowRequestToShowHandCards, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addGroup(main_gameLayout.createSequentialGroup() - .addGroup(main_gameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(main_gameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) - .addComponent(showPlayerNamesPermanently, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(nonLandPermanentsInOnePile, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(showAbilityPickerForced, javax.swing.GroupLayout.Alignment.LEADING)) - .addComponent(cbShowStormCounter, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(cbConfirmEmptyManaPool, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(0, 0, Short.MAX_VALUE)))) + .addComponent(cbAllowRequestToShowHandCards, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(main_gameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addComponent(showPlayerNamesPermanently, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(nonLandPermanentsInOnePile, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(showAbilityPickerForced, javax.swing.GroupLayout.Alignment.LEADING)) + .addComponent(cbShowStormCounter, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(cbConfirmEmptyManaPool, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(cbAskMoveToGraveOrder, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); main_gameLayout.setVerticalGroup( main_gameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -603,7 +613,10 @@ public class PreferencesDialog extends javax.swing.JDialog { .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(cbShowStormCounter) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(cbConfirmEmptyManaPool)) + .addComponent(cbConfirmEmptyManaPool) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(cbAskMoveToGraveOrder) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); nonLandPermanentsInOnePile.getAccessibleContext().setAccessibleName("nonLandPermanentsInOnePile"); @@ -651,10 +664,10 @@ public class PreferencesDialog extends javax.swing.JDialog { .addContainerGap() .addComponent(main_card, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(main_game, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(main_game, javax.swing.GroupLayout.PREFERRED_SIZE, 189, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(main_gamelog, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(40, Short.MAX_VALUE)) + .addContainerGap()) ); main_card.getAccessibleContext().setAccessibleName("Game panel"); @@ -1626,7 +1639,7 @@ public class PreferencesDialog extends javax.swing.JDialog { .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(exitButton, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) - .addComponent(tabsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 595, Short.MAX_VALUE) + .addComponent(tabsPanel) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -1655,6 +1668,7 @@ public class PreferencesDialog extends javax.swing.JDialog { save(prefs, dialog.cbAllowRequestToShowHandCards, KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS, "true", "false", UPDATE_CACHE_POLICY); save(prefs, dialog.cbShowStormCounter, KEY_GAME_SHOW_STORM_COUNTER, "true", "false", UPDATE_CACHE_POLICY); save(prefs, dialog.cbConfirmEmptyManaPool, KEY_GAME_CONFIRM_EMPTY_MANA_POOL, "true", "false", UPDATE_CACHE_POLICY); + save(prefs, dialog.cbAskMoveToGraveOrder, KEY_GAME_ASK_MOVE_TO_GRAVE_ORDER, "true", "false", UPDATE_CACHE_POLICY); save(prefs, dialog.cbGameLogAutoSave, KEY_GAME_LOG_AUTO_SAVE, "true", "false", UPDATE_CACHE_POLICY); // Phases @@ -1717,13 +1731,7 @@ public class PreferencesDialog extends javax.swing.JDialog { } try { - MageFrame.getSession().updatePreferencesForServer( - getSelectedAvatar(), - dialog.showAbilityPickerForced.isSelected(), - dialog.cbAllowRequestToShowHandCards.isSelected(), - dialog.cbConfirmEmptyManaPool.isSelected(), - getUserSkipPrioritySteps(), - MageFrame.getPreferences().get(KEY_CONNECT_FLAG, "world.png")); + MageFrame.getSession().updatePreferencesForServer(getUserData()); prefs.flush(); } catch (BackingStoreException ex) { @@ -1978,6 +1986,10 @@ public class PreferencesDialog extends javax.swing.JDialog { // TODO add your handling code here: }//GEN-LAST:event_cbConfirmEmptyManaPoolActionPerformed + private void cbAskMoveToGraveOrderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbAskMoveToGraveOrderActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_cbAskMoveToGraveOrderActionPerformed + private void showProxySettings() { if (cbProxyType.getSelectedItem() == Connection.ProxyType.SOCKS) { this.pnlProxy.setVisible(true); @@ -2055,6 +2067,7 @@ public class PreferencesDialog extends javax.swing.JDialog { load(prefs, dialog.cbAllowRequestToShowHandCards, KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS, "true"); load(prefs, dialog.cbShowStormCounter, KEY_GAME_SHOW_STORM_COUNTER, "true"); load(prefs, dialog.cbConfirmEmptyManaPool, KEY_GAME_CONFIRM_EMPTY_MANA_POOL, "true"); + load(prefs, dialog.cbAskMoveToGraveOrder, KEY_GAME_ASK_MOVE_TO_GRAVE_ORDER, "true"); load(prefs, dialog.cbGameLogAutoSave, KEY_GAME_LOG_AUTO_SAVE, "true"); @@ -2395,26 +2408,32 @@ public class PreferencesDialog extends javax.swing.JDialog { public void mousePressed(MouseEvent e) { if (selectedAvatarId != id) { setSelectedId(id); - MageFrame.getSession().updatePreferencesForServer( - id, - PreferencesDialog.getCachedValue(PreferencesDialog.KEY_SHOW_TOOLTIPS_ANY_ZONE, "true").equals("true"), - PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS, "true").equals("true"), - PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_CONFIRM_EMPTY_MANA_POOL, "true").equals("true"), - getUserSkipPrioritySteps(), - MageFrame.getPreferences().get(KEY_CONNECT_FLAG, "world.png") - ); + MageFrame.getSession().updatePreferencesForServer(getUserData()); } } }); } } + public static UserDataView getUserData(){ + return new UserDataView( + getSelectedAvatar(), + PreferencesDialog.getCachedValue(PreferencesDialog.KEY_SHOW_TOOLTIPS_ANY_ZONE, "true").equals("true"), + PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS, "true").equals("true"), + PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_CONFIRM_EMPTY_MANA_POOL, "true").equals("true"), + getUserSkipPrioritySteps(), + MageFrame.getPreferences().get(KEY_CONNECT_FLAG, "world.png"), + PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_ASK_MOVE_TO_GRAVE_ORDER, "true").equals("true") + ); + } + // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnBattlefieldBGMBrowse; private javax.swing.JButton btnBrowseBackgroundImage; private javax.swing.JButton btnBrowseBattlefieldImage; private javax.swing.JButton btnBrowseImageLocation; private javax.swing.JCheckBox cbAllowRequestToShowHandCards; + private javax.swing.JCheckBox cbAskMoveToGraveOrder; private javax.swing.JCheckBox cbCheckForNewImages; private javax.swing.JCheckBox cbConfirmEmptyManaPool; private javax.swing.JCheckBox cbEnableBattlefieldBGM; diff --git a/Mage.Common/src/mage/remote/Connection.java b/Mage.Common/src/mage/remote/Connection.java index 21e51faf79..e8337feacd 100644 --- a/Mage.Common/src/mage/remote/Connection.java +++ b/Mage.Common/src/mage/remote/Connection.java @@ -35,6 +35,7 @@ import java.net.NetworkInterface; import java.net.SocketException; import java.util.Enumeration; import mage.players.net.UserSkipPrioritySteps; +import mage.view.UserDataView; /** * @@ -54,12 +55,14 @@ public class Connection { private int clientCardDatabaseVersion; private boolean forceDBComparison; - private int avatarId; - private boolean showAbilityPickerForced; - private boolean allowRequestShowHandCards; - private boolean confirmEmptyManaPool; - private String flagName; - private UserSkipPrioritySteps userSkipPrioritySteps; + private UserDataView userData; + +// private int avatarId; +// private boolean showAbilityPickerForced; +// private boolean allowRequestShowHandCards; +// private boolean confirmEmptyManaPool; +// private String flagName; +// private UserSkipPrioritySteps userSkipPrioritySteps; private static final String serialization = "?serializationtype=jboss"; private static final String transport = "bisocket"; @@ -221,45 +224,12 @@ public class Connection { return null; } - public int getAvatarId() { - return avatarId; - } - - public void setAvatarId(int avatarId) { - this.avatarId = avatarId; - } - - public boolean isShowAbilityPickerForced() { - return showAbilityPickerForced; - } - - public void setShowAbilityPickerForced(boolean showAbilityPickerForced) { - this.showAbilityPickerForced = showAbilityPickerForced; - } - - public boolean allowRequestShowHandCards() { - return allowRequestShowHandCards; - } - - public void setAllowRequestShowHandCards(boolean allowRequestShowHandCards) { - this.allowRequestShowHandCards = allowRequestShowHandCards; - } - - public boolean confirmEmptyManaPool() { - return confirmEmptyManaPool; - } - - public void setConfirmEmptyManaPool(boolean confirmEmptyManaPool) { - this.confirmEmptyManaPool = confirmEmptyManaPool; + public void setUserData(UserDataView userData) { + this.userData= userData; } - - public UserSkipPrioritySteps getUserSkipPrioritySteps() { - return userSkipPrioritySteps; - } - - public void setUserSkipPrioritySteps(UserSkipPrioritySteps userSkipPrioritySteps) { - this.userSkipPrioritySteps = userSkipPrioritySteps; + public UserDataView getUserData() { + return userData; } public boolean isForceDBComparison() { @@ -269,13 +239,4 @@ public class Connection { public void setForceDBComparison(boolean forceDBComparison) { this.forceDBComparison = forceDBComparison; } - - public String getFlagName() { - return flagName; - } - - public void setFlagName(String flagName) { - this.flagName = flagName; - } - } diff --git a/Mage.Common/src/mage/remote/SessionImpl.java b/Mage.Common/src/mage/remote/SessionImpl.java index 2bcc00dfb3..a5bf686b3b 100644 --- a/Mage.Common/src/mage/remote/SessionImpl.java +++ b/Mage.Common/src/mage/remote/SessionImpl.java @@ -275,16 +275,10 @@ public class SessionImpl implements Session { this.sessionId = callbackClient.getSessionId(); boolean registerResult; if (connection.getPassword() == null) { - UserDataView userDataView = new UserDataView(connection.getAvatarId(), - connection.isShowAbilityPickerForced(), - connection.allowRequestShowHandCards(), - connection.confirmEmptyManaPool(), - connection.getUserSkipPrioritySteps(), - connection.getFlagName()); // for backward compatibility. don't remove twice call - first one does nothing but for version checking registerResult = server.registerClient(connection.getUsername(), sessionId, client.getVersion()); if (registerResult) { - server.setUserData(connection.getUsername(), sessionId, userDataView); + server.setUserData(connection.getUsername(), sessionId, connection.getUserData()); } } else { registerResult = server.registerAdmin(connection.getPassword(), sessionId, client.getVersion()); @@ -1397,11 +1391,10 @@ public class SessionImpl implements Session { } @Override - public boolean updatePreferencesForServer(int avatarId, boolean showAbilityPickerForced, boolean allowRequestShowHandCards, boolean confirmEmptyManaPool, UserSkipPrioritySteps userSkipPrioritySteps, String flagName) { + public boolean updatePreferencesForServer(UserDataView userData) { try { if (isConnected()) { - UserDataView userDataView = new UserDataView(avatarId, showAbilityPickerForced, allowRequestShowHandCards, confirmEmptyManaPool, userSkipPrioritySteps, flagName); - server.setUserData(connection.getUsername(), sessionId, userDataView); + server.setUserData(connection.getUsername(), sessionId, userData); } return true; } catch (MageException ex) { diff --git a/Mage.Common/src/mage/remote/interfaces/ClientData.java b/Mage.Common/src/mage/remote/interfaces/ClientData.java index 2a9fe56b38..7b4f248d93 100644 --- a/Mage.Common/src/mage/remote/interfaces/ClientData.java +++ b/Mage.Common/src/mage/remote/interfaces/ClientData.java @@ -27,7 +27,7 @@ */ package mage.remote.interfaces; -import mage.players.net.UserSkipPrioritySteps; +import mage.view.UserDataView; /** * @author noxx @@ -36,5 +36,5 @@ public interface ClientData { String getUserName(); - boolean updatePreferencesForServer(int avatarId, boolean showAbilityPickerForced, boolean allowRequestShowHandCards, boolean confirmEmptyManaPool, UserSkipPrioritySteps userSkipPrioritySteps, String flagName); + boolean updatePreferencesForServer(UserDataView userData); } diff --git a/Mage.Common/src/mage/view/PlayerView.java b/Mage.Common/src/mage/view/PlayerView.java index 3e9eb437d8..487e84afd2 100644 --- a/Mage.Common/src/mage/view/PlayerView.java +++ b/Mage.Common/src/mage/view/PlayerView.java @@ -115,7 +115,7 @@ public class PlayerView implements Serializable { if (player.getUserData() != null) { this.userDataView = new UserDataView(player.getUserData()); } else { - this.userDataView = new UserDataView(0, false, false, true, null,"world.png"); + this.userDataView = UserDataView.getDefaultUserDataView(); } for (CommandObject commandObject : game.getState().getCommand()) { diff --git a/Mage.Common/src/mage/view/UserDataView.java b/Mage.Common/src/mage/view/UserDataView.java index 9bf65b6f2e..40171cbe31 100644 --- a/Mage.Common/src/mage/view/UserDataView.java +++ b/Mage.Common/src/mage/view/UserDataView.java @@ -18,15 +18,22 @@ public class UserDataView implements Serializable { protected boolean confirmEmptyManaPool; protected UserSkipPrioritySteps userSkipPrioritySteps; String flagName; + protected boolean askMoveToGraveOrder; + static UserDataView getDefaultUserDataView() { + return new UserDataView(0, false, false, true, null,"world.png", false); + } + public UserDataView(int avatarId, boolean showAbilityPickerForced, boolean allowRequestShowHandCards, - boolean confirmEmptyManaPool, UserSkipPrioritySteps userSkipPrioritySteps, String flagName) { + boolean confirmEmptyManaPool, UserSkipPrioritySteps userSkipPrioritySteps, String flagName, boolean askMoveToGraveOrder) { this.avatarId = avatarId; this.showAbilityPickerForced = showAbilityPickerForced; this.allowRequestShowHandCards = allowRequestShowHandCards; this.userSkipPrioritySteps = userSkipPrioritySteps; this.confirmEmptyManaPool = confirmEmptyManaPool; this.flagName = flagName; + this.askMoveToGraveOrder = askMoveToGraveOrder; + } public UserDataView(UserData userData) { @@ -37,6 +44,7 @@ public class UserDataView implements Serializable { this.userSkipPrioritySteps = userData.getUserSkipPrioritySteps(); this.confirmEmptyManaPool = userData.confirmEmptyManaPool(); this.flagName = userData.getFlagName(); + this.askMoveToGraveOrder = userData.askMoveToGraveOrder(); } public int getAvatarId() { @@ -62,5 +70,9 @@ public class UserDataView implements Serializable { public String getFlagName() { return flagName; } + + public boolean askMoveToGraveOrder() { + return askMoveToGraveOrder; + } } diff --git a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java index e10917f274..7daf4cb517 100644 --- a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java @@ -175,7 +175,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { public ComputerPlayer(String name, RangeOfInfluence range) { super(name, range); human = false; - userData = new UserData(UserGroup.COMPUTER, 64, false, true, false, null, "Computer.png"); + userData = new UserData(UserGroup.COMPUTER, 64, false, true, false, null, "Computer.png", false); pickedCards = new ArrayList<>(); } diff --git a/Mage.Server/src/main/java/mage/server/Session.java b/Mage.Server/src/main/java/mage/server/Session.java index 2560f43da8..5bfe452d51 100644 --- a/Mage.Server/src/main/java/mage/server/Session.java +++ b/Mage.Server/src/main/java/mage/server/Session.java @@ -142,7 +142,7 @@ public class Session { if (user == null) { user = UserManager.getInstance().findUser("Admin"); } - user.setUserData(new UserData(UserGroup.ADMIN, 0, false, false, false, null, "world.png")); + user.setUserData(new UserData(UserGroup.ADMIN, 0, false, false, false, null, "world.png", false)); if (!UserManager.getInstance().connectToSession(sessionId, user.getId())) { logger.info("Error connecting Admin!"); } @@ -157,7 +157,7 @@ public class Session { userData = new UserData(UserGroup.PLAYER, userDataView.getAvatarId(), userDataView.isShowAbilityPickerForced(), userDataView.allowRequestShowHandCards(), userDataView.confirmEmptyManaPool(), userDataView.getUserSkipPrioritySteps(), - userDataView.getFlagName()); + userDataView.getFlagName(), userDataView.askMoveToGraveOrder()); user.setUserData(userData); } else { if (userDataView.getAvatarId() == 51) { // Update special avatar if first avatar is selected @@ -168,6 +168,7 @@ public class Session { userData.setAllowRequestShowHandCards(userDataView.allowRequestShowHandCards()); userData.setUserSkipPrioritySteps(userDataView.getUserSkipPrioritySteps()); userData.setConfirmEmptyManaPool(userDataView.confirmEmptyManaPool()); + userData.setAskMoveToGraveOrder(userDataView.askMoveToGraveOrder()); } return true; } diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index 79702411d2..eb51a19151 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -2936,9 +2936,11 @@ public abstract class PlayerImpl implements Player, Serializable { if (choosingPlayer == null) { continue; } - boolean chooseOrder = true; - if (cards.size() > 2) { - chooseOrder = choosingPlayer.chooseUse(Outcome.Neutral, "Would you like to choose the order the cards go to graveyard?", game); + boolean chooseOrder = false; + if (userData.askMoveToGraveOrder()) { + if (cards.size() > 3) { + chooseOrder = choosingPlayer.chooseUse(Outcome.Neutral, "Would you like to choose the order the cards go to graveyard?", game); + } } if (chooseOrder) { TargetCard target = new TargetCard(fromZone, new FilterCard("card to put on the top of your graveyard (last one chosen will be topmost)")); diff --git a/Mage/src/mage/players/net/UserData.java b/Mage/src/mage/players/net/UserData.java index 72823bd53e..b1b83a7a7c 100644 --- a/Mage/src/mage/players/net/UserData.java +++ b/Mage/src/mage/players/net/UserData.java @@ -16,10 +16,11 @@ public class UserData implements Serializable { protected boolean confirmEmptyManaPool; protected UserSkipPrioritySteps userSkipPrioritySteps; protected String flagName; + protected boolean askMoveToGraveOrder; public UserData(UserGroup userGroup, int avatarId, boolean showAbilityPickerForced, boolean allowRequestShowHandCards, boolean confirmEmptyManaPool, UserSkipPrioritySteps userSkipPrioritySteps, - String flagName) { + String flagName, boolean askMoveToGraveOrder) { this.groupId = userGroup.getGroupId(); this.avatarId = avatarId; this.showAbilityPickerForced = showAbilityPickerForced; @@ -84,5 +85,13 @@ public class UserData implements Serializable { public String getFlagName() { return flagName; } + + public boolean askMoveToGraveOrder() { + return askMoveToGraveOrder; + } + + public void setAskMoveToGraveOrder(boolean askMoveToGraveOrder) { + this.askMoveToGraveOrder = askMoveToGraveOrder; + } }