- Rewrite Dev features to use getGui().many correctly.

- Revert the ListChooser thing for now.
This commit is contained in:
Michael Kamensky
2021-02-28 07:40:21 +03:00
parent dc26f99309
commit 50425bf68e
2 changed files with 8 additions and 6 deletions

View File

@@ -287,7 +287,7 @@ public class ListChooser<T> {
@Override @Override
public void valueChanged(final ListSelectionEvent e) { public void valueChanged(final ListSelectionEvent e) {
final int num = ListChooser.this.lstChoices.getSelectedIndices().length; final int num = ListChooser.this.lstChoices.getSelectedIndices().length;
ListChooser.this.optionPane.setButtonEnabled(0, (num >= ListChooser.this.minChoices) && (num <= ListChooser.this.maxChoices || ListChooser.this.maxChoices == -1)); ListChooser.this.optionPane.setButtonEnabled(0, (num >= ListChooser.this.minChoices) && (num <= ListChooser.this.maxChoices));
} }
} }

View File

@@ -2627,9 +2627,10 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
} }
Player p = gameCachePlayer.get(pv); Player p = gameCachePlayer.get(pv);
GameEntityViewMap<Card, CardView> gameCacheExile = GameEntityView.getMap(p.getCardsIn(ZoneType.Hand)); CardCollectionView inHand = p.getCardsIn(ZoneType.Hand);
GameEntityViewMap<Card, CardView> gameCacheExile = GameEntityView.getMap(inHand);
List<CardView> views = getGui().many(localizer.getMessage("lblChooseCardsExile"), localizer.getMessage("lblDiscarded"), 0, -1, List<CardView> views = getGui().many(localizer.getMessage("lblChooseCardsExile"), localizer.getMessage("lblDiscarded"), 0, inHand.size(),
gameCacheExile.getTrackableKeys(), null); gameCacheExile.getTrackableKeys(), null);
final CardCollection selection = new CardCollection(); final CardCollection selection = new CardCollection();
@@ -2665,9 +2666,10 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
} }
Player p = gameCachePlayer.get(pv); Player p = gameCachePlayer.get(pv);
GameEntityViewMap<Card, CardView> gameCacheExile = GameEntityView.getMap(p.getCardsIn(ZoneType.Battlefield)); CardCollectionView otb = p.getCardsIn(ZoneType.Battlefield);
GameEntityViewMap<Card, CardView> gameCacheExile = GameEntityView.getMap(otb);
List<CardView> views = getGui().many(localizer.getMessage("lblChooseCardsExile"), localizer.getMessage("lblDiscarded"), 0, -1, List<CardView> views = getGui().many(localizer.getMessage("lblChooseCardsExile"), localizer.getMessage("lblDiscarded"), 0, otb.size(),
gameCacheExile.getTrackableKeys(), null); gameCacheExile.getTrackableKeys(), null);
final CardCollection selection = new CardCollection(); final CardCollection selection = new CardCollection();
@@ -2708,7 +2710,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
CardCollectionView cards = p.getCardsIn(ZoneType.smartValueOf(zone)); CardCollectionView cards = p.getCardsIn(ZoneType.smartValueOf(zone));
GameEntityViewMap<Card, CardView> gameCacheExile = GameEntityView.getMap(cards); GameEntityViewMap<Card, CardView> gameCacheExile = GameEntityView.getMap(cards);
List<CardView> views = getGui().many(localizer.getMessage("lblChooseCardsRemoveFromGame"), localizer.getMessage("lblRemoved"), 0, -1, List<CardView> views = getGui().many(localizer.getMessage("lblChooseCardsRemoveFromGame"), localizer.getMessage("lblRemoved"), 0, cards.size(),
gameCacheExile.getTrackableKeys(), null); gameCacheExile.getTrackableKeys(), null);
final CardCollection selection = new CardCollection(); final CardCollection selection = new CardCollection();