From 7c6d93ee6660ee1ab18b4ac50e817d00f18bdce8 Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 14:31:33 +0000 Subject: [PATCH] minor description and stack description edits in a few different areas. --- src/forge/CardFactory.java | 8 +- src/forge/CardFactory_Creatures.java | 14 +-- src/forge/CardFactory_Sorceries.java | 6 +- src/forge/GameActionUtil.java | 14 +-- src/forge/Gui_DeckEditor.java | 144 ++++++++++-------------- src/forge/PlayerZone_ComesIntoPlay.java | 2 +- 6 files changed, 81 insertions(+), 107 deletions(-) diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index 27c5e58d776..8e769984525 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -5310,7 +5310,7 @@ public class CardFactory implements NewConstants { } }//resolve() };//SpellAbility - ability.setStackDescription("Oblivion Ring - returning permanent to play."); + ability.setStackDescription("Oblivion Ring - returning permanent to the battlefield."); AllZone.Stack.add(ability); }//execute() };//Command @@ -5399,7 +5399,7 @@ public class CardFactory implements NewConstants { }//resolve() };//SpellAbility StringBuilder sb = new StringBuilder(); - sb.append(card.getName()).append(" - returning creature to play"); + sb.append(card.getName()).append(" - returning creature to the battlefield"); ability.setStackDescription(sb.toString()); AllZone.Stack.add(ability); @@ -5703,7 +5703,7 @@ public class CardFactory implements NewConstants { private static final long serialVersionUID = 4511445425867383336L; public void execute() { - //put cards removed by Necropotence into player's hand + //put cards removed by Necropotence into the player's hand if(necroCards.size() > 0) { PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController()); @@ -7352,7 +7352,7 @@ public class CardFactory implements NewConstants { }//if }//resolve() };//SpellAbility - ability.setStackDescription("Journey To Nowhere - returning creature to play."); + ability.setStackDescription("Journey To Nowhere - returning creature to the battlefield."); AllZone.Stack.add(ability); }//execute() };//Command diff --git a/src/forge/CardFactory_Creatures.java b/src/forge/CardFactory_Creatures.java index c496ea72191..a9c3e4f7f6d 100644 --- a/src/forge/CardFactory_Creatures.java +++ b/src/forge/CardFactory_Creatures.java @@ -818,10 +818,10 @@ public class CardFactory_Creatures { };//SpellAbility a1.makeUntapAbility(); card.addSpellAbility(a1); - a1.setDescription("1 W W, Untap: Return target creature card with converted mana cost 3 or less from your graveyard to play."); + a1.setDescription("1 W W, Untap: Return target creature card with converted mana cost 3 or less from your graveyard to the battlefield."); StringBuilder sb = new StringBuilder(); - sb.append(card.getName()).append(" - return target creature card with converted mana cost 3 or less from your graveyard to play."); + sb.append(card.getName()).append(" - return target creature card with converted mana cost 3 or less from your graveyard to the battlefield."); a1.setStackDescription(sb.toString()); a1.setBeforePayMana(new Input_PayManaCost(a1)); @@ -3633,7 +3633,7 @@ public class CardFactory_Creatures { };//SpellAbility StringBuilder sb = new StringBuilder(); - sb.append(card.getName()).append(" - returning creature to play"); + sb.append(card.getName()).append(" - returning creature to the battlefield"); ability.setStackDescription(sb.toString()); AllZone.Stack.add(ability); @@ -3756,7 +3756,7 @@ public class CardFactory_Creatures { } }//resolve() };//SpellAbility - ability.setStackDescription("Faceless Butcher - returning creature to play"); + ability.setStackDescription("Faceless Butcher - returning creature to the battlefield"); AllZone.Stack.add(ability); }//execute() };//Command @@ -4849,7 +4849,7 @@ public class CardFactory_Creatures { private static final long serialVersionUID = -2433442359225521472L; public void execute() { - AllZone.Stack.add(new Ability(card, "0", "Adarkar Valkyrie - Return " + target[0] + " from graveyard to play") { + AllZone.Stack.add(new Ability(card, "0", "Adarkar Valkyrie - Return " + target[0] + " from graveyard to the battlefield") { @Override public void resolve() { PlayerZone grave = AllZone.getZone(target[0]); @@ -4901,7 +4901,7 @@ public class CardFactory_Creatures { StringBuilder sb = new StringBuilder(); sb.append("tap: When target creature other than Adarkar Valkyrie is put into a "); - sb.append("graveyard this turn, return that card to play under your control."); + sb.append("graveyard this turn, return that card to the battlefield under your control."); ability.setDescription(sb.toString()); }//*************** END ************ END ************************** @@ -11455,7 +11455,7 @@ public class CardFactory_Creatures { public void execute() { StringBuilder sb = new StringBuilder(); - sb.append(card.getName()).append(" - return up to 2 creatures with power < 2 from graveyard to play."); + sb.append(card.getName()).append(" - return up to 2 creatures with power < 2 from graveyard to the battlefield."); ability.setStackDescription(sb.toString()); AllZone.Stack.add(ability); diff --git a/src/forge/CardFactory_Sorceries.java b/src/forge/CardFactory_Sorceries.java index 2da89314fe8..940e1f9b416 100644 --- a/src/forge/CardFactory_Sorceries.java +++ b/src/forge/CardFactory_Sorceries.java @@ -1274,7 +1274,7 @@ public class CardFactory_Sorceries { int Spells = Pile1.size(); for( int i = 0; i < Spells; i++) { if(stop2 == false) { - Object check = AllZone.Display.getChoiceOptional("Select spells to play in reserve order: ", Pile1.toArray()); + Object check = AllZone.Display.getChoiceOptional("Select spells to play in reverse order: ", Pile1.toArray()); if(check != null) { if(((Card) check).isLand() == true) { if(CardFactoryUtil.canHumanPlayLand()) { @@ -1296,7 +1296,7 @@ public class CardFactory_Sorceries { int Spells = Pile2.size(); for( int i = 0; i < Spells; i++) { if(stop2 == false) { - Object check = AllZone.Display.getChoiceOptional("Select spells to play in reserve order: ", Pile2.toArray()); + Object check = AllZone.Display.getChoiceOptional("Select spells to play in reverse order: ", Pile2.toArray()); if(check != null) { if(((Card) check).isLand() == true) { if(CardFactoryUtil.canHumanPlayLand()) { @@ -1367,7 +1367,7 @@ public class CardFactory_Sorceries { } if(dragons.size() != 0) { - Object o = AllZone.Display.getChoiceOptional("Select an Dragon to put onto the battlefield", dragons.toArray()); + Object o = AllZone.Display.getChoiceOptional("Select a Dragon to put onto the battlefield", dragons.toArray()); card.getController().shuffle(); if(o != null) { diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index e064952979e..e3ec288ea7a 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -3768,7 +3768,7 @@ public class GameActionUtil { };//sacrificeCreature StringBuilder sb = new StringBuilder(); - sb.append(eve.getName()).append(" - remove a scream counter and return creatures to play."); + sb.append(eve.getName()).append(" - remove a scream counter and return creatures to the battlefield."); hallow.setStackDescription(sb.toString()); if(AllZone.GameAction.isCardExiled(eve)) { AllZone.Stack.add(hallow); @@ -5895,7 +5895,7 @@ public class GameActionUtil { StringBuilder sb = new StringBuilder(); sb.append(darien.getName()).append(" - ").append(darien.getController()); - sb.append(" puts ").append(damage).append(" Soldier tokens in play."); + sb.append(" puts ").append(damage).append(" Soldier tokens onto the battlefield."); ability.setStackDescription(sb.toString()); AllZone.Stack.add(ability); @@ -8807,7 +8807,7 @@ public class GameActionUtil { } } };// Ability - ability.setStackDescription("Debtors' Knell returns creature from graveyard to play"); + ability.setStackDescription("Debtors' Knell returns creature from graveyard to the battlefield."); AllZone.Stack.add(ability); }//for } // if creatures > 0 @@ -8942,7 +8942,7 @@ public class GameActionUtil { } };// Ability - ability.setStackDescription("Reya returns creature from graveyard back to play"); + ability.setStackDescription("Reya returns creature from graveyard to the battlefield."); AllZone.Stack.add(ability); } // if creatures > 0 } // reya @@ -12859,14 +12859,14 @@ public class GameActionUtil { // Holds Wirewood_Hivemaster's in play CardList hivemasterList = current.getName("Wirewood Hivemaster"); - // Holds Wirewood_Hivemaster's that are new to play + // Holds Wirewood_Hivemaster's that are new the battlefield CardList newHivemaster = new CardList(); - // Go through the list of Wirewood_Hivemaster's in play + // Go through the list of Wirewood_Hivemaster's on the battlefield for(int i = 0; i < hivemasterList.size(); i++) { Card c = hivemasterList.get(i); - // Check to see which Wirewood_Hivemaster's in play are new + // Check to see which Wirewood_Hivemaster's on the battlefield are new if(!wirewood.contains(c)) { newHivemaster.add(c); hivemasterList.remove(c); diff --git a/src/forge/Gui_DeckEditor.java b/src/forge/Gui_DeckEditor.java index a4a8f5766d8..854d1d2373b 100644 --- a/src/forge/Gui_DeckEditor.java +++ b/src/forge/Gui_DeckEditor.java @@ -13,8 +13,6 @@ import java.awt.Image; import java.awt.Point; //import java.awt.Rectangle; import java.awt.event.ActionEvent; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.WindowAdapter; @@ -35,6 +33,7 @@ import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; +import javax.swing.JTextField; import javax.swing.SwingUtilities; import javax.swing.border.Border; import javax.swing.border.EtchedBorder; @@ -93,7 +92,7 @@ public class Gui_DeckEditor extends JFrame implements CardContainer, DeckDisplay public JCheckBox redCheckBox = new JCheckBox("R", true); public JCheckBox greenCheckBox = new JCheckBox("G", true); public JCheckBox colorlessCheckBox = new JCheckBox("C", true); - + public JCheckBox landCheckBox = new JCheckBox("Land", true); public JCheckBox creatureCheckBox = new JCheckBox("Creature", true); public JCheckBox sorceryCheckBox = new JCheckBox("Sorcery", true); @@ -102,6 +101,11 @@ public class Gui_DeckEditor extends JFrame implements CardContainer, DeckDisplay public JCheckBox artifactCheckBox = new JCheckBox("Artifact", true); public JCheckBox enchantmentCheckBox = new JCheckBox("Enchant", true); + /*CHOPPIC*/ + private JButton filterButton = new JButton(); + public JTextField searchTextField = new JTextField(); + /*CHOPPIC*/ + private CardList top; private CardList bottom; public Card cCardHQ; @@ -234,6 +238,10 @@ public class Gui_DeckEditor extends JFrame implements CardContainer, DeckDisplay filteredOut = filterByType(c); } + if(!filteredOut) { + filteredOut = filterByName(c); + } + if(!filteredOut) { topModel.addCard(c); } @@ -242,6 +250,17 @@ public class Gui_DeckEditor extends JFrame implements CardContainer, DeckDisplay topModel.resort(); } + /*CHOPPIC*/ + private boolean filterByName(Card c){ + boolean filterOut = false; + if(!(searchTextField.getText() == "")){ + filterOut = !(c.getName().toLowerCase().contains(searchTextField.getText().toLowerCase())); + } + return filterOut; + } + /*CHOPPIC*/ + + private boolean filterByColor(Card c) { boolean filterOut = false; @@ -251,13 +270,13 @@ public class Gui_DeckEditor extends JFrame implements CardContainer, DeckDisplay } } - if(!blueCheckBox.isSelected()) { + if(!blueCheckBox.isSelected()) { if(CardUtil.getColors(c).contains(Constant.Color.Blue)) { filterOut = true; } } - if(!blackCheckBox.isSelected()) { + if(!blackCheckBox.isSelected()) { if(CardUtil.getColors(c).contains(Constant.Color.Black)) { filterOut = true; } @@ -523,6 +542,16 @@ public class Gui_DeckEditor extends JFrame implements CardContainer, DeckDisplay //addButton.setIcon(downIcon); if(!Gui_NewGame.useLAFFonts.isSelected()) addButton.setFont(new java.awt.Font("Dialog", 0, 13)); + /*CHOPPIC*/ + filterButton.setText("Filter"); + filterButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(ActionEvent e) { + filterButton_actionPerformed(e); + } + }); + if(!Gui_NewGame.useLAFFonts.isSelected()) analysisButton.setFont(new java.awt.Font("Dialog", 0, 13)); + /*CHOPPIC*/ + analysisButton.setText("Deck Analysis"); analysisButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { @@ -553,102 +582,36 @@ public class Gui_DeckEditor extends JFrame implements CardContainer, DeckDisplay Font f = new Font("Tahoma", Font.PLAIN, 10); if(!Gui_NewGame.useLAFFonts.isSelected()) landCheckBox.setFont(f); landCheckBox.setOpaque(false); - landCheckBox.addItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - updateDisplay(); - } - }); + landCheckBox.setToolTipText("Land"); if(!Gui_NewGame.useLAFFonts.isSelected()) creatureCheckBox.setFont(f); creatureCheckBox.setOpaque(false); - creatureCheckBox.addItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - updateDisplay(); - } - }); + creatureCheckBox.setToolTipText("Creature"); if(!Gui_NewGame.useLAFFonts.isSelected()) sorceryCheckBox.setFont(f); sorceryCheckBox.setOpaque(false); - sorceryCheckBox.addItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - updateDisplay(); - } - }); + sorceryCheckBox.setToolTipText("Sorcery"); if(!Gui_NewGame.useLAFFonts.isSelected()) instantCheckBox.setFont(f); instantCheckBox.setOpaque(false); - instantCheckBox.addItemListener(new ItemListener() { - - public void itemStateChanged(ItemEvent e) { - updateDisplay(); - } - }); + instantCheckBox.setToolTipText("Instant"); if(!Gui_NewGame.useLAFFonts.isSelected()) planeswalkerCheckBox.setFont(f); planeswalkerCheckBox.setOpaque(false); - planeswalkerCheckBox.addItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - updateDisplay(); - } - }); + planeswalkerCheckBox.setToolTipText("Planeswalker"); if(!Gui_NewGame.useLAFFonts.isSelected()) artifactCheckBox.setFont(f); artifactCheckBox.setOpaque(false); - artifactCheckBox.addItemListener(new ItemListener() { - - public void itemStateChanged(ItemEvent e) { - updateDisplay(); - } - }); + artifactCheckBox.setToolTipText("Artifact"); if(!Gui_NewGame.useLAFFonts.isSelected()) enchantmentCheckBox.setFont(f); enchantmentCheckBox.setOpaque(false); - enchantmentCheckBox.addItemListener(new ItemListener() { - - public void itemStateChanged(ItemEvent e) { - updateDisplay(); - } - }); + enchantmentCheckBox.setToolTipText("Enchantment"); /** * Color filtering */ whiteCheckBox.setOpaque(false); - whiteCheckBox.addItemListener(new ItemListener() { - - public void itemStateChanged(ItemEvent e) { - updateDisplay(); - } - }); blueCheckBox.setOpaque(false); - blueCheckBox.addItemListener(new ItemListener() { - - public void itemStateChanged(ItemEvent e) { - updateDisplay(); - } - }); blackCheckBox.setOpaque(false); - blackCheckBox.addItemListener(new ItemListener() { - - public void itemStateChanged(ItemEvent e) { - updateDisplay(); - } - }); redCheckBox.setOpaque(false); - redCheckBox.addItemListener(new ItemListener() { - - public void itemStateChanged(ItemEvent e) { - updateDisplay(); - } - }); greenCheckBox.setOpaque(false); - greenCheckBox.addItemListener(new ItemListener() { - - public void itemStateChanged(ItemEvent e) { - updateDisplay(); - } - }); colorlessCheckBox.setOpaque(false); - colorlessCheckBox.addItemListener(new ItemListener() { - - public void itemStateChanged(ItemEvent e) { - updateDisplay(); - } - }); + picture.addMouseListener(new CustomListener()); if(!Gui_NewGame.useLAFFonts.isSelected()) statsLabel.setFont(new java.awt.Font("Dialog", 0, 14)); statsLabel.setText("Total - 0, Creatures - 0 Land - 0"); @@ -668,16 +631,17 @@ public class Gui_DeckEditor extends JFrame implements CardContainer, DeckDisplay this.getContentPane().add(jLabel1, "span 3, wrap"); - this.getContentPane().add(jScrollPane1, "span 2 2, pushy, grow"); - this.getContentPane().add(detail, "w 239, h 323, grow, flowy, wrap"); + this.getContentPane().add(jScrollPane1, "span 2 2, pushy, grow"); + /*this.getContentPane().add(detail, "w 239, h 323, grow, flowy, wrap");*/ + this.getContentPane().add(detail, "align 50% 50%, w 239, h 323, flowy, wrap"); this.getContentPane().add(changePictureButton, "align 50% 0%,split 2, flowx"); this.getContentPane().add(removePictureButton, "align 50% 0%, wrap"); this.getContentPane().add(statsLabel2, "span 2"); this.getContentPane().add(pictureViewPanel, "wmin 239, hmin 323, grow, span 1 4, wrap"); - this.getContentPane().add(addButton, "align 50% 50%, w 146, h 49, sg button, span 1 2, split 2"); - this.getContentPane().add(removeButton, "w 146, h 49, sg button"); + this.getContentPane().add(addButton, "align 50% 50%, w 100, h 49, sg button, span 1 2, split 2"); + this.getContentPane().add(removeButton, "w 100, h 49, sg button"); this.getContentPane().add(landCheckBox, ", egx checkbox, split 7"); this.getContentPane().add(creatureCheckBox, ""); @@ -687,12 +651,16 @@ public class Gui_DeckEditor extends JFrame implements CardContainer, DeckDisplay this.getContentPane().add(artifactCheckBox, ""); this.getContentPane().add(enchantmentCheckBox, "wrap"); - this.getContentPane().add(whiteCheckBox, "split 7"); + this.getContentPane().add(whiteCheckBox, "split 9"); this.getContentPane().add(blueCheckBox, ""); this.getContentPane().add(blackCheckBox, ""); this.getContentPane().add(redCheckBox, ""); this.getContentPane().add(greenCheckBox, ""); this.getContentPane().add(colorlessCheckBox, ""); + /*CHOPPIC*/ + this.getContentPane().add(searchTextField, "wmin 100"); + this.getContentPane().add(filterButton, ""); + /*CHOPPIC*/ this.getContentPane().add(analysisButton, "wmin 166, hmin 25, wrap"); this.getContentPane().add(jScrollPane2, "span 2, grow, wrap"); @@ -700,7 +668,7 @@ public class Gui_DeckEditor extends JFrame implements CardContainer, DeckDisplay jScrollPane2.getViewport().add(bottomTable, null); jScrollPane1.getViewport().add(topTable, null); - + glassPane = new JPanel() { private static final long serialVersionUID = 7394924497724994317L; @@ -736,6 +704,12 @@ public class Gui_DeckEditor extends JFrame implements CardContainer, DeckDisplay }//if(valid row) }//addButton_actionPerformed + /*CHOPPIC*/ + void filterButton_actionPerformed(ActionEvent e) { + updateDisplay(); + } + /*CHOPPIC*/ + void analysisButton_actionPerformed(ActionEvent e) { if(bottomModel.getRowCount() == 0) { diff --git a/src/forge/PlayerZone_ComesIntoPlay.java b/src/forge/PlayerZone_ComesIntoPlay.java index a7625da5a82..d9bfa1fceb0 100644 --- a/src/forge/PlayerZone_ComesIntoPlay.java +++ b/src/forge/PlayerZone_ComesIntoPlay.java @@ -223,7 +223,7 @@ public class PlayerZone_ComesIntoPlay extends DefaultPlayerZone { }; StringBuilder sb = new StringBuilder(); sb.append(source).append(" - ").append(seedLand.getController()); - sb.append(" puts a 1/1 green Snake token in play"); + sb.append(" puts a 1/1 green Snake token onto the battlefield."); ability.setStackDescription(sb.toString()); AllZone.Stack.add(ability);