From 8b563e2c479e3460c0cfbedba2a95fe2199000bd Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 05:33:04 +0000 Subject: [PATCH] * fix for targeting in new GUI ex. Chandra Nalaar always targeted itself --- src/forge/GuiDisplay4.java | 33 ++++----------------------------- src/forge/Input_Cleanup.java | 4 +++- 2 files changed, 7 insertions(+), 30 deletions(-) diff --git a/src/forge/GuiDisplay4.java b/src/forge/GuiDisplay4.java index e4e624722e8..d2face0ab5c 100644 --- a/src/forge/GuiDisplay4.java +++ b/src/forge/GuiDisplay4.java @@ -391,22 +391,8 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo } } } - - inputControl.selectCard(c, AllZone.Human_Play); - - } - } - }); - //self play (no land) ---- Mouse - playerPlayPanel.addMouseListener(new MouseAdapter() { - - @Override - public void mousePressed(MouseEvent e) { - Card c = playerPlayPanel.getCardFromMouseOverPanel(); - if(c != null) { + CardList att = new CardList(AllZone.Combat.getAttackers()); - //CardList block = AllZone.Combat.getAllBlockers(); - if((c.isTapped() ||c.hasSickness() || ((c.getKeyword().contains("Vigilance")) && att.contains(c))) && (inputControl.input instanceof Input_Attack)) { arcane.ui.CardPanel cardPanel = playerPlayPanel.getCardPanel(c.getUniqueNumber()); @@ -416,28 +402,17 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo } } } - //right click: + if(e.isMetaDown()) { if(att.contains(c) && (inputControl.input instanceof Input_Attack)) { c.untap(); AllZone.Combat.removeFromCombat(c); } - - /* - // won't work yet: - else if (block.contains(cardPanel.getCard()) && inputControl.input instanceof Input_Block) - { - Card crd = cardPanel.getCard(); - AllZone.Combat.removeFromCombat(crd); - } - */ - - } - - else inputControl.selectCard(c, AllZone.Human_Play); + } else inputControl.selectCard(c, AllZone.Human_Play); } } }); + //self hand ---- Mouse playerHandPanel.addMouseListener(new MouseAdapter() { diff --git a/src/forge/Input_Cleanup.java b/src/forge/Input_Cleanup.java index 41e34b3aa7f..5bf597baa97 100644 --- a/src/forge/Input_Cleanup.java +++ b/src/forge/Input_Cleanup.java @@ -3,6 +3,8 @@ package forge; import java.util.LinkedList; +import com.esotericsoftware.minlog.Log; + public class Input_Cleanup extends Input { private static final long serialVersionUID = -4164275418971547948L; @@ -116,7 +118,7 @@ public class Input_Cleanup extends Input { AllZone.GameAction.discard(card); showMessage(); //We need a nextPhase here or else it will never get the needToNextPhase from showMessage() (because there isn't a nextPhsae() in the stack). - System.out.println("There better not be a nextPhase() on the stack!"); + Log.debug("There better not be a nextPhase() on the stack!"); if(AllZone.Phase != null) { if(AllZone.Phase.isNeedToNextPhase()) { AllZone.Phase.setNeedToNextPhase(false);