From 722627baa2dcd6dc35a302190fd285309c9427b9 Mon Sep 17 00:00:00 2001 From: Artemis Kearney Date: Tue, 8 Aug 2023 00:37:38 -0500 Subject: [PATCH] Create new "custom options" button/dialog, consolidate game-modifying options there (#10768) * create CustomOptionsDialog; update NewTournamentDialog to use it * add custom options button to new table/tournament dialogs * fix buffer time in new table dialog * further UI improvements - move multiplayer options back out to NewTableDialog - hide multiplayer options when all are disabled - rearrange other options for consistency * update button label to show number of active custom options * remove commented-out code --- .../client/dialog/CustomOptionsDialog.form | 199 ++++++++++ .../client/dialog/CustomOptionsDialog.java | 289 ++++++++++++++ .../mage/client/dialog/NewTableDialog.form | 354 +++++++----------- .../mage/client/dialog/NewTableDialog.java | 299 +++++++-------- .../client/dialog/NewTournamentDialog.form | 237 +++++------- .../client/dialog/NewTournamentDialog.java | 226 +++++------ 6 files changed, 943 insertions(+), 661 deletions(-) create mode 100644 Mage.Client/src/main/java/mage/client/dialog/CustomOptionsDialog.form create mode 100644 Mage.Client/src/main/java/mage/client/dialog/CustomOptionsDialog.java diff --git a/Mage.Client/src/main/java/mage/client/dialog/CustomOptionsDialog.form b/Mage.Client/src/main/java/mage/client/dialog/CustomOptionsDialog.form new file mode 100644 index 00000000000..a19c7607bde --- /dev/null +++ b/Mage.Client/src/main/java/mage/client/dialog/CustomOptionsDialog.form @@ -0,0 +1,199 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Mage.Client/src/main/java/mage/client/dialog/CustomOptionsDialog.java b/Mage.Client/src/main/java/mage/client/dialog/CustomOptionsDialog.java new file mode 100644 index 00000000000..f7c9495a3c5 --- /dev/null +++ b/Mage.Client/src/main/java/mage/client/dialog/CustomOptionsDialog.java @@ -0,0 +1,289 @@ +package mage.client.dialog; + +import mage.constants.MultiplayerAttackOption; +import mage.constants.RangeOfInfluence; +import mage.game.match.MatchOptions; +import mage.game.mulligan.MulliganType; +import org.apache.log4j.Logger; + +import javax.swing.*; + +/** + * App GUI: custom options for match/tournament + * + * @author artemiswkearney + */ +public class CustomOptionsDialog extends MageDialog { + + public enum SaveLoadKeys { + TABLE( + PreferencesDialog.KEY_NEW_TABLE_NUMBER_OF_FREE_MULLIGANS, + PreferencesDialog.KEY_NEW_TABLE_MULLIGAN_TYPE, + PreferencesDialog.KEY_NEW_TABLE_PLANECHASE + ), + + TOURNEY( + PreferencesDialog.KEY_NEW_TOURNAMENT_NUMBER_OF_FREE_MULLIGANS, + PreferencesDialog.KEY_NEW_TOURNAMENT_MULLIGUN_TYPE, + PreferencesDialog.KEY_NEW_TOURNAMENT_PLANE_CHASE + ); + public final String NUMBER_OF_FREE_MULLIGANS; + public final String MULLIGAN_TYPE; + public final String PLANECHASE; + + SaveLoadKeys(String numberOfFreeMulligans, String mulliganType, String planechase) { + NUMBER_OF_FREE_MULLIGANS = numberOfFreeMulligans; + MULLIGAN_TYPE = mulliganType; + PLANECHASE = planechase; + } + } + + private static final Logger logger = Logger.getLogger(CustomOptionsDialog.class); + private final SaveLoadKeys saveLoadKeys; + private final JButton openButton; + + /** + * Creates new form NewTableDialog + */ + public CustomOptionsDialog(SaveLoadKeys saveLoadKeys, JButton openButton) { + this.saveLoadKeys = saveLoadKeys; + this.openButton = openButton; + initComponents(); + this.spnFreeMulligans.setModel(new SpinnerNumberModel(0, 0, 5, 1)); + cbMulliganType.setModel(new DefaultComboBoxModel(MulliganType.values())); + this.setModal(true); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + lblGeneralOptions = new javax.swing.JLabel(); + lblMulliganType = new javax.swing.JLabel(); + cbMulliganType = new javax.swing.JComboBox<>(); + lblFreeMulligans = new javax.swing.JLabel(); + spnFreeMulligans = new javax.swing.JSpinner(); + jSeparator2 = new javax.swing.JSeparator(); + lblVariantOptions = new javax.swing.JLabel(); + chkPlaneChase = new javax.swing.JCheckBox(); + jSeparator4 = new javax.swing.JSeparator(); + btnOK = new javax.swing.JButton(); + + setTitle("Custom Options"); + + lblGeneralOptions.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N + lblGeneralOptions.setText("General Options"); + + lblMulliganType.setLabelFor(cbMulliganType); + lblMulliganType.setText("Mulligan type:"); + lblMulliganType.setToolTipText("What style of mulligan?"); + + cbMulliganType.setToolTipText("Selections the type of mulligan for games."); + cbMulliganType.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + cbMulliganTypeActionPerformed(evt); + } + }); + + lblFreeMulligans.setLabelFor(cbMulliganType); + lblFreeMulligans.setText("Free mulligans:"); + lblFreeMulligans.setToolTipText("What style of mulligan?"); + + spnFreeMulligans.addChangeListener(new javax.swing.event.ChangeListener() { + public void stateChanged(javax.swing.event.ChangeEvent evt) { + spnFreeMulligansStateChanged(evt); + } + }); + + lblVariantOptions.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N + lblVariantOptions.setText("Variant Options"); + + chkPlaneChase.setText("PlaneChase"); + chkPlaneChase.setToolTipText("Use the PlaneChase variant for your game."); + chkPlaneChase.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + chkPlaneChaseActionPerformed(evt); + } + }); + + btnOK.setText("OK"); + btnOK.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnOKActionPerformed(evt); + } + }); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jSeparator2) + .addComponent(jSeparator4) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() + .addComponent(lblMulliganType) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(cbMulliganType, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() + .addComponent(lblFreeMulligans) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(spnFreeMulligans, javax.swing.GroupLayout.DEFAULT_SIZE, 126, Short.MAX_VALUE)) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(chkPlaneChase) + .addComponent(lblGeneralOptions) + .addComponent(lblVariantOptions)) + .addGap(0, 125, Short.MAX_VALUE)) + .addGroup(layout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(btnOK))) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(lblGeneralOptions) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblMulliganType) + .addComponent(cbMulliganType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(spnFreeMulligans, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblFreeMulligans)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblVariantOptions) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(chkPlaneChase) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jSeparator4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, 0) + .addComponent(btnOK, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap()) + ); + + lblMulliganType.getAccessibleContext().setAccessibleName("Mulligan Type:"); + lblMulliganType.getAccessibleContext().setAccessibleParent(lblGeneralOptions); + cbMulliganType.getAccessibleContext().setAccessibleName(""); + cbMulliganType.getAccessibleContext().setAccessibleDescription("Select the type of mulligan for games."); + cbMulliganType.getAccessibleContext().setAccessibleParent(lblMulliganType); + lblFreeMulligans.getAccessibleContext().setAccessibleDescription(""); + lblFreeMulligans.getAccessibleContext().setAccessibleParent(lblGeneralOptions); + spnFreeMulligans.getAccessibleContext().setAccessibleDescription("Select the number of free mulligans"); + spnFreeMulligans.getAccessibleContext().setAccessibleParent(lblFreeMulligans); + chkPlaneChase.getAccessibleContext().setAccessibleParent(lblVariantOptions); + + pack(); + }// //GEN-END:initComponents + + private void btnPreviousConfigurationActionPerformed(java.awt.event.ActionEvent evt, int i) {//GEN-FIRST:event_btnPreviousConfigurationActionPerformed + }//GEN-LAST:event_btnPreviousConfigurationActionPerformed + + private void btnOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnOKActionPerformed + this.hideDialog(); + }//GEN-LAST:event_btnOKActionPerformed + + private void cbMulliganTypeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbMulliganTypeActionPerformed + updateActiveCount(); + }//GEN-LAST:event_cbMulliganTypeActionPerformed + + private void spnFreeMulligansStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnFreeMulligansStateChanged + updateActiveCount(); + }//GEN-LAST:event_spnFreeMulligansStateChanged + + private void chkPlaneChaseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkPlaneChaseActionPerformed + updateActiveCount(); + }//GEN-LAST:event_chkPlaneChaseActionPerformed + + public void showDialog() { + this.setLocation(150, 100); + this.setVisible(true); + } + + public void onLoadSettings(int version) { + + String versionStr = ""; + switch (version) { + case -1: + versionStr = "-1"; // default (empty) + break; + case 1: + versionStr = "1"; + break; + case 2: + versionStr = "2"; + break; + default: + versionStr = ""; + break; + } + + this.chkPlaneChase.setSelected(PreferencesDialog.getCachedValue(saveLoadKeys.PLANECHASE + versionStr, "No").equals("Yes")); + this.spnFreeMulligans.setValue(Integer.parseInt(PreferencesDialog.getCachedValue(saveLoadKeys.NUMBER_OF_FREE_MULLIGANS + versionStr, "0"))); + this.cbMulliganType.setSelectedItem(MulliganType.valueByName(PreferencesDialog.getCachedValue(saveLoadKeys.MULLIGAN_TYPE + versionStr, MulliganType.GAME_DEFAULT.toString()))); + updateActiveCount(); + } + + public void onSaveSettings(int version, MatchOptions options) { + String versionStr = ""; + switch (version) { + case 1: + versionStr = "1"; + break; + case 2: + versionStr = "2"; + break; + default: + versionStr = ""; + break; + } + PreferencesDialog.saveValue(saveLoadKeys.NUMBER_OF_FREE_MULLIGANS + versionStr, Integer.toString(options.getFreeMulligans())); + PreferencesDialog.saveValue(saveLoadKeys.MULLIGAN_TYPE + versionStr, options.getMulliganType().toString()); + PreferencesDialog.saveValue(saveLoadKeys.PLANECHASE + versionStr, options.isPlaneChase() ? "Yes" : "No"); + } + + /** + * Applies this dialog's configured match options to a MatchOptions object. + */ + public void writeMatchOptionsTo(MatchOptions options) { + options.setFreeMulligans((Integer) spnFreeMulligans.getValue()); + options.setMullgianType((MulliganType) cbMulliganType.getSelectedItem()); + options.setPlaneChase(chkPlaneChase.isSelected()); + } + + public void updateActiveCount() { + int activeCount = 0; + if ((Integer)spnFreeMulligans.getValue() > 0) activeCount++; + if (!cbMulliganType.getSelectedItem().toString().equals(MulliganType.GAME_DEFAULT.toString())) activeCount++; + if (chkPlaneChase.isSelected()) activeCount++; + if (activeCount == 0) { + openButton.setText("Custom Options..."); + } + else { + openButton.setText("Custom Options (" + activeCount + ")"); + } + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton btnOK; + private javax.swing.JComboBox cbMulliganType; + private javax.swing.JCheckBox chkPlaneChase; + private javax.swing.JSeparator jSeparator2; + private javax.swing.JSeparator jSeparator4; + private javax.swing.JLabel lblFreeMulligans; + private javax.swing.JLabel lblGeneralOptions; + private javax.swing.JLabel lblMulliganType; + private javax.swing.JLabel lblVariantOptions; + private javax.swing.JSpinner spnFreeMulligans; + // End of variables declaration//GEN-END:variables +} diff --git a/Mage.Client/src/main/java/mage/client/dialog/NewTableDialog.form b/Mage.Client/src/main/java/mage/client/dialog/NewTableDialog.form index f7b3141da17..686e4897484 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/NewTableDialog.form +++ b/Mage.Client/src/main/java/mage/client/dialog/NewTableDialog.form @@ -110,106 +110,93 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + - - - - + + + + + + + + + + + - - - - + - - - - - - - - - - - - - + + + + + + - + + - + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + @@ -218,7 +205,7 @@ - + @@ -227,22 +214,23 @@ - + + + + + + + + + - - - - - - - @@ -258,53 +246,35 @@ - - - - + + + + + + + + + + + + - - - - - + + + + - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - + @@ -313,7 +283,7 @@ - + @@ -399,29 +369,12 @@ - - - - - - - - - - - - - - - - - @@ -435,43 +388,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -556,32 +474,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -622,5 +514,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Mage.Client/src/main/java/mage/client/dialog/NewTableDialog.java b/Mage.Client/src/main/java/mage/client/dialog/NewTableDialog.java index ebf81b61b99..20163486470 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/NewTableDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/NewTableDialog.java @@ -23,6 +23,7 @@ import org.apache.log4j.Logger; import javax.swing.*; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.UUID; @@ -35,6 +36,7 @@ public class NewTableDialog extends MageDialog { private static final Logger logger = Logger.getLogger(NewTableDialog.class); + private CustomOptionsDialog customOptions; private TableView table; private UUID playerId; private UUID roomId; @@ -50,9 +52,10 @@ public class NewTableDialog extends MageDialog { public NewTableDialog() { lastSessionId = ""; initComponents(); + this.customOptions = new CustomOptionsDialog(CustomOptionsDialog.SaveLoadKeys.TABLE, btnCustomOptions); + MageFrame.getDesktop().add(customOptions, JLayeredPane.MODAL_LAYER); player1Panel.showLevel(false); this.spnNumWins.setModel(new SpinnerNumberModel(1, 1, 5, 1)); - this.spnFreeMulligans.setModel(new SpinnerNumberModel(0, 0, 5, 1)); this.spnQuitRatio.setModel(new SpinnerNumberModel(100, 0, 100, 5)); this.spnMinimumRating.setModel(new SpinnerNumberModel(0, 0, 3000, 10)); this.spnEdhPowerLevel.setModel(new SpinnerNumberModel(100, 0, 100, 5)); @@ -91,16 +94,9 @@ public class NewTableDialog extends MageDialog { lblGameType = new javax.swing.JLabel(); cbGameType = new javax.swing.JComboBox(); chkRollbackTurnsAllowed = new javax.swing.JCheckBox(); - lblFreeMulligans = new javax.swing.JLabel(); chkSpectatorsAllowed = new javax.swing.JCheckBox(); - chkPlaneChase = new javax.swing.JCheckBox(); - spnFreeMulligans = new javax.swing.JSpinner(); lblNumPlayers = new javax.swing.JLabel(); spnNumPlayers = new javax.swing.JSpinner(); - lblRange = new javax.swing.JLabel(); - cbRange = new javax.swing.JComboBox(); - lblAttack = new javax.swing.JLabel(); - cbAttackOption = new javax.swing.JComboBox(); lblSkillLevel = new javax.swing.JLabel(); cbSkillLevel = new javax.swing.JComboBox(); lblNumWins = new javax.swing.JLabel(); @@ -118,14 +114,17 @@ public class NewTableDialog extends MageDialog { spnQuitRatio = new javax.swing.JSpinner(); lblEdhPowerLevel = new javax.swing.JLabel(); spnEdhPowerLevel = new javax.swing.JSpinner(); - cbMulligan = new javax.swing.JComboBox<>(); - lblMullgian = new javax.swing.JLabel(); lblMinimumRating = new javax.swing.JLabel(); spnMinimumRating = new javax.swing.JSpinner(); chkRated = new javax.swing.JCheckBox(); btnSettingsLoad = new javax.swing.JButton(); btnSettingsSave = new javax.swing.JButton(); lblSettings = new javax.swing.JLabel(); + btnCustomOptions = new javax.swing.JButton(); + lblRange = new javax.swing.JLabel(); + cbRange = new javax.swing.JComboBox(); + lblAttack = new javax.swing.JLabel(); + cbAttackOption = new javax.swing.JComboBox(); menuSaveSettings1.setText("Save to config 1"); menuSaveSettings1.addActionListener(new java.awt.event.ActionListener() { @@ -209,16 +208,9 @@ public class NewTableDialog extends MageDialog { chkRollbackTurnsAllowed.setText("Rollbacks"); chkRollbackTurnsAllowed.setToolTipText("Allow to rollback to the start of previous turns
\nif all players agree.\n"); - lblFreeMulligans.setLabelFor(spnFreeMulligans); - lblFreeMulligans.setText("Free Mulligans:"); - lblFreeMulligans.setToolTipText("The number of mulligans a player can use without decreasing the number of drawn cards."); - chkSpectatorsAllowed.setText("Spectators allowed"); chkSpectatorsAllowed.setToolTipText("Allow spectators to view your game."); - chkPlaneChase.setText("PlaneChase"); - chkPlaneChase.setToolTipText("Use the PlaneChase variant for your game."); - lblNumPlayers.setLabelFor(spnNumPlayers); lblNumPlayers.setText("Players:"); @@ -228,17 +220,6 @@ public class NewTableDialog extends MageDialog { } }); - lblRange.setLabelFor(cbRange); - lblRange.setText("Range of Influence:"); - - cbRange.setToolTipText("An option for multiplayer games.\nA player's range of influence is the maximum distance from that player, measured in player seats,
\nthat the player can affect. Players within that many seats of the player are within that player's range
\nof influence. Objects controlled by players within a player's range of influence are also within that
\nplayer's range of influence. Range of influence covers spells, abilities, effects, damage dealing, attacking,\nmaking choices, and winning the game."); - - lblAttack.setLabelFor(cbAttackOption); - lblAttack.setText("Attack Option:"); - - cbAttackOption.setToolTipText("An option for multiplayer games that defines
\nwhich opponents can be attacked from a player."); - - lblSkillLevel.setLabelFor(cbAttackOption); lblSkillLevel.setText("Skill Level:"); lblSkillLevel.setToolTipText(""); @@ -274,12 +255,6 @@ public class NewTableDialog extends MageDialog { lblEdhPowerLevel.setText("EDH power level:"); - cbMulligan.setToolTipText("Selections the type of mulligan for games."); - - lblMullgian.setLabelFor(cbMulligan); - lblMullgian.setText("Mulligan type:"); - lblMullgian.setToolTipText("What style of mulligan?"); - lblMinimumRating.setLabelFor(spnMinimumRating); lblMinimumRating.setText("Minimum rating:"); lblMinimumRating.setToolTipText("Players with rating less than this value can't join this table"); @@ -305,6 +280,21 @@ public class NewTableDialog extends MageDialog { lblSettings.setText("Settings"); + btnCustomOptions.setText("Custom Options..."); + btnCustomOptions.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnCustomOptionsActionPerformed(evt); + } + }); + + lblRange.setText("Range of Influence:"); + + cbRange.setToolTipText("An option for multiplayer games.\nA player's range of influence is the maximum distance from that player, measured in player seats,
\nthat the player can affect. Players within that many seats of the player are within that player's range
\nof influence. Objects controlled by players within a player's range of influence are also within that
\nplayer's range of influence. Range of influence covers spells, abilities, effects, damage dealing, attacking,\nmaking choices, and winning the game."); + + lblAttack.setText("Attack Option:"); + + cbAttackOption.setToolTipText("An option for multiplayer games that defines
\nwhich opponents can be attacked from a player."); + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( @@ -323,113 +313,108 @@ public class NewTableDialog extends MageDialog { .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnCancel, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jSeparator2) - .addComponent(player1Panel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 863, Short.MAX_VALUE) + .addComponent(player1Panel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(pnlOtherPlayers, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(lblName) - .addComponent(lbDeckType) - .addComponent(lblGameType)) - .addGap(6, 6, 6) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(lblName) + .addComponent(lbDeckType) + .addComponent(lblGameType)) + .addGap(6, 6, 6) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(txtName, javax.swing.GroupLayout.PREFERRED_SIZE, 178, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lbTimeLimit) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(cbTimeLimit, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lbBufferTime) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(cbBufferTime, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblNumWins) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(spnNumWins, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(8, 8, 8) + .addComponent(chkRollbackTurnsAllowed) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(chkSpectatorsAllowed)) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(cbDeckType, 0, 255, Short.MAX_VALUE) + .addComponent(cbGameType, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() - .addComponent(txtName, javax.swing.GroupLayout.PREFERRED_SIZE, 178, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(btnCustomOptions) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(lbTimeLimit) + .addComponent(lblSkillLevel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(cbTimeLimit, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(lbBufferTime) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(cbBufferTime, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(cbSkillLevel, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(lblPassword) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(txtPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(chkSpectatorsAllowed)) + .addComponent(txtPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) - .addComponent(cbDeckType, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(cbGameType, 0, 270, Short.MAX_VALUE)) + .addComponent(chkRated) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(chkRollbackTurnsAllowed) - .addGroup(layout.createSequentialGroup() - .addComponent(chkRated) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(lblMinimumRating) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(spnMinimumRating, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(lblQuitRatio) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(spnQuitRatio, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(lblEdhPowerLevel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(spnEdhPowerLevel, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)))))) + .addComponent(lblMinimumRating) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(spnMinimumRating, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblQuitRatio) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(spnQuitRatio, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblEdhPowerLevel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(spnEdhPowerLevel, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, Short.MAX_VALUE)))))) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(lblNumPlayers) - .addComponent(spnNumPlayers, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(lblNumPlayers) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(lblRange) - .addComponent(cbRange, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(8, 8, 8) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(cbAttackOption, javax.swing.GroupLayout.PREFERRED_SIZE, 177, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(lblAttack)) + .addComponent(spnNumPlayers, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(cbSkillLevel, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(lblSkillLevel)) - .addGap(4, 4, 4) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(spnNumWins, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(lblNumWins)) + .addComponent(lblRange) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(lblMullgian) - .addComponent(cbMulligan, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(cbRange, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addComponent(spnFreeMulligans, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(chkPlaneChase)) - .addComponent(lblFreeMulligans)))) + .addComponent(lblAttack) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(cbAttackOption, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap()) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() - .addComponent(jSeparator3, javax.swing.GroupLayout.DEFAULT_SIZE, 863, Short.MAX_VALUE) + .addComponent(jSeparator3, javax.swing.GroupLayout.DEFAULT_SIZE, 933, Short.MAX_VALUE) .addContainerGap())) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() - .addGap(3, 3, 3) + .addGap(2, 2, 2) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(txtName) .addComponent(lblName)) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lbBufferTime) + .addComponent(cbBufferTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblNumWins) + .addComponent(spnNumWins, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(chkRollbackTurnsAllowed) + .addComponent(chkSpectatorsAllowed)) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cbTimeLimit) - .addComponent(lbTimeLimit) - .addComponent(lblPassword) - .addComponent(txtPassword) - .addComponent(chkSpectatorsAllowed) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(lbBufferTime) - .addComponent(cbBufferTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addComponent(lbTimeLimit))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cbDeckType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) @@ -442,43 +427,28 @@ public class NewTableDialog extends MageDialog { .addComponent(spnMinimumRating, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(chkRated)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(cbGameType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(lblGameType) - .addComponent(chkRollbackTurnsAllowed)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addGroup(layout.createSequentialGroup() - .addComponent(lblRange) - .addGap(0, 0, 0) - .addComponent(cbRange, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(layout.createSequentialGroup() - .addComponent(lblNumPlayers) - .addGap(0, 0, 0) - .addComponent(spnNumPlayers, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(layout.createSequentialGroup() - .addComponent(lblAttack) - .addGap(0, 0, 0) - .addComponent(cbAttackOption, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblPassword) + .addComponent(txtPassword) + .addComponent(cbSkillLevel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lblSkillLevel) - .addGap(0, 0, 0) - .addComponent(cbSkillLevel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(layout.createSequentialGroup() - .addComponent(lblNumWins) - .addGap(0, 0, 0) - .addComponent(spnNumWins, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(layout.createSequentialGroup() - .addComponent(lblMullgian) - .addGap(0, 0, 0) - .addComponent(cbMulligan, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(layout.createSequentialGroup() - .addComponent(lblFreeMulligans) - .addGap(0, 0, 0) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(spnFreeMulligans, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(chkPlaneChase)))) - .addGap(14, 14, 14) + .addComponent(btnCustomOptions)) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(cbGameType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblGameType))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(cbAttackOption, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblAttack)) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(cbRange, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblRange)) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblNumPlayers) + .addComponent(spnNumPlayers, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel1) @@ -487,7 +457,7 @@ public class NewTableDialog extends MageDialog { .addGap(16, 16, 16) .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(pnlOtherPlayers, javax.swing.GroupLayout.DEFAULT_SIZE, 98, Short.MAX_VALUE) + .addComponent(pnlOtherPlayers, javax.swing.GroupLayout.DEFAULT_SIZE, 131, Short.MAX_VALUE) .addGap(9, 9, 9) .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) @@ -505,8 +475,6 @@ public class NewTableDialog extends MageDialog { .addContainerGap(180, Short.MAX_VALUE))) ); - lblMullgian.getAccessibleContext().setAccessibleName("Mullgian"); - pack(); }// //GEN-END:initComponents @@ -609,6 +577,10 @@ public class NewTableDialog extends MageDialog { onLoadSettings(-1); }//GEN-LAST:event_menuLoadSettingsDefaultActionPerformed + private void btnCustomOptionsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCustomOptionsActionPerformed + customOptions.showDialog(); + }//GEN-LAST:event_btnCustomOptionsActionPerformed + private MatchOptions getMatchOptions() { // current settings GameTypeView gameType = (GameTypeView) cbGameType.getSelectedItem(); @@ -626,14 +598,11 @@ public class NewTableDialog extends MageDialog { options.setWinsNeeded((Integer) this.spnNumWins.getValue()); options.setRollbackTurnsAllowed(chkRollbackTurnsAllowed.isSelected()); options.setSpectatorsAllowed(chkSpectatorsAllowed.isSelected()); - options.setPlaneChase(chkPlaneChase.isSelected()); options.setRated(chkRated.isSelected()); - options.setFreeMulligans((Integer) this.spnFreeMulligans.getValue()); options.setPassword(this.txtPassword.getText()); options.setQuitRatio((Integer) this.spnQuitRatio.getValue()); options.setMinimumRating((Integer) this.spnMinimumRating.getValue()); options.setEdhPowerLevel((Integer) this.spnEdhPowerLevel.getValue()); - options.setMullgianType((MulliganType) this.cbMulligan.getSelectedItem()); String serverAddress = SessionHandler.getSession().getServerHostname().orElse(""); options.setBannedUsers(IgnoreList.getIgnoredUsers(serverAddress)); options.setLimited(options.getDeckType().startsWith("Limited")); @@ -641,6 +610,8 @@ public class NewTableDialog extends MageDialog { options.setLimited(true); // limited-style sideboarding with unlimited basics enabled for Freeform Unlimited Commander } + customOptions.writeMatchOptionsTo(options); + return options; } @@ -765,6 +736,19 @@ public class NewTableDialog extends MageDialog { } this.cbAttackOption.setEnabled(gameType.isUseAttackOption()); this.cbRange.setEnabled(gameType.isUseRange()); + // hide multiplayer options row if none are editable, otherwise show it + JComponent[] multiplayerOptions = { + lblNumPlayers, + spnNumPlayers, + lblRange, + cbRange, + lblAttack, + cbAttackOption, + }; + boolean showMultiplayerOptions = Arrays.stream(multiplayerOptions).anyMatch(c -> !(c instanceof JLabel) && c.isEnabled()); + for (JComponent component : multiplayerOptions) { + component.setVisible(showMultiplayerOptions); + } createPlayers((Integer) spnNumPlayers.getValue() - 1); } @@ -821,7 +805,6 @@ public class NewTableDialog extends MageDialog { cbRange.setModel(new DefaultComboBoxModel(RangeOfInfluence.values())); cbAttackOption.setModel(new DefaultComboBoxModel(MultiplayerAttackOption.values())); cbSkillLevel.setModel(new DefaultComboBoxModel(SkillLevel.values())); - cbMulligan.setModel(new DefaultComboBoxModel(MulliganType.values())); // Update the existing player panels (neccessary if server was changes = new session) int i = 2; for (TablePlayerPanel tablePlayerPanel : players) { @@ -914,10 +897,7 @@ public class NewTableDialog extends MageDialog { this.spnNumWins.setValue(Integer.parseInt(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_NUMBER_OF_WINS + versionStr, "2"))); this.chkRollbackTurnsAllowed.setSelected(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_ROLLBACK_TURNS_ALLOWED + versionStr, "Yes").equals("Yes")); this.chkSpectatorsAllowed.setSelected(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_SPECTATORS_ALLOWED + versionStr, "Yes").equals("Yes")); - this.chkPlaneChase.setSelected(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_PLANECHASE + versionStr, "No").equals("Yes")); this.chkRated.setSelected(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_RATED + versionStr, "No").equals("Yes")); - this.spnFreeMulligans.setValue(Integer.parseInt(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_NUMBER_OF_FREE_MULLIGANS + versionStr, "0"))); - this.cbMulligan.setSelectedItem(MulliganType.valueByName(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_MULLIGAN_TYPE + versionStr, MulliganType.GAME_DEFAULT.toString()))); int range = Integer.parseInt(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_RANGE + versionStr, "0")); for (RangeOfInfluence roi : RangeOfInfluence.values()) { @@ -944,6 +924,8 @@ public class NewTableDialog extends MageDialog { this.spnQuitRatio.setValue(Integer.parseInt(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_QUIT_RATIO + versionStr, "100"))); this.spnMinimumRating.setValue(Integer.parseInt(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_MINIMUM_RATING + versionStr, "0"))); this.spnEdhPowerLevel.setValue(Integer.parseInt(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_EDH_POWER_LEVEL + versionStr, "0"))); + + this.customOptions.onLoadSettings(version); } private void onSaveSettings(int version) { @@ -975,15 +957,10 @@ public class NewTableDialog extends MageDialog { PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_NUMBER_OF_WINS + versionStr, Integer.toString(options.getWinsNeeded())); PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_ROLLBACK_TURNS_ALLOWED + versionStr, options.isRollbackTurnsAllowed() ? "Yes" : "No"); PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_RATED + versionStr, options.isRated() ? "Yes" : "No"); - PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_NUMBER_OF_FREE_MULLIGANS + versionStr, Integer.toString(options.getFreeMulligans())); - PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_MULLIGAN_TYPE + versionStr, options.getMulliganType().toString()); PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_DECK_FILE + versionStr, deckFile); PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_NUMBER_PLAYERS + versionStr, spnNumPlayers.getValue().toString()); - PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_RANGE + versionStr, Integer.toString(options.getRange().getRange())); - PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_ATTACK_OPTION + versionStr, options.getAttackOption().toString()); PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_SKILL_LEVEL + versionStr, options.getSkillLevel().toString()); PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_SPECTATORS_ALLOWED + versionStr, options.isSpectatorsAllowed() ? "Yes" : "No"); - PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_PLANECHASE + versionStr, options.isPlaneChase() ? "Yes" : "No"); PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_QUIT_RATIO + versionStr, Integer.toString(options.getQuitRatio())); PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_MINIMUM_RATING + versionStr, Integer.toString(options.getMinimumRating())); PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_EDH_POWER_LEVEL + versionStr, Integer.toString(options.getEdhPowerLevel())); @@ -997,10 +974,13 @@ public class NewTableDialog extends MageDialog { playerTypesString.append(tpp.getPlayerType()); } PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_PLAYER_TYPES + versionStr, playerTypesString.toString()); + + customOptions.onSaveSettings(version, options); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnCancel; + private javax.swing.JButton btnCustomOptions; private javax.swing.JButton btnOK; private javax.swing.JButton btnSettingsLoad; private javax.swing.JButton btnSettingsSave; @@ -1008,11 +988,9 @@ public class NewTableDialog extends MageDialog { private javax.swing.JComboBox cbBufferTime; private javax.swing.JComboBox cbDeckType; private javax.swing.JComboBox cbGameType; - private javax.swing.JComboBox cbMulligan; private javax.swing.JComboBox cbRange; private javax.swing.JComboBox cbSkillLevel; private javax.swing.JComboBox cbTimeLimit; - private javax.swing.JCheckBox chkPlaneChase; private javax.swing.JCheckBox chkRated; private javax.swing.JCheckBox chkRollbackTurnsAllowed; private javax.swing.JCheckBox chkSpectatorsAllowed; @@ -1026,10 +1004,8 @@ public class NewTableDialog extends MageDialog { private javax.swing.JLabel lbTimeLimit; private javax.swing.JLabel lblAttack; private javax.swing.JLabel lblEdhPowerLevel; - private javax.swing.JLabel lblFreeMulligans; private javax.swing.JLabel lblGameType; private javax.swing.JLabel lblMinimumRating; - private javax.swing.JLabel lblMullgian; private javax.swing.JLabel lblName; private javax.swing.JLabel lblNumPlayers; private javax.swing.JLabel lblNumWins; @@ -1051,7 +1027,6 @@ public class NewTableDialog extends MageDialog { private javax.swing.JPopupMenu.Separator separator1; private javax.swing.JPopupMenu.Separator separator2; private javax.swing.JSpinner spnEdhPowerLevel; - private javax.swing.JSpinner spnFreeMulligans; private javax.swing.JSpinner spnMinimumRating; private javax.swing.JSpinner spnNumPlayers; private javax.swing.JSpinner spnNumWins; diff --git a/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.form b/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.form index 89aa6ae5a7b..3f5a8f0d304 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.form +++ b/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.form @@ -96,7 +96,7 @@ - + @@ -129,14 +129,9 @@ - - - - - + - @@ -151,13 +146,56 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -166,84 +204,33 @@ - + - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
- + + + + + + + @@ -252,20 +239,20 @@ - - - - - + + + - - + + + + @@ -274,20 +261,17 @@ - - - - - - - - - - - - - + + + + + + + + + + @@ -298,26 +282,15 @@ - - - - - - - - - - - - + - + @@ -339,7 +312,6 @@ - @@ -393,17 +365,11 @@ - - - - - - @@ -466,19 +432,6 @@ - - - - - - - - - - - - - @@ -624,12 +577,6 @@ - - - - - - @@ -671,7 +618,7 @@ - + @@ -750,26 +697,6 @@
- - - - - - - - - - - - - - - - - - - - @@ -793,5 +720,13 @@ + + + + + + + + diff --git a/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java b/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java index a3dc406722a..87ca1abc7ae 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java @@ -18,15 +18,10 @@ import mage.client.SessionHandler; import mage.client.table.TournamentPlayerPanel; import mage.client.util.IgnoreList; import mage.client.util.gui.FastSearchUtil; -import mage.constants.MatchBufferTime; -import mage.constants.MatchTimeLimit; -import mage.constants.MultiplayerAttackOption; -import mage.constants.RangeOfInfluence; -import mage.constants.SkillLevel; +import mage.constants.*; import mage.game.GameException; import mage.game.draft.DraftOptions; import mage.game.draft.DraftOptions.TimingOption; -import mage.game.mulligan.MulliganType; import mage.game.tournament.LimitedOptions; import mage.game.tournament.TournamentOptions; import mage.players.PlayerType; @@ -49,6 +44,7 @@ public class NewTournamentDialog extends MageDialog { private UUID roomId; private String lastSessionId; private RandomPacksSelectorDialog randomPackSelector; + private CustomOptionsDialog customOptions; private JTextArea txtRandomPacks; private final java.util.List players = new ArrayList<>(); private final java.util.List packPanels = new ArrayList<>(); @@ -63,11 +59,11 @@ public class NewTournamentDialog extends MageDialog { public NewTournamentDialog() { initComponents(); + this.customOptions = new CustomOptionsDialog(CustomOptionsDialog.SaveLoadKeys.TOURNEY, btnCustomOptions); + MageFrame.getDesktop().add(customOptions, JLayeredPane.MODAL_LAYER); lastSessionId = ""; txtName.setText("Tournament"); this.spnNumWins.setModel(new SpinnerNumberModel(2, 1, 5, 1)); - this.spnFreeMulligans.setModel(new SpinnerNumberModel(0, 0, 5, 1)); - this.cbMulligan.setModel(new DefaultComboBoxModel(MulliganType.values())); this.spnConstructTime.setModel(new SpinnerNumberModel(10, CONSTRUCTION_TIME_MIN, CONSTRUCTION_TIME_MAX, 2)); this.spnNumRounds.setModel(new SpinnerNumberModel(2, 2, 10, 1)); this.spnQuitRatio.setModel(new SpinnerNumberModel(100, 0, 100, 5)); @@ -99,7 +95,6 @@ public class NewTournamentDialog extends MageDialog { tournamentPlayerPanel.init(i++); } cbAllowSpectators.setSelected(true); - cbPlaneChase.setSelected(false); this.setModal(true); this.setLocation(150, 100); } @@ -145,8 +140,6 @@ public class NewTournamentDialog extends MageDialog { cbDeckType = new javax.swing.JComboBox(); lblGameType = new javax.swing.JLabel(); cbGameType = new javax.swing.JComboBox(); - lblFreeMulligans = new javax.swing.JLabel(); - spnFreeMulligans = new javax.swing.JSpinner(); lblNumWins = new javax.swing.JLabel(); spnNumWins = new javax.swing.JSpinner(); lblDraftCube = new javax.swing.JLabel(); @@ -163,7 +156,6 @@ public class NewTournamentDialog extends MageDialog { jLabel6 = new javax.swing.JLabel(); cbDraftTiming = new javax.swing.JComboBox(); cbAllowSpectators = new javax.swing.JCheckBox(); - cbPlaneChase = new javax.swing.JCheckBox(); lblPlayer1 = new javax.swing.JLabel(); lblConstructionTime = new javax.swing.JLabel(); chkRollbackTurnsAllowed = new javax.swing.JCheckBox(); @@ -179,11 +171,10 @@ public class NewTournamentDialog extends MageDialog { lblMinimumRating = new javax.swing.JLabel(); spnMinimumRating = new javax.swing.JSpinner(); chkRated = new javax.swing.JCheckBox(); - lblMullgian = new javax.swing.JLabel(); - cbMulligan = new javax.swing.JComboBox<>(); btnSettingsSave = new javax.swing.JButton(); btnSettingsLoad = new javax.swing.JButton(); lblSettings = new javax.swing.JLabel(); + btnCustomOptions = new javax.swing.JButton(); menuSaveSettings1.setText("Save to config 1"); menuSaveSettings1.addActionListener(new java.awt.event.ActionListener() { @@ -287,11 +278,6 @@ public class NewTournamentDialog extends MageDialog { } }); - lblFreeMulligans.setLabelFor(spnFreeMulligans); - lblFreeMulligans.setText("Free Mulligans:"); - - spnFreeMulligans.setToolTipText("Players can take this number of free mulligans (their hand size will not be reduced)."); - lblNumWins.setText("Wins:"); spnNumWins.setToolTipText("To win a match a player has to win this number of games."); @@ -374,9 +360,6 @@ public class NewTournamentDialog extends MageDialog { cbAllowSpectators.setText("Allow spectators"); cbAllowSpectators.setToolTipText("Allow other players to watch the games of this table."); - cbPlaneChase.setText("PlaneChase"); - cbPlaneChase.setToolTipText("Use Plane Chase for the tournament."); - lblPlayer1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N lblPlayer1.setText("Player 1 (You)"); @@ -400,7 +383,7 @@ public class NewTournamentDialog extends MageDialog { ); pnlPlayersLayout.setVerticalGroup( pnlPlayersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(pnlOtherPlayers, javax.swing.GroupLayout.DEFAULT_SIZE, 9, Short.MAX_VALUE) + .addComponent(pnlOtherPlayers, javax.swing.GroupLayout.DEFAULT_SIZE, 8, Short.MAX_VALUE) ); btnOk.setText("Create"); @@ -437,11 +420,6 @@ public class NewTournamentDialog extends MageDialog { chkRated.setText("Rated game"); chkRated.setToolTipText("Indicates if matches will be rated"); - lblMullgian.setText("Mulligan type:"); - lblMullgian.setToolTipText("What style of mulligan?"); - - cbMulligan.setToolTipText("Selections the type of mulligan for games."); - btnSettingsSave.setText("Save..."); btnSettingsSave.setToolTipText("Save settings"); btnSettingsSave.addMouseListener(new java.awt.event.MouseAdapter() { @@ -460,6 +438,13 @@ public class NewTournamentDialog extends MageDialog { lblSettings.setText("Settings"); + btnCustomOptions.setText("Custom Options..."); + btnCustomOptions.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnCustomOptionsActionPerformed(evt); + } + }); + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( @@ -492,12 +477,8 @@ public class NewTournamentDialog extends MageDialog { .addComponent(lblConstructionTime))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addComponent(spnConstructTime, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(chkRollbackTurnsAllowed)) - .addComponent(spnNumRounds, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(95, 95, 95)) + .addComponent(spnConstructTime, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(spnNumRounds, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(lblSettings) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) @@ -510,13 +491,49 @@ public class NewTournamentDialog extends MageDialog { .addComponent(btnCancel, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(player1Panel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(pnlRandomPacks, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(layout.createSequentialGroup() + .addComponent(lblTournamentType) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(cbTournamentType, javax.swing.GroupLayout.PREFERRED_SIZE, 290, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(lblDraftCube) + .addComponent(lbDeckType) + .addComponent(lblGameType)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(cbDraftCube, javax.swing.GroupLayout.PREFERRED_SIZE, 290, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(cbDeckType, javax.swing.GroupLayout.PREFERRED_SIZE, 290, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(cbGameType, javax.swing.GroupLayout.PREFERRED_SIZE, 290, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(lblName) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(txtName, javax.swing.GroupLayout.PREFERRED_SIZE, 224, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtName, javax.swing.GroupLayout.PREFERRED_SIZE, 224, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addComponent(chkRated) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblMinimumRating) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(spnMinimumRating, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(lblQuitRatio) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(spnQuitRatio, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lbSkillLevel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(cbSkillLevel, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblPassword) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtPassword, javax.swing.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(btnCustomOptions)) + .addGroup(layout.createSequentialGroup() .addComponent(lbTimeLimit) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(cbTimeLimit, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE) @@ -525,64 +542,25 @@ public class NewTournamentDialog extends MageDialog { .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(cbBufferTime, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(lblPassword) + .addComponent(lblNumWins) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(txtPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(spnNumWins, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(cbAllowSpectators)) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(lblDraftCube) - .addComponent(lblTournamentType) - .addComponent(lbDeckType) - .addComponent(lblGameType)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(cbDraftCube, javax.swing.GroupLayout.PREFERRED_SIZE, 290, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(cbDeckType, javax.swing.GroupLayout.PREFERRED_SIZE, 290, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(cbGameType, javax.swing.GroupLayout.PREFERRED_SIZE, 290, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(cbTournamentType, javax.swing.GroupLayout.PREFERRED_SIZE, 290, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() - .addComponent(chkRated) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(lblMinimumRating) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(spnMinimumRating, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(lblNumWins) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(spnNumWins, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addComponent(chkRollbackTurnsAllowed) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(lblMullgian) - .addComponent(cbMulligan, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(lblFreeMulligans, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(spnFreeMulligans, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(cbPlaneChase)) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) - .addGroup(layout.createSequentialGroup() - .addComponent(lblQuitRatio) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(spnQuitRatio)) - .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() - .addComponent(lbSkillLevel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(cbSkillLevel, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)))))) - .addGap(0, 0, Short.MAX_VALUE))) - .addContainerGap()) + .addComponent(cbAllowSpectators))))) + .addGap(5, 5, 5)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() - .addGap(3, 3, 3) + .addGap(2, 2, 2) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblNumWins) + .addComponent(spnNumWins, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(chkRollbackTurnsAllowed) + .addComponent(cbAllowSpectators, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lbBufferTime) .addComponent(cbBufferTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) @@ -590,58 +568,47 @@ public class NewTournamentDialog extends MageDialog { .addComponent(txtName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lblName) .addComponent(lbTimeLimit) - .addComponent(cbTimeLimit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(lblPassword) - .addComponent(txtPassword, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(cbAllowSpectators, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) + .addComponent(cbTimeLimit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(lblQuitRatio) - .addComponent(spnQuitRatio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(lblPassword) + .addComponent(txtPassword, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnCustomOptions)) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(lblNumWins) - .addComponent(spnNumWins, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(lblQuitRatio) + .addComponent(spnQuitRatio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lbSkillLevel) + .addComponent(cbSkillLevel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(chkRated) .addComponent(lblMinimumRating) .addComponent(spnMinimumRating, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(cbTournamentType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(lblTournamentType) - .addComponent(lbSkillLevel) - .addComponent(cbSkillLevel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(cbDraftCube, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(lblDraftCube)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(cbTournamentType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblTournamentType)) .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(cbDraftCube, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblDraftCube)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cbDeckType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lbDeckType)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lblGameType) - .addComponent(cbGameType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(lblMullgian) - .addComponent(lblFreeMulligans)) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(cbMulligan, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(spnFreeMulligans, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(cbPlaneChase, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(cbGameType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addGap(0, 0, 0) .addComponent(lblPacks) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createSequentialGroup() .addComponent(pnlPacks, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(pnlRandomPacks, javax.swing.GroupLayout.DEFAULT_SIZE, 14, Short.MAX_VALUE) + .addComponent(pnlRandomPacks, javax.swing.GroupLayout.DEFAULT_SIZE, 9, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) @@ -658,8 +625,7 @@ public class NewTournamentDialog extends MageDialog { .addComponent(lblPlayer1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(spnConstructTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(lblConstructionTime) - .addComponent(chkRollbackTurnsAllowed))) + .addComponent(lblConstructionTime))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(player1Panel, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) @@ -676,9 +642,6 @@ public class NewTournamentDialog extends MageDialog { .addContainerGap()) ); - lbBufferTime.getAccessibleContext().setAccessibleDescription("The extra time a player gets whenever the timer starts before their normal time limit starts going down."); - cbBufferTime.getAccessibleContext().setAccessibleDescription("The extra time a player gets whenever the timer starts before their normal time limit starts going down."); - bindingGroup.bind(); pack(); @@ -903,6 +866,10 @@ public class NewTournamentDialog extends MageDialog { popupLoadSettings.show(evt.getComponent(), evt.getX(), evt.getY()); }//GEN-LAST:event_btnSettingsLoadMouseClicked + private void btnCustomOptionsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCustomOptionsActionPerformed + customOptions.showDialog(); + }//GEN-LAST:event_btnCustomOptionsActionPerformed + private void setGameOptions() { GameTypeView gameType = (GameTypeView) cbGameType.getSelectedItem(); // int oldValue = (Integer) this.spnNumPlayers.getValue(); @@ -1251,7 +1218,6 @@ public class NewTournamentDialog extends MageDialog { tOptions.setPassword(txtPassword.getText()); tOptions.getPlayerTypes().add(PlayerType.HUMAN); tOptions.setWatchingAllowed(cbAllowSpectators.isSelected()); - tOptions.setPlaneChase(cbPlaneChase.isSelected()); tOptions.setQuitRatio((Integer) spnQuitRatio.getValue()); tOptions.setMinimumRating((Integer) spnMinimumRating.getValue()); for (TournamentPlayerPanel player : players) { @@ -1363,12 +1329,11 @@ public class NewTournamentDialog extends MageDialog { tOptions.getMatchOptions().setMatchBufferTime((MatchBufferTime) this.cbBufferTime.getSelectedItem()); tOptions.getMatchOptions().setSkillLevel((SkillLevel) this.cbSkillLevel.getSelectedItem()); tOptions.getMatchOptions().setWinsNeeded((Integer) this.spnNumWins.getValue()); - tOptions.getMatchOptions().setFreeMulligans((Integer) this.spnFreeMulligans.getValue()); - tOptions.getMatchOptions().setMullgianType((MulliganType) this.cbMulligan.getSelectedItem()); tOptions.getMatchOptions().setAttackOption(MultiplayerAttackOption.LEFT); tOptions.getMatchOptions().setRange(RangeOfInfluence.ALL); tOptions.getMatchOptions().setRollbackTurnsAllowed(this.chkRollbackTurnsAllowed.isSelected()); tOptions.getMatchOptions().setRated(this.chkRated.isSelected()); + customOptions.writeMatchOptionsTo(tOptions.getMatchOptions()); return tOptions; } @@ -1412,8 +1377,6 @@ public class NewTournamentDialog extends MageDialog { break; } } - this.spnFreeMulligans.setValue(Integer.parseInt(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TOURNAMENT_NUMBER_OF_FREE_MULLIGANS + versionStr, "0"))); - this.cbMulligan.setSelectedItem(MulliganType.valueByName(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TOURNAMENT_MULLIGUN_TYPE + versionStr, MulliganType.GAME_DEFAULT.toString()))); this.spnNumWins.setValue(Integer.parseInt(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TOURNAMENT_NUMBER_OF_WINS + versionStr, "2"))); this.spnQuitRatio.setValue(Integer.parseInt(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TOURNAMENT_QUIT_RATIO + versionStr, "100"))); this.spnMinimumRating.setValue(Integer.parseInt(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TOURNAMENT_MINIMUM_RATING + versionStr, "0"))); @@ -1446,9 +1409,10 @@ public class NewTournamentDialog extends MageDialog { } } this.cbAllowSpectators.setSelected(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TOURNAMENT_ALLOW_SPECTATORS + versionStr, "Yes").equals("Yes")); - this.cbPlaneChase.setSelected(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TOURNAMENT_PLANE_CHASE + versionStr, "No").equals("Yes")); this.chkRollbackTurnsAllowed.setSelected(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TOURNAMENT_ALLOW_ROLLBACKS + versionStr, "Yes").equals("Yes")); this.chkRated.setSelected(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TOURNAMENT_RATED + versionStr, "No").equals("Yes")); + + this.customOptions.onLoadSettings(version); } private void onSaveSettings(int version) { @@ -1466,8 +1430,6 @@ public class NewTournamentDialog extends MageDialog { PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TOURNAMENT_CONSTR_TIME + versionStr, Integer.toString(tOptions.getLimitedOptions().getConstructionTime())); } PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TOURNAMENT_TYPE + versionStr, tOptions.getTournamentType()); - PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TOURNAMENT_NUMBER_OF_FREE_MULLIGANS + versionStr, Integer.toString(tOptions.getMatchOptions().getFreeMulligans())); - PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TOURNAMENT_MULLIGUN_TYPE + versionStr, tOptions.getMatchOptions().getMulliganType().toString()); PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TOURNAMENT_NUMBER_OF_WINS + versionStr, Integer.toString(tOptions.getMatchOptions().getWinsNeeded())); PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TOURNAMENT_QUIT_RATIO + versionStr, Integer.toString(tOptions.getQuitRatio())); PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TOURNAMENT_MINIMUM_RATING + versionStr, Integer.toString(tOptions.getMinimumRating())); @@ -1493,9 +1455,9 @@ public class NewTournamentDialog extends MageDialog { } } PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TOURNAMENT_ALLOW_SPECTATORS + versionStr, (tOptions.isWatchingAllowed() ? "Yes" : "No")); - PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TOURNAMENT_PLANE_CHASE + versionStr, (tOptions.isPlaneChase() ? "Yes" : "No")); PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TOURNAMENT_ALLOW_ROLLBACKS + versionStr, (tOptions.getMatchOptions().isRollbackTurnsAllowed() ? "Yes" : "No")); PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TOURNAMENT_RATED + versionStr, (tOptions.getMatchOptions().isRated() ? "Yes" : "No")); + customOptions.onSaveSettings(version, tOptions.getMatchOptions()); } public TableView getTable() { @@ -1504,6 +1466,7 @@ public class NewTournamentDialog extends MageDialog { // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnCancel; + private javax.swing.JButton btnCustomOptions; private javax.swing.JButton btnOk; private javax.swing.JButton btnSettingsLoad; private javax.swing.JButton btnSettingsSave; @@ -1513,8 +1476,6 @@ public class NewTournamentDialog extends MageDialog { private javax.swing.JComboBox cbDraftCube; private javax.swing.JComboBox cbDraftTiming; private javax.swing.JComboBox cbGameType; - private javax.swing.JComboBox cbMulligan; - private javax.swing.JCheckBox cbPlaneChase; private javax.swing.JComboBox cbSkillLevel; private javax.swing.JComboBox cbTimeLimit; private javax.swing.JComboBox cbTournamentType; @@ -1527,10 +1488,8 @@ public class NewTournamentDialog extends MageDialog { private javax.swing.JLabel lbTimeLimit; private javax.swing.JLabel lblConstructionTime; private javax.swing.JLabel lblDraftCube; - private javax.swing.JLabel lblFreeMulligans; private javax.swing.JLabel lblGameType; private javax.swing.JLabel lblMinimumRating; - private javax.swing.JLabel lblMullgian; private javax.swing.JLabel lblName; private javax.swing.JLabel lblNbrPlayers; private javax.swing.JLabel lblNbrSeats; @@ -1559,7 +1518,6 @@ public class NewTournamentDialog extends MageDialog { private javax.swing.JPopupMenu.Separator separator1; private javax.swing.JPopupMenu.Separator separator2; private javax.swing.JSpinner spnConstructTime; - private javax.swing.JSpinner spnFreeMulligans; private javax.swing.JSpinner spnMinimumRating; private javax.swing.JSpinner spnNumPlayers; private javax.swing.JSpinner spnNumRounds;