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 d8e89ec4be..20d3cfa718 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/NewTableDialog.form +++ b/Mage.Client/src/main/java/mage/client/dialog/NewTableDialog.form @@ -37,7 +37,7 @@ <Component id="cbGameType" min="-2" pref="398" max="-2" attributes="1"/> <EmptySpace type="separate" max="-2" attributes="0"/> <Component id="lblFreeMulligans" min="-2" max="-2" attributes="0"/> - <EmptySpace pref="12" max="32767" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> <Component id="spnFreeMulligans" min="-2" pref="50" max="-2" attributes="0"/> </Group> <Group type="102" alignment="0" attributes="0"> @@ -74,14 +74,22 @@ <EmptySpace min="-2" max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> <Component id="lblRange" min="-2" max="-2" attributes="1"/> - <Component id="cbRange" min="-2" pref="143" max="-2" attributes="1"/> + <Component id="cbRange" min="-2" pref="117" max="-2" attributes="1"/> </Group> - <EmptySpace min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="lblAttack" min="-2" max="-2" attributes="0"/> - <Component id="cbAttackOption" max="32767" attributes="0"/> + <Group type="102" attributes="0"> + <Component id="lblAttack" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="116" max="-2" attributes="0"/> + <Component id="lblSkillLevel" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Component id="cbAttackOption" min="-2" pref="177" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="cbSkillLevel" min="-2" pref="148" max="-2" attributes="0"/> + </Group> </Group> - <EmptySpace min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> <Component id="spnNumWins" min="-2" pref="50" max="-2" attributes="0"/> <Component id="lblNumWins" alignment="0" min="-2" max="-2" attributes="0"/> @@ -97,7 +105,7 @@ <Group type="103" rootIndex="1" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> - <Component id="jSeparator3" pref="642" max="32767" attributes="0"/> + <Component id="jSeparator3" pref="606" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/> </Group> </Group> @@ -131,29 +139,27 @@ <Component id="lblGameType" alignment="3" min="-2" max="-2" attributes="0"/> </Group> </Group> - <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="103" groupAlignment="1" attributes="0"> - <Group type="102" alignment="1" attributes="0"> - <Component id="lblNumPlayers" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="0" max="-2" attributes="0"/> - <Component id="spnNumPlayers" min="-2" max="-2" attributes="0"/> - </Group> - <Group type="102" attributes="0"> - <Component id="lblRange" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="0" max="-2" attributes="0"/> - <Component id="cbRange" min="-2" max="-2" attributes="0"/> - </Group> - <Group type="102" attributes="0"> - <Component id="lblAttack" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="0" max="-2" attributes="0"/> - <Component id="cbAttackOption" min="-2" max="-2" attributes="0"/> - </Group> - </Group> <Group type="102" attributes="0"> - <Component id="lblNumWins" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="6" max="-2" attributes="0"/> + <Component id="lblNumPlayers" min="-2" max="-2" attributes="0"/> <EmptySpace min="-2" pref="0" max="-2" attributes="0"/> - <Component id="spnNumWins" min="-2" max="-2" attributes="0"/> + <Component id="spnNumPlayers" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="lblRange" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblAttack" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblSkillLevel" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="lblNumWins" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="0" pref="0" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="cbRange" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="cbAttackOption" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="cbSkillLevel" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="spnNumWins" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> </Group> </Group> <EmptySpace max="-2" attributes="0"/> @@ -162,24 +168,24 @@ <Component id="jLabel1" min="-2" max="-2" attributes="0"/> <EmptySpace min="-2" pref="0" max="-2" attributes="0"/> <Component id="player1Panel" min="-2" max="-2" attributes="0"/> - <EmptySpace type="unrelated" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="16" max="-2" attributes="0"/> <Component id="jLabel2" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="pnlOtherPlayers" pref="244" max="32767" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> + <Component id="pnlOtherPlayers" pref="113" max="32767" attributes="0"/> + <EmptySpace pref="13" max="32767" attributes="0"/> <Component id="jSeparator1" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> <Component id="btnCancel" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="btnOK" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace max="-2" attributes="0"/> + <EmptySpace min="0" pref="0" max="-2" attributes="0"/> </Group> <Group type="103" rootIndex="1" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> <EmptySpace min="-2" pref="201" max="-2" attributes="0"/> <Component id="jSeparator3" min="-2" max="-2" attributes="0"/> - <EmptySpace pref="335" max="32767" attributes="0"/> + <EmptySpace pref="178" max="32767" attributes="0"/> </Group> </Group> </Group> @@ -265,6 +271,7 @@ <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> <StringArray count="0"/> </Property> + <Property name="toolTipText" type="java.lang.String" value="<HTML>An option for multiplayer games.
A player's range of influence is the maximum distance from that player, measured in player seats,<br>
that the player can affect. Players within that many seats of the player are within that player's range<br>
of influence. Objects controlled by players within a player's range of influence are also within that<br>
player's range of influence. Range of influence covers spells, abilities, effects, damage dealing, attacking,<nr>
making choices, and winning the game."/> </Properties> </Component> <Component class="javax.swing.JLabel" name="lblAttack"> @@ -280,6 +287,23 @@ <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> <StringArray count="0"/> </Property> + <Property name="toolTipText" type="java.lang.String" value="<HTML>An option for multiplayer games that defines<br>
which opponents can be attacked from a player."/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblSkillLevel"> + <Properties> + <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor"> + <ComponentRef name="cbAttackOption"/> + </Property> + <Property name="text" type="java.lang.String" value="Skill Level"/> + </Properties> + </Component> + <Component class="javax.swing.JComboBox" name="cbSkillLevel"> + <Properties> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="0"/> + </Property> + <Property name="toolTipText" type="java.lang.String" value="<HTML>This option can be used to make it easier to find matches<br>
with opponents of the appropriate skill level."/> </Properties> </Component> <Component class="javax.swing.JLabel" name="lblNumWins"> 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 98d2a9eb0a..be45b59639 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/NewTableDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/NewTableDialog.java @@ -46,6 +46,7 @@ import mage.client.util.Listener; import mage.constants.MatchTimeLimit; import mage.constants.MultiplayerAttackOption; import mage.constants.RangeOfInfluence; +import mage.constants.SkillLevel; import mage.game.match.MatchOptions; import mage.remote.Session; import mage.view.GameTypeView; @@ -108,6 +109,8 @@ public class NewTableDialog extends MageDialog { 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(); spnNumWins = new javax.swing.JSpinner(); jSeparator2 = new javax.swing.JSeparator(); @@ -156,9 +159,18 @@ public class NewTableDialog extends MageDialog { lblRange.setLabelFor(cbRange); lblRange.setText("Range of Influence"); + cbRange.setToolTipText("<HTML>An option for multiplayer games.\nA player's range of influence is the maximum distance from that player, measured in player seats,<br>\nthat the player can affect. Players within that many seats of the player are within that player's range<br>\nof influence. Objects controlled by players within a player's range of influence are also within that<br>\nplayer's range of influence. Range of influence covers spells, abilities, effects, damage dealing, attacking,<nr>\nmaking choices, and winning the game."); + lblAttack.setLabelFor(cbAttackOption); lblAttack.setText("Attack Option"); + cbAttackOption.setToolTipText("<HTML>An option for multiplayer games that defines<br>\nwhich opponents can be attacked from a player."); + + lblSkillLevel.setLabelFor(cbAttackOption); + lblSkillLevel.setText("Skill Level"); + + cbSkillLevel.setToolTipText("<HTML>This option can be used to make it easier to find matches<br>\nwith opponents of the appropriate skill level."); + lblNumWins.setLabelFor(spnNumWins); lblNumWins.setText("Wins"); lblNumWins.setToolTipText("How many games has a player to win to win the match."); @@ -209,7 +221,7 @@ public class NewTableDialog extends MageDialog { .addComponent(cbGameType, javax.swing.GroupLayout.PREFERRED_SIZE, 398, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(lblFreeMulligans) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(spnFreeMulligans, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) @@ -237,12 +249,18 @@ public class NewTableDialog extends MageDialog { .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(lblRange) - .addComponent(cbRange, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(cbRange, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(lblAttack) - .addComponent(cbAttackOption, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createSequentialGroup() + .addComponent(lblAttack) + .addGap(116, 116, 116) + .addComponent(lblSkillLevel)) + .addGroup(layout.createSequentialGroup() + .addComponent(cbAttackOption, javax.swing.GroupLayout.PREFERRED_SIZE, 177, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(cbSkillLevel, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(spnNumWins, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lblNumWins))) @@ -254,7 +272,7 @@ public class NewTableDialog extends MageDialog { .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() - .addComponent(jSeparator3, javax.swing.GroupLayout.DEFAULT_SIZE, 642, Short.MAX_VALUE) + .addComponent(jSeparator3, javax.swing.GroupLayout.DEFAULT_SIZE, 606, Short.MAX_VALUE) .addContainerGap())) ); layout.setVerticalGroup( @@ -280,47 +298,46 @@ public class NewTableDialog extends MageDialog { .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.TRAILING) - .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(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(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() - .addComponent(lblNumWins) + .addGap(6, 6, 6) + .addComponent(lblNumPlayers) .addGap(0, 0, 0) - .addComponent(spnNumWins, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addComponent(spnNumPlayers, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblRange) + .addComponent(lblAttack) + .addComponent(lblSkillLevel) + .addComponent(lblNumWins)) + .addGap(0, 0, 0) + .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(cbAttackOption, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(cbSkillLevel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(spnNumWins, 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) .addGap(0, 0, 0) .addComponent(player1Panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGap(16, 16, 16) .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(pnlOtherPlayers, javax.swing.GroupLayout.DEFAULT_SIZE, 244, Short.MAX_VALUE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(pnlOtherPlayers, javax.swing.GroupLayout.DEFAULT_SIZE, 113, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 13, Short.MAX_VALUE) .addComponent(jSeparator1, 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(btnCancel) .addComponent(btnOK)) - .addContainerGap()) + .addGap(0, 0, 0)) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(201, 201, 201) .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(335, Short.MAX_VALUE))) + .addContainerGap(178, Short.MAX_VALUE))) ); pack(); @@ -343,6 +360,7 @@ public class NewTableDialog extends MageDialog { options.setLimited(false); options.setMatchTimeLimit((MatchTimeLimit) this.cbTimeLimit.getSelectedItem()); options.setAttackOption((MultiplayerAttackOption) this.cbAttackOption.getSelectedItem()); + options.setSkillLevel((SkillLevel) this.cbSkillLevel.getSelectedItem()); options.setRange((RangeOfInfluence) this.cbRange.getSelectedItem()); options.setWinsNeeded((Integer)this.spnNumWins.getValue()); options.setFreeMulligans((Integer)this.spnFreeMulligans.getValue()); @@ -472,6 +490,7 @@ public class NewTableDialog extends MageDialog { cbTimeLimit.setModel(new DefaultComboBoxModel(MatchTimeLimit.values())); cbRange.setModel(new DefaultComboBoxModel(RangeOfInfluence.values())); cbAttackOption.setModel(new DefaultComboBoxModel(MultiplayerAttackOption.values())); + cbSkillLevel.setModel(new DefaultComboBoxModel(SkillLevel.values())); // Update the existing player panels (neccessary if server was changes = new session) int i=2; for (TablePlayerPanel tablePlayerPanel :players) { @@ -550,6 +569,13 @@ public class NewTableDialog extends MageDialog { break; } } + String skillLevelDefault = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_SKILL_LEVEL, "Casual"); + for (SkillLevel skillLevel :SkillLevel.values()) { + if (skillLevel.toString().equals(skillLevelDefault)) { + this.cbSkillLevel.setSelectedItem(skillLevel); + break; + } + } } /** @@ -569,6 +595,7 @@ public class NewTableDialog extends MageDialog { PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_NUMBER_PLAYERS, spnNumPlayers.getValue().toString()); PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_RANGE, Integer.toString(options.getRange().getRange())); PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_ATTACK_OPTION, options.getAttackOption().toString()); + PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_SKILL_LEVEL, options.getSkillLevel().toString()); StringBuilder playerTypesString = new StringBuilder(); ListIterator iterator = players.listIterator(); while (iterator.hasNext()) { @@ -588,6 +615,7 @@ public class NewTableDialog extends MageDialog { private javax.swing.JComboBox cbDeckType; private javax.swing.JComboBox cbGameType; private javax.swing.JComboBox cbRange; + private javax.swing.JComboBox cbSkillLevel; private javax.swing.JComboBox cbTimeLimit; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; @@ -604,6 +632,7 @@ public class NewTableDialog extends MageDialog { private javax.swing.JLabel lblNumWins; private javax.swing.JLabel lblPassword; private javax.swing.JLabel lblRange; + private javax.swing.JLabel lblSkillLevel; private mage.client.table.NewPlayerPanel player1Panel; private javax.swing.JPanel pnlOtherPlayers; private javax.swing.JSpinner spnFreeMulligans; 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 2f7ffaa1d2..5736b53444 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.form +++ b/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.form @@ -27,13 +27,6 @@ <Group type="103" groupAlignment="0" attributes="0"> <Component id="pnlPlayers" alignment="0" max="32767" attributes="0"/> <Component id="pnlPacks" alignment="1" max="32767" attributes="0"/> - <Group type="102" alignment="1" attributes="0"> - <EmptySpace min="0" pref="0" max="32767" attributes="0"/> - <Component id="btnOk" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="btnCancel" min="-2" max="-2" attributes="0"/> - </Group> - <Component id="player1Panel" alignment="0" max="32767" attributes="0"/> <Group type="102" alignment="1" attributes="0"> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> @@ -67,60 +60,63 @@ </Group> </Group> <Group type="102" alignment="1" attributes="0"> - <Group type="103" groupAlignment="1" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <Component id="lblName" min="-2" max="-2" attributes="0"/> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <Component id="btnOk" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="txtName" min="-2" pref="205" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="lbTimeLimit" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="cbTimeLimit" max="32767" attributes="1"/> + <Component id="btnCancel" min="-2" max="-2" attributes="0"/> </Group> - <Group type="102" attributes="0"> - <EmptySpace min="0" pref="0" max="32767" attributes="0"/> - <Group type="103" groupAlignment="1" attributes="0"> - <Group type="102" alignment="1" attributes="0"> - <Component id="lblGameType" max="-2" attributes="0"/> + <Group type="102" alignment="1" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="lblDraftCube" max="-2" attributes="0"/> + <Component id="lblTournamentType" min="-2" max="-2" attributes="0"/> + <Component id="lbDeckType" max="-2" attributes="0"/> + <Component id="lblGameType" max="-2" attributes="0"/> + </Group> <EmptySpace max="-2" attributes="0"/> - <Component id="cbGameType" min="-2" pref="290" max="-2" attributes="1"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="cbDraftCube" min="-2" pref="290" max="-2" attributes="0"/> + <Component id="cbDeckType" alignment="0" min="-2" pref="290" max="-2" attributes="1"/> + <Component id="cbGameType" min="-2" pref="290" max="-2" attributes="1"/> + <Group type="102" alignment="0" attributes="0"> + <Component id="cbTournamentType" min="-2" pref="290" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblFreeMulligans" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="spnFreeMulligans" min="-2" pref="41" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblNumWins" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="spnNumWins" min="-2" pref="50" max="-2" attributes="0"/> + </Group> + </Group> </Group> - <Group type="102" attributes="0"> - <Component id="lbDeckType" max="-2" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <Component id="lblName" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="cbDeckType" min="-2" pref="290" max="-2" attributes="1"/> - </Group> - <Group type="102" attributes="0"> - <Component id="lblDraftCube" max="-2" attributes="0"/> + <Component id="txtName" min="-2" pref="124" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="cbDraftCube" min="-2" pref="290" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="1" attributes="0"> - <Component id="lblTournamentType" min="-2" max="-2" attributes="0"/> + <Component id="lbTimeLimit" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="cbTournamentType" min="-2" pref="290" max="-2" attributes="0"/> + <Component id="cbTimeLimit" min="-2" pref="89" max="-2" attributes="1"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lbSkillLevel" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="cbSkillLevel" min="-2" pref="112" max="-2" attributes="1"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblPassword" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtPassword" min="-2" pref="56" max="-2" attributes="0"/> </Group> </Group> - <EmptySpace min="7" pref="7" max="-2" attributes="0"/> + <EmptySpace min="0" pref="0" max="-2" attributes="0"/> </Group> </Group> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="1" attributes="0"> - <Component id="lblFreeMulligans" min="-2" max="-2" attributes="0"/> - <Component id="lblPassword" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" max="-2" attributes="0"> - <Group type="102" attributes="0"> - <Component id="spnFreeMulligans" min="-2" pref="41" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="lblNumWins" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="spnNumWins" min="-2" pref="50" max="-2" attributes="0"/> - </Group> - <Component id="txtPassword" max="32767" attributes="0"/> - </Group> </Group> + <Component id="player1Panel" alignment="0" max="32767" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> </Group> @@ -137,6 +133,8 @@ <Component id="cbTimeLimit" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="lblPassword" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="txtPassword" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lbSkillLevel" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="cbSkillLevel" alignment="3" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace min="-2" max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> @@ -188,7 +186,7 @@ </Group> </Group> <EmptySpace max="-2" attributes="0"/> - <Component id="player1Panel" pref="59" max="32767" attributes="0"/> + <Component id="player1Panel" pref="62" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Component id="pnlPlayers" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/> @@ -223,6 +221,17 @@ <Property name="toolTipText" type="java.lang.String" value="The time a player has for the whole match. If a player runs out of time during a game, he loses the complete match. "/> </Properties> </Component> + <Component class="javax.swing.JLabel" name="lbSkillLevel"> + <Properties> + <Property name="text" type="java.lang.String" value="Skill Level:"/> + <Property name="toolTipText" type="java.lang.String" value="The time a player has for the whole match. If a player runs out of time during a game, he loses the complete match. "/> + </Properties> + </Component> + <Component class="javax.swing.JComboBox" name="cbSkillLevel"> + <Properties> + <Property name="toolTipText" type="java.lang.String" value="<HTML>This option can be used to make it easier to find matches<br>
with opponents of the appropriate skill level."/> + </Properties> + </Component> <Component class="javax.swing.JLabel" name="lblPassword"> <Properties> <Property name="text" type="java.lang.String" value="Password:"/> @@ -437,6 +446,11 @@ </Properties> </Component> <Component class="mage.client.table.NewPlayerPanel" name="player1Panel"> + <Properties> + <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> + <Dimension value="[400, 44]"/> + </Property> + </Properties> </Component> <Container class="javax.swing.JPanel" name="pnlPlayers"> @@ -448,7 +462,7 @@ </DimensionLayout> <DimensionLayout dim="1"> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="pnlOtherPlayers" alignment="0" max="32767" attributes="0"/> + <Component id="pnlOtherPlayers" alignment="0" pref="5" max="32767" attributes="0"/> </Group> </DimensionLayout> </Layout> 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 af82f4168a..ca6a30b6f6 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java @@ -41,7 +41,6 @@ import javax.swing.ComboBoxModel; import javax.swing.DefaultComboBoxModel; import javax.swing.JComboBox; import javax.swing.JOptionPane; -import javax.swing.SpinnerModel; import javax.swing.SpinnerNumberModel; import mage.cards.decks.importer.DeckImporterUtil; import mage.cards.repository.ExpansionInfo; @@ -51,6 +50,7 @@ import mage.client.table.TournamentPlayerPanel; import mage.constants.MatchTimeLimit; import mage.constants.MultiplayerAttackOption; import mage.constants.RangeOfInfluence; +import mage.constants.SkillLevel; import mage.game.draft.DraftOptions; import mage.game.draft.DraftOptions.TimingOption; import mage.game.tournament.LimitedOptions; @@ -106,6 +106,7 @@ public class NewTournamentDialog extends MageDialog { cbDeckType.setModel(new DefaultComboBoxModel(session.getDeckTypes())); cbTimeLimit.setModel(new DefaultComboBoxModel(MatchTimeLimit.values())); + cbSkillLevel.setModel(new DefaultComboBoxModel(SkillLevel.values())); cbDraftCube.setModel(new DefaultComboBoxModel(session.getDraftCubes())); cbDraftTiming.setModel(new DefaultComboBoxModel(DraftOptions.TimingOption.values())); // update player types @@ -135,6 +136,8 @@ public class NewTournamentDialog extends MageDialog { txtName = new javax.swing.JTextField(); lbTimeLimit = new javax.swing.JLabel(); cbTimeLimit = new javax.swing.JComboBox(); + lbSkillLevel = new javax.swing.JLabel(); + cbSkillLevel = new javax.swing.JComboBox(); lblPassword = new javax.swing.JLabel(); txtPassword = new javax.swing.JTextField(); lblTournamentType = new javax.swing.JLabel(); @@ -180,6 +183,11 @@ public class NewTournamentDialog extends MageDialog { cbTimeLimit.setToolTipText("The time a player has for the whole match. If a player runs out of time during a game, he loses the complete match. "); + lbSkillLevel.setText("Skill Level:"); + lbSkillLevel.setToolTipText("The time a player has for the whole match. If a player runs out of time during a game, he loses the complete match. "); + + cbSkillLevel.setToolTipText("<HTML>This option can be used to make it easier to find matches<br>\nwith opponents of the appropriate skill level."); + lblPassword.setText("Password:"); lblPassword.setToolTipText("Players have to enter the password to be able to join this table."); @@ -291,6 +299,8 @@ public class NewTournamentDialog extends MageDialog { spnConstructTime.setToolTipText("The time players have to build their deck."); + player1Panel.setPreferredSize(new java.awt.Dimension(400, 44)); + pnlOtherPlayers.setBorder(javax.swing.BorderFactory.createEtchedBorder()); pnlOtherPlayers.setLayout(new java.awt.GridLayout(0, 1, 2, 0)); @@ -302,7 +312,7 @@ public class NewTournamentDialog extends MageDialog { ); pnlPlayersLayout.setVerticalGroup( pnlPlayersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(pnlOtherPlayers, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(pnlOtherPlayers, javax.swing.GroupLayout.DEFAULT_SIZE, 5, Short.MAX_VALUE) ); btnOk.setText("OK"); @@ -328,12 +338,6 @@ public class NewTournamentDialog extends MageDialog { .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(pnlPlayers, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(pnlPacks, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addGap(0, 0, Short.MAX_VALUE) - .addComponent(btnOk) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(btnCancel)) - .addComponent(player1Panel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() @@ -359,48 +363,53 @@ public class NewTournamentDialog extends MageDialog { .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(cbAllowSpectators)))) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() - .addComponent(lblName) + .addGap(0, 0, Short.MAX_VALUE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addComponent(btnOk) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(txtName, javax.swing.GroupLayout.PREFERRED_SIZE, 205, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(lbTimeLimit) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(cbTimeLimit, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addGroup(layout.createSequentialGroup() - .addGap(0, 0, Short.MAX_VALUE) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(btnCancel)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() - .addComponent(lblGameType) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(lblDraftCube) + .addComponent(lblTournamentType) + .addComponent(lbDeckType) + .addComponent(lblGameType)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(cbGameType, javax.swing.GroupLayout.PREFERRED_SIZE, 290, javax.swing.GroupLayout.PREFERRED_SIZE)) + .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() + .addComponent(cbTournamentType, javax.swing.GroupLayout.PREFERRED_SIZE, 290, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblFreeMulligans) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(spnFreeMulligans, javax.swing.GroupLayout.PREFERRED_SIZE, 41, 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)))) .addGroup(layout.createSequentialGroup() - .addComponent(lbDeckType) + .addComponent(lblName) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(cbDeckType, javax.swing.GroupLayout.PREFERRED_SIZE, 290, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(layout.createSequentialGroup() - .addComponent(lblDraftCube) + .addComponent(txtName, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(cbDraftCube, javax.swing.GroupLayout.PREFERRED_SIZE, 290, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(layout.createSequentialGroup() - .addComponent(lblTournamentType) + .addComponent(lbTimeLimit) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(cbTournamentType, javax.swing.GroupLayout.PREFERRED_SIZE, 290, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGap(7, 7, 7))) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(lblFreeMulligans) - .addComponent(lblPassword)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addGroup(layout.createSequentialGroup() - .addComponent(spnFreeMulligans, javax.swing.GroupLayout.PREFERRED_SIZE, 41, 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(txtPassword)))) + .addComponent(cbTimeLimit, javax.swing.GroupLayout.PREFERRED_SIZE, 89, 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, 112, 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, 56, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(0, 0, 0)))) + .addComponent(player1Panel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) ); layout.setVerticalGroup( @@ -413,7 +422,9 @@ public class NewTournamentDialog extends MageDialog { .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(txtPassword, 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)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lblTournamentType) @@ -455,7 +466,7 @@ public class NewTournamentDialog extends MageDialog { .addComponent(spnConstructTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lblConstructionTime))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(player1Panel, javax.swing.GroupLayout.DEFAULT_SIZE, 59, Short.MAX_VALUE) + .addComponent(player1Panel, javax.swing.GroupLayout.DEFAULT_SIZE, 62, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(pnlPlayers, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) @@ -519,6 +530,7 @@ public class NewTournamentDialog extends MageDialog { } tOptions.getMatchOptions().setMatchTimeLimit((MatchTimeLimit) this.cbTimeLimit.getSelectedItem()); + tOptions.getMatchOptions().setSkillLevel((SkillLevel) this.cbSkillLevel.getSelectedItem()); tOptions.getMatchOptions().setWinsNeeded((Integer)this.spnNumWins.getValue()); tOptions.getMatchOptions().setFreeMulligans((Integer)this.spnFreeMulligans.getValue()); tOptions.getMatchOptions().setAttackOption(MultiplayerAttackOption.LEFT); @@ -774,6 +786,13 @@ public class NewTournamentDialog extends MageDialog { break; } } + String skillLevelDefault = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_SKILL_LEVEL, "Casual"); + for (SkillLevel skillLevel :SkillLevel.values()) { + if (skillLevel.toString().equals(skillLevelDefault)) { + this.cbSkillLevel.setSelectedItem(skillLevel); + break; + } + } int constructionTime = Integer.parseInt(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TOURNAMENT_CONSTR_TIME, "600")) / 60; if (constructionTime < CONSTRUCTION_TIME_MIN || constructionTime > CONSTRUCTION_TIME_MAX) { constructionTime = CONSTRUCTION_TIME_MIN; @@ -893,10 +912,12 @@ public class NewTournamentDialog extends MageDialog { private javax.swing.JComboBox cbDraftCube; private javax.swing.JComboBox cbDraftTiming; private javax.swing.JComboBox cbGameType; + private javax.swing.JComboBox cbSkillLevel; private javax.swing.JComboBox cbTimeLimit; private javax.swing.JComboBox cbTournamentType; private javax.swing.JLabel jLabel6; private javax.swing.JLabel lbDeckType; + private javax.swing.JLabel lbSkillLevel; private javax.swing.JLabel lbTimeLimit; private javax.swing.JLabel lblConstructionTime; private javax.swing.JLabel lblDraftCube; 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 6481e0c8a1..94da44852b 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java @@ -163,6 +163,7 @@ public class PreferencesDialog extends javax.swing.JDialog { public static final String KEY_NEW_TABLE_DECK_FILE = "newTableDeckFile"; public static final String KEY_NEW_TABLE_RANGE = "newTableRange"; public static final String KEY_NEW_TABLE_ATTACK_OPTION = "newTableAttackOption"; + public static final String KEY_NEW_TABLE_SKILL_LEVEL = "newTableSkillLevel"; public static final String KEY_NEW_TABLE_NUMBER_PLAYERS = "newTableNumberPlayers"; public static final String KEY_NEW_TABLE_PLAYER_TYPES = "newTablePlayerTypes"; diff --git a/Mage.Client/src/main/java/mage/client/table/NewPlayerPanel.java b/Mage.Client/src/main/java/mage/client/table/NewPlayerPanel.java index afe8487565..71709ce7da 100644 --- a/Mage.Client/src/main/java/mage/client/table/NewPlayerPanel.java +++ b/Mage.Client/src/main/java/mage/client/table/NewPlayerPanel.java @@ -67,7 +67,7 @@ public class NewPlayerPanel extends javax.swing.JPanel { this.txtPlayerName.setText(Config.defaultComputerName); } if (cbLevel.getModel().getSize() > 0) { - cbLevel.setSelectedIndex((int) cbLevel.getModel().getSize()/2); + cbLevel.setSelectedIndex(cbLevel.getModel().getSize()/2); } } diff --git a/Mage.Client/src/main/java/mage/client/table/TablesPanel.form b/Mage.Client/src/main/java/mage/client/table/TablesPanel.form index 59293bc783..77d5926402 100644 --- a/Mage.Client/src/main/java/mage/client/table/TablesPanel.form +++ b/Mage.Client/src/main/java/mage/client/table/TablesPanel.form @@ -236,14 +236,11 @@ <Component class="javax.swing.JToggleButton" name="btnTypeTourneyConstructed"> <Properties> <Property name="selected" type="boolean" value="true"/> - <Property name="text" type="java.lang.String" value="Constructed tourneys"/> + <Property name="text" type="java.lang.String" value="Constructed tourn."/> <Property name="toolTipText" type="java.lang.String" value="Shows all constructed tournament tables."/> <Property name="actionCommand" type="java.lang.String" value="typeTourneyConstructed"/> <Property name="focusPainted" type="boolean" value="false"/> <Property name="focusable" type="boolean" value="false"/> - <Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> - <Dimension value="[115, 25]"/> - </Property> <Property name="requestFocusEnabled" type="boolean" value="false"/> <Property name="verifyInputWhenFocusTarget" type="boolean" value="false"/> </Properties> @@ -254,13 +251,13 @@ <Component class="javax.swing.JToggleButton" name="btnTypeTourneyLimited"> <Properties> <Property name="selected" type="boolean" value="true"/> - <Property name="text" type="java.lang.String" value="Limited tourneys"/> + <Property name="text" type="java.lang.String" value="Limited tourn."/> <Property name="toolTipText" type="java.lang.String" value="Shows all limited tournament tables."/> <Property name="actionCommand" type="java.lang.String" value="typeTourneyLimited"/> <Property name="focusPainted" type="boolean" value="false"/> <Property name="focusable" type="boolean" value="false"/> <Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> - <Dimension value="[90, 25]"/> + <Dimension value="[72, 20]"/> </Property> <Property name="requestFocusEnabled" type="boolean" value="false"/> <Property name="verifyInputWhenFocusTarget" type="boolean" value="false"/> @@ -269,6 +266,59 @@ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnFilterActionPerformed"/> </Events> </Component> + <Component class="javax.swing.JToolBar$Separator" name="jSeparator4"> + </Component> + <Component class="javax.swing.JToggleButton" name="btnSkillBeginner"> + <Properties> + <Property name="selected" type="boolean" value="true"/> + <Property name="text" type="java.lang.String" value="Beginner"/> + <Property name="toolTipText" type="java.lang.String" value="Shows all tables with skill level beginner."/> + <Property name="actionCommand" type="java.lang.String" value="typeMatch"/> + <Property name="focusPainted" type="boolean" value="false"/> + <Property name="focusable" type="boolean" value="false"/> + <Property name="horizontalTextPosition" type="int" value="0"/> + <Property name="requestFocusEnabled" type="boolean" value="false"/> + <Property name="verifyInputWhenFocusTarget" type="boolean" value="false"/> + <Property name="verticalTextPosition" type="int" value="3"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnFilterActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JToggleButton" name="btnSkillCasual"> + <Properties> + <Property name="selected" type="boolean" value="true"/> + <Property name="text" type="java.lang.String" value="Casual"/> + <Property name="toolTipText" type="java.lang.String" value="Shows all tables with skill level casual."/> + <Property name="actionCommand" type="java.lang.String" value="typeMatch"/> + <Property name="focusPainted" type="boolean" value="false"/> + <Property name="focusable" type="boolean" value="false"/> + <Property name="horizontalTextPosition" type="int" value="0"/> + <Property name="requestFocusEnabled" type="boolean" value="false"/> + <Property name="verifyInputWhenFocusTarget" type="boolean" value="false"/> + <Property name="verticalTextPosition" type="int" value="3"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnFilterActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JToggleButton" name="btnSkillSerious"> + <Properties> + <Property name="selected" type="boolean" value="true"/> + <Property name="text" type="java.lang.String" value="Serious"/> + <Property name="toolTipText" type="java.lang.String" value="Shows all tables with skill level serious."/> + <Property name="actionCommand" type="java.lang.String" value="typeMatch"/> + <Property name="focusPainted" type="boolean" value="false"/> + <Property name="focusable" type="boolean" value="false"/> + <Property name="horizontalTextPosition" type="int" value="0"/> + <Property name="requestFocusEnabled" type="boolean" value="false"/> + <Property name="verifyInputWhenFocusTarget" type="boolean" value="false"/> + <Property name="verticalTextPosition" type="int" value="3"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnFilterActionPerformed"/> + </Events> + </Component> </SubComponents> </Container> <Container class="javax.swing.JToolBar" name="filterBar2"> diff --git a/Mage.Client/src/main/java/mage/client/table/TablesPanel.java b/Mage.Client/src/main/java/mage/client/table/TablesPanel.java index f5d4acbe96..3904e394f3 100644 --- a/Mage.Client/src/main/java/mage/client/table/TablesPanel.java +++ b/Mage.Client/src/main/java/mage/client/table/TablesPanel.java @@ -85,6 +85,7 @@ import mage.client.util.gui.GuiDisplayUtil; import mage.constants.MatchTimeLimit; import mage.constants.MultiplayerAttackOption; import mage.constants.RangeOfInfluence; +import mage.constants.SkillLevel; import mage.game.match.MatchOptions; import mage.remote.MageRemoteException; import mage.remote.Session; @@ -557,8 +558,19 @@ public class TablesPanel extends javax.swing.JPanel { formatFilterList.add(RowFilter.regexFilter("Pauper|Extended", TableTableModel.COLUMN_DECK_TYPE)); } - if (stateFilterList.isEmpty() || typeFilterList.isEmpty() || formatFilterList.isEmpty()) { // no selection - activeTablesSorter.setRowFilter(RowFilter.regexFilter("Nothing", TableTableModel.COLUMN_GAME_TYPE)); + List<RowFilter<Object, Object>> skillFilterList = new ArrayList<>(); + if (btnSkillBeginner.isSelected()) { + skillFilterList.add(RowFilter.regexFilter(SkillLevel.BEGINNER.toString(), TableTableModel.COLUMN_SKILL)); + } + if (btnSkillCasual.isSelected()) { + skillFilterList.add(RowFilter.regexFilter(SkillLevel.CASUAL.toString(), TableTableModel.COLUMN_SKILL)); + } + if (btnSkillSerious.isSelected()) { + skillFilterList.add(RowFilter.regexFilter(SkillLevel.SERIOUS.toString(), TableTableModel.COLUMN_SKILL)); + } + + if (stateFilterList.isEmpty() || typeFilterList.isEmpty() || formatFilterList.isEmpty() || skillFilterList.isEmpty()) { // no selection + activeTablesSorter.setRowFilter(RowFilter.regexFilter("Nothing", TableTableModel.COLUMN_SKILL)); } else { List<RowFilter<Object, Object>> filterList = new ArrayList<>(); @@ -579,6 +591,12 @@ public class TablesPanel extends javax.swing.JPanel { } else if (formatFilterList.size() == 1) { filterList.addAll(formatFilterList); } + + if (skillFilterList.size() > 1) { + filterList.add(RowFilter.orFilter(skillFilterList)); + } else if (skillFilterList.size() == 1) { + filterList.addAll(skillFilterList); + } if (filterList.size() == 1) { activeTablesSorter.setRowFilter(filterList.get(0)); @@ -608,6 +626,10 @@ public class TablesPanel extends javax.swing.JPanel { btnTypeMatch = new javax.swing.JToggleButton(); btnTypeTourneyConstructed = new javax.swing.JToggleButton(); btnTypeTourneyLimited = new javax.swing.JToggleButton(); + jSeparator4 = new javax.swing.JToolBar.Separator(); + btnSkillBeginner = new javax.swing.JToggleButton(); + btnSkillCasual = new javax.swing.JToggleButton(); + btnSkillSerious = new javax.swing.JToggleButton(); filterBar2 = new javax.swing.JToolBar(); btnFormatBlock = new javax.swing.JToggleButton(); btnFormatStandard = new javax.swing.JToggleButton(); @@ -739,12 +761,11 @@ public class TablesPanel extends javax.swing.JPanel { filterBar1.add(btnTypeMatch); btnTypeTourneyConstructed.setSelected(true); - btnTypeTourneyConstructed.setText("Constructed tourneys"); + btnTypeTourneyConstructed.setText("Constructed tourn."); btnTypeTourneyConstructed.setToolTipText("Shows all constructed tournament tables."); btnTypeTourneyConstructed.setActionCommand("typeTourneyConstructed"); btnTypeTourneyConstructed.setFocusPainted(false); btnTypeTourneyConstructed.setFocusable(false); - btnTypeTourneyConstructed.setMaximumSize(new java.awt.Dimension(115, 25)); btnTypeTourneyConstructed.setRequestFocusEnabled(false); btnTypeTourneyConstructed.setVerifyInputWhenFocusTarget(false); btnTypeTourneyConstructed.addActionListener(new java.awt.event.ActionListener() { @@ -755,12 +776,12 @@ public class TablesPanel extends javax.swing.JPanel { filterBar1.add(btnTypeTourneyConstructed); btnTypeTourneyLimited.setSelected(true); - btnTypeTourneyLimited.setText("Limited tourneys"); + btnTypeTourneyLimited.setText("Limited tourn."); btnTypeTourneyLimited.setToolTipText("Shows all limited tournament tables."); btnTypeTourneyLimited.setActionCommand("typeTourneyLimited"); btnTypeTourneyLimited.setFocusPainted(false); btnTypeTourneyLimited.setFocusable(false); - btnTypeTourneyLimited.setMaximumSize(new java.awt.Dimension(90, 25)); + btnTypeTourneyLimited.setMaximumSize(new java.awt.Dimension(72, 20)); btnTypeTourneyLimited.setRequestFocusEnabled(false); btnTypeTourneyLimited.setVerifyInputWhenFocusTarget(false); btnTypeTourneyLimited.addActionListener(new java.awt.event.ActionListener() { @@ -769,6 +790,58 @@ public class TablesPanel extends javax.swing.JPanel { } }); filterBar1.add(btnTypeTourneyLimited); + filterBar1.add(jSeparator4); + + btnSkillBeginner.setSelected(true); + btnSkillBeginner.setText("Beginner"); + btnSkillBeginner.setToolTipText("Shows all tables with skill level beginner."); + btnSkillBeginner.setActionCommand("typeMatch"); + btnSkillBeginner.setFocusPainted(false); + btnSkillBeginner.setFocusable(false); + btnSkillBeginner.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + btnSkillBeginner.setRequestFocusEnabled(false); + btnSkillBeginner.setVerifyInputWhenFocusTarget(false); + btnSkillBeginner.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + btnSkillBeginner.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnFilterActionPerformed(evt); + } + }); + filterBar1.add(btnSkillBeginner); + + btnSkillCasual.setSelected(true); + btnSkillCasual.setText("Casual"); + btnSkillCasual.setToolTipText("Shows all tables with skill level casual."); + btnSkillCasual.setActionCommand("typeMatch"); + btnSkillCasual.setFocusPainted(false); + btnSkillCasual.setFocusable(false); + btnSkillCasual.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + btnSkillCasual.setRequestFocusEnabled(false); + btnSkillCasual.setVerifyInputWhenFocusTarget(false); + btnSkillCasual.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + btnSkillCasual.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnFilterActionPerformed(evt); + } + }); + filterBar1.add(btnSkillCasual); + + btnSkillSerious.setSelected(true); + btnSkillSerious.setText("Serious"); + btnSkillSerious.setToolTipText("Shows all tables with skill level serious."); + btnSkillSerious.setActionCommand("typeMatch"); + btnSkillSerious.setFocusPainted(false); + btnSkillSerious.setFocusable(false); + btnSkillSerious.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + btnSkillSerious.setRequestFocusEnabled(false); + btnSkillSerious.setVerifyInputWhenFocusTarget(false); + btnSkillSerious.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + btnSkillSerious.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnFilterActionPerformed(evt); + } + }); + filterBar1.add(btnSkillSerious); filterBar2.setFloatable(false); filterBar2.setFocusable(false); @@ -1142,6 +1215,9 @@ public class TablesPanel extends javax.swing.JPanel { private javax.swing.JButton btnNewTable; private javax.swing.JButton btnNewTournament; private javax.swing.JButton btnQuickStart; + private javax.swing.JToggleButton btnSkillBeginner; + private javax.swing.JToggleButton btnSkillCasual; + private javax.swing.JToggleButton btnSkillSerious; private javax.swing.JToggleButton btnStateActive; private javax.swing.JToggleButton btnStateFinished; private javax.swing.JToggleButton btnStateWaiting; @@ -1161,6 +1237,7 @@ public class TablesPanel extends javax.swing.JPanel { private javax.swing.JToolBar.Separator jSeparator1; private javax.swing.JToolBar.Separator jSeparator2; private javax.swing.JToolBar.Separator jSeparator3; + private javax.swing.JToolBar.Separator jSeparator4; private javax.swing.JSplitPane jSplitPane1; private javax.swing.JSplitPane jSplitPane2; private javax.swing.JTable tableCompleted; @@ -1180,10 +1257,11 @@ class TableTableModel extends AbstractTableModel { public static final int COLUMN_GAME_TYPE = 3; public static final int COLUMN_INFO = 4; public static final int COLUMN_STATUS = 5; - public static final int ACTION_COLUMN = 7; // column the action is located (starting with 0) + public static final int COLUMN_SKILL = 7; + public static final int ACTION_COLUMN = 8; // column the action is located (starting with 0) - private final String[] columnNames = new String[]{"M/T","Deck Type", "Owner / Players", "Game Type", "Info", "Status", "Created / Started", "Action"}; - private static final int[] defaultColumnsWidth = {35, 150, 120, 180, 80, 120, 80, 60}; + private final String[] columnNames = new String[]{"M/T","Deck Type", "Owner / Players", "Game Type", "Info", "Status", "Created / Started", "Skill Level", "Action"}; + private static final int[] defaultColumnsWidth = {35, 150, 120, 180, 80, 120, 80, 60, 60}; private TableView[] tables = new TableView[0]; private static final DateFormat timeFormatter = new SimpleDateFormat("HH:mm:ss");; @@ -1252,6 +1330,8 @@ class TableTableModel extends AbstractTableModel { case 6: return timeFormatter.format(tables[arg0].getCreateTime()); case 7: + return tables[arg0].getSkillLevel(); + case 8: switch (tables[arg0].getTableState()) { case WAITING: @@ -1278,14 +1358,14 @@ class TableTableModel extends AbstractTableModel { default: return ""; } - case 8: - return tables[arg0].isTournament(); case 9: + return tables[arg0].isTournament(); + case 10: if (!tables[arg0].getGames().isEmpty()) { return tables[arg0].getGames().get(0); } return null; - case 10: + case 11: return tables[arg0].getTableId(); } return ""; diff --git a/Mage.Common/src/mage/view/TableView.java b/Mage.Common/src/mage/view/TableView.java index bc388a51a6..8005e9d9e9 100644 --- a/Mage.Common/src/mage/view/TableView.java +++ b/Mage.Common/src/mage/view/TableView.java @@ -33,6 +33,7 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.UUID; +import mage.constants.SkillLevel; import mage.constants.TableState; import mage.game.Game; import mage.game.Seat; @@ -56,6 +57,7 @@ public class TableView implements Serializable { private final String additionalInfo; private Date createTime; private TableState tableState; + private final SkillLevel skillLevel; private final String tableStateText; private boolean isTournament; private List<SeatView> seats = new ArrayList<>(); @@ -127,6 +129,7 @@ public class TableView implements Serializable { addInfo.append(sbScore.toString()); } this.additionalInfo = addInfo.toString(); + this.skillLevel = table.getMatch().getOptions().getSkillLevel(); } else { // TOURNAMENT if (table.getTournament().getOptions().getNumberRounds() > 0) { @@ -172,6 +175,7 @@ public class TableView implements Serializable { this.additionalInfo = infoText.toString(); this.tableStateText = stateText.toString(); this.deckType = table.getDeckType() + " " + table.getTournament().getBoosterInfo() + (tableNameInfo != null ? tableNameInfo : ""); + this.skillLevel = table.getTournament().getOptions().getMatchOptions().getSkillLevel(); } } @@ -222,4 +226,8 @@ public class TableView implements Serializable { return tableStateText; } + public SkillLevel getSkillLevel() { + return skillLevel; + } + } diff --git a/Mage/src/mage/constants/MultiplayerAttackOption.java b/Mage/src/mage/constants/MultiplayerAttackOption.java index f29a5f236e..d1670ca837 100644 --- a/Mage/src/mage/constants/MultiplayerAttackOption.java +++ b/Mage/src/mage/constants/MultiplayerAttackOption.java @@ -9,7 +9,7 @@ public enum MultiplayerAttackOption { LEFT("Attack Left"), RIGHT("Attack Right"); - private String text; + private final String text; MultiplayerAttackOption(String text) { this.text = text; diff --git a/Mage/src/mage/constants/SkillLevel.java b/Mage/src/mage/constants/SkillLevel.java new file mode 100644 index 0000000000..735faece72 --- /dev/null +++ b/Mage/src/mage/constants/SkillLevel.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.constants; + +/** + * + * @author LevelX2 + */ + +public enum SkillLevel { + BEGINNER ("Beginner"), + CASUAL("Casual"), + SERIOUS ("Serious"); + + private final String text; + + SkillLevel(String text) { + this.text = text; + } + + @Override + public String toString() { + return text; + } + +} \ No newline at end of file diff --git a/Mage/src/mage/game/match/MatchOptions.java b/Mage/src/mage/game/match/MatchOptions.java index 237a7f5a49..71ff1cd250 100644 --- a/Mage/src/mage/game/match/MatchOptions.java +++ b/Mage/src/mage/game/match/MatchOptions.java @@ -34,6 +34,7 @@ import java.util.List; import mage.constants.MatchTimeLimit; import mage.constants.MultiplayerAttackOption; import mage.constants.RangeOfInfluence; +import mage.constants.SkillLevel; /** * @@ -51,6 +52,7 @@ public class MatchOptions implements Serializable { protected boolean limited; protected List<String> playerTypes = new ArrayList<>(); protected String password; + protected SkillLevel skillLevel; /** * Time each player has during the game to play using his\her priority. @@ -134,7 +136,6 @@ public class MatchOptions implements Serializable { return matchTimeLimit.getTimeLimit(); } - public MatchTimeLimit getMatchTimeLimit() { return this.matchTimeLimit; } @@ -151,4 +152,11 @@ public class MatchOptions implements Serializable { this.password = password; } + public SkillLevel getSkillLevel() { + return skillLevel; + } + + public void setSkillLevel(SkillLevel skillLevel) { + this.skillLevel = skillLevel; + } } diff --git a/Mage/src/mage/game/tournament/TournamentOptions.java b/Mage/src/mage/game/tournament/TournamentOptions.java index a18a691467..3f107e4369 100644 --- a/Mage/src/mage/game/tournament/TournamentOptions.java +++ b/Mage/src/mage/game/tournament/TournamentOptions.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.game.tournament; import java.io.Serializable;