From bebb2a4de78885a914645a3391b3ddc565140b77 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 15 Apr 2017 18:51:54 +0200 Subject: [PATCH] Fixed a problem that it was not possible to create tournaments with "Human" players ( related to #3083 ?). --- .../client/dialog/NewTournamentDialog.java | 31 ++++++++----------- 1 file changed, 13 insertions(+), 18 deletions(-) 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 205442fde9..c3f38fc4c8 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java @@ -26,13 +26,19 @@ * or implied, of BetaSteward_at_googlemail.com. */ -/* + /* * NewTournamentDialog.java * * Created on Jan 28, 2011, 12:15:56 PM */ 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.importer.DeckImporterUtil; import mage.cards.repository.ExpansionInfo; @@ -55,13 +61,6 @@ import mage.view.TableView; import mage.view.TournamentTypeView; 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 */ @@ -127,10 +126,9 @@ public class NewTournamentDialog extends MageDialog { } /** - * 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. + * 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 @@ -603,7 +601,7 @@ public class NewTournamentDialog extends MageDialog { DeckImporterUtil.importDeck(this.player1Panel.getDeckFile()), tOptions.getPassword())) { 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()))) { // error message must be send by sever SessionHandler.removeTable(roomId, table.getTableId()); @@ -664,7 +662,6 @@ public class NewTournamentDialog extends MageDialog { updateNumSeats(); }//GEN-LAST:event_spnNumSeatsStateChanged - private void spnNumWinsnumPlayersChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnNumWinsnumPlayersChanged int numSeats = (Integer) this.spnNumSeats.getValue(); int numWins = (Integer) this.spnNumSeats.getValue(); @@ -693,7 +690,6 @@ public class NewTournamentDialog extends MageDialog { return ""; } - private void cbDraftCubeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbDraftCubeActionPerformed cubeFromDeckFilename = ""; if (cbDraftCube.getSelectedItem().toString().equals("Cube From Deck")) { @@ -914,7 +910,6 @@ public class NewTournamentDialog extends MageDialog { } - private void drawPlayers() { this.pnlOtherPlayers.removeAll(); 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 */ @@ -1091,7 +1087,6 @@ public class NewTournamentDialog extends MageDialog { return table; } - // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnCancel; private javax.swing.JButton btnOk;