mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user