|
|
@ -1,6 +1,5 @@
|
|
|
|
package eu.jonahbauer.wizard.client.libgdx.screens;
|
|
|
|
package eu.jonahbauer.wizard.client.libgdx.screens;
|
|
|
|
|
|
|
|
|
|
|
|
import com.badlogic.gdx.Gdx;
|
|
|
|
|
|
|
|
import com.badlogic.gdx.graphics.Color;
|
|
|
|
import com.badlogic.gdx.graphics.Color;
|
|
|
|
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
|
|
|
|
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
|
|
|
|
import com.badlogic.gdx.math.Vector2;
|
|
|
|
import com.badlogic.gdx.math.Vector2;
|
|
|
@ -9,11 +8,11 @@ import com.badlogic.gdx.scenes.scene2d.Touchable;
|
|
|
|
import com.badlogic.gdx.scenes.scene2d.actions.MoveToAction;
|
|
|
|
import com.badlogic.gdx.scenes.scene2d.actions.MoveToAction;
|
|
|
|
import com.badlogic.gdx.scenes.scene2d.ui.Container;
|
|
|
|
import com.badlogic.gdx.scenes.scene2d.ui.Container;
|
|
|
|
import com.badlogic.gdx.scenes.scene2d.ui.Label;
|
|
|
|
import com.badlogic.gdx.scenes.scene2d.ui.Label;
|
|
|
|
|
|
|
|
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
|
|
|
|
import com.badlogic.gdx.scenes.scene2d.ui.VerticalGroup;
|
|
|
|
import com.badlogic.gdx.scenes.scene2d.ui.VerticalGroup;
|
|
|
|
import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
|
|
|
|
import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
|
|
|
|
import com.badlogic.gdx.utils.Align;
|
|
|
|
import com.badlogic.gdx.utils.Align;
|
|
|
|
import com.badlogic.gdx.utils.I18NBundle;
|
|
|
|
import com.badlogic.gdx.utils.I18NBundle;
|
|
|
|
import eu.jonahbauer.wizard.client.libgdx.AnimationTimings;
|
|
|
|
|
|
|
|
import eu.jonahbauer.wizard.client.libgdx.GameAtlas;
|
|
|
|
import eu.jonahbauer.wizard.client.libgdx.GameAtlas;
|
|
|
|
import eu.jonahbauer.wizard.client.libgdx.WizardGame;
|
|
|
|
import eu.jonahbauer.wizard.client.libgdx.WizardGame;
|
|
|
|
import eu.jonahbauer.wizard.client.libgdx.actions.overlay.*;
|
|
|
|
import eu.jonahbauer.wizard.client.libgdx.actions.overlay.*;
|
|
|
@ -22,10 +21,11 @@ import eu.jonahbauer.wizard.client.libgdx.actors.CardStack;
|
|
|
|
import eu.jonahbauer.wizard.client.libgdx.actors.CardsGroup;
|
|
|
|
import eu.jonahbauer.wizard.client.libgdx.actors.CardsGroup;
|
|
|
|
import eu.jonahbauer.wizard.client.libgdx.actors.PadOfTruth;
|
|
|
|
import eu.jonahbauer.wizard.client.libgdx.actors.PadOfTruth;
|
|
|
|
import eu.jonahbauer.wizard.client.libgdx.state.Game;
|
|
|
|
import eu.jonahbauer.wizard.client.libgdx.state.Game;
|
|
|
|
|
|
|
|
import eu.jonahbauer.wizard.client.libgdx.util.AnimationTimings;
|
|
|
|
|
|
|
|
import eu.jonahbauer.wizard.client.libgdx.util.WizardAssetManager;
|
|
|
|
import eu.jonahbauer.wizard.common.messages.observer.UserInputMessage;
|
|
|
|
import eu.jonahbauer.wizard.common.messages.observer.UserInputMessage;
|
|
|
|
import eu.jonahbauer.wizard.common.model.Card;
|
|
|
|
import eu.jonahbauer.wizard.common.model.Card;
|
|
|
|
import lombok.Getter;
|
|
|
|
import lombok.Getter;
|
|
|
|
import org.jetbrains.annotations.Nls;
|
|
|
|
|
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
import org.jetbrains.annotations.Range;
|
|
|
|
import org.jetbrains.annotations.Range;
|
|
|
@ -55,7 +55,7 @@ public class GameScreen extends MenuScreen {
|
|
|
|
@Getter
|
|
|
|
@Getter
|
|
|
|
private CardActor trumpSuitActor;
|
|
|
|
private CardActor trumpSuitActor;
|
|
|
|
|
|
|
|
|
|
|
|
private VerticalGroup messages;
|
|
|
|
private VerticalGroup messageStack;
|
|
|
|
private Label persistentMessage;
|
|
|
|
private Label persistentMessage;
|
|
|
|
|
|
|
|
|
|
|
|
private Action currentAction;
|
|
|
|
private Action currentAction;
|
|
|
@ -77,8 +77,12 @@ public class GameScreen extends MenuScreen {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void show() {
|
|
|
|
public void show() {
|
|
|
|
super.show();
|
|
|
|
super.show();
|
|
|
|
atlas = new TextureAtlas(Gdx.files.internal(GameAtlas.$PATH));
|
|
|
|
|
|
|
|
labelStyleDefault = game.data.skin.get(Label.LabelStyle.class);
|
|
|
|
assets.loadGame();
|
|
|
|
|
|
|
|
assets.finishLoading();
|
|
|
|
|
|
|
|
atlas = assets.get(WizardAssetManager.ATLAS_GAME);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
labelStyleDefault = skin.get(Label.LabelStyle.class);
|
|
|
|
labelStyleActive = new Label.LabelStyle(labelStyleDefault);
|
|
|
|
labelStyleActive = new Label.LabelStyle(labelStyleDefault);
|
|
|
|
labelStyleActive.fontColor = Color.RED;
|
|
|
|
labelStyleActive.fontColor = Color.RED;
|
|
|
|
|
|
|
|
|
|
|
@ -91,12 +95,12 @@ public class GameScreen extends MenuScreen {
|
|
|
|
container.setSize(1200, CardActor.PREF_HEIGHT);
|
|
|
|
container.setSize(1200, CardActor.PREF_HEIGHT);
|
|
|
|
container.fillX();
|
|
|
|
container.fillX();
|
|
|
|
|
|
|
|
|
|
|
|
messages = new VerticalGroup().columnCenter().bottom();
|
|
|
|
messageStack = new VerticalGroup().columnCenter().bottom();
|
|
|
|
messages.setPosition(360, 85 + CardActor.PREF_HEIGHT);
|
|
|
|
messageStack.setPosition(360, 85 + CardActor.PREF_HEIGHT);
|
|
|
|
messages.setSize(1200, 0);
|
|
|
|
messageStack.setSize(1200, 0);
|
|
|
|
messages.setTouchable(Touchable.disabled);
|
|
|
|
messageStack.setTouchable(Touchable.disabled);
|
|
|
|
|
|
|
|
|
|
|
|
padOfTruth = new PadOfTruth(game.data.skin, new TextureRegionDrawable(atlas.findRegion(GameAtlas.PAD_OF_TRUTH)));
|
|
|
|
padOfTruth = new PadOfTruth(skin, new TextureRegionDrawable(atlas.findRegion(GameAtlas.PAD_OF_TRUTH)));
|
|
|
|
padOfTruth.setPosition(WizardGame.WIDTH - 10 - PadOfTruth.EXTENDED_WIDTH, 10);
|
|
|
|
padOfTruth.setPosition(WizardGame.WIDTH - 10 - PadOfTruth.EXTENDED_WIDTH, 10);
|
|
|
|
padOfTruth.setOrigin(PadOfTruth.EXTENDED_WIDTH, 0);
|
|
|
|
padOfTruth.setOrigin(PadOfTruth.EXTENDED_WIDTH, 0);
|
|
|
|
|
|
|
|
|
|
|
@ -105,11 +109,10 @@ public class GameScreen extends MenuScreen {
|
|
|
|
|
|
|
|
|
|
|
|
addLabels();
|
|
|
|
addLabels();
|
|
|
|
|
|
|
|
|
|
|
|
Gdx.input.setInputProcessor(game.data.stage);
|
|
|
|
stage.addActor(container);
|
|
|
|
game.data.stage.addActor(container);
|
|
|
|
stage.addActor(cardStack);
|
|
|
|
game.data.stage.addActor(cardStack);
|
|
|
|
stage.addActor(padOfTruth);
|
|
|
|
game.data.stage.addActor(padOfTruth);
|
|
|
|
stage.addActor(messageStack);
|
|
|
|
game.data.stage.addActor(messages);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void seat() {
|
|
|
|
private void seat() {
|
|
|
@ -139,14 +142,14 @@ public class GameScreen extends MenuScreen {
|
|
|
|
padOfTruth.setName(i++, name);
|
|
|
|
padOfTruth.setName(i++, name);
|
|
|
|
|
|
|
|
|
|
|
|
if (isSelf(uuid)) continue;
|
|
|
|
if (isSelf(uuid)) continue;
|
|
|
|
var label = new Label("", game.data.skin);
|
|
|
|
var label = new Label("", skin);
|
|
|
|
var seat = seats.get(uuid);
|
|
|
|
var seat = seats.get(uuid);
|
|
|
|
label.setX(seat.getLabelX());
|
|
|
|
label.setX(seat.getLabelX());
|
|
|
|
label.setY(seat.getLabelY());
|
|
|
|
label.setY(seat.getLabelY());
|
|
|
|
label.setAlignment(seat.getLabelAlign());
|
|
|
|
label.setAlignment(seat.getLabelAlign());
|
|
|
|
label.setText(name);
|
|
|
|
label.setText(name);
|
|
|
|
nameLabels.put(uuid, label);
|
|
|
|
nameLabels.put(uuid, label);
|
|
|
|
game.data.stage.addActor(label);
|
|
|
|
stage.addActor(label);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//</editor-fold>
|
|
|
|
//</editor-fold>
|
|
|
@ -154,24 +157,24 @@ public class GameScreen extends MenuScreen {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void renderBackground(float delta) {
|
|
|
|
protected void renderBackground(float delta) {
|
|
|
|
float scale = Math.max(
|
|
|
|
float scale = Math.max(
|
|
|
|
game.data.extendViewport.getWorldWidth() / WizardGame.WIDTH,
|
|
|
|
extendViewport.getWorldWidth() / WizardGame.WIDTH,
|
|
|
|
game.data.extendViewport.getWorldHeight() / WizardGame.HEIGHT
|
|
|
|
extendViewport.getWorldHeight() / WizardGame.HEIGHT
|
|
|
|
);
|
|
|
|
);
|
|
|
|
game.batch.draw(game.data.background, 0,0, scale * WizardGame.WIDTH, scale * WizardGame.HEIGHT);
|
|
|
|
game.batch.draw(background, 0,0, scale * WizardGame.WIDTH, scale * WizardGame.HEIGHT);
|
|
|
|
game.batch.setColor(1, 1, 1, 0.25f);
|
|
|
|
game.batch.setColor(1, 1, 1, 0.25f);
|
|
|
|
game.batch.draw(
|
|
|
|
game.batch.draw(
|
|
|
|
game.data.title,
|
|
|
|
title,
|
|
|
|
(game.data.extendViewport.getWorldWidth() - game.data.title.getRegionWidth() * 0.75f) / 2f,
|
|
|
|
(extendViewport.getWorldWidth() - title.getRegionWidth() * 0.75f) / 2f,
|
|
|
|
(game.data.extendViewport.getWorldHeight() - game.data.title.getRegionHeight() * 0.75f) / 2f,
|
|
|
|
(extendViewport.getWorldHeight() - title.getRegionHeight() * 0.75f) / 2f,
|
|
|
|
0.75f * game.data.title.getRegionWidth(),
|
|
|
|
0.75f * title.getRegionWidth(),
|
|
|
|
0.75f * game.data.title.getRegionHeight()
|
|
|
|
0.75f * title.getRegionHeight()
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void renderForeground(float delta) {
|
|
|
|
protected void renderForeground(float delta) {
|
|
|
|
if (pendingActions.size() > 0) {
|
|
|
|
if (pendingActions.size() > 0) {
|
|
|
|
var actions = game.data.stage.getRoot().getActions();
|
|
|
|
var actions = stage.getRoot().getActions();
|
|
|
|
boolean running = false;
|
|
|
|
boolean running = false;
|
|
|
|
if (currentAction != null) {
|
|
|
|
if (currentAction != null) {
|
|
|
|
for (int i = 0; i < actions.size; i++) {
|
|
|
|
for (int i = 0; i < actions.size; i++) {
|
|
|
@ -184,7 +187,7 @@ public class GameScreen extends MenuScreen {
|
|
|
|
|
|
|
|
|
|
|
|
if (!running) {
|
|
|
|
if (!running) {
|
|
|
|
currentAction = pendingActions.poll();
|
|
|
|
currentAction = pendingActions.poll();
|
|
|
|
game.data.stage.addAction(currentAction);
|
|
|
|
stage.addAction(currentAction);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (pendingSync.getAndSet(false)) {
|
|
|
|
} else if (pendingSync.getAndSet(false)) {
|
|
|
|
game.getClient().execute(Game.class, Game::sync);
|
|
|
|
game.getClient().execute(Game.class, Game::sync);
|
|
|
@ -252,7 +255,7 @@ public class GameScreen extends MenuScreen {
|
|
|
|
rotation.setUseShortestDirection(true);
|
|
|
|
rotation.setUseShortestDirection(true);
|
|
|
|
|
|
|
|
|
|
|
|
action.addAction(sequence(
|
|
|
|
action.addAction(sequence(
|
|
|
|
targeting(card, changeParent(game.data.stage.getRoot())),
|
|
|
|
targeting(card, changeParent(stage.getRoot())),
|
|
|
|
parallel(
|
|
|
|
parallel(
|
|
|
|
targeting(card, rotation),
|
|
|
|
targeting(card, rotation),
|
|
|
|
targeting(card, moveTo(
|
|
|
|
targeting(card, moveTo(
|
|
|
@ -293,10 +296,10 @@ public class GameScreen extends MenuScreen {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public void addPrediction(@Range(from = 0, to = 19) int round, @NotNull UUID player, int prediction, boolean changed) {
|
|
|
|
public void addPrediction(@Range(from = 0, to = 19) int round, @NotNull UUID player, int prediction, boolean changed) {
|
|
|
|
if (isSelf(player)) {
|
|
|
|
if (isSelf(player)) {
|
|
|
|
addMessage(game.messages.format("game.action." + (changed ? "change" : "make") + "_prediction.self", prediction));
|
|
|
|
addMessage("game.action." + (changed ? "change" : "make") + "_prediction.self", prediction);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
var name = players.get(player);
|
|
|
|
var name = players.get(player);
|
|
|
|
addMessage(game.messages.format("game.action." + (changed ? "change" : "make") + "_prediction.other", name, prediction));
|
|
|
|
addMessage("game.action." + (changed ? "change" : "make") + "_prediction.other", name, prediction);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var index = orderedPlayers.indexOf(player);
|
|
|
|
var index = orderedPlayers.indexOf(player);
|
|
|
@ -312,10 +315,10 @@ public class GameScreen extends MenuScreen {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public void playCard(@NotNull UUID player, @NotNull Card card) {
|
|
|
|
public void playCard(@NotNull UUID player, @NotNull Card card) {
|
|
|
|
if (isSelf(player)) {
|
|
|
|
if (isSelf(player)) {
|
|
|
|
addMessage(game.messages.get("game.action.play_card.self"));
|
|
|
|
addMessage("game.action.play_card.self");
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
var name = players.get(player);
|
|
|
|
var name = players.get(player);
|
|
|
|
addMessage(game.messages.format("game.action.play_card.other", name));
|
|
|
|
addMessage("game.action.play_card.other", name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Seat seat = seats.getOrDefault(player, Seat.FALLBACK);
|
|
|
|
Seat seat = seats.getOrDefault(player, Seat.FALLBACK);
|
|
|
@ -378,9 +381,9 @@ public class GameScreen extends MenuScreen {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
if (player != null) {
|
|
|
|
if (player != null) {
|
|
|
|
setPersistentMessage(game.messages.format(key + "other", players.get(player)));
|
|
|
|
setPersistentMessage(key + "other", players.get(player));
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
setPersistentMessage(game.messages.get(key + "all"));
|
|
|
|
setPersistentMessage(key + "all");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -439,7 +442,7 @@ public class GameScreen extends MenuScreen {
|
|
|
|
var handCard = new CardActor(trumpCardActor.getCard(), atlas);
|
|
|
|
var handCard = new CardActor(trumpCardActor.getCard(), atlas);
|
|
|
|
handCard.setPosition(10, 10);
|
|
|
|
handCard.setPosition(10, 10);
|
|
|
|
trumpCardActor.setCard(Card.WEREWOLF);
|
|
|
|
trumpCardActor.setCard(Card.WEREWOLF);
|
|
|
|
game.data.stage.addActor(handCard);
|
|
|
|
stage.addActor(handCard);
|
|
|
|
|
|
|
|
|
|
|
|
sequence.addAction(seat.moveToHand(trumpCardActor, 0));
|
|
|
|
sequence.addAction(seat.moveToHand(trumpCardActor, 0));
|
|
|
|
sequence.addAction(parallel(
|
|
|
|
sequence.addAction(parallel(
|
|
|
@ -454,6 +457,14 @@ public class GameScreen extends MenuScreen {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//<editor-fold desc="Overlays" defaultstate="collapsed">
|
|
|
|
//<editor-fold desc="Overlays" defaultstate="collapsed">
|
|
|
|
|
|
|
|
public Skin getSkin() {
|
|
|
|
|
|
|
|
return skin;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public I18NBundle getMessages() {
|
|
|
|
|
|
|
|
return messages;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void showTrumpOverlay(@Nullable UUID player, @Nullable Card trumpCard, @Nullable Card.Suit trumpSuit) {
|
|
|
|
public void showTrumpOverlay(@Nullable UUID player, @Nullable Card trumpCard, @Nullable Card.Suit trumpSuit) {
|
|
|
|
if (trumpCardActor == null) {
|
|
|
|
if (trumpCardActor == null) {
|
|
|
|
trumpCardActor = new CardActor(Card.HIDDEN, atlas);
|
|
|
|
trumpCardActor = new CardActor(Card.HIDDEN, atlas);
|
|
|
@ -512,12 +523,21 @@ public class GameScreen extends MenuScreen {
|
|
|
|
//</editor-fold>
|
|
|
|
//</editor-fold>
|
|
|
|
|
|
|
|
|
|
|
|
//<editor-fold desc="Messages" defaultstate="collapsed">
|
|
|
|
//<editor-fold desc="Messages" defaultstate="collapsed">
|
|
|
|
public void addMessage(@Nls String text) {
|
|
|
|
public void addMessage(String key) {
|
|
|
|
addMessage(text, false);
|
|
|
|
addMessage(false, key);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void addMessage(String key, Object...args) {
|
|
|
|
|
|
|
|
addMessage(false, key, args);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void addMessage(@Nls String text, boolean immediate) {
|
|
|
|
public void addMessage(boolean immediate, String key) {
|
|
|
|
var label = new Label(text, game.data.skin);
|
|
|
|
addMessage(immediate, key, (Object[]) null);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void addMessage(boolean immediate, String key, Object...args) {
|
|
|
|
|
|
|
|
var text = args != null ? messages.format(key, args) : messages.get(key);
|
|
|
|
|
|
|
|
var label = new Label(text, skin);
|
|
|
|
label.addAction(sequence(
|
|
|
|
label.addAction(sequence(
|
|
|
|
delay(AnimationTimings.MESSAGE_HOLD),
|
|
|
|
delay(AnimationTimings.MESSAGE_HOLD),
|
|
|
|
alpha(0, AnimationTimings.MESSAGE_FADE),
|
|
|
|
alpha(0, AnimationTimings.MESSAGE_FADE),
|
|
|
@ -525,10 +545,10 @@ public class GameScreen extends MenuScreen {
|
|
|
|
));
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
|
|
Runnable runnable = () -> {
|
|
|
|
Runnable runnable = () -> {
|
|
|
|
if (persistentMessage != null && persistentMessage.getParent() == messages) {
|
|
|
|
if (persistentMessage != null && persistentMessage.getParent() == messageStack) {
|
|
|
|
messages.addActorBefore(persistentMessage, label);
|
|
|
|
messageStack.addActorBefore(persistentMessage, label);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
messages.addActor(label);
|
|
|
|
messageStack.addActor(label);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -539,7 +559,12 @@ public class GameScreen extends MenuScreen {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setPersistentMessage(@Nls String text) {
|
|
|
|
public void setPersistentMessage(String key) {
|
|
|
|
|
|
|
|
setPersistentMessage(key, (Object[]) null);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setPersistentMessage(String key, Object...args) {
|
|
|
|
|
|
|
|
var text = key == null ? null : args != null ? messages.format(key, args) : messages.get(key);
|
|
|
|
execute(() -> {
|
|
|
|
execute(() -> {
|
|
|
|
if (persistentMessage != null) {
|
|
|
|
if (persistentMessage != null) {
|
|
|
|
persistentMessage.addAction(sequence(
|
|
|
|
persistentMessage.addAction(sequence(
|
|
|
@ -551,8 +576,8 @@ public class GameScreen extends MenuScreen {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (text != null) {
|
|
|
|
if (text != null) {
|
|
|
|
persistentMessage = new Label(text, game.data.skin);
|
|
|
|
persistentMessage = new Label(text, skin);
|
|
|
|
messages.addActor(persistentMessage);
|
|
|
|
messageStack.addActor(persistentMessage);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -563,7 +588,7 @@ public class GameScreen extends MenuScreen {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void timeout() {
|
|
|
|
public void timeout() {
|
|
|
|
addMessage(game.messages.get("game.message.timeout"));
|
|
|
|
addMessage("game.message.timeout");
|
|
|
|
closeInteractionOverlay();
|
|
|
|
closeInteractionOverlay();
|
|
|
|
clearActivePlayer();
|
|
|
|
clearActivePlayer();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -582,15 +607,7 @@ public class GameScreen extends MenuScreen {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void dispose() {
|
|
|
|
public void dispose() {
|
|
|
|
if (atlas != null) atlas.dispose();
|
|
|
|
assets.unloadGame();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public WizardGame.Data getData() {
|
|
|
|
|
|
|
|
return game.data;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public I18NBundle getMessages() {
|
|
|
|
|
|
|
|
return game.messages;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private Action animateJuggle(@NotNull List<CardActor> removed, @NotNull List<CardActor> added) {
|
|
|
|
private Action animateJuggle(@NotNull List<CardActor> removed, @NotNull List<CardActor> added) {
|
|
|
@ -607,7 +624,7 @@ public class GameScreen extends MenuScreen {
|
|
|
|
|
|
|
|
|
|
|
|
var animation = parallel();
|
|
|
|
var animation = parallel();
|
|
|
|
removed.forEach(actor -> {
|
|
|
|
removed.forEach(actor -> {
|
|
|
|
game.data.stage.addActor(actor);
|
|
|
|
stage.addActor(actor);
|
|
|
|
animation.addAction(left.moveToHand(actor, AnimationTimings.JUGGLE));
|
|
|
|
animation.addAction(left.moveToHand(actor, AnimationTimings.JUGGLE));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|