- 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:
elcnesh
2015-04-08 09:03:33 +00:00
parent c4e4f02f93
commit 8acb8a7f23
16 changed files with 125 additions and 110 deletions

View File

@@ -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:

View File

@@ -165,12 +165,8 @@ public class QuestDraftUtils {
}
return;
}
if (waitForUserInput) {
return;
}
if (matchInProgress) {
if (waitForUserInput || matchInProgress) {
return;
}