mirror of
https://github.com/correl/mage.git
synced 2024-11-25 03:00:11 +00:00
* GUI: added popup menu to view player's outside/sideboard at any time (allows to view only own or computer's sideboards);
This commit is contained in:
parent
eda50cc7b1
commit
28473c7bd0
12 changed files with 265 additions and 165 deletions
|
@ -34,7 +34,7 @@ public class CardInfoWindowDialog extends MageDialog {
|
||||||
private static final Logger LOGGER = Logger.getLogger(CardInfoWindowDialog.class);
|
private static final Logger LOGGER = Logger.getLogger(CardInfoWindowDialog.class);
|
||||||
|
|
||||||
public enum ShowType {
|
public enum ShowType {
|
||||||
REVEAL, REVEAL_TOP_LIBRARY, LOOKED_AT, EXILE, GRAVEYARD, COMPANION, OTHER
|
REVEAL, REVEAL_TOP_LIBRARY, LOOKED_AT, EXILE, GRAVEYARD, COMPANION, SIDEBOARD, OTHER
|
||||||
}
|
}
|
||||||
|
|
||||||
private final ShowType showType;
|
private final ShowType showType;
|
||||||
|
@ -89,6 +89,17 @@ public class CardInfoWindowDialog extends MageDialog {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
case SIDEBOARD:
|
||||||
|
this.setFrameIcon(new ImageIcon(ImageHelper.getImageFromResources("/info/library.png")));
|
||||||
|
this.setClosable(true);
|
||||||
|
this.setDefaultCloseOperation(HIDE_ON_CLOSE);
|
||||||
|
this.addInternalFrameListener(new InternalFrameAdapter() {
|
||||||
|
@Override
|
||||||
|
public void internalFrameClosing(InternalFrameEvent e) {
|
||||||
|
CardInfoWindowDialog.this.hideDialog();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
case EXILE:
|
case EXILE:
|
||||||
this.setFrameIcon(new ImageIcon(ImageManagerImpl.instance.getExileImage()));
|
this.setFrameIcon(new ImageIcon(ImageManagerImpl.instance.getExileImage()));
|
||||||
break;
|
break;
|
||||||
|
@ -96,6 +107,7 @@ public class CardInfoWindowDialog extends MageDialog {
|
||||||
this.setFrameIcon(new ImageIcon(ImageManagerImpl.instance.getTokenIconImage()));
|
this.setFrameIcon(new ImageIcon(ImageManagerImpl.instance.getTokenIconImage()));
|
||||||
this.setClosable(false);
|
this.setClosable(false);
|
||||||
break;
|
break;
|
||||||
|
case OTHER:
|
||||||
default:
|
default:
|
||||||
// no icon yet
|
// no icon yet
|
||||||
}
|
}
|
||||||
|
@ -149,12 +161,22 @@ public class CardInfoWindowDialog extends MageDialog {
|
||||||
|
|
||||||
public void loadCards(CardsView showCards, BigCard bigCard, UUID gameId, boolean revertOrder) {
|
public void loadCards(CardsView showCards, BigCard bigCard, UUID gameId, boolean revertOrder) {
|
||||||
cards.loadCards(showCards, bigCard, gameId, revertOrder);
|
cards.loadCards(showCards, bigCard, gameId, revertOrder);
|
||||||
|
|
||||||
|
// additional info for grave windows
|
||||||
if (showType == ShowType.GRAVEYARD) {
|
if (showType == ShowType.GRAVEYARD) {
|
||||||
int qty = qtyCardTypes(showCards);
|
int qty = qtyCardTypes(showCards);
|
||||||
String titel = name + "'s Graveyard (" + showCards.size() + ") - " + qty + ((qty == 1) ? " Card Type" : " Card Types");
|
String newTitle = name + "'s graveyard (" + showCards.size() + ") - " + qty + ((qty == 1) ? " card type" : " card types");
|
||||||
setTitle(titel);
|
setTitle(newTitle);
|
||||||
this.setTitelBarToolTip(titel);
|
this.setTitelBarToolTip(newTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// additional info for sideboard window
|
||||||
|
if (showType == ShowType.SIDEBOARD) {
|
||||||
|
String newTitle = name + "'s sideboard";
|
||||||
|
setTitle(newTitle);
|
||||||
|
this.setTitelBarToolTip(newTitle);
|
||||||
|
}
|
||||||
|
|
||||||
showAndPositionWindow();
|
showAndPositionWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,9 +77,11 @@ public final class GamePanel extends javax.swing.JPanel {
|
||||||
private final Map<UUID, CardInfoWindowDialog> exiles = new HashMap<>();
|
private final Map<UUID, CardInfoWindowDialog> exiles = new HashMap<>();
|
||||||
private final Map<String, CardInfoWindowDialog> revealed = new HashMap<>();
|
private final Map<String, CardInfoWindowDialog> revealed = new HashMap<>();
|
||||||
private final Map<String, CardInfoWindowDialog> lookedAt = new HashMap<>();
|
private final Map<String, CardInfoWindowDialog> lookedAt = new HashMap<>();
|
||||||
|
private final Map<String, CardsView> graveyards = new HashMap<>(); // need to sync selection
|
||||||
private final Map<String, CardInfoWindowDialog> graveyardWindows = new HashMap<>();
|
private final Map<String, CardInfoWindowDialog> graveyardWindows = new HashMap<>();
|
||||||
private final Map<String, CardInfoWindowDialog> companion = new HashMap<>();
|
private final Map<String, CardInfoWindowDialog> companion = new HashMap<>();
|
||||||
private final Map<String, CardsView> graveyards = new HashMap<>();
|
private final Map<String, CardsView> sideboards = new HashMap<>(); // need to sync selection
|
||||||
|
private final Map<String, CardInfoWindowDialog> sideboardWindows = new HashMap<>();
|
||||||
private final ArrayList<ShowCardsDialog> pickTarget = new ArrayList<>();
|
private final ArrayList<ShowCardsDialog> pickTarget = new ArrayList<>();
|
||||||
private final ArrayList<PickPileDialog> pickPile = new ArrayList<>();
|
private final ArrayList<PickPileDialog> pickPile = new ArrayList<>();
|
||||||
private UUID gameId;
|
private UUID gameId;
|
||||||
|
@ -246,25 +248,29 @@ public final class GamePanel extends javax.swing.JPanel {
|
||||||
if (pickMultiNumber != null) {
|
if (pickMultiNumber != null) {
|
||||||
pickMultiNumber.removeDialog();
|
pickMultiNumber.removeDialog();
|
||||||
}
|
}
|
||||||
for (CardInfoWindowDialog exileDialog : exiles.values()) {
|
for (CardInfoWindowDialog windowDialog : exiles.values()) {
|
||||||
exileDialog.cleanUp();
|
windowDialog.cleanUp();
|
||||||
exileDialog.removeDialog();
|
windowDialog.removeDialog();
|
||||||
}
|
}
|
||||||
for (CardInfoWindowDialog graveyardDialog : graveyardWindows.values()) {
|
for (CardInfoWindowDialog windowDialog : graveyardWindows.values()) {
|
||||||
graveyardDialog.cleanUp();
|
windowDialog.cleanUp();
|
||||||
graveyardDialog.removeDialog();
|
windowDialog.removeDialog();
|
||||||
}
|
}
|
||||||
for (CardInfoWindowDialog revealDialog : revealed.values()) {
|
for (CardInfoWindowDialog windowDialog : sideboardWindows.values()) {
|
||||||
revealDialog.cleanUp();
|
windowDialog.cleanUp();
|
||||||
revealDialog.removeDialog();
|
windowDialog.removeDialog();
|
||||||
}
|
}
|
||||||
for (CardInfoWindowDialog lookedAtDialog : lookedAt.values()) {
|
for (CardInfoWindowDialog windowDialog : revealed.values()) {
|
||||||
lookedAtDialog.cleanUp();
|
windowDialog.cleanUp();
|
||||||
lookedAtDialog.removeDialog();
|
windowDialog.removeDialog();
|
||||||
}
|
}
|
||||||
for (CardInfoWindowDialog companionDialog : companion.values()) {
|
for (CardInfoWindowDialog windowDialog : lookedAt.values()) {
|
||||||
companionDialog.cleanUp();
|
windowDialog.cleanUp();
|
||||||
companionDialog.removeDialog();
|
windowDialog.removeDialog();
|
||||||
|
}
|
||||||
|
for (CardInfoWindowDialog windowDialog : companion.values()) {
|
||||||
|
windowDialog.cleanUp();
|
||||||
|
windowDialog.removeDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
clearPickTargetDialogs();
|
clearPickTargetDialogs();
|
||||||
|
@ -308,26 +314,29 @@ public final class GamePanel extends javax.swing.JPanel {
|
||||||
playAreaPanel.changeGUISize();
|
playAreaPanel.changeGUISize();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (CardInfoWindowDialog cardInfoWindowDialog : exiles.values()) {
|
for (CardInfoWindowDialog windowDialog : exiles.values()) {
|
||||||
cardInfoWindowDialog.changeGUISize();
|
windowDialog.changeGUISize();
|
||||||
}
|
}
|
||||||
for (CardInfoWindowDialog cardInfoWindowDialog : revealed.values()) {
|
for (CardInfoWindowDialog windowDialog : revealed.values()) {
|
||||||
cardInfoWindowDialog.changeGUISize();
|
windowDialog.changeGUISize();
|
||||||
}
|
}
|
||||||
for (CardInfoWindowDialog cardInfoWindowDialog : lookedAt.values()) {
|
for (CardInfoWindowDialog windowDialog : lookedAt.values()) {
|
||||||
cardInfoWindowDialog.changeGUISize();
|
windowDialog.changeGUISize();
|
||||||
}
|
}
|
||||||
for (CardInfoWindowDialog cardInfoWindowDialog : companion.values()) {
|
for (CardInfoWindowDialog windowDialog : companion.values()) {
|
||||||
cardInfoWindowDialog.changeGUISize();
|
windowDialog.changeGUISize();
|
||||||
}
|
}
|
||||||
for (CardInfoWindowDialog cardInfoWindowDialog : graveyardWindows.values()) {
|
for (CardInfoWindowDialog windowDialog : graveyardWindows.values()) {
|
||||||
cardInfoWindowDialog.changeGUISize();
|
windowDialog.changeGUISize();
|
||||||
}
|
}
|
||||||
for (ShowCardsDialog showCardsDialog : pickTarget) {
|
for (CardInfoWindowDialog windowDialog : sideboardWindows.values()) {
|
||||||
showCardsDialog.changeGUISize();
|
windowDialog.changeGUISize();
|
||||||
}
|
}
|
||||||
for (PickPileDialog pickPileDialog : pickPile) {
|
for (ShowCardsDialog windowDialog : pickTarget) {
|
||||||
pickPileDialog.changeGUISize();
|
windowDialog.changeGUISize();
|
||||||
|
}
|
||||||
|
for (PickPileDialog windowDialog : pickPile) {
|
||||||
|
windowDialog.changeGUISize();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.revalidate();
|
this.revalidate();
|
||||||
|
@ -575,7 +584,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
||||||
}
|
}
|
||||||
PlayerView player = game.getPlayers().get(playerSeat);
|
PlayerView player = game.getPlayers().get(playerSeat);
|
||||||
PlayAreaPanel playAreaPanel = new PlayAreaPanel(player, bigCard, gameId, game.getPriorityTime(), this,
|
PlayAreaPanel playAreaPanel = new PlayAreaPanel(player, bigCard, gameId, game.getPriorityTime(), this,
|
||||||
new PlayAreaPanelOptions(game.isPlayer(), game.isPlayer(), game.isRollbackTurnsAllowed(), row == 0));
|
new PlayAreaPanelOptions(game.isPlayer(), player.isHuman(), game.isPlayer(), game.isRollbackTurnsAllowed(), row == 0));
|
||||||
players.put(player.getPlayerId(), playAreaPanel);
|
players.put(player.getPlayerId(), playAreaPanel);
|
||||||
playersWhoLeft.put(player.getPlayerId(), false);
|
playersWhoLeft.put(player.getPlayerId(), false);
|
||||||
GridBagConstraints c = new GridBagConstraints();
|
GridBagConstraints c = new GridBagConstraints();
|
||||||
|
@ -619,7 +628,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
||||||
}
|
}
|
||||||
player = game.getPlayers().get(playerNum);
|
player = game.getPlayers().get(playerNum);
|
||||||
PlayAreaPanel playerPanel = new PlayAreaPanel(player, bigCard, gameId, game.getPriorityTime(), this,
|
PlayAreaPanel playerPanel = new PlayAreaPanel(player, bigCard, gameId, game.getPriorityTime(), this,
|
||||||
new PlayAreaPanelOptions(game.isPlayer(), false, game.isRollbackTurnsAllowed(), row == 0));
|
new PlayAreaPanelOptions(game.isPlayer(), player.isHuman(), false, game.isRollbackTurnsAllowed(), row == 0));
|
||||||
players.put(player.getPlayerId(), playerPanel);
|
players.put(player.getPlayerId(), playerPanel);
|
||||||
playersWhoLeft.put(player.getPlayerId(), false);
|
playersWhoLeft.put(player.getPlayerId(), false);
|
||||||
c = new GridBagConstraints();
|
c = new GridBagConstraints();
|
||||||
|
@ -790,16 +799,29 @@ public final class GamePanel extends javax.swing.JPanel {
|
||||||
if (player.getPlayerId().equals(playerId)) {
|
if (player.getPlayerId().equals(playerId)) {
|
||||||
skipButtons.updateFromPlayer(player);
|
skipButtons.updateFromPlayer(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
// update open or remove closed graveyard windows
|
// update open or remove closed graveyard windows
|
||||||
graveyards.put(player.getName(), player.getGraveyard());
|
graveyards.put(player.getName(), player.getGraveyard());
|
||||||
if (graveyardWindows.containsKey(player.getName())) {
|
if (graveyardWindows.containsKey(player.getName())) {
|
||||||
CardInfoWindowDialog cardInfoWindowDialog = graveyardWindows.get(player.getName());
|
CardInfoWindowDialog windowDialog = graveyardWindows.get(player.getName());
|
||||||
if (cardInfoWindowDialog.isClosed()) {
|
if (windowDialog.isClosed()) {
|
||||||
graveyardWindows.remove(player.getName());
|
graveyardWindows.remove(player.getName());
|
||||||
} else {
|
} else {
|
||||||
cardInfoWindowDialog.loadCards(player.getGraveyard(), bigCard, gameId, false);
|
windowDialog.loadCards(player.getGraveyard(), bigCard, gameId, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// update open or remove closed sideboard windows
|
||||||
|
sideboards.put(player.getName(), player.getSideboard());
|
||||||
|
if (sideboardWindows.containsKey(player.getName())) {
|
||||||
|
CardInfoWindowDialog windowDialog = sideboardWindows.get(player.getName());
|
||||||
|
if (windowDialog.isClosed()) {
|
||||||
|
sideboardWindows.remove(player.getName());
|
||||||
|
} else {
|
||||||
|
windowDialog.loadCards(player.getSideboard(), bigCard, gameId, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// show top card window
|
// show top card window
|
||||||
if (player.getTopCard() != null) {
|
if (player.getTopCard() != null) {
|
||||||
CardsView cardsView = new CardsView();
|
CardsView cardsView = new CardsView();
|
||||||
|
@ -852,8 +874,12 @@ public final class GamePanel extends javax.swing.JPanel {
|
||||||
exiles.get(exile.getId()).loadCards(exile, bigCard, gameId);
|
exiles.get(exile.getId()).loadCards(exile, bigCard, gameId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// reveal and look at dialogs can unattached, so windows opened by game doesn't have it
|
||||||
showRevealed(lastGameData.game);
|
showRevealed(lastGameData.game);
|
||||||
showLookedAt(lastGameData.game);
|
showLookedAt(lastGameData.game);
|
||||||
|
|
||||||
|
// sideboard dialogs is unattached all the time -- user opens it by command
|
||||||
|
|
||||||
showCompanion(lastGameData.game);
|
showCompanion(lastGameData.game);
|
||||||
if (!lastGameData.game.getCombat().isEmpty()) {
|
if (!lastGameData.game.getCombat().isEmpty()) {
|
||||||
CombatManager.instance.showCombat(lastGameData.game.getCombat(), gameId);
|
CombatManager.instance.showCombat(lastGameData.game.getCombat(), gameId);
|
||||||
|
@ -1147,40 +1173,46 @@ public final class GamePanel extends javax.swing.JPanel {
|
||||||
// Called if the game frame is deactivated because the tabled the deck editor or other frames go to foreground
|
// Called if the game frame is deactivated because the tabled the deck editor or other frames go to foreground
|
||||||
public void deactivated() {
|
public void deactivated() {
|
||||||
// hide the non modal windows (because otherwise they are shown on top of the new active pane)
|
// hide the non modal windows (because otherwise they are shown on top of the new active pane)
|
||||||
for (CardInfoWindowDialog exileDialog : exiles.values()) {
|
for (CardInfoWindowDialog windowDialog : exiles.values()) {
|
||||||
exileDialog.hideDialog();
|
windowDialog.hideDialog();
|
||||||
}
|
}
|
||||||
for (CardInfoWindowDialog graveyardDialog : graveyardWindows.values()) {
|
for (CardInfoWindowDialog windowDialog : graveyardWindows.values()) {
|
||||||
graveyardDialog.hideDialog();
|
windowDialog.hideDialog();
|
||||||
}
|
}
|
||||||
for (CardInfoWindowDialog revealDialog : revealed.values()) {
|
for (CardInfoWindowDialog windowDialog : revealed.values()) {
|
||||||
revealDialog.hideDialog();
|
windowDialog.hideDialog();
|
||||||
}
|
}
|
||||||
for (CardInfoWindowDialog lookedAtDialog : lookedAt.values()) {
|
for (CardInfoWindowDialog windowDialog : lookedAt.values()) {
|
||||||
lookedAtDialog.hideDialog();
|
windowDialog.hideDialog();
|
||||||
}
|
}
|
||||||
for (CardInfoWindowDialog companionDialog : companion.values()) {
|
for (CardInfoWindowDialog windowDialog : companion.values()) {
|
||||||
companionDialog.hideDialog();
|
windowDialog.hideDialog();
|
||||||
|
}
|
||||||
|
for (CardInfoWindowDialog windowDialog : sideboardWindows.values()) {
|
||||||
|
windowDialog.hideDialog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called if the game frame comes to front again
|
// Called if the game frame comes to front again
|
||||||
public void activated() {
|
public void activated() {
|
||||||
// hide the non modal windows (because otherwise they are shown on top of the new active pane)
|
// hide the non modal windows (because otherwise they are shown on top of the new active pane)
|
||||||
for (CardInfoWindowDialog exileDialog : exiles.values()) {
|
for (CardInfoWindowDialog windowDialog : exiles.values()) {
|
||||||
exileDialog.show();
|
windowDialog.show();
|
||||||
}
|
}
|
||||||
for (CardInfoWindowDialog graveyardDialog : graveyardWindows.values()) {
|
for (CardInfoWindowDialog windowDialog : graveyardWindows.values()) {
|
||||||
graveyardDialog.show();
|
windowDialog.show();
|
||||||
}
|
}
|
||||||
for (CardInfoWindowDialog revealDialog : revealed.values()) {
|
for (CardInfoWindowDialog windowDialog : revealed.values()) {
|
||||||
revealDialog.show();
|
windowDialog.show();
|
||||||
}
|
}
|
||||||
for (CardInfoWindowDialog lookedAtDialog : lookedAt.values()) {
|
for (CardInfoWindowDialog windowDialog : lookedAt.values()) {
|
||||||
lookedAtDialog.show();
|
windowDialog.show();
|
||||||
}
|
}
|
||||||
for (CardInfoWindowDialog companionDialog : companion.values()) {
|
for (CardInfoWindowDialog windowDialog : companion.values()) {
|
||||||
companionDialog.show();
|
windowDialog.show();
|
||||||
|
}
|
||||||
|
for (CardInfoWindowDialog windowDialog : sideboardWindows.values()) {
|
||||||
|
windowDialog.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1197,9 +1229,40 @@ public final class GamePanel extends javax.swing.JPanel {
|
||||||
CardInfoWindowDialog newGraveyard = new CardInfoWindowDialog(ShowType.GRAVEYARD, playerName);
|
CardInfoWindowDialog newGraveyard = new CardInfoWindowDialog(ShowType.GRAVEYARD, playerName);
|
||||||
graveyardWindows.put(playerName, newGraveyard);
|
graveyardWindows.put(playerName, newGraveyard);
|
||||||
MageFrame.getDesktop().add(newGraveyard, JLayeredPane.PALETTE_LAYER);
|
MageFrame.getDesktop().add(newGraveyard, JLayeredPane.PALETTE_LAYER);
|
||||||
|
// use graveyards to sync selection (don't use player data here)
|
||||||
newGraveyard.loadCards(graveyards.get(playerName), bigCard, gameId, false);
|
newGraveyard.loadCards(graveyards.get(playerName), bigCard, gameId, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void openSideboardWindow(UUID playerId) {
|
||||||
|
if (lastGameData == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
PlayerView playerView = lastGameData.game.getPlayers().stream()
|
||||||
|
.filter(p -> p.getPlayerId().equals(playerId))
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
|
if (playerView == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sideboardWindows.containsKey(playerView.getName())) {
|
||||||
|
CardInfoWindowDialog windowDialog = sideboardWindows.get(playerView.getName());
|
||||||
|
if (windowDialog.isVisible()) {
|
||||||
|
windowDialog.hideDialog();
|
||||||
|
} else {
|
||||||
|
windowDialog.show();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CardInfoWindowDialog windowDialog = new CardInfoWindowDialog(ShowType.SIDEBOARD, playerView.getName());
|
||||||
|
sideboardWindows.put(playerView.getName(), windowDialog);
|
||||||
|
MageFrame.getDesktop().add(windowDialog, JLayeredPane.PALETTE_LAYER);
|
||||||
|
// use sideboards to sync selection (don't use player data here)
|
||||||
|
windowDialog.loadCards(sideboards.get(playerView.getName()), bigCard, gameId, false);
|
||||||
|
}
|
||||||
|
|
||||||
public void openTopLibraryWindow(String playerName) {
|
public void openTopLibraryWindow(String playerName) {
|
||||||
String title = playerName + "'s top library card";
|
String title = playerName + "'s top library card";
|
||||||
if (revealed.containsKey(title)) {
|
if (revealed.containsKey(title)) {
|
||||||
|
@ -1387,6 +1450,25 @@ public final class GamePanel extends javax.swing.JPanel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// sideboard
|
||||||
|
if (needZone == Zone.OUTSIDE || needZone == Zone.ALL) {
|
||||||
|
for (PlayerView player : lastGameData.game.getPlayers()) {
|
||||||
|
for (Map.Entry<UUID, CardView> card : player.getSideboard().entrySet()) {
|
||||||
|
if (needSelectable.contains(card.getKey())) {
|
||||||
|
card.getValue().setChoosable(true);
|
||||||
|
}
|
||||||
|
if (needChoosen.contains(card.getKey())) {
|
||||||
|
card.getValue().setSelected(true);
|
||||||
|
}
|
||||||
|
if (needPlayable.containsObject(card.getKey())) {
|
||||||
|
card.getValue().setPlayableStats(needPlayable.getStats(card.getKey()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// sideboards (old windows all the time, e.g. unattached from game data)
|
||||||
|
prepareSelectableWindows(sideboardWindows.values(), needSelectable, needChoosen, needPlayable);
|
||||||
|
|
||||||
// exile
|
// exile
|
||||||
if (needZone == Zone.EXILED || needZone == Zone.ALL) {
|
if (needZone == Zone.EXILED || needZone == Zone.ALL) {
|
||||||
// exile from player panel
|
// exile from player panel
|
||||||
|
@ -1403,6 +1485,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// exile from windows
|
// exile from windows
|
||||||
for (ExileView exile : lastGameData.game.getExile()) {
|
for (ExileView exile : lastGameData.game.getExile()) {
|
||||||
for (Map.Entry<UUID, CardView> card : exile.entrySet()) {
|
for (Map.Entry<UUID, CardView> card : exile.entrySet()) {
|
||||||
|
|
|
@ -1,89 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
|
|
||||||
<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
|
||||||
<AuxValues>
|
|
||||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
|
||||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
|
||||||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
|
||||||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
|
||||||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
|
||||||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
|
||||||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
|
||||||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
|
||||||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
|
||||||
</AuxValues>
|
|
||||||
|
|
||||||
<Layout>
|
|
||||||
<DimensionLayout dim="0">
|
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
|
||||||
<Group type="102" alignment="0" attributes="0">
|
|
||||||
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
|
||||||
<Component id="jScrollPane1" pref="357" max="32767" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
|
||||||
</DimensionLayout>
|
|
||||||
<DimensionLayout dim="1">
|
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
|
||||||
<Component id="jScrollPane1" alignment="1" pref="278" max="32767" attributes="0"/>
|
|
||||||
<Component id="jPanel1" alignment="0" max="32767" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</DimensionLayout>
|
|
||||||
</Layout>
|
|
||||||
<SubComponents>
|
|
||||||
<Container class="javax.swing.JPanel" name="jPanel1">
|
|
||||||
<Properties>
|
|
||||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
|
||||||
<Border info="org.netbeans.modules.form.compat2.border.BevelBorderInfo">
|
|
||||||
<BevelBorder/>
|
|
||||||
</Border>
|
|
||||||
</Property>
|
|
||||||
</Properties>
|
|
||||||
|
|
||||||
<Layout>
|
|
||||||
<DimensionLayout dim="0">
|
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
|
||||||
<Component id="manaPool" alignment="0" pref="116" max="32767" attributes="1"/>
|
|
||||||
<Component id="playerPanel" alignment="0" max="32767" attributes="1"/>
|
|
||||||
<Component id="btnCheat" alignment="0" pref="116" max="32767" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</DimensionLayout>
|
|
||||||
<DimensionLayout dim="1">
|
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
|
||||||
<Group type="102" alignment="0" attributes="0">
|
|
||||||
<Component id="playerPanel" min="-2" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
|
||||||
<Component id="manaPool" min="-2" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace pref="17" max="32767" attributes="0"/>
|
|
||||||
<Component id="btnCheat" min="-2" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
|
||||||
</DimensionLayout>
|
|
||||||
</Layout>
|
|
||||||
<SubComponents>
|
|
||||||
<Component class="mage.client.game.PlayerPanel" name="playerPanel">
|
|
||||||
</Component>
|
|
||||||
<Component class="mage.client.game.ManaPool" name="manaPool">
|
|
||||||
</Component>
|
|
||||||
<Component class="javax.swing.JButton" name="btnCheat">
|
|
||||||
<Properties>
|
|
||||||
<Property name="text" type="java.lang.String" value="Cheat"/>
|
|
||||||
</Properties>
|
|
||||||
<Events>
|
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCheatActionPerformed"/>
|
|
||||||
</Events>
|
|
||||||
</Component>
|
|
||||||
</SubComponents>
|
|
||||||
</Container>
|
|
||||||
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
|
|
||||||
|
|
||||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
|
||||||
<SubComponents>
|
|
||||||
<Container class="mage.client.game.BattlefieldPanel" name="battlefieldPanel">
|
|
||||||
|
|
||||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JLayeredPaneSupportLayout"/>
|
|
||||||
</Container>
|
|
||||||
</SubComponents>
|
|
||||||
</Container>
|
|
||||||
</SubComponents>
|
|
||||||
</Form>
|
|
|
@ -24,6 +24,8 @@ import java.util.UUID;
|
||||||
import static mage.client.dialog.PreferencesDialog.*;
|
import static mage.client.dialog.PreferencesDialog.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* GUI: play area panel (player with avatar/mana panel + battlefield panel)
|
||||||
|
*
|
||||||
* @author BetaSteward_at_googlemail.com
|
* @author BetaSteward_at_googlemail.com
|
||||||
*/
|
*/
|
||||||
public class PlayAreaPanel extends javax.swing.JPanel {
|
public class PlayAreaPanel extends javax.swing.JPanel {
|
||||||
|
@ -441,14 +443,28 @@ public class PlayAreaPanel extends javax.swing.JPanel {
|
||||||
|
|
||||||
popupMenu.addSeparator();
|
popupMenu.addSeparator();
|
||||||
|
|
||||||
menuItem = new JMenuItem("<html>View current deck");
|
// view deck
|
||||||
menuItem.setMnemonic(KeyEvent.VK_V);
|
menuItem = new JMenuItem("<html>View player's deck");
|
||||||
|
menuItem.setMnemonic(KeyEvent.VK_D);
|
||||||
popupMenu.add(menuItem);
|
popupMenu.add(menuItem);
|
||||||
|
|
||||||
// View limited deck
|
|
||||||
menuItem.addActionListener(e -> {
|
menuItem.addActionListener(e -> {
|
||||||
SessionHandler.sendPlayerAction(PlayerAction.VIEW_LIMITED_DECK, gameId, null);
|
SessionHandler.sendPlayerAction(PlayerAction.VIEW_LIMITED_DECK, gameId, null);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// view sideboard (allows to view only own sideboard or computer)
|
||||||
|
// it's a client side checks... same checks must be on server side too (see PlayerView)
|
||||||
|
if (options.playerItself || !options.isHuman) {
|
||||||
|
String menuCaption = "<html>View my sideboard";
|
||||||
|
if (!options.isHuman) {
|
||||||
|
menuCaption = "<html>View computer's sideboard";
|
||||||
|
}
|
||||||
|
menuItem = new JMenuItem(menuCaption);
|
||||||
|
menuItem.setMnemonic(KeyEvent.VK_S);
|
||||||
|
popupMenu.add(menuItem);
|
||||||
|
menuItem.addActionListener(e -> {
|
||||||
|
SessionHandler.sendPlayerAction(PlayerAction.VIEW_SIDEBOARD, gameId, playerId);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addPopupMenuWatcher() {
|
private void addPopupMenuWatcher() {
|
||||||
|
|
|
@ -8,8 +8,9 @@ package mage.client.game;
|
||||||
*/
|
*/
|
||||||
public class PlayAreaPanelOptions {
|
public class PlayAreaPanelOptions {
|
||||||
|
|
||||||
public PlayAreaPanelOptions(boolean isPlayer, boolean playerItself, boolean rollbackTurnsAllowed, boolean topRow) {
|
public PlayAreaPanelOptions(boolean isPlayer, boolean isHuman, boolean playerItself, boolean rollbackTurnsAllowed, boolean topRow) {
|
||||||
this.isPlayer = isPlayer;
|
this.isPlayer = isPlayer;
|
||||||
|
this.isHuman = isHuman;
|
||||||
this.playerItself = playerItself;
|
this.playerItself = playerItself;
|
||||||
this.rollbackTurnsAllowed = rollbackTurnsAllowed;
|
this.rollbackTurnsAllowed = rollbackTurnsAllowed;
|
||||||
this.topRow = topRow;
|
this.topRow = topRow;
|
||||||
|
@ -18,22 +19,27 @@ public class PlayAreaPanelOptions {
|
||||||
/**
|
/**
|
||||||
* true if the client is a player / false if the client is a watcher
|
* true if the client is a player / false if the client is a watcher
|
||||||
*/
|
*/
|
||||||
public boolean isPlayer = false;
|
public boolean isPlayer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* true if the player is the human, not computer
|
||||||
|
*/
|
||||||
|
public boolean isHuman;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* true if the player is the client player itself, false if the player is
|
* true if the player is the client player itself, false if the player is
|
||||||
* another player playing with the clinet player
|
* another player playing with the client player
|
||||||
*/
|
*/
|
||||||
public boolean playerItself = false;
|
public boolean playerItself;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* true if the player can rollback turns if all players agree
|
* true if the player can rollback turns if all players agree
|
||||||
*/
|
*/
|
||||||
public boolean rollbackTurnsAllowed = false;
|
public boolean rollbackTurnsAllowed;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* true if the battlefield is on the top row of player areas
|
* true if the battlefield is on the top row of player areas
|
||||||
*/
|
*/
|
||||||
public boolean topRow = false;
|
public boolean topRow;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -391,6 +391,12 @@ public class CallbackClientImpl implements CallbackClient {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case VIEW_SIDEBOARD: {
|
||||||
|
TableClientMessage message = (TableClientMessage) callback.getData();
|
||||||
|
viewSideboard(message.getGameId(), message.getPlayerId());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case CONSTRUCT: {
|
case CONSTRUCT: {
|
||||||
TableClientMessage message = (TableClientMessage) callback.getData();
|
TableClientMessage message = (TableClientMessage) callback.getData();
|
||||||
DeckView deckView = message.getDeck();
|
DeckView deckView = message.getDeck();
|
||||||
|
@ -616,6 +622,15 @@ public class CallbackClientImpl implements CallbackClient {
|
||||||
frame.showDeckEditor(DeckEditorMode.VIEW_LIMITED_DECK, deck, tableId, time);
|
frame.showDeckEditor(DeckEditorMode.VIEW_LIMITED_DECK, deck, tableId, time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void viewSideboard(UUID gameId, UUID playerId) {
|
||||||
|
SwingUtilities.invokeLater(() -> {
|
||||||
|
GamePanel panel = MageFrame.getGame(gameId);
|
||||||
|
if (panel != null) {
|
||||||
|
panel.openSideboardWindow(playerId);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private void handleException(Exception ex) {
|
private void handleException(Exception ex) {
|
||||||
logger.fatal("Client error\n", ex);
|
logger.fatal("Client error\n", ex);
|
||||||
String errorMessage = ex.getMessage();
|
String errorMessage = ex.getMessage();
|
||||||
|
|
|
@ -14,6 +14,7 @@ public enum ClientCallbackMethod {
|
||||||
START_TOURNAMENT("startTournament"),
|
START_TOURNAMENT("startTournament"),
|
||||||
SIDEBOARD("sideboard"),
|
SIDEBOARD("sideboard"),
|
||||||
VIEW_LIMITED_DECK("viewLimitedDeck"),
|
VIEW_LIMITED_DECK("viewLimitedDeck"),
|
||||||
|
VIEW_SIDEBOARD("viewSideboard"),
|
||||||
CONSTRUCT("construct"),
|
CONSTRUCT("construct"),
|
||||||
SHOW_USERMESSAGE("showUserMessage"),
|
SHOW_USERMESSAGE("showUserMessage"),
|
||||||
WATCHGAME("watchGame"),
|
WATCHGAME("watchGame"),
|
||||||
|
|
|
@ -24,6 +24,7 @@ public class PlayerView implements Serializable {
|
||||||
private final UUID playerId;
|
private final UUID playerId;
|
||||||
private final String name;
|
private final String name;
|
||||||
private final boolean controlled; // gui: player is current user
|
private final boolean controlled; // gui: player is current user
|
||||||
|
private final boolean isHuman; // human or computer
|
||||||
private final int life;
|
private final int life;
|
||||||
private final Counters counters;
|
private final Counters counters;
|
||||||
private final int wins;
|
private final int wins;
|
||||||
|
@ -38,6 +39,7 @@ public class PlayerView implements Serializable {
|
||||||
private final ManaPoolView manaPool;
|
private final ManaPoolView manaPool;
|
||||||
private final CardsView graveyard = new CardsView();
|
private final CardsView graveyard = new CardsView();
|
||||||
private final CardsView exile = new CardsView();
|
private final CardsView exile = new CardsView();
|
||||||
|
private final CardsView sideboard = new CardsView();
|
||||||
private final Map<UUID, PermanentView> battlefield = new LinkedHashMap<>();
|
private final Map<UUID, PermanentView> battlefield = new LinkedHashMap<>();
|
||||||
private final CardView topCard;
|
private final CardView topCard;
|
||||||
private final UserData userData;
|
private final UserData userData;
|
||||||
|
@ -58,6 +60,7 @@ public class PlayerView implements Serializable {
|
||||||
this.playerId = player.getId();
|
this.playerId = player.getId();
|
||||||
this.name = player.getName();
|
this.name = player.getName();
|
||||||
this.controlled = player.getId().equals(createdForPlayerId);
|
this.controlled = player.getId().equals(createdForPlayerId);
|
||||||
|
this.isHuman = player.isHuman();
|
||||||
this.life = player.getLife();
|
this.life = player.getLife();
|
||||||
this.counters = player.getCounters();
|
this.counters = player.getCounters();
|
||||||
this.wins = player.getMatchPlayer().getWins();
|
this.wins = player.getMatchPlayer().getWins();
|
||||||
|
@ -85,6 +88,13 @@ public class PlayerView implements Serializable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (this.controlled || !player.isHuman()) {
|
||||||
|
// sideboard available for itself or for computer only
|
||||||
|
for (Card card : player.getSideboard().getCards(game)) {
|
||||||
|
sideboard.put(card.getId(), new CardView(card, game, false));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
for (Permanent permanent : state.getBattlefield().getAllPermanents()) {
|
for (Permanent permanent : state.getBattlefield().getAllPermanents()) {
|
||||||
if (showInBattlefield(permanent, state)) {
|
if (showInBattlefield(permanent, state)) {
|
||||||
|
@ -167,6 +177,10 @@ public class PlayerView implements Serializable {
|
||||||
return this.controlled;
|
return this.controlled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isHuman() {
|
||||||
|
return this.isHuman;
|
||||||
|
}
|
||||||
|
|
||||||
public int getLife() {
|
public int getLife() {
|
||||||
return this.life;
|
return this.life;
|
||||||
}
|
}
|
||||||
|
@ -207,6 +221,10 @@ public class PlayerView implements Serializable {
|
||||||
return exile;
|
return exile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CardsView getSideboard() {
|
||||||
|
return this.sideboard;
|
||||||
|
}
|
||||||
|
|
||||||
public Map<UUID, PermanentView> getBattlefield() {
|
public Map<UUID, PermanentView> getBattlefield() {
|
||||||
return this.battlefield;
|
return this.battlefield;
|
||||||
}
|
}
|
||||||
|
|
|
@ -259,6 +259,10 @@ public class User {
|
||||||
fireCallback(new ClientCallback(ClientCallbackMethod.VIEW_LIMITED_DECK, tableId, new TableClientMessage(deck, tableId, time, limited)));
|
fireCallback(new ClientCallback(ClientCallbackMethod.VIEW_LIMITED_DECK, tableId, new TableClientMessage(deck, tableId, time, limited)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ccViewSideboard(final UUID tableId, final UUID gameId, final UUID targetPlayerId) {
|
||||||
|
fireCallback(new ClientCallback(ClientCallbackMethod.VIEW_SIDEBOARD, tableId, new TableClientMessage(gameId, targetPlayerId)));
|
||||||
|
}
|
||||||
|
|
||||||
public void ccConstruct(final Deck deck, final UUID tableId, final int time) {
|
public void ccConstruct(final Deck deck, final UUID tableId, final int time) {
|
||||||
fireCallback(new ClientCallback(ClientCallbackMethod.CONSTRUCT, tableId, new TableClientMessage(deck, tableId, time)));
|
fireCallback(new ClientCallback(ClientCallbackMethod.CONSTRUCT, tableId, new TableClientMessage(deck, tableId, time)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -598,6 +598,12 @@ public class GameController implements GameCallback {
|
||||||
case VIEW_LIMITED_DECK:
|
case VIEW_LIMITED_DECK:
|
||||||
viewLimitedDeck(getPlayerId(userId), userId);
|
viewLimitedDeck(getPlayerId(userId), userId);
|
||||||
break;
|
break;
|
||||||
|
case VIEW_SIDEBOARD:
|
||||||
|
if (data instanceof UUID) {
|
||||||
|
UUID targetPlayerId = (UUID) data;
|
||||||
|
viewSideboard(getPlayerId(userId), userId, targetPlayerId);
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
game.sendPlayerAction(playerAction, getPlayerId(userId), data);
|
game.sendPlayerAction(playerAction, getPlayerId(userId), data);
|
||||||
}
|
}
|
||||||
|
@ -656,13 +662,13 @@ public class GameController implements GameCallback {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void viewLimitedDeck(UUID userIdRequester, UUID origId) {
|
private void viewLimitedDeck(UUID playerId, UUID userId) {
|
||||||
Player viewLimitedDeckPlayer = game.getPlayer(userIdRequester);
|
Player viewLimitedDeckPlayer = game.getPlayer(playerId);
|
||||||
if (viewLimitedDeckPlayer != null) {
|
if (viewLimitedDeckPlayer != null) {
|
||||||
if (viewLimitedDeckPlayer.isHuman()) {
|
if (viewLimitedDeckPlayer.isHuman()) {
|
||||||
for (MatchPlayer p : managerFactory.tableManager().getTable(tableId).getMatch().getPlayers()) {
|
for (MatchPlayer p : managerFactory.tableManager().getTable(tableId).getMatch().getPlayers()) {
|
||||||
if (p.getPlayer().getId().equals(userIdRequester)) {
|
if (p.getPlayer().getId().equals(playerId)) {
|
||||||
Optional<User> u = managerFactory.userManager().getUser(origId);
|
Optional<User> u = managerFactory.userManager().getUser(userId);
|
||||||
if (u.isPresent() && p.getDeck() != null) {
|
if (u.isPresent() && p.getDeck() != null) {
|
||||||
u.get().ccViewLimitedDeck(p.getDeck(), tableId, requestsOpen, true);
|
u.get().ccViewLimitedDeck(p.getDeck(), tableId, requestsOpen, true);
|
||||||
}
|
}
|
||||||
|
@ -672,6 +678,18 @@ public class GameController implements GameCallback {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void viewSideboard(UUID playerId, UUID userId, UUID targetPlayerId) {
|
||||||
|
Player needPlayer = game.getPlayer(playerId);
|
||||||
|
if (needPlayer != null && needPlayer.isHuman()) {
|
||||||
|
for (MatchPlayer p : managerFactory.tableManager().getTable(tableId).getMatch().getPlayers()) {
|
||||||
|
if (p.getPlayer().getId().equals(playerId)) {
|
||||||
|
Optional<User> u = managerFactory.userManager().getUser(userId);
|
||||||
|
u.ifPresent(user -> user.ccViewSideboard(tableId, game.getId(), targetPlayerId));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void cheat(UUID userId, UUID playerId, DeckCardLists deckList) {
|
public void cheat(UUID userId, UUID playerId, DeckCardLists deckList) {
|
||||||
try {
|
try {
|
||||||
Deck deck = Deck.load(deckList, false, false);
|
Deck deck = Deck.load(deckList, false, false);
|
||||||
|
|
|
@ -592,9 +592,14 @@ public class ContinuousEffects implements Serializable {
|
||||||
Map<String, String> keyChoices = new HashMap<>();
|
Map<String, String> keyChoices = new HashMap<>();
|
||||||
for (ApprovingObject approvingObject : possibleApprovingObjects) {
|
for (ApprovingObject approvingObject : possibleApprovingObjects) {
|
||||||
MageObject mageObject = game.getObject(approvingObject.getApprovingAbility().getSourceId());
|
MageObject mageObject = game.getObject(approvingObject.getApprovingAbility().getSourceId());
|
||||||
keyChoices.put(approvingObject.getApprovingAbility().getId().toString(),
|
String choiceKey = approvingObject.getApprovingAbility().getId().toString();
|
||||||
(approvingObject.getApprovingAbility().getRule(mageObject == null ? "" : mageObject.getName()))
|
String choiceValue;
|
||||||
+ (mageObject == null ? "" : " (" + mageObject.getIdName() + ")"));
|
if (mageObject == null) {
|
||||||
|
choiceValue = approvingObject.getApprovingAbility().getRule();
|
||||||
|
} else {
|
||||||
|
choiceValue = mageObject.getIdName() + ": " + approvingObject.getApprovingAbility().getRule(mageObject.getName());
|
||||||
|
}
|
||||||
|
keyChoices.put(choiceKey, choiceValue);
|
||||||
}
|
}
|
||||||
Choice choicePermitting = new ChoiceImpl(true);
|
Choice choicePermitting = new ChoiceImpl(true);
|
||||||
choicePermitting.setMessage("Choose the permitting object");
|
choicePermitting.setMessage("Choose the permitting object");
|
||||||
|
|
|
@ -59,5 +59,6 @@ public enum PlayerAction {
|
||||||
HOLD_PRIORITY,
|
HOLD_PRIORITY,
|
||||||
UNHOLD_PRIORITY,
|
UNHOLD_PRIORITY,
|
||||||
VIEW_LIMITED_DECK,
|
VIEW_LIMITED_DECK,
|
||||||
|
VIEW_SIDEBOARD,
|
||||||
TOGGLE_RECORD_MACRO
|
TOGGLE_RECORD_MACRO
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue