mirror of
https://github.com/correl/mage.git
synced 2025-01-13 11:01:58 +00:00
Fixed a problem that it was not possible to create tournaments with "Human" players ( related to #3083 ?).
This commit is contained in:
parent
88d121f6e9
commit
bebb2a4de7
1 changed files with 13 additions and 18 deletions
|
@ -26,13 +26,19 @@
|
||||||
* or implied, of BetaSteward_at_googlemail.com.
|
* or implied, of BetaSteward_at_googlemail.com.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NewTournamentDialog.java
|
* NewTournamentDialog.java
|
||||||
*
|
*
|
||||||
* Created on Jan 28, 2011, 12:15:56 PM
|
* Created on Jan 28, 2011, 12:15:56 PM
|
||||||
*/
|
*/
|
||||||
package mage.client.dialog;
|
package mage.client.dialog;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.List;
|
||||||
|
import javax.swing.*;
|
||||||
|
import javax.swing.filechooser.FileFilter;
|
||||||
import mage.cards.decks.Deck;
|
import mage.cards.decks.Deck;
|
||||||
import mage.cards.decks.importer.DeckImporterUtil;
|
import mage.cards.decks.importer.DeckImporterUtil;
|
||||||
import mage.cards.repository.ExpansionInfo;
|
import mage.cards.repository.ExpansionInfo;
|
||||||
|
@ -55,13 +61,6 @@ import mage.view.TableView;
|
||||||
import mage.view.TournamentTypeView;
|
import mage.view.TournamentTypeView;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import javax.swing.filechooser.FileFilter;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.*;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author BetaSteward_at_googlemail.com
|
* @author BetaSteward_at_googlemail.com
|
||||||
*/
|
*/
|
||||||
|
@ -127,10 +126,9 @@ public class NewTournamentDialog extends MageDialog {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called from within the constructor to
|
* This method is called from within the constructor to initialize the form.
|
||||||
* initialize the form.
|
* WARNING: Do NOT modify this code. The content of this method is always
|
||||||
* WARNING: Do NOT modify this code. The content of this method is
|
* regenerated by the Form Editor.
|
||||||
* always regenerated by the Form Editor.
|
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
|
@ -603,7 +601,7 @@ public class NewTournamentDialog extends MageDialog {
|
||||||
DeckImporterUtil.importDeck(this.player1Panel.getDeckFile()),
|
DeckImporterUtil.importDeck(this.player1Panel.getDeckFile()),
|
||||||
tOptions.getPassword())) {
|
tOptions.getPassword())) {
|
||||||
for (TournamentPlayerPanel player : players) {
|
for (TournamentPlayerPanel player : players) {
|
||||||
if (!player.getPlayerType().toString().equals("Human")) {
|
if (!player.getPlayerType().getSelectedItem().toString().equals("Human")) {
|
||||||
if (!player.joinTournamentTable(roomId, table.getTableId(), DeckImporterUtil.importDeck(this.player1Panel.getDeckFile()))) {
|
if (!player.joinTournamentTable(roomId, table.getTableId(), DeckImporterUtil.importDeck(this.player1Panel.getDeckFile()))) {
|
||||||
// error message must be send by sever
|
// error message must be send by sever
|
||||||
SessionHandler.removeTable(roomId, table.getTableId());
|
SessionHandler.removeTable(roomId, table.getTableId());
|
||||||
|
@ -664,7 +662,6 @@ public class NewTournamentDialog extends MageDialog {
|
||||||
updateNumSeats();
|
updateNumSeats();
|
||||||
}//GEN-LAST:event_spnNumSeatsStateChanged
|
}//GEN-LAST:event_spnNumSeatsStateChanged
|
||||||
|
|
||||||
|
|
||||||
private void spnNumWinsnumPlayersChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnNumWinsnumPlayersChanged
|
private void spnNumWinsnumPlayersChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnNumWinsnumPlayersChanged
|
||||||
int numSeats = (Integer) this.spnNumSeats.getValue();
|
int numSeats = (Integer) this.spnNumSeats.getValue();
|
||||||
int numWins = (Integer) this.spnNumSeats.getValue();
|
int numWins = (Integer) this.spnNumSeats.getValue();
|
||||||
|
@ -693,7 +690,6 @@ public class NewTournamentDialog extends MageDialog {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void cbDraftCubeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbDraftCubeActionPerformed
|
private void cbDraftCubeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbDraftCubeActionPerformed
|
||||||
cubeFromDeckFilename = "";
|
cubeFromDeckFilename = "";
|
||||||
if (cbDraftCube.getSelectedItem().toString().equals("Cube From Deck")) {
|
if (cbDraftCube.getSelectedItem().toString().equals("Cube From Deck")) {
|
||||||
|
@ -914,7 +910,6 @@ public class NewTournamentDialog extends MageDialog {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void drawPlayers() {
|
private void drawPlayers() {
|
||||||
this.pnlOtherPlayers.removeAll();
|
this.pnlOtherPlayers.removeAll();
|
||||||
for (TournamentPlayerPanel panel : players) {
|
for (TournamentPlayerPanel panel : players) {
|
||||||
|
@ -1039,7 +1034,8 @@ public class NewTournamentDialog extends MageDialog {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save the settings to java prefs to reload it next time the dialog will be created
|
* Save the settings to java prefs to reload it next time the dialog will be
|
||||||
|
* created
|
||||||
*
|
*
|
||||||
* @param tOptions Tournament options
|
* @param tOptions Tournament options
|
||||||
*/
|
*/
|
||||||
|
@ -1091,7 +1087,6 @@ public class NewTournamentDialog extends MageDialog {
|
||||||
return table;
|
return table;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
private javax.swing.JButton btnCancel;
|
private javax.swing.JButton btnCancel;
|
||||||
private javax.swing.JButton btnOk;
|
private javax.swing.JButton btnOk;
|
||||||
|
|
Loading…
Reference in a new issue