diff --git a/src/ch/epfl/chacun/gui/BoardUI.java b/src/ch/epfl/chacun/gui/BoardUI.java index 17e7e1b..2a46df4 100644 --- a/src/ch/epfl/chacun/gui/BoardUI.java +++ b/src/ch/epfl/chacun/gui/BoardUI.java @@ -138,6 +138,9 @@ public static Node create(int reach, ObservableValue gameStateO, } container.setContent(gridPane); + // Center board + container.setVvalue(.5); + container.setHvalue(.5); return container; } diff --git a/src/ch/epfl/chacun/gui/Main.java b/src/ch/epfl/chacun/gui/Main.java index 653fc2c..e009e12 100644 --- a/src/ch/epfl/chacun/gui/Main.java +++ b/src/ch/epfl/chacun/gui/Main.java @@ -96,7 +96,7 @@ public void start(Stage primaryStage) throws Exception { gameStateO.set(stateAction.gameState()); tileToPlaceRotationP.set(Rotation.NONE); - if (!gameStateO.get().lastTilePotentialOccupants().isEmpty()) { + if (gameStateO.get().nextAction() == GameState.Action.OCCUPY_TILE) { // Display potential occupants Set occupantsToDisplay = new HashSet<>(visibleOccupantsP.get()); occupantsToDisplay.addAll(gameStateO.get().lastTilePotentialOccupants()); diff --git a/src/ch/epfl/chacun/gui/MessageBoardUI.java b/src/ch/epfl/chacun/gui/MessageBoardUI.java index eeac956..a8a39a6 100644 --- a/src/ch/epfl/chacun/gui/MessageBoardUI.java +++ b/src/ch/epfl/chacun/gui/MessageBoardUI.java @@ -65,7 +65,10 @@ public static Node create(ObservableValue> messagesO, wrapper.getChildren().add(message); }); // Scroll to the last message - Platform.runLater(() -> container.setVvalue(1)); + Platform.runLater(() -> { + container.setVvalue(1); + container.layout(); + }); }); wrapper.setSpacing(MESSAGES_SPACING);