mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
Make it so human player has prompt disabled while other human player has an input active
This commit is contained in:
@@ -232,6 +232,18 @@ public class MatchUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static LocalGameView getOtherGameView() {
|
||||||
|
//return other game view besides current game view
|
||||||
|
if (gameViews.size() < 2) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
LocalGameView gameView = getGameView();
|
||||||
|
if (gameView == gameViews.get(0)) {
|
||||||
|
return gameViews.get(1);
|
||||||
|
}
|
||||||
|
return gameViews.get(0);
|
||||||
|
}
|
||||||
|
|
||||||
public static InputQueue getInputQueue() {
|
public static InputQueue getInputQueue() {
|
||||||
LocalGameView gameView = getGameView();
|
LocalGameView gameView = getGameView();
|
||||||
if (gameView != null) {
|
if (gameView != null) {
|
||||||
|
|||||||
@@ -100,7 +100,10 @@ public abstract class InputBase implements java.io.Serializable, Input {
|
|||||||
awaitNextInputTimer.schedule(awaitNextInputTask, 250);
|
awaitNextInputTimer.schedule(awaitNextInputTask, 250);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void waitForHumanOpponent(final LocalGameView gameView) {
|
public static void waitForOtherPlayer() {
|
||||||
|
final LocalGameView gameView = MatchUtil.getOtherGameView();
|
||||||
|
if (gameView == null) { return; }
|
||||||
|
|
||||||
cancelAwaitNextInput();
|
cancelAwaitNextInput();
|
||||||
FThreads.invokeInEdtNowOrLater(gameView.getGui(), new Runnable() {
|
FThreads.invokeInEdtNowOrLater(gameView.getGui(), new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ public class InputQueue extends Observable {
|
|||||||
activeInput = input;
|
activeInput = input;
|
||||||
inputStack.push(input);
|
inputStack.push(input);
|
||||||
inputLock.setGui(input.getGui());
|
inputLock.setGui(input.getGui());
|
||||||
|
InputBase.waitForOtherPlayer();
|
||||||
syncPoint();
|
syncPoint();
|
||||||
updateObservers();
|
updateObservers();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user