|
|
@ -13,6 +13,13 @@ public final class Constants {
|
||||||
private Constants() {
|
private Constants() {
|
||||||
throw new AssertionError();
|
throw new AssertionError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static final String[] foulMagicsBlocks = {
|
||||||
|
"* Foundations Block",
|
||||||
|
"* Guilds of Ravnica Block",
|
||||||
|
"* Return to Ravnica Block",
|
||||||
|
"* Ravnica Block",
|
||||||
|
};
|
||||||
|
|
||||||
public static final int FRAME_MAX_HEIGHT = 367;
|
public static final int FRAME_MAX_HEIGHT = 367;
|
||||||
public static final int FRAME_MAX_WIDTH = 256;
|
public static final int FRAME_MAX_WIDTH = 256;
|
||||||
|
|
@ -144,5 +151,6 @@ public final class Constants {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -222,6 +222,24 @@
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnExpansionSearchActionPerformed"/>
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnExpansionSearchActionPerformed"/>
|
||||||
</Events>
|
</Events>
|
||||||
</Component>
|
</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 class="javax.swing.JToolBar$Separator" name="jSeparator2">
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JCheckBox" name="chkPennyDreadful">
|
<Component class="javax.swing.JCheckBox" name="chkPennyDreadful">
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import mage.cards.decks.PennyDreadfulLegalityUtil;
|
||||||
import mage.cards.repository.*;
|
import mage.cards.repository.*;
|
||||||
import mage.client.MageFrame;
|
import mage.client.MageFrame;
|
||||||
import mage.client.cards.*;
|
import mage.client.cards.*;
|
||||||
|
import mage.client.constants.Constants;
|
||||||
import mage.client.constants.Constants.SortBy;
|
import mage.client.constants.Constants.SortBy;
|
||||||
import mage.client.dialog.PreferencesDialog;
|
import mage.client.dialog.PreferencesDialog;
|
||||||
import mage.client.deckeditor.table.TableModel;
|
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();
|
jSeparator1 = new javax.swing.JToolBar.Separator();
|
||||||
cbExpansionSet = new javax.swing.JComboBox<>();
|
cbExpansionSet = new javax.swing.JComboBox<>();
|
||||||
btnExpansionSearch = new javax.swing.JButton();
|
btnExpansionSearch = new javax.swing.JButton();
|
||||||
|
btnFoulMagicPreset = new javax.swing.JButton();
|
||||||
jSeparator2 = new javax.swing.JToolBar.Separator();
|
jSeparator2 = new javax.swing.JToolBar.Separator();
|
||||||
chkPennyDreadful = new javax.swing.JCheckBox();
|
chkPennyDreadful = new javax.swing.JCheckBox();
|
||||||
btnBooster = new javax.swing.JButton();
|
btnBooster = new javax.swing.JButton();
|
||||||
|
|
@ -741,6 +743,21 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
tbColor.add(btnExpansionSearch);
|
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);
|
tbColor.add(jSeparator2);
|
||||||
|
|
||||||
chkPennyDreadful.setText("Penny Dreadful Only");
|
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
|
private void chkUniqueActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkRulesActionPerformed
|
||||||
// TODO add your handling code here:
|
// TODO add your handling code here:
|
||||||
}//GEN-LAST:event_chkRulesActionPerformed
|
}//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
|
private void btnExpansionSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExpansionSearchActionPerformed
|
||||||
// search and check multiple items
|
// search and check multiple items
|
||||||
|
|
@ -1505,6 +1542,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
||||||
isSetsFilterLoading = false;
|
isSetsFilterLoading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// update data
|
// update data
|
||||||
filterCards();
|
filterCards();
|
||||||
});
|
});
|
||||||
|
|
@ -1575,6 +1613,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
||||||
private javax.swing.JButton btnBooster;
|
private javax.swing.JButton btnBooster;
|
||||||
private javax.swing.JButton btnClear;
|
private javax.swing.JButton btnClear;
|
||||||
private javax.swing.JButton btnExpansionSearch;
|
private javax.swing.JButton btnExpansionSearch;
|
||||||
|
private javax.swing.JButton btnFoulMagicPreset;
|
||||||
private javax.swing.JLabel cardCount;
|
private javax.swing.JLabel cardCount;
|
||||||
private javax.swing.JLabel cardCountLabel;
|
private javax.swing.JLabel cardCountLabel;
|
||||||
private javax.swing.JPanel cardSelectorBottomPanel;
|
private javax.swing.JPanel cardSelectorBottomPanel;
|
||||||
|
|
|
||||||
|
|
@ -222,6 +222,7 @@ public class DownloadImagesDialog extends MageDialog {
|
||||||
comboSets = new javax.swing.JComboBox<>();
|
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));
|
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();
|
buttonSearchSet = new javax.swing.JButton();
|
||||||
|
|
||||||
panelRedownload = new javax.swing.JPanel();
|
panelRedownload = new javax.swing.JPanel();
|
||||||
checkboxRedownload = new javax.swing.JCheckBox();
|
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));
|
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);
|
buttonSearchSetActionPerformed(evt);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
panelModeSelect.add(buttonSearchSet);
|
panelModeSelect.add(buttonSearchSet);
|
||||||
|
|
||||||
panelModeInner.add(panelModeSelect);
|
panelModeInner.add(panelModeSelect);
|
||||||
|
|
||||||
panelMode.add(panelModeInner);
|
panelMode.add(panelModeInner);
|
||||||
|
|
@ -426,7 +428,7 @@ public class DownloadImagesDialog extends MageDialog {
|
||||||
private void buttonSearchSetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSearchSetActionPerformed
|
private void buttonSearchSetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSearchSetActionPerformed
|
||||||
FastSearchUtil.showFastSearchForStringComboBox(comboSets, FastSearchUtil.DEFAULT_EXPANSION_SEARCH_MESSAGE, 400, 500);
|
FastSearchUtil.showFastSearchForStringComboBox(comboSets, FastSearchUtil.DEFAULT_EXPANSION_SEARCH_MESSAGE, 400, 500);
|
||||||
}//GEN-LAST:event_buttonSearchSetActionPerformed
|
}//GEN-LAST:event_buttonSearchSetActionPerformed
|
||||||
|
|
||||||
private void buttonStopActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonStopActionPerformed
|
private void buttonStopActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonStopActionPerformed
|
||||||
// TODO implement stop feature for cancel button
|
// TODO implement stop feature for cancel button
|
||||||
}//GEN-LAST:event_buttonStopActionPerformed
|
}//GEN-LAST:event_buttonStopActionPerformed
|
||||||
|
|
|
||||||
BIN
Mage.Client/src/main/resources/buttons/brick.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 595 B After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 831 B After Width: | Height: | Size: 5 KiB |
|
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 6.3 KiB |