Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Alessandro Coli
2019-11-17 17:48:03 +01:00
100 changed files with 863 additions and 190 deletions

View File

@@ -301,8 +301,7 @@ public class FControlGameEventHandler extends IGameEventVisitor.Base<Void> {
@Override
public Void visit(final GameEventCardTapped event) {
if(GuiBase.isNetworkplay())
refreshFieldUpdate = true; //update all players field when event un/tapped
refreshFieldUpdate = true; //update all players field when event un/tapped
processCard(event.card, cardsUpdate);
return processEvent();
}

View File

@@ -165,6 +165,8 @@ public interface IGuiGame {
void setSelectables(final Iterable<CardView> cards);
void clearSelectables();
boolean isSelecting();
boolean isGamePaused();
public void setgamePause(boolean pause);
void awaitNextInput();
void cancelAwaitNextInput();

View File

@@ -40,6 +40,7 @@ public abstract class AbstractGuiGame implements IGuiGame, IMayViewCards {
private IGameController spectator = null;
private final Map<PlayerView, IGameController> gameControllers = Maps.newHashMap();
private final Map<PlayerView, IGameController> originalGameControllers = Maps.newHashMap();
private boolean gamePause = false;
public final boolean hasLocalPlayers() {
return !gameControllers.isEmpty();
@@ -263,6 +264,8 @@ public abstract class AbstractGuiGame implements IGuiGame, IMayViewCards {
public boolean isSelecting() {
return !selectableCards.isEmpty();
}
public boolean isGamePaused() { return gamePause; }
public void setgamePause(boolean pause) { gamePause = pause; }
/** Concede game, bring up WinLose UI. */
public boolean concede() {
@@ -297,7 +300,8 @@ public abstract class AbstractGuiGame implements IGuiGame, IMayViewCards {
if (showConfirmDialog(Localizer.getInstance().getMessage("lblCloseGameSpectator"), Localizer.getInstance().getMessage("lblCloseGame"), Localizer.getInstance().getMessage("lblClose"), Localizer.getInstance().getMessage("lblCancel"))) {
IGameController controller = spectator;
spectator = null; //ensure we don't prompt again, including when calling nextGameDecision below
controller.selectButtonOk(); //pause
if (!isGamePaused())
controller.selectButtonOk(); //pause
controller.nextGameDecision(NextGameDecision.QUIT);
}
return false; //let logic above handle closing current screen

View File

@@ -48,6 +48,7 @@ public class InputPlaybackControl extends InputSyncronizedBase {
} else {
getController().getGui().updateButtons(null, "Pause", isFast ? "1x Speed" : "10x Faster", true, true, true);
}
getController().getGui().setgamePause(isPaused);
}
public void pause() {