mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
- Fix vanguard avatar selection in lobby
- Fix card (image) viewing with multiple players in same GUI - Fix dev mode toggle buttons with multiple players in same GUI - Fix possible NPE in Quest mode (related to Antes) - Some cleanup
This commit is contained in:
@@ -7,6 +7,7 @@ import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.collect.Iterables;
|
||||
|
||||
import forge.ImageKeys;
|
||||
@@ -60,11 +61,11 @@ public class CardView extends GameEntityView {
|
||||
return collection;
|
||||
}
|
||||
|
||||
public static boolean mayViewAny(Iterable<CardView> cards, PlayerView viewer) {
|
||||
public static boolean mayViewAny(Iterable<CardView> cards, Iterable<PlayerView> viewer) {
|
||||
if (cards == null) { return false; }
|
||||
|
||||
for (CardView cv : cards) {
|
||||
if (cv.canBeShownTo(viewer)) {
|
||||
if (cv.canBeShownToAny(viewer)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -282,15 +283,13 @@ public class CardView extends GameEntityView {
|
||||
if (card.isFaceDown()) {
|
||||
sb.append("Face Down");
|
||||
// face-down cards don't show unique number to avoid cheating
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
sb.append(card.getName());
|
||||
sb.append(" (");
|
||||
sb.append(card.getId());
|
||||
sb.append(")");
|
||||
}
|
||||
}
|
||||
else if (o != null) {
|
||||
} else if (o != null) {
|
||||
sb.append(o.toString());
|
||||
}
|
||||
sb.append("\r\n");
|
||||
@@ -339,7 +338,16 @@ public class CardView extends GameEntityView {
|
||||
}
|
||||
}
|
||||
}
|
||||
public boolean canBeShownTo(final PlayerView viewer) {
|
||||
|
||||
public boolean canBeShownToAny(final Iterable<PlayerView> viewers) {
|
||||
return Iterables.any(viewers, new Predicate<PlayerView>() {
|
||||
public final boolean apply(final PlayerView input) {
|
||||
return canBeShownTo(input);
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
private boolean canBeShownTo(final PlayerView viewer) {
|
||||
if (viewer == null) { return false; }
|
||||
|
||||
ZoneType zone = getZone();
|
||||
@@ -394,7 +402,16 @@ public class CardView extends GameEntityView {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public boolean canFaceDownBeShownTo(final PlayerView viewer) {
|
||||
|
||||
public boolean canFaceDownBeShownToAny(final Iterable<PlayerView> viewers) {
|
||||
return Iterables.any(viewers, new Predicate<PlayerView>() {
|
||||
@Override public final boolean apply(final PlayerView input) {
|
||||
return canFaceDownBeShownTo(input);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private boolean canFaceDownBeShownTo(final PlayerView viewer) {
|
||||
if (!isFaceDown()) {
|
||||
return true;
|
||||
}
|
||||
@@ -777,8 +794,11 @@ public class CardView extends GameEntityView {
|
||||
set(TrackableProperty.Colors, c.getColor());
|
||||
}
|
||||
|
||||
public String getImageKey(PlayerView viewer) {
|
||||
if (viewer == null || canBeShownTo(viewer)) {
|
||||
public String getImageKey() {
|
||||
return getImageKey(null);
|
||||
}
|
||||
public String getImageKey(Iterable<PlayerView> viewers) {
|
||||
if (viewers == null || canBeShownToAny(viewers)) {
|
||||
return get(TrackableProperty.ImageKey);
|
||||
}
|
||||
return ImageKeys.HIDDEN_CARD;
|
||||
|
||||
@@ -83,8 +83,8 @@ public class ImageCache {
|
||||
* retrieve an image from the cache. returns null if the image is not found in the cache
|
||||
* and cannot be loaded from disk. pass -1 for width and/or height to avoid resizing in that dimension.
|
||||
*/
|
||||
public static BufferedImage getImage(final CardView card, final PlayerView viewer, final int width, final int height) {
|
||||
final String key = card.getCurrentState().getImageKey(viewer);
|
||||
public static BufferedImage getImage(final CardView card, final Iterable<PlayerView> viewers, final int width, final int height) {
|
||||
final String key = card.getCurrentState().getImageKey(viewers);
|
||||
return scaleImage(key, width, height, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import java.util.Vector;
|
||||
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.ListSelectionModel;
|
||||
import javax.swing.ScrollPaneConstants;
|
||||
import javax.swing.event.ListSelectionEvent;
|
||||
import javax.swing.event.ListSelectionListener;
|
||||
@@ -299,7 +300,8 @@ public class VLobby implements IUpdateable {
|
||||
}
|
||||
}
|
||||
private void fireDeckSectionChangeListener(final int index, final DeckSection section, final CardPool cards) {
|
||||
final Deck copy = new Deck(decks[index]);
|
||||
final Deck deck = decks[index];
|
||||
final Deck copy = deck == null ? new Deck() : new Deck(decks[index]);
|
||||
copy.putSection(section, cards);
|
||||
decks[index] = copy;
|
||||
if (playerChangeListener != null) {
|
||||
@@ -342,7 +344,7 @@ public class VLobby implements IUpdateable {
|
||||
schemeDeckPanel.setLayout(new MigLayout(sectionConstraints));
|
||||
schemeDeckPanel.add(new FLabel.Builder().text("Select Scheme deck:").build(), labelConstraints);
|
||||
final FList<Object> schemeDeckList = new FList<Object>();
|
||||
schemeDeckList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
|
||||
schemeDeckList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||
schemeDeckList.addListSelectionListener(new ListSelectionListener() {
|
||||
@Override public final void valueChanged(final ListSelectionEvent e) {
|
||||
selectSchemeDeck(playerIndex);
|
||||
@@ -361,7 +363,7 @@ public class VLobby implements IUpdateable {
|
||||
commanderDeckPanel.setLayout(new MigLayout(sectionConstraints));
|
||||
commanderDeckPanel.add(new FLabel.Builder().text("Select Commander deck:").build(), labelConstraints);
|
||||
final FList<Object> commanderDeckList = new FList<Object>();
|
||||
commanderDeckList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
|
||||
commanderDeckList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||
commanderDeckList.addListSelectionListener(new ListSelectionListener() {
|
||||
@Override public final void valueChanged(final ListSelectionEvent e) {
|
||||
selectCommanderDeck(playerIndex);
|
||||
@@ -380,7 +382,7 @@ public class VLobby implements IUpdateable {
|
||||
planarDeckPanel.setLayout(new MigLayout(sectionConstraints));
|
||||
planarDeckPanel.add(new FLabel.Builder().text("Select Planar deck:").build(), labelConstraints);
|
||||
final FList<Object> planarDeckList = new FList<Object>();
|
||||
planarDeckList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
|
||||
planarDeckList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||
planarDeckList.addListSelectionListener(new ListSelectionListener() {
|
||||
@Override public final void valueChanged(final ListSelectionEvent e) {
|
||||
selectPlanarDeck(playerIndex);
|
||||
@@ -400,11 +402,15 @@ public class VLobby implements IUpdateable {
|
||||
final FList<Object> vgdAvatarList = new FList<Object>();
|
||||
vgdAvatarList.setListData(isPlayerAI(playerIndex) ? aiListData : humanListData);
|
||||
vgdAvatarList.setSelectedIndex(0);
|
||||
vgdAvatarList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
|
||||
vgdAvatarList.addListSelectionListener(vgdLSListener);
|
||||
vgdAvatarList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||
vgdAvatarList.addListSelectionListener(new ListSelectionListener() {
|
||||
@Override public final void valueChanged(final ListSelectionEvent e) {
|
||||
selectVanguardAvatar(playerIndex);
|
||||
}
|
||||
});
|
||||
|
||||
final FScrollPane scrAvatars = new FScrollPane(vgdAvatarList, true,
|
||||
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||
|
||||
final CardDetailPanel vgdDetail = new CardDetailPanel();
|
||||
vgdAvatarDetails.add(vgdDetail);
|
||||
|
||||
@@ -417,10 +423,14 @@ public class VLobby implements IUpdateable {
|
||||
}
|
||||
|
||||
private void selectDeck(final int playerIndex) {
|
||||
// Full deck selection
|
||||
selectMainDeck(playerIndex);
|
||||
selectCommanderDeck(playerIndex);
|
||||
|
||||
// Deck section selection
|
||||
selectSchemeDeck(playerIndex);
|
||||
selectPlanarDeck(playerIndex);
|
||||
selectVanguardAvatar(playerIndex);
|
||||
}
|
||||
|
||||
private void selectMainDeck(final int playerIndex) {
|
||||
@@ -519,6 +529,50 @@ public class VLobby implements IUpdateable {
|
||||
getDeckChooser(playerIndex).saveState();
|
||||
}
|
||||
|
||||
private void selectVanguardAvatar(final int playerIndex) {
|
||||
if (playerIndex >= activePlayersNum || !hasVariant(GameType.Vanguard)) {
|
||||
return;
|
||||
}
|
||||
|
||||
final Object selected = vgdAvatarLists.get(playerIndex).getSelectedValue();
|
||||
final PlayerPanel pp = playerPanels.get(playerIndex);
|
||||
final CardDetailPanel cdp = vgdAvatarDetails.get(playerIndex);
|
||||
|
||||
final PaperCard vanguardAvatar;
|
||||
final Deck deck = decks[playerIndex];
|
||||
if (selected instanceof PaperCard) {
|
||||
pp.setVanguardButtonText(((PaperCard) selected).getName());
|
||||
cdp.setCard(CardView.getCardForUi((PaperCard) selected));
|
||||
cdp.setVisible(true);
|
||||
refreshPanels(false, true);
|
||||
|
||||
vanguardAvatar = (PaperCard)selected;
|
||||
} else {
|
||||
final String sel = (String) selected;
|
||||
pp.setVanguardButtonText(sel);
|
||||
cdp.setVisible(false);
|
||||
|
||||
if (sel == null) {
|
||||
vanguardAvatar = null;
|
||||
} else {
|
||||
if (sel.contains("Use deck's default avatar") && deck != null && deck.has(DeckSection.Avatar)) {
|
||||
vanguardAvatar = deck.get(DeckSection.Avatar).get(0);
|
||||
} else { //Only other string is "Random"
|
||||
if (playerPanels.get(playerIndex).isAi()) { //AI
|
||||
vanguardAvatar = Aggregates.random(getNonRandomAiAvatars());
|
||||
} else { //Human
|
||||
vanguardAvatar = Aggregates.random(getNonRandomHumanAvatars());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final CardPool avatarOnce = new CardPool();
|
||||
avatarOnce.add(vanguardAvatar);
|
||||
fireDeckSectionChangeListener(playerIndex, DeckSection.Avatar, avatarOnce);
|
||||
getDeckChooser(playerIndex).saveState();
|
||||
}
|
||||
|
||||
protected void onDeckClicked(final int iPlayer, final DeckType type, final Deck deck, final Collection<DeckProxy> selectedDecks) {
|
||||
if (iPlayer < activePlayersNum && lobby.mayEdit(iPlayer)) {
|
||||
final String text = type.toString() + ": " + Lang.joinHomogenous(selectedDecks, DeckProxy.FN_GET_NAME);
|
||||
@@ -732,59 +786,6 @@ public class VLobby implements IUpdateable {
|
||||
}
|
||||
};
|
||||
|
||||
/** This listener will look for a vanguard avatar being selected in the lists
|
||||
/ and update the corresponding detail panel. */
|
||||
private ListSelectionListener vgdLSListener = new ListSelectionListener() {
|
||||
@Override public final void valueChanged(final ListSelectionEvent e) {
|
||||
if (!hasVariant(GameType.Vanguard)) {
|
||||
return;
|
||||
}
|
||||
|
||||
final int index = vgdAvatarLists.indexOf(e.getSource());
|
||||
if (index >= activePlayersNum) {
|
||||
return;
|
||||
}
|
||||
final Object selected = vgdAvatarLists.get(index).getSelectedValue();
|
||||
final PlayerPanel pp = playerPanels.get(index);
|
||||
final CardDetailPanel cdp = vgdAvatarDetails.get(index);
|
||||
|
||||
final PaperCard vanguardAvatar;
|
||||
final Deck deck = decks[index];
|
||||
if (selected instanceof PaperCard) {
|
||||
pp.setVanguardButtonText(((PaperCard) selected).getName());
|
||||
cdp.setCard(CardView.getCardForUi((PaperCard) selected));
|
||||
cdp.setVisible(true);
|
||||
refreshPanels(false, true);
|
||||
|
||||
vanguardAvatar = (PaperCard)selected;
|
||||
} else {
|
||||
final String sel = (String) selected;
|
||||
pp.setVanguardButtonText(sel);
|
||||
cdp.setVisible(false);
|
||||
|
||||
if (sel == null) {
|
||||
vanguardAvatar = null;
|
||||
} else {
|
||||
if (sel.contains("Use deck's default avatar") && deck != null && deck.has(DeckSection.Avatar)) {
|
||||
vanguardAvatar = deck.get(DeckSection.Avatar).get(0);
|
||||
} else { //Only other string is "Random"
|
||||
if (playerPanels.get(index).isAi()) { //AI
|
||||
vanguardAvatar = Aggregates.random(getNonRandomAiAvatars());
|
||||
} else { //Human
|
||||
vanguardAvatar = Aggregates.random(getNonRandomHumanAvatars());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final CardPool avatarOnce = new CardPool();
|
||||
avatarOnce.add(vanguardAvatar);
|
||||
fireDeckSectionChangeListener(index, DeckSection.Avatar, avatarOnce);
|
||||
getDeckChooser(index).saveState();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/////////////////////////////////////
|
||||
//========== METHODS FOR VARIANTS
|
||||
|
||||
|
||||
@@ -205,7 +205,8 @@ public final class CMatchUI
|
||||
|
||||
@Override
|
||||
protected void updateCurrentPlayer(final PlayerView player) {
|
||||
// No action necessary
|
||||
// Update toggle buttons in dev mdoe panel
|
||||
getCDev().update();
|
||||
}
|
||||
|
||||
public CAntes getCAntes() {
|
||||
@@ -303,10 +304,11 @@ public final class CMatchUI
|
||||
|
||||
private void initHandViews() {
|
||||
final List<VHand> hands = new ArrayList<VHand>();
|
||||
final Iterable<PlayerView> localPlayers = getLocalPlayers();
|
||||
|
||||
int i = 0;
|
||||
for (final PlayerView p : sortedPlayers) {
|
||||
if (allHands || isLocalPlayer(p) || CardView.mayViewAny(p.getHand(), getCurrentPlayer())) {
|
||||
if (allHands || isLocalPlayer(p) || CardView.mayViewAny(p.getHand(), localPlayers)) {
|
||||
final EDocID doc = EDocID.Hands[i];
|
||||
final VHand newHand = new VHand(this, doc, p);
|
||||
newHand.getLayoutControl().initialize();
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package forge.screens.match;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import javax.swing.SwingUtilities;
|
||||
@@ -103,7 +102,8 @@ public class VMatchUI implements IVTopLevelUI {
|
||||
// Default to a cell we know exists
|
||||
cellWithHands = EDocID.REPORT_LOG.getDoc().getParentCell();
|
||||
}
|
||||
for (final EDocID handId : EDocID.Hands) {
|
||||
for (int iHandId = 0; iHandId < EDocID.Hands.length; iHandId++) {
|
||||
final EDocID handId = EDocID.Hands[iHandId];
|
||||
final DragCell parentCell = handId.getDoc().getParentCell();
|
||||
VHand myVHand = null;
|
||||
for (final VHand vHand : lstHands) {
|
||||
@@ -122,12 +122,12 @@ public class VMatchUI implements IVTopLevelUI {
|
||||
} else {
|
||||
// Hand present, add it if necessary
|
||||
if (parentCell == null) {
|
||||
final EDocID fieldDoc = EDocID.Fields[Arrays.asList(EDocID.Hands).indexOf(handId)];
|
||||
final EDocID fieldDoc = EDocID.Fields[iHandId];
|
||||
if (fieldDoc.getDoc().getParentCell() != null) {
|
||||
fieldDoc.getDoc().getParentCell().addDoc(myVHand);
|
||||
continue;
|
||||
}
|
||||
final EDocID commandDoc = EDocID.Commands[Arrays.asList(EDocID.Hands).indexOf(handId)];
|
||||
final EDocID commandDoc = EDocID.Commands[iHandId];
|
||||
if (commandDoc.getDoc().getParentCell() != null) {
|
||||
commandDoc.getDoc().getParentCell().addDoc(myVHand);
|
||||
continue;
|
||||
|
||||
@@ -227,9 +227,10 @@ public class CDev implements ICDoc {
|
||||
*/
|
||||
@Override
|
||||
public void update() {
|
||||
if (getController() != null) {
|
||||
view.getLblUnlimitedLands().setToggled(getController().canPlayUnlimitedLands());
|
||||
view.getLblViewAll().setToggled(getController().mayLookAtAllCards());
|
||||
final IGameController controller = getController();
|
||||
if (controller != null) {
|
||||
view.getLblUnlimitedLands().setToggled(controller.canPlayUnlimitedLands());
|
||||
view.getLblViewAll().setToggled(controller.mayLookAtAllCards());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,8 @@ import forge.screens.match.controllers.CPlayers;
|
||||
import forge.toolbox.FScrollPanel;
|
||||
import forge.toolbox.FSkin;
|
||||
import forge.toolbox.FSkin.SkinnedLabel;
|
||||
import forge.util.FCollectionView;
|
||||
import forge.util.Lang;
|
||||
|
||||
/**
|
||||
* Assembles Swing components of players report.
|
||||
@@ -169,16 +171,13 @@ public class VPlayers implements IVDoc<CPlayers> {
|
||||
temp[5].setText("");
|
||||
}
|
||||
if (FModel.getPreferences().getPrefBoolean(FPref.UI_ANTE)) {
|
||||
final Iterable<CardView> list = p0.getAnte();
|
||||
final FCollectionView<CardView> list = p0.getAnte();
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append("Ante'd: ");
|
||||
boolean needDelim = false;
|
||||
for (CardView cv : list) {
|
||||
if (needDelim) {
|
||||
sb.append(", ");
|
||||
}
|
||||
else { needDelim = true; }
|
||||
sb.append(cv);
|
||||
if (list == null || list.isEmpty()) {
|
||||
sb.append("none");
|
||||
} else {
|
||||
sb.append(Lang.joinHomogenous(list));
|
||||
}
|
||||
temp[6].setText(sb.toString());
|
||||
}
|
||||
|
||||
@@ -239,7 +239,7 @@ public class VStack implements IVDoc<CStack> {
|
||||
final Graphics2D g2d = (Graphics2D) g;
|
||||
|
||||
//draw image for source card
|
||||
final BufferedImage img = ImageCache.getImage(item.getSourceCard(), controller.getMatchUI().getCurrentPlayer(), CARD_WIDTH, CARD_HEIGHT);
|
||||
final BufferedImage img = ImageCache.getImage(item.getSourceCard(), controller.getMatchUI().getLocalPlayers(), CARD_WIDTH, CARD_HEIGHT);
|
||||
if (img != null) {
|
||||
g2d.drawImage(img, null, PADDING, PADDING);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public final class FImageUtil {
|
||||
* For flip cards, returns the un-flipped image.
|
||||
*/
|
||||
public static BufferedImage getImage(final CardStateView card) {
|
||||
BufferedImage image = ImageCache.getOriginalImage(card.getImageKey(null), true);
|
||||
BufferedImage image = ImageCache.getOriginalImage(card.getImageKey(), true);
|
||||
final int foilIndex = card.getFoilIndex();
|
||||
if (image != null && foilIndex > 0) {
|
||||
image = getImageWithFoilEffect(image, foilIndex);
|
||||
@@ -64,7 +64,7 @@ public final class FImageUtil {
|
||||
}
|
||||
|
||||
public static BufferedImage getImageXlhq(final CardStateView state) {
|
||||
final String key = state.getImageKey(null);
|
||||
final String key = state.getImageKey();
|
||||
if (key.isEmpty() || key.length() < 3) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
|
||||
updateImage(false);
|
||||
}
|
||||
private void updateImage(boolean fromSetCard) {
|
||||
final BufferedImage image = card == null ? null : ImageCache.getImage(card, matchUI.getCurrentPlayer(), imagePanel.getWidth(), imagePanel.getHeight());
|
||||
final BufferedImage image = card == null ? null : ImageCache.getImage(card, matchUI.getLocalPlayers(), imagePanel.getWidth(), imagePanel.getHeight());
|
||||
if (fromSetCard) {
|
||||
setImage(image);
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ public class ImageCache {
|
||||
}
|
||||
|
||||
public static Texture getImage(final CardView card) {
|
||||
final String key = card.getCurrentState().getImageKey(MatchController.instance.getCurrentPlayer());
|
||||
final String key = card.getCurrentState().getImageKey(MatchController.instance.getLocalPlayers());
|
||||
return getImage(key, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -330,7 +330,7 @@ public class CardImageRenderer {
|
||||
}
|
||||
|
||||
public static void drawZoom(Graphics g, CardView card, GameView gameView, boolean altState, float x, float y, float w, float h) {
|
||||
final Texture image = ImageCache.getImage(card.getState(altState).getImageKey(MatchController.instance.getCurrentPlayer()), true);
|
||||
final Texture image = ImageCache.getImage(card.getState(altState).getImageKey(MatchController.instance.getLocalPlayers()), true);
|
||||
if (image == null) { //draw details if can't draw zoom
|
||||
drawDetails(g, card, gameView, altState, x, y, w, h);
|
||||
return;
|
||||
|
||||
@@ -84,7 +84,7 @@ public class CardRenderer {
|
||||
return getCardArt(ImageKeys.getImageKey(pc, false), pc.getRules().getSplitType() == CardSplitType.Split);
|
||||
}
|
||||
public static FImageComplex getCardArt(CardView card) {
|
||||
return getCardArt(card.getCurrentState().getImageKey(null), card.isSplitCard());
|
||||
return getCardArt(card.getCurrentState().getImageKey(), card.isSplitCard());
|
||||
}
|
||||
public static FImageComplex getCardArt(String imageKey, boolean isSplitCard) {
|
||||
FImageComplex cardArt = cardArtCache.get(imageKey);
|
||||
|
||||
@@ -254,7 +254,7 @@ public class VStack extends FDropDown {
|
||||
final IGuiGame gui = MatchController.instance;
|
||||
final IGameController controller = MatchController.instance.getGameController();
|
||||
final PlayerView player = MatchController.instance.getCurrentPlayer();
|
||||
if (MatchController.instance.getCurrentPlayer() != null) { //don't show menu if tapping on art
|
||||
if (player != null) { //don't show menu if tapping on art
|
||||
if (stackInstance.isAbility()) {
|
||||
FPopupMenu menu = new FPopupMenu() {
|
||||
@Override
|
||||
|
||||
@@ -11,7 +11,6 @@ import java.util.TimerTask;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
@@ -93,8 +92,7 @@ public abstract class AbstractGuiGame implements IGuiGame, IMayViewCards {
|
||||
}
|
||||
|
||||
public String getCardImageKey(final CardStateView csv) {
|
||||
if (getCurrentPlayer() == null) { return csv.getImageKey(null); } //if not in game, card can be shown
|
||||
return csv.getImageKey(getCurrentPlayer());
|
||||
return csv.getImageKey(getLocalPlayers());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -105,9 +103,7 @@ public abstract class AbstractGuiGame implements IGuiGame, IMayViewCards {
|
||||
if (getGameController().mayLookAtAllCards()) {
|
||||
return true;
|
||||
}
|
||||
return Iterables.any(localPlayers, new Predicate<PlayerView>() {
|
||||
@Override public boolean apply(final PlayerView input) { return c.canBeShownTo(input); };
|
||||
});
|
||||
return c.canBeShownToAny(getLocalPlayers());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -121,7 +117,7 @@ public abstract class AbstractGuiGame implements IGuiGame, IMayViewCards {
|
||||
case Original:
|
||||
CardStateView currentState = cv.getCurrentState();
|
||||
if (currentState.getState() == CardStateName.FaceDown) {
|
||||
return getCurrentPlayer() == null || cv.canFaceDownBeShownTo(getCurrentPlayer());
|
||||
return getCurrentPlayer() == null || cv.canFaceDownBeShownToAny(getLocalPlayers());
|
||||
}
|
||||
return true; //original can always be shown if not a face down that can't be shown
|
||||
case Flipped:
|
||||
|
||||
@@ -166,11 +166,7 @@ public class QuestDraftUtils {
|
||||
return;
|
||||
}
|
||||
|
||||
if (waitForUserInput) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (matchInProgress) {
|
||||
if (waitForUserInput || matchInProgress) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user