only use new input methods if in desktop GUI; remove debugging prints

This commit is contained in:
Peter F. Patel-Schneider
2019-01-11 03:48:42 -05:00
parent 09fc3ae60c
commit 3609ff9eff
3 changed files with 7 additions and 9 deletions

View File

@@ -184,7 +184,6 @@ public class ListCardArea extends CardArea {
//update index of dragged card in hand zone to match new index within hand area //update index of dragged card in hand zone to match new index within hand area
final int index = getCardPanels().indexOf(dragPanel); final int index = getCardPanels().indexOf(dragPanel);
if (validIndex(dragCard,index)) { if (validIndex(dragCard,index)) {
System.out.print("Really move card to index "); System.out.println(index);
synchronized (cardList) { synchronized (cardList) {
cardList.remove(dragCard); cardList.remove(dragCard);
cardList.add(index, dragCard); cardList.add(index, dragCard);
@@ -195,10 +194,8 @@ public class ListCardArea extends CardArea {
} }
private void loadLocation() { private void loadLocation() {
System.out.println("loadlocation");
if (locPref != null) { if (locPref != null) {
String value = prefs.getPref(locPref); String value = prefs.getPref(locPref);
System.out.print(locPref); System.out.println(value);
if (value.length() > 0) { if (value.length() > 0) {
String[] coords = value.split(COORD_DELIM); String[] coords = value.split(COORD_DELIM);
if (coords.length == 4) { if (coords.length == 4) {

View File

@@ -523,7 +523,8 @@ public class MatchController extends AbstractGuiGame {
@Override @Override
public List<Card> manipulateCardList(final String title, final List<Card> cards, final List<Card> manipulable, final boolean toTop, final boolean toBottom, final boolean toAnywhere) { public List<Card> manipulateCardList(final String title, final List<Card> cards, final List<Card> manipulable, final boolean toTop, final boolean toBottom, final boolean toAnywhere) {
return null; // pfps not implemented yet System.err.println("Not implemented yet - should never be called");
return null;
} }
@Override @Override

View File

@@ -349,9 +349,9 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
} }
private boolean useSelectCardsInput(final FCollectionView<? extends GameEntity> sourceList) { private boolean useSelectCardsInput(final FCollectionView<? extends GameEntity> sourceList) {
if ( FThreads.isGuiThread() ) { return false; } // can't use InputSelect from GUI thread (e.g., DevMode Tutor)
// if UI_SELECT_FROM_CARD_DISPLAYS not set use InputSelect only for battlefield and player hand // if UI_SELECT_FROM_CARD_DISPLAYS not set use InputSelect only for battlefield and player hand
// if UI_SELECT_FROM_CARD_DISPLAYS set use InputSelect for any zone that can be shown // if UI_SELECT_FROM_CARD_DISPLAYS set and using desktop GUI use InputSelect for any zone that can be shown
if ( FThreads.isGuiThread() ) { return false; } // also can't use InputSelect from GUI thread (e.g., DevMode Tutor)
for (final GameEntity c : sourceList) { for (final GameEntity c : sourceList) {
if (c instanceof Player) { if (c instanceof Player) {
continue; continue;
@@ -362,7 +362,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
final Zone cz = ((Card) c).getZone(); final Zone cz = ((Card) c).getZone();
final boolean useUiPointAtCard = final boolean useUiPointAtCard =
cz != null && cz != null &&
FModel.getPreferences().getPrefBoolean(FPref.UI_SELECT_FROM_CARD_DISPLAYS) ? (FModel.getPreferences().getPrefBoolean(FPref.UI_SELECT_FROM_CARD_DISPLAYS) && (!GuiBase.getInterface().isLibgdxPort()) ) ?
(cz.is(ZoneType.Battlefield) || cz.is(ZoneType.Hand) || cz.is(ZoneType.Library) || (cz.is(ZoneType.Battlefield) || cz.is(ZoneType.Hand) || cz.is(ZoneType.Library) ||
cz.is(ZoneType.Graveyard) || cz.is(ZoneType.Exile) || cz.is(ZoneType.Flashback) || cz.is(ZoneType.Command)) : cz.is(ZoneType.Graveyard) || cz.is(ZoneType.Exile) || cz.is(ZoneType.Flashback) || cz.is(ZoneType.Command)) :
(cz.is(ZoneType.Hand) && cz.getPlayer() == player || cz.is(ZoneType.Battlefield)); (cz.is(ZoneType.Hand) && cz.getPlayer() == player || cz.is(ZoneType.Battlefield));
@@ -758,14 +758,14 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
CardCollection toTop = null; CardCollection toTop = null;
tempShowCards(topN); tempShowCards(topN);
if ( FModel.getPreferences().getPrefBoolean(FPref.UI_SELECT_FROM_CARD_DISPLAYS) ) { if ( FModel.getPreferences().getPrefBoolean(FPref.UI_SELECT_FROM_CARD_DISPLAYS) &&
(!GuiBase.getInterface().isLibgdxPort()) ) {
ArrayList<Card> cardList = new ArrayList<Card>(); // pfps there must be a better way ArrayList<Card> cardList = new ArrayList<Card>(); // pfps there must be a better way
for (final Card card : player.getCardsIn(ZoneType.Library)) { for (final Card card : player.getCardsIn(ZoneType.Library)) {
cardList.add(card); cardList.add(card);
} }
ImmutablePair<CardCollection, CardCollection> result = ImmutablePair<CardCollection, CardCollection> result =
arrangeForMove("Move cards to top or bottom of library", cardList, topN, true, true); arrangeForMove("Move cards to top or bottom of library", cardList, topN, true, true);
System.out.print("Arrange "); System.out.println(result);
toTop = result.getLeft(); toTop = result.getLeft();
toBottom = result.getRight(); toBottom = result.getRight();
} else { } else {