diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.form b/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.form index 6a61f94de5..0ab0eb66fe 100644 --- a/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.form +++ b/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.form @@ -151,6 +151,17 @@ + + + + + + + + + + + diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.java b/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.java index 8cafcb5393..69499db2bc 100644 --- a/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.java +++ b/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.java @@ -70,10 +70,11 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene jScrollPane1.getViewport().setOpaque(false); } - public void loadCards(List sideboard, BigCard bigCard) { + public void loadCards(List sideboard, BigCard bigCard, boolean construct) { this.bigCard = bigCard; this.btnBooster.setVisible(false); this.btnClear.setVisible(false); + this.btnAddLand.setVisible(construct); this.cbExpansionSet.setVisible(false); this.cards.clear(); for (Card card: sideboard) { @@ -87,6 +88,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene this.bigCard = bigCard; this.btnBooster.setVisible(true); this.btnClear.setVisible(true); + this.btnAddLand.setVisible(false); this.cbExpansionSet.setVisible(true); Object[] l = Sets.getInstance().values().toArray(); Arrays.sort(l, new Comparator() { @@ -186,6 +188,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene cbExpansionSet = new javax.swing.JComboBox(); btnBooster = new javax.swing.JButton(); btnClear = new javax.swing.JButton(); + btnAddLand = new javax.swing.JButton(); jScrollPane1 = new javax.swing.JScrollPane(); cardGrid = new mage.client.cards.CardGrid(); tbTypes = new javax.swing.JToolBar(); @@ -302,6 +305,17 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene }); tbColor.add(btnClear); + btnAddLand.setText("Add Land"); + btnAddLand.setFocusable(false); + btnAddLand.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + btnAddLand.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + btnAddLand.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnAddLandActionPerformed(evt); + } + }); + tbColor.add(btnAddLand); + jScrollPane1.setViewportView(cardGrid); tbTypes.setFloatable(false); @@ -507,7 +521,6 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene private void btnClearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnClearActionPerformed cards.clear(); filterCards(); -// this.cardGrid.loadCards(new CardsView(cards), bigCard, null); }//GEN-LAST:event_btnClearActionPerformed private void btnBoosterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBoosterActionPerformed @@ -516,11 +529,15 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene cards.add(card); } filterCards(); -// this.cardGrid.loadCards(new CardsView(cards), bigCard, null); }//GEN-LAST:event_btnBoosterActionPerformed + private void btnAddLandActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddLandActionPerformed + + }//GEN-LAST:event_btnAddLandActionPerformed + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton btnAddLand; private javax.swing.JButton btnBooster; private javax.swing.JButton btnClear; private mage.client.cards.CardGrid cardGrid; diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/DeckEditorPanel.java b/Mage.Client/src/main/java/mage/client/deckeditor/DeckEditorPanel.java index fdbfd86237..4e9fe9b677 100644 --- a/Mage.Client/src/main/java/mage/client/deckeditor/DeckEditorPanel.java +++ b/Mage.Client/src/main/java/mage/client/deckeditor/DeckEditorPanel.java @@ -89,17 +89,28 @@ public class DeckEditorPanel extends javax.swing.JPanel { } public void showDeckEditor(DeckEditorMode mode, Deck deck, UUID tableId) { - if (deck != null) { + if (deck != null) this.deck = deck; - this.tableId = tableId; - this.mode = mode; - this.btnSubmit.setVisible(mode == DeckEditorMode.Sideboard || mode == DeckEditorMode.Limited); - this.cardSelector.loadCards(new ArrayList(deck.getSideboard()), this.bigCard); - this.deckArea.showSideboard(false); - } - else { - this.cardSelector.loadCards(this.bigCard); - this.deckArea.showSideboard(true); + this.tableId = tableId; + this.mode = mode; + switch (mode) { + case Limited: + case Sideboard: + this.btnSubmit.setVisible(true); + this.cardSelector.loadCards(new ArrayList(deck.getSideboard()), this.bigCard, mode == DeckEditorMode.Limited); + this.btnExit.setVisible(false); + this.btnImport.setVisible(false); + this.btnLoad.setVisible(false); + this.deckArea.showSideboard(false); + break; + case Constructed: + this.btnSubmit.setVisible(false); + this.cardSelector.loadCards(this.bigCard); + this.btnExit.setVisible(true); + this.btnImport.setVisible(true); + this.btnLoad.setVisible(true); + this.deckArea.showSideboard(true); + break; } init(); }