mirror of
https://github.com/correl/mage.git
synced 2025-04-06 01:04:10 -09:00
* Added Momir Basic format to table filtering so Momir Basic games are shown.
This commit is contained in:
parent
5262d8d358
commit
79c04eef47
2 changed files with 79 additions and 73 deletions
Mage.Client/src/main/java/mage/client
|
@ -71,7 +71,9 @@ public class NewTableDialog extends MageDialog {
|
|||
|
||||
private static final String LIMITED = "Limited";
|
||||
|
||||
/** Creates new form NewTableDialog */
|
||||
/**
|
||||
* Creates new form NewTableDialog
|
||||
*/
|
||||
public NewTableDialog() {
|
||||
session = MageFrame.getSession();
|
||||
lastSessionId = "";
|
||||
|
@ -82,10 +84,10 @@ public class NewTableDialog extends MageDialog {
|
|||
MageFrame.getUI().addButton(MageComponents.NEW_TABLE_OK_BUTTON, btnOK);
|
||||
}
|
||||
|
||||
/** 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")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
|
@ -391,8 +393,7 @@ public class NewTableDialog extends MageDialog {
|
|||
this.player1Panel.getPlayerName(),
|
||||
"Human", 1,
|
||||
DeckImporterUtil.importDeck(this.player1Panel.getDeckFile()),
|
||||
this.txtPassword.getText())
|
||||
) {
|
||||
this.txtPassword.getText())) {
|
||||
for (TablePlayerPanel player : players) {
|
||||
if (!player.getPlayerType().equals("Human")) {
|
||||
if (!player.joinTable(roomId, table.getTableId())) {
|
||||
|
@ -432,7 +433,8 @@ public class NewTableDialog extends MageDialog {
|
|||
}//GEN-LAST:event_spnNumWinsnumPlayersChanged
|
||||
|
||||
/**
|
||||
* Checks about not valid game option combinations and shows an error message
|
||||
* Checks about not valid game option combinations and shows an error
|
||||
* message
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
|
@ -451,6 +453,12 @@ public class NewTableDialog extends MageDialog {
|
|||
return false;
|
||||
}
|
||||
break;
|
||||
case "Variant Magic - Momir Basic":
|
||||
if (!options.getGameType().startsWith("Momir Basic")) {
|
||||
JOptionPane.showMessageDialog(MageFrame.getDesktop(), "Deck type Momir Basic needs also a Momir Basic game type", "Error", JOptionPane.ERROR_MESSAGE);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
switch (options.getGameType()) {
|
||||
case "Commander Two Player Duel":
|
||||
|
@ -504,8 +512,7 @@ public class NewTableDialog extends MageDialog {
|
|||
);
|
||||
}
|
||||
|
||||
}
|
||||
// remove player panels no longer needed
|
||||
} // remove player panels no longer needed
|
||||
else if (numPlayers < players.size()) {
|
||||
while (players.size() != numPlayers) {
|
||||
players.remove(players.size() - 1);
|
||||
|
@ -585,7 +592,6 @@ public class NewTableDialog extends MageDialog {
|
|||
prefPlayerTypes.addAll(Arrays.asList(playerTypes.split(",")));
|
||||
this.spnNumPlayers.setValue(Integer.parseInt(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_NUMBER_PLAYERS, "2")));
|
||||
|
||||
|
||||
String gameTypeName = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_GAME_TYPE, "Two Player Duel");
|
||||
for (GameTypeView gtv : session.getGameTypes()) {
|
||||
if (gtv.getName().equals(gameTypeName)) {
|
||||
|
@ -608,7 +614,6 @@ public class NewTableDialog extends MageDialog {
|
|||
this.spnNumWins.setValue(Integer.parseInt(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_NUMBER_OF_WINS, "2")));
|
||||
this.chkRollbackTurnsAllowed.setSelected(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_ROLLBACK_TURNS_ALLOWED, "Yes").equals("Yes"));
|
||||
|
||||
|
||||
int range = Integer.parseInt(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_RANGE, "1"));
|
||||
for (RangeOfInfluence roi : RangeOfInfluence.values()) {
|
||||
if (roi.getRange() == range) {
|
||||
|
@ -633,7 +638,8 @@ public class NewTableDialog 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 options
|
||||
* @param deckFile
|
||||
|
|
|
@ -501,7 +501,7 @@ public class TablesPanel extends javax.swing.JPanel {
|
|||
// type
|
||||
List<RowFilter<Object, Object>> typeFilterList = new ArrayList<>();
|
||||
if (btnTypeMatch.isSelected()) {
|
||||
typeFilterList.add(RowFilter.regexFilter("Two|Commander|Free|Tiny", TableTableModel.COLUMN_GAME_TYPE));
|
||||
typeFilterList.add(RowFilter.regexFilter("Two|Commander|Free|Tiny|Momir", TableTableModel.COLUMN_GAME_TYPE));
|
||||
}
|
||||
if (btnTypeTourneyConstructed.isSelected()) {
|
||||
typeFilterList.add(RowFilter.regexFilter("Constructed", TableTableModel.COLUMN_GAME_TYPE));
|
||||
|
@ -537,7 +537,7 @@ public class TablesPanel extends javax.swing.JPanel {
|
|||
formatFilterList.add(RowFilter.regexFilter("^Limited", TableTableModel.COLUMN_DECK_TYPE));
|
||||
}
|
||||
if (btnFormatOther.isSelected()) {
|
||||
formatFilterList.add(RowFilter.regexFilter("^Constructed - Pauper|^Constructed - Extended|^Constructed - Historical|^Constructed - Super", TableTableModel.COLUMN_DECK_TYPE));
|
||||
formatFilterList.add(RowFilter.regexFilter("^Momir Basic|^Constructed - Pauper|^Constructed - Extended|^Constructed - Historical|^Constructed - Super", TableTableModel.COLUMN_DECK_TYPE));
|
||||
}
|
||||
|
||||
List<RowFilter<Object, Object>> skillFilterList = new ArrayList<>();
|
||||
|
|
Loading…
Add table
Reference in a new issue