mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
[UI] Quick game start missing test.dck handling
This commit is contained in:
parent
ed654092f3
commit
50ffb96a3f
1 changed files with 8 additions and 0 deletions
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue