mirror of
https://github.com/correl/mage.git
synced 2025-01-11 11:05:23 +00:00
Some match time options added. Set the deafult macth time to 25 minutes per player.
This commit is contained in:
parent
ba7bf794f5
commit
e1ae922214
3 changed files with 18 additions and 7 deletions
|
@ -49,7 +49,7 @@
|
|||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
<EmptySpace min="0" pref="9" max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" max="-2" attributes="0">
|
||||
<Component id="txtName" min="-2" pref="546" max="-2" attributes="0"/>
|
||||
<Group type="102" attributes="0">
|
||||
|
@ -173,7 +173,7 @@
|
|||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="pnlOtherPlayers" pref="144" max="32767" attributes="0"/>
|
||||
<Component id="pnlOtherPlayers" pref="181" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jSeparator1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
|
@ -187,7 +187,7 @@
|
|||
<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="244" max="32767" attributes="0"/>
|
||||
<EmptySpace pref="252" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
|
@ -214,6 +214,7 @@
|
|||
<Component class="javax.swing.JLabel" name="lbTimeLimit">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Time Limit:"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="The activie time a player may use to finish the match. If the time runs out, the player looses the current game."/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="cbTimeLimit">
|
||||
|
@ -231,6 +232,7 @@
|
|||
<Component class="javax.swing.JLabel" name="lblFreeMulligans">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Free Mulligans:"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="The number of mulligans a player can use without decreasing the number of drawn cards."/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnFreeMulligans">
|
||||
|
@ -284,6 +286,7 @@
|
|||
<ComponentRef name="spnNumWins"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Wins"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="How many games has a player to win to win the match."/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnNumWins">
|
||||
|
|
|
@ -119,6 +119,7 @@ public class NewTableDialog extends MageDialog {
|
|||
lbDeckType.setText("Deck Type:");
|
||||
|
||||
lbTimeLimit.setText("Time Limit:");
|
||||
lbTimeLimit.setToolTipText("The activie time a player may use to finish the match. If the time runs out, the player looses the current game.");
|
||||
|
||||
lblGameType.setText("Game Type:");
|
||||
|
||||
|
@ -129,6 +130,7 @@ public class NewTableDialog extends MageDialog {
|
|||
});
|
||||
|
||||
lblFreeMulligans.setText("Free Mulligans:");
|
||||
lblFreeMulligans.setToolTipText("The number of mulligans a player can use without decreasing the number of drawn cards.");
|
||||
|
||||
lblNumPlayers.setLabelFor(spnNumPlayers);
|
||||
lblNumPlayers.setText("Players");
|
||||
|
@ -147,6 +149,7 @@ public class NewTableDialog extends MageDialog {
|
|||
|
||||
lblNumWins.setLabelFor(spnNumWins);
|
||||
lblNumWins.setText("Wins");
|
||||
lblNumWins.setToolTipText("How many games has a player to win to win the match.");
|
||||
|
||||
spnNumWins.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
|
@ -202,7 +205,7 @@ public class NewTableDialog extends MageDialog {
|
|||
.addComponent(spnFreeMulligans, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(0, 0, Short.MAX_VALUE))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addGap(0, 0, Short.MAX_VALUE)
|
||||
.addGap(0, 9, Short.MAX_VALUE)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
|
||||
.addComponent(txtName, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
|
@ -297,7 +300,7 @@ public class NewTableDialog extends MageDialog {
|
|||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(jLabel2)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(pnlOtherPlayers, javax.swing.GroupLayout.DEFAULT_SIZE, 144, Short.MAX_VALUE)
|
||||
.addComponent(pnlOtherPlayers, javax.swing.GroupLayout.DEFAULT_SIZE, 181, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
|
@ -309,7 +312,7 @@ public class NewTableDialog extends MageDialog {
|
|||
.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(244, Short.MAX_VALUE)))
|
||||
.addContainerGap(252, Short.MAX_VALUE)))
|
||||
);
|
||||
|
||||
pack();
|
||||
|
@ -481,7 +484,7 @@ public class NewTableDialog extends MageDialog {
|
|||
break;
|
||||
}
|
||||
}
|
||||
int timeLimit = Integer.parseInt(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_TIME_LIMIT, "0"));
|
||||
int timeLimit = Integer.parseInt(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_TIME_LIMIT, "1500"));
|
||||
for (MatchTimeLimit mtl :MatchTimeLimit.values()) {
|
||||
if (mtl.getTimeLimit() == timeLimit) {
|
||||
this.cbTimeLimit.setSelectedItem(mtl);
|
||||
|
|
|
@ -1,12 +1,17 @@
|
|||
package mage.constants;
|
||||
|
||||
/**
|
||||
* The time per player to have activity in a match.
|
||||
* If time runs out for a player, he looses the currently running game of a match.
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public enum MatchTimeLimit {
|
||||
NONE(0,"None"),
|
||||
MIN__10(600, "10 Minutes"),
|
||||
MIN__15(900, "15 Minutes"),
|
||||
MIN__20(1200, "20 Minutes"),
|
||||
MIN__25(1500, "25 Minutes"),
|
||||
MIN__30(1800, "30 Minutes"),
|
||||
MIN__40(2400, "40 Minutes"),
|
||||
MIN__50(3000, "50 Minutes"),
|
||||
|
|
Loading…
Reference in a new issue