|
|
|
@ -318,6 +318,7 @@ public class GameScreen extends WizardScreen {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (currentAction == null && pendingSync.getAndSet(false)) {
|
|
|
|
|
doSetPersistentMessage(null);
|
|
|
|
|
game.getClient().execute(Game.class, Game::sync);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -732,11 +733,15 @@ public class GameScreen extends WizardScreen {
|
|
|
|
|
execute(new TrumpOverlay(this, players.get(player), trumpCard, trumpSuit));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void showColoredCardOverlay(@NotNull Card card, long timeout) {
|
|
|
|
|
public PlayColoredCardOverlay showColoredCardOverlay(@NotNull Card card, long timeout) {
|
|
|
|
|
if (card == Card.JUGGLER) {
|
|
|
|
|
execute(new PlayColoredCardOverlay(this, timeout, card, Card.JUGGLER_RED, Card.JUGGLER_GREEN, Card.JUGGLER_BLUE, Card.JUGGLER_YELLOW));
|
|
|
|
|
var overlay = new PlayColoredCardOverlay(this, timeout, card, Card.JUGGLER_RED, Card.JUGGLER_GREEN, Card.JUGGLER_BLUE, Card.JUGGLER_YELLOW);
|
|
|
|
|
execute(overlay);
|
|
|
|
|
return overlay;
|
|
|
|
|
} else if (card == Card.CLOUD) {
|
|
|
|
|
execute(new PlayColoredCardOverlay(this, timeout, card, Card.CLOUD_RED, Card.CLOUD_GREEN, Card.CLOUD_BLUE, Card.CLOUD_YELLOW));
|
|
|
|
|
var overlay = new PlayColoredCardOverlay(this, timeout, card, Card.CLOUD_RED, Card.CLOUD_GREEN, Card.CLOUD_BLUE, Card.CLOUD_YELLOW);
|
|
|
|
|
execute(overlay);
|
|
|
|
|
return overlay;
|
|
|
|
|
} else {
|
|
|
|
|
throw new IllegalArgumentException();
|
|
|
|
|
}
|
|
|
|
@ -808,7 +813,10 @@ public class GameScreen extends WizardScreen {
|
|
|
|
|
|
|
|
|
|
public void setPersistentMessage(String key, Object...args) {
|
|
|
|
|
var text = key == null ? null : args != null ? messages.format(key, args) : messages.get(key);
|
|
|
|
|
execute(() -> {
|
|
|
|
|
execute(() -> doSetPersistentMessage(text));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void doSetPersistentMessage(String message) {
|
|
|
|
|
if (persistentMessage != null) {
|
|
|
|
|
persistentMessage.addAction(sequence(
|
|
|
|
|
delay(AnimationTimings.MESSAGE_HOLD),
|
|
|
|
@ -818,11 +826,10 @@ public class GameScreen extends WizardScreen {
|
|
|
|
|
persistentMessage = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (text != null) {
|
|
|
|
|
persistentMessage = new Label(text, skin);
|
|
|
|
|
if (message != null) {
|
|
|
|
|
persistentMessage = new Label(message, skin);
|
|
|
|
|
messageStack.addActor(persistentMessage);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
//</editor-fold>
|
|
|
|
|
|
|
|
|
@ -838,6 +845,11 @@ public class GameScreen extends WizardScreen {
|
|
|
|
|
|
|
|
|
|
public void sync() {
|
|
|
|
|
pendingSync.set(true);
|
|
|
|
|
execute(() -> {
|
|
|
|
|
if (pendingSync.get()) {
|
|
|
|
|
doSetPersistentMessage(messages.get("game.message.sync"));
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void closeInteractionOverlay() {
|
|
|
|
|