mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
Show "Waiting for opponent..." while you wait for the other player to choose whether to go first or keep their first hand
This commit is contained in:
@@ -872,4 +872,13 @@ public class PlayerControllerAi extends PlayerController {
|
||||
public void autoPassCancel() {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void awaitNextInput() {
|
||||
// Do nothing
|
||||
}
|
||||
@Override
|
||||
public void cancelAwaitNextInput() {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1486,6 +1486,11 @@ public class GameAction {
|
||||
goesFirst = game.getPlayers().get(0); // does not really matter who plays first - it's controlled from the same computer.
|
||||
}
|
||||
|
||||
for (Player p : game.getPlayers()) {
|
||||
if (p != goesFirst) {
|
||||
p.getController().awaitNextInput(); //show "Waiting for opponent..." while first player chooses whether to go first or keep their hand
|
||||
}
|
||||
}
|
||||
goesFirst = goesFirst.getController().chooseStartingPlayer(isFirstGame);
|
||||
return goesFirst;
|
||||
}
|
||||
|
||||
@@ -229,6 +229,10 @@ public abstract class PlayerController {
|
||||
|
||||
public abstract void autoPassCancel();
|
||||
|
||||
public abstract void awaitNextInput();
|
||||
|
||||
public abstract void cancelAwaitNextInput();
|
||||
|
||||
public boolean isGuiPlayer() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -659,4 +659,13 @@ public class PlayerControllerForTests extends PlayerController {
|
||||
public void autoPassCancel() {
|
||||
// Not used by the controller for tests
|
||||
}
|
||||
|
||||
@Override
|
||||
public void awaitNextInput() {
|
||||
// Not used by the controller for tests
|
||||
}
|
||||
@Override
|
||||
public void cancelAwaitNextInput() {
|
||||
// Not used by the controller for tests
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1813,9 +1813,11 @@ public class PlayerControllerHuman
|
||||
public void autoPassCancel() {
|
||||
getGui().autoPassCancel(getLocalPlayerView());
|
||||
}
|
||||
@Override
|
||||
public void awaitNextInput() {
|
||||
getGui().awaitNextInput();
|
||||
}
|
||||
@Override
|
||||
public void cancelAwaitNextInput() {
|
||||
getGui().cancelAwaitNextInput();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user