mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
* fix for targeting in new GUI ex. Chandra Nalaar always targeted itself
This commit is contained in:
@@ -392,21 +392,7 @@ 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 att = new CardList(AllZone.Combat.getAttackers());
|
||||||
//CardList block = AllZone.Combat.getAllBlockers();
|
|
||||||
|
|
||||||
if((c.isTapped() ||c.hasSickness() || ((c.getKeyword().contains("Vigilance")) && att.contains(c)))
|
if((c.isTapped() ||c.hasSickness() || ((c.getKeyword().contains("Vigilance")) && att.contains(c)))
|
||||||
&& (inputControl.input instanceof Input_Attack)) {
|
&& (inputControl.input instanceof Input_Attack)) {
|
||||||
arcane.ui.CardPanel cardPanel = playerPlayPanel.getCardPanel(c.getUniqueNumber());
|
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(e.isMetaDown()) {
|
||||||
if(att.contains(c) && (inputControl.input instanceof Input_Attack)) {
|
if(att.contains(c) && (inputControl.input instanceof Input_Attack)) {
|
||||||
c.untap();
|
c.untap();
|
||||||
AllZone.Combat.removeFromCombat(c);
|
AllZone.Combat.removeFromCombat(c);
|
||||||
}
|
}
|
||||||
|
} else inputControl.selectCard(c, AllZone.Human_Play);
|
||||||
/*
|
|
||||||
// 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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//self hand ---- Mouse
|
//self hand ---- Mouse
|
||||||
playerHandPanel.addMouseListener(new MouseAdapter() {
|
playerHandPanel.addMouseListener(new MouseAdapter() {
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package forge;
|
|||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
|
||||||
|
import com.esotericsoftware.minlog.Log;
|
||||||
|
|
||||||
|
|
||||||
public class Input_Cleanup extends Input {
|
public class Input_Cleanup extends Input {
|
||||||
private static final long serialVersionUID = -4164275418971547948L;
|
private static final long serialVersionUID = -4164275418971547948L;
|
||||||
@@ -116,7 +118,7 @@ public class Input_Cleanup extends Input {
|
|||||||
AllZone.GameAction.discard(card);
|
AllZone.GameAction.discard(card);
|
||||||
showMessage();
|
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).
|
//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 != null) {
|
||||||
if(AllZone.Phase.isNeedToNextPhase()) {
|
if(AllZone.Phase.isNeedToNextPhase()) {
|
||||||
AllZone.Phase.setNeedToNextPhase(false);
|
AllZone.Phase.setNeedToNextPhase(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user