forked from External/mage
Merge branch 'master' into External-master
This commit is contained in:
commit
c19616a5fb
65 changed files with 282 additions and 160 deletions
|
|
@ -90,7 +90,7 @@ import java.util.stream.Collectors;
|
|||
*/
|
||||
public class MageFrame extends javax.swing.JFrame implements MageClient {
|
||||
|
||||
private static final String TITLE_NAME = "XMage";
|
||||
private static final String TITLE_NAME = "XMage (Foul Magics)";
|
||||
|
||||
private static final Logger LOGGER = Logger.getLogger(MageFrame.class);
|
||||
private static final String LITE_MODE_ARG = "-lite";
|
||||
|
|
@ -297,14 +297,6 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
errorDialog.setLocation(100, 100);
|
||||
desktopPane.add(errorDialog, errorDialog.isModal() ? JLayeredPane.MODAL_LAYER : JLayeredPane.PALETTE_LAYER);
|
||||
|
||||
try {
|
||||
this.whatsNewDialog = new WhatsNewDialog();
|
||||
} catch (Throwable e) {
|
||||
// example: JavaFX is not supported on old MacOS with OpenJDK
|
||||
// https://bugs.openjdk.java.net/browse/JDK-8202132
|
||||
LOGGER.error("JavaFX is not supported by your system. What's new page will be disabled.", e);
|
||||
this.whatsNewDialog = null;
|
||||
}
|
||||
|
||||
PING_SENDER_EXECUTOR.scheduleAtFixedRate(SessionHandler::ping, TablesPanel.PING_SERVER_SECS, TablesPanel.PING_SERVER_SECS, TimeUnit.SECONDS);
|
||||
|
||||
|
|
@ -385,11 +377,6 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
|
||||
setWindowTitle(); // make sure title is actual on startup
|
||||
});
|
||||
|
||||
// run what's new checks (loading in background)
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
showWhatsNewDialog(false);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -13,6 +13,12 @@ public final class Constants {
|
|||
private Constants() {
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
public static final String[] foulMagicsBlocks = {
|
||||
"* Foundations Block",
|
||||
"* Guilds of Ravnica Block",
|
||||
"* Return to Ravnica Block",
|
||||
};
|
||||
|
||||
public static final int FRAME_MAX_HEIGHT = 367;
|
||||
public static final int FRAME_MAX_WIDTH = 256;
|
||||
|
|
@ -144,5 +150,6 @@ public final class Constants {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ public class DeckGeneratorDialog {
|
|||
c.ipadx = 30;
|
||||
c.insets = new Insets(5, 10, 0, 10);
|
||||
c.weightx = 0.90;
|
||||
cbDeckSize = new JComboBox<>(new String[]{"40", "60"});
|
||||
cbDeckSize = new JComboBox<>(new String[]{"40", "60", "100"});
|
||||
cbDeckSize.setSelectedIndex(0);
|
||||
cbDeckSize.setAlignmentX(Component.LEFT_ALIGNMENT);
|
||||
mainPanel.add(cbDeckSize, c);
|
||||
|
|
|
|||
|
|
@ -222,6 +222,24 @@
|
|||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnExpansionSearchActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="btnFoulMagicPreset">
|
||||
<Properties>
|
||||
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||
<Image iconType="3" name="/buttons/brick.png"/>
|
||||
</Property>
|
||||
<Property name="toolTipText" type="java.lang.String" value="Set to Foul Magic preset"/>
|
||||
<Property name="alignmentX" type="float" value="1.0"/>
|
||||
<Property name="focusable" type="boolean" value="false"/>
|
||||
<Property name="horizontalTextPosition" type="int" value="0"/>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[23, 23]"/>
|
||||
</Property>
|
||||
<Property name="verticalTextPosition" type="int" value="3"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnFoulMagicPresetSet"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JToolBar$Separator" name="jSeparator2">
|
||||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="chkPennyDreadful">
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import mage.cards.decks.PennyDreadfulLegalityUtil;
|
|||
import mage.cards.repository.*;
|
||||
import mage.client.MageFrame;
|
||||
import mage.client.cards.*;
|
||||
import mage.client.constants.Constants;
|
||||
import mage.client.constants.Constants.SortBy;
|
||||
import mage.client.dialog.PreferencesDialog;
|
||||
import mage.client.deckeditor.table.TableModel;
|
||||
|
|
@ -562,6 +563,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
jSeparator1 = new javax.swing.JToolBar.Separator();
|
||||
cbExpansionSet = new javax.swing.JComboBox<>();
|
||||
btnExpansionSearch = new javax.swing.JButton();
|
||||
btnFoulMagicPreset = new javax.swing.JButton();
|
||||
jSeparator2 = new javax.swing.JToolBar.Separator();
|
||||
chkPennyDreadful = new javax.swing.JCheckBox();
|
||||
btnBooster = new javax.swing.JButton();
|
||||
|
|
@ -741,6 +743,21 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
}
|
||||
});
|
||||
tbColor.add(btnExpansionSearch);
|
||||
|
||||
btnFoulMagicPreset.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/brick.png"))); // NOI18N
|
||||
btnFoulMagicPreset.setToolTipText("Set to Foul Magic preset");
|
||||
btnFoulMagicPreset.setAlignmentX(1.0F);
|
||||
btnFoulMagicPreset.setFocusable(false);
|
||||
btnFoulMagicPreset.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
|
||||
btnFoulMagicPreset.setPreferredSize(new java.awt.Dimension(24, 24));
|
||||
btnFoulMagicPreset.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
||||
btnFoulMagicPreset.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
btnFoulMagicPresetSet(evt);
|
||||
}
|
||||
});
|
||||
tbColor.add(btnFoulMagicPreset);
|
||||
|
||||
tbColor.add(jSeparator2);
|
||||
|
||||
chkPennyDreadful.setText("Penny Dreadful Only");
|
||||
|
|
@ -1465,6 +1482,26 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
private void chkUniqueActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkRulesActionPerformed
|
||||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_chkRulesActionPerformed
|
||||
|
||||
private void btnFoulMagicPresetSet(java.awt.event.ActionEvent evt) {
|
||||
if (cbExpansionSet.getItemAt(0).startsWith(MULTI_SETS_SELECTION_TEXT)) {
|
||||
cbExpansionSet.removeItemAt(0);
|
||||
}
|
||||
|
||||
listCodeSelected.uncheckAll();
|
||||
|
||||
List<String> formats = ConstructedFormats.getTypes(false);
|
||||
for (int i = 0; i < formats.size(); i++) {
|
||||
if (Arrays.stream(Constants.foulMagicsBlocks).anyMatch(formats.get(i)::equals)) {
|
||||
listCodeSelected.setChecked(i - 1, true);
|
||||
}
|
||||
}
|
||||
|
||||
String message = String.format("%s: %s", MULTI_SETS_SELECTION_TEXT, "[Foul Magics]");
|
||||
cbExpansionSet.insertItemAt(message, 0);
|
||||
cbExpansionSet.setSelectedIndex(0);
|
||||
filterCards();
|
||||
}
|
||||
|
||||
private void btnExpansionSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExpansionSearchActionPerformed
|
||||
// search and check multiple items
|
||||
|
|
@ -1505,6 +1542,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
isSetsFilterLoading = false;
|
||||
}
|
||||
|
||||
|
||||
// update data
|
||||
filterCards();
|
||||
});
|
||||
|
|
@ -1575,6 +1613,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
private javax.swing.JButton btnBooster;
|
||||
private javax.swing.JButton btnClear;
|
||||
private javax.swing.JButton btnExpansionSearch;
|
||||
private javax.swing.JButton btnFoulMagicPreset;
|
||||
private javax.swing.JLabel cardCount;
|
||||
private javax.swing.JLabel cardCountLabel;
|
||||
private javax.swing.JPanel cardSelectorBottomPanel;
|
||||
|
|
|
|||
|
|
@ -329,6 +329,7 @@ public class ConnectDialog extends MageDialog {
|
|||
});
|
||||
|
||||
btnFindBeta.setText("BETA");
|
||||
btnFindBeta.setEnabled(false);
|
||||
btnFindBeta.setToolTipText("Connect to BETA server, AI disabled (use any username without registration)");
|
||||
btnFindBeta.setAlignmentY(0.0F);
|
||||
btnFindBeta.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
|
||||
|
|
|
|||
|
|
@ -222,6 +222,7 @@ public class DownloadImagesDialog extends MageDialog {
|
|||
comboSets = new javax.swing.JComboBox<>();
|
||||
fillerMode1 = new javax.swing.Box.Filler(new java.awt.Dimension(5, 0), new java.awt.Dimension(5, 0), new java.awt.Dimension(5, 32767));
|
||||
buttonSearchSet = new javax.swing.JButton();
|
||||
|
||||
panelRedownload = new javax.swing.JPanel();
|
||||
checkboxRedownload = new javax.swing.JCheckBox();
|
||||
filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 5), new java.awt.Dimension(0, 3), new java.awt.Dimension(32767, 5));
|
||||
|
|
@ -354,8 +355,9 @@ public class DownloadImagesDialog extends MageDialog {
|
|||
buttonSearchSetActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
panelModeSelect.add(buttonSearchSet);
|
||||
|
||||
|
||||
panelModeInner.add(panelModeSelect);
|
||||
|
||||
panelMode.add(panelModeInner);
|
||||
|
|
@ -426,7 +428,7 @@ public class DownloadImagesDialog extends MageDialog {
|
|||
private void buttonSearchSetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSearchSetActionPerformed
|
||||
FastSearchUtil.showFastSearchForStringComboBox(comboSets, FastSearchUtil.DEFAULT_EXPANSION_SEARCH_MESSAGE, 400, 500);
|
||||
}//GEN-LAST:event_buttonSearchSetActionPerformed
|
||||
|
||||
|
||||
private void buttonStopActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonStopActionPerformed
|
||||
// TODO implement stop feature for cancel button
|
||||
}//GEN-LAST:event_buttonStopActionPerformed
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue