Last adjustments to design, made sure the game notification(game over) gets cleared when a new game starts

This commit is contained in:
Seraina 2022-05-18 11:02:25 +02:00
parent 0e8da93f72
commit 87ba46fb59
5 changed files with 16 additions and 5 deletions

View File

@ -91,7 +91,7 @@ public class ListOfLobbiesController implements Initializable {
} }
HBox rootHBox = new HBox(); HBox rootHBox = new HBox();
rootHBox.setPrefWidth(300); rootHBox.setPrefWidth(300);
rootHBox.setMaxHeight(37); rootHBox.setMaxHeight(45);
String statusLobby; String statusLobby;
if (isOpen) { if (isOpen) {
statusLobby = " (open)"; statusLobby = " (open)";
@ -112,7 +112,7 @@ public class ListOfLobbiesController implements Initializable {
for (String member : members) { for (String member : members) {
HBox memberBox = new HBox(); HBox memberBox = new HBox();
memberBox.setPrefWidth(300); memberBox.setPrefWidth(300);
memberBox.setMaxHeight(37); memberBox.setMaxHeight(45);
memberBox.setPrefHeight(USE_COMPUTED_SIZE); memberBox.setPrefHeight(USE_COMPUTED_SIZE);
Label memberLabel = new Label("- " + member); Label memberLabel = new Label("- " + member);
memberLabel.setTextFill(Color.WHITE); memberLabel.setTextFill(Color.WHITE);
@ -123,8 +123,9 @@ public class ListOfLobbiesController implements Initializable {
TreeView<HBox> treeView = new TreeView<>(root); TreeView<HBox> treeView = new TreeView<>(root);
treeView.setVisible(true); treeView.setVisible(true);
treeView.setPrefWidth(300); treeView.setPrefWidth(300);
treeView.setPrefHeight(i*37 + 10); treeView.setMinHeight(i*45 + 10);
treeView.setMaxHeight(i*37 + 10); treeView.setPrefHeight(i*45 + 10);
treeView.setMaxHeight(i*45 + 10);
Platform.runLater(new Runnable() { Platform.runLater(new Runnable() {
@Override @Override
public void run() { public void run() {

View File

@ -115,7 +115,7 @@ public class LobbyDisplayHandler {
LobbyDisplayHandler handler = new LobbyDisplayHandler(); LobbyDisplayHandler handler = new LobbyDisplayHandler();
String lobby = "1:Seraina:true:Alex:Jonas$2:Sebi:false:Maria:Claudia:Hansli$3:Vanessa:true:Lara:Flu"; String lobby = "1:Seraina:true:Alex:Jonas$2:Sebi:false:Maria:Claudia:Hansli$3:Vanessa:true:Lara:Flu";
handler.updateLobbies(lobby); handler.updateLobbies(lobby);
System.out.println("lobby size in main:" + lobbies.size()); //System.out.println("lobby size in main:" + lobbies.size());
for (LobbyModel model : lobbies) { for (LobbyModel model : lobbies) {
//System.out.println(model); //System.out.println(model);
System.out.println("Lobby " + model.getId() + " " + model.isLobbyIsOpen() + " (" + model.getAdmin() + "):"); System.out.println("Lobby " + model.getId() + " " + model.isLobbyIsOpen() + " (" + model.getAdmin() + "):");

View File

@ -168,6 +168,8 @@ public class LoungeSceneViewController implements Initializable {
LOGGER.debug(" in GameView()" + chatApp); LOGGER.debug(" in GameView()" + chatApp);
allLobbyElementsBorderPane.setVisible(false); allLobbyElementsBorderPane.setVisible(false);
gameDisplayAnchorPane.getChildren().add(chatApp.game); gameDisplayAnchorPane.getChildren().add(chatApp.game);
chatApp.getGameController().clearAllNoiseDisplay();
chatApp.getGameController().clearNotificationText();
} catch (Exception e) { } catch (Exception e) {
LOGGER.debug("Not yet initialized"); LOGGER.debug("Not yet initialized");
} }
@ -185,6 +187,8 @@ public class LoungeSceneViewController implements Initializable {
try { try {
trainAnimationDayController.showFullWagon(); trainAnimationDayController.showFullWagon();
allLobbyElementsBorderPane.setVisible(true); allLobbyElementsBorderPane.setVisible(true);
chatApp.getGameController().clearAllNoiseDisplay();
chatApp.getGameController().clearNotificationText();
gameDisplayAnchorPane.getChildren().clear(); gameDisplayAnchorPane.getChildren().clear();
} catch (Exception e) { } catch (Exception e) {
LOGGER.debug("Not yet initialized"); LOGGER.debug("Not yet initialized");

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 KiB

View File

@ -3,6 +3,12 @@
-fx-font-size: 15; -fx-font-size: 15;
} }
#backGroundAnchorPane{
-fx-background-image: url(logo.jpg);
-fx-background-size: 100%;
-fx-background-position: center;
-fx-background-repeat: no-repeat;
}
.anchorPane{ .anchorPane{
-fx-alignment: center; -fx-alignment: center;