From 50ffb96a3f2cc08b84050ef3f733bc1c29d9db62 Mon Sep 17 00:00:00 2001 From: magenoxx Date: Sun, 29 Jul 2012 08:34:04 +0400 Subject: [PATCH] [UI] Quick game start missing test.dck handling --- .../src/main/java/mage/client/table/TablesPanel.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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 b05e248391..4e6a05bd5c 100644 --- a/Mage.Client/src/main/java/mage/client/table/TablesPanel.java +++ b/Mage.Client/src/main/java/mage/client/table/TablesPanel.java @@ -58,6 +58,7 @@ import javax.swing.table.AbstractTableModel; import java.awt.*; import java.awt.event.ActionEvent; import java.beans.PropertyVetoException; +import java.io.File; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.*; @@ -508,6 +509,12 @@ public class TablesPanel extends javax.swing.JPanel { private void btnQuickStartActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnQuickStartActionPerformed TableView table; try { + File f = new File("test.dck"); + if (!f.exists()) { + JOptionPane.showMessageDialog(null, "Couldn't find test.dck file for quick game start", "Error", JOptionPane.ERROR_MESSAGE); + return; + } + MatchOptions options = new MatchOptions("1", "Two Player Duel"); options.getPlayerTypes().add("Human"); options.getPlayerTypes().add("Computer - mad"); @@ -516,6 +523,7 @@ public class TablesPanel extends javax.swing.JPanel { options.setRange(RangeOfInfluence.ALL); options.setWinsNeeded(1); table = session.createTable(roomId, options); + session.joinTable(roomId, table.getTableId(), "Human", "Human", 1, DeckImporterUtil.importDeck("test.dck")); session.joinTable(roomId, table.getTableId(), "Computer", "Computer - mad", 5, DeckImporterUtil.importDeck("test.dck")); session.startGame(roomId, table.getTableId());