|
|
@ -83,6 +83,7 @@ public class GameScreen extends WizardScreen {
|
|
|
|
|
|
|
|
|
|
|
|
private final Map<UUID, Seat> seats = new HashMap<>();
|
|
|
|
private final Map<UUID, Seat> seats = new HashMap<>();
|
|
|
|
private final Map<UUID, Label> nameLabels = new HashMap<>();
|
|
|
|
private final Map<UUID, Label> nameLabels = new HashMap<>();
|
|
|
|
|
|
|
|
private final Map<UUID, Label> trickLabels = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
|
|
private final AtomicBoolean pendingSync = new AtomicBoolean();
|
|
|
|
private final AtomicBoolean pendingSync = new AtomicBoolean();
|
|
|
|
|
|
|
|
|
|
|
@ -131,7 +132,7 @@ public class GameScreen extends WizardScreen {
|
|
|
|
stage.addActor(overlayRoot);
|
|
|
|
stage.addActor(overlayRoot);
|
|
|
|
stage.addActor(menu = createMenu());
|
|
|
|
stage.addActor(menu = createMenu());
|
|
|
|
|
|
|
|
|
|
|
|
labelStyleDefault = skin.get(Label.LabelStyle.class);
|
|
|
|
labelStyleDefault = skin.get("textfield", Label.LabelStyle.class);
|
|
|
|
labelStyleActive = new Label.LabelStyle(labelStyleDefault);
|
|
|
|
labelStyleActive = new Label.LabelStyle(labelStyleDefault);
|
|
|
|
labelStyleActive.fontColor = Color.RED;
|
|
|
|
labelStyleActive.fontColor = Color.RED;
|
|
|
|
|
|
|
|
|
|
|
@ -238,15 +239,22 @@ public class GameScreen extends WizardScreen {
|
|
|
|
|
|
|
|
|
|
|
|
padOfTruth.setName(i++, name);
|
|
|
|
padOfTruth.setName(i++, name);
|
|
|
|
|
|
|
|
|
|
|
|
if (isSelf(uuid)) continue;
|
|
|
|
|
|
|
|
var label = new Label("", skin);
|
|
|
|
|
|
|
|
var seat = seats.get(uuid);
|
|
|
|
var seat = seats.get(uuid);
|
|
|
|
label.setX(seat.getLabelX());
|
|
|
|
var group = new HorizontalGroup();
|
|
|
|
label.setY(seat.getLabelY());
|
|
|
|
group.setPosition(seat.getLabelX(), seat.getLabelY());
|
|
|
|
label.setAlignment(seat.getLabelAlign());
|
|
|
|
group.align(seat.getLabelAlign());
|
|
|
|
label.setText(name);
|
|
|
|
group.space(-3);
|
|
|
|
nameLabels.put(uuid, label);
|
|
|
|
|
|
|
|
contentRoot.addActor(label);
|
|
|
|
var nameLabel = new Label(name, skin);
|
|
|
|
|
|
|
|
group.addActor(nameLabel);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var trickLabel = new Label("0", skin, "textfield");
|
|
|
|
|
|
|
|
trickLabel.setAlignment(Align.center);
|
|
|
|
|
|
|
|
group.addActor(new Container<>(trickLabel).fill().width(50));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nameLabels.put(uuid, nameLabel);
|
|
|
|
|
|
|
|
trickLabels.put(uuid, trickLabel);
|
|
|
|
|
|
|
|
contentRoot.addActor(group);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -403,6 +411,7 @@ public class GameScreen extends WizardScreen {
|
|
|
|
|
|
|
|
|
|
|
|
handCards.clearChildren();
|
|
|
|
handCards.clearChildren();
|
|
|
|
cardStack.clearChildren();
|
|
|
|
cardStack.clearChildren();
|
|
|
|
|
|
|
|
trickLabels.values().forEach(label -> label.setText("0"));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
execute(new StartRoundOverlay(this, round));
|
|
|
|
execute(new StartRoundOverlay(this, round));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -412,7 +421,7 @@ public class GameScreen extends WizardScreen {
|
|
|
|
execute(() -> cardStack.clearChildren());
|
|
|
|
execute(() -> cardStack.clearChildren());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void finishTrick(@NotNull UUID player) {
|
|
|
|
public void finishTrick(@NotNull UUID player, int totalPlayerTricks) {
|
|
|
|
var seat = seats.getOrDefault(player, Seat.FALLBACK);
|
|
|
|
var seat = seats.getOrDefault(player, Seat.FALLBACK);
|
|
|
|
|
|
|
|
|
|
|
|
var animation = parallel();
|
|
|
|
var animation = parallel();
|
|
|
@ -437,7 +446,11 @@ public class GameScreen extends WizardScreen {
|
|
|
|
AnimationTimings.STACK_FINISH_MOVE
|
|
|
|
AnimationTimings.STACK_FINISH_MOVE
|
|
|
|
))
|
|
|
|
))
|
|
|
|
),
|
|
|
|
),
|
|
|
|
targeting(card, alpha(0, AnimationTimings.STACK_FINISH_FADE))
|
|
|
|
targeting(card, alpha(0, AnimationTimings.STACK_FINISH_FADE)),
|
|
|
|
|
|
|
|
run(() -> {
|
|
|
|
|
|
|
|
var trickLabel = trickLabels.get(player);
|
|
|
|
|
|
|
|
if (trickLabel != null) trickLabel.setText(Integer.toString(totalPlayerTricks));
|
|
|
|
|
|
|
|
})
|
|
|
|
));
|
|
|
|
));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
}),
|
|
|
@ -710,6 +723,7 @@ public class GameScreen extends WizardScreen {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
padOfTruth.clearValues();
|
|
|
|
padOfTruth.clearValues();
|
|
|
|
nameLabels.values().forEach(label -> label.setStyle(labelStyleDefault));
|
|
|
|
nameLabels.values().forEach(label -> label.setStyle(labelStyleDefault));
|
|
|
|
|
|
|
|
trickLabels.values().forEach(label -> label.setText("0"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//</editor-fold>
|
|
|
|
//</editor-fold>
|
|
|
|
|
|
|
|
|
|
|
@ -947,7 +961,7 @@ public class GameScreen extends WizardScreen {
|
|
|
|
@Getter
|
|
|
|
@Getter
|
|
|
|
public enum Seat {
|
|
|
|
public enum Seat {
|
|
|
|
FALLBACK(WizardGame.WIDTH * 0.5f, WizardGame.HEIGHT * 0.5f, 0, 0, 0, WizardGame.WIDTH * 0.5f, WizardGame.HEIGHT * 0.5f),
|
|
|
|
FALLBACK(WizardGame.WIDTH * 0.5f, WizardGame.HEIGHT * 0.5f, 0, 0, 0, WizardGame.WIDTH * 0.5f, WizardGame.HEIGHT * 0.5f),
|
|
|
|
BOTTOM(WizardGame.WIDTH * 0.5f, 0, 0, 0, Align.bottom, WizardGame.WIDTH * 0.5f, 300),
|
|
|
|
BOTTOM(WizardGame.WIDTH * 0.5f, 0, WizardGame.WIDTH * 0.5f, 37.5f, Align.center, WizardGame.WIDTH * 0.5f, 300),
|
|
|
|
LEFT(-324, WizardGame.HEIGHT * 0.5f, 50, WizardGame.HEIGHT * 0.5f + 110f, Align.bottomLeft, 117.5f, WizardGame.HEIGHT * 0.5f),
|
|
|
|
LEFT(-324, WizardGame.HEIGHT * 0.5f, 50, WizardGame.HEIGHT * 0.5f + 110f, Align.bottomLeft, 117.5f, WizardGame.HEIGHT * 0.5f),
|
|
|
|
TOP_LEFT(WizardGame.WIDTH * 0.25f - 144, WizardGame.HEIGHT + 289, WizardGame.WIDTH * 0.25f, WizardGame.HEIGHT - 50, Align.top, WizardGame.WIDTH * 0.25f, WizardGame.HEIGHT - 200),
|
|
|
|
TOP_LEFT(WizardGame.WIDTH * 0.25f - 144, WizardGame.HEIGHT + 289, WizardGame.WIDTH * 0.25f, WizardGame.HEIGHT - 50, Align.top, WizardGame.WIDTH * 0.25f, WizardGame.HEIGHT - 200),
|
|
|
|
TOP(WizardGame.WIDTH * 0.5f, WizardGame.HEIGHT + 324, WizardGame.WIDTH * 0.5f, WizardGame.HEIGHT - 50, Align.top, WizardGame.WIDTH * 0.5f, WizardGame.HEIGHT - 200),
|
|
|
|
TOP(WizardGame.WIDTH * 0.5f, WizardGame.HEIGHT + 324, WizardGame.WIDTH * 0.5f, WizardGame.HEIGHT - 50, Align.top, WizardGame.WIDTH * 0.5f, WizardGame.HEIGHT - 200),
|
|
|
|