Had to remove BoarderPane from LoungeSceneView, because i did not manage to make it not interfere with gameplay in the background

Also did some css Styling work, all of it experimental
This commit is contained in:
Seraina 2022-05-14 09:01:45 +02:00
parent f279298af1
commit 778a5f224d
6 changed files with 85 additions and 53 deletions

View File

@ -187,6 +187,7 @@ public class ChatApp extends Application {
primaryStage.setTitle("Night Train To Budapest");
primaryStage.setResizable(true);
primaryStage.setMaximized(true);
primaryStage.show();
}

View File

@ -48,6 +48,8 @@ public class LoungeSceneViewController implements Initializable {
public static final Logger LOGGER = LogManager.getLogger(LoungeSceneViewController.class);
public static final BudaLogConfig l = new BudaLogConfig(LOGGER);
@FXML
public AnchorPane buttonPane;
@FXML
private AnchorPane backGroundAnimationPane;

View File

@ -0,0 +1,29 @@
#ChatScrollPane{
}
#vBoxChatMessages{
-fx-background-color: rgba(255,255,255,0.3);
}
.anchorPane{
-fx-background-color: transparent;
}
*{
-fx-background-color: transparent;
}
.button{
-fx-background-color: midnightblue;
-fx-text-fill: lightsteelblue;
}
.button:pressed{
-fx-background-color: lightsteelblue;
-fx-text-fill: midnightblue;
}
.button:hover{
-fx-effect: innershadow(gaussian, lightsteelblue, 10, 0.5 , 2, 2);
}

View File

@ -12,9 +12,9 @@
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<AnchorPane fx:id="chatPaneRoot" xmlns="http://javafx.com/javafx/18" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ch.unibas.dmi.dbis.cs108.multiplayer.client.gui.chat.ChatController">
<AnchorPane fx:id="chatPaneRoot" pickOnBounds="false" stylesheets="@Chat.css" xmlns="http://javafx.com/javafx/18" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ch.unibas.dmi.dbis.cs108.multiplayer.client.gui.chat.ChatController">
<children>
<GridPane alignment="CENTER" layoutY="149.0" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<GridPane alignment="CENTER" layoutY="149.0" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" pickOnBounds="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="100.0" />
</columnConstraints>
@ -23,16 +23,12 @@
<RowConstraints maxHeight="-Infinity" minHeight="10.0" percentHeight="30.0" valignment="CENTER" vgrow="ALWAYS" />
</rowConstraints>
<children>
<AnchorPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308">
<children>
<ScrollPane fx:id="ChatScrollPane" fitToHeight="true" fitToWidth="true" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="176.0" prefWidth="343.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<content>
<VBox fx:id="vBoxChatMessages" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minWidth="-Infinity" prefWidth="170.0" spacing="2.0" />
</content>
</ScrollPane>
</children>
</AnchorPane>
<AnchorPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" GridPane.rowIndex="1">
<ScrollPane fx:id="ChatScrollPane" fitToHeight="true" fitToWidth="true" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="176.0" prefWidth="343.0">
<content>
<VBox fx:id="vBoxChatMessages" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minWidth="-Infinity" prefWidth="170.0" spacing="2.0" />
</content>
</ScrollPane>
<AnchorPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" pickOnBounds="false" GridPane.rowIndex="1">
<children>
<GridPane alignment="CENTER" layoutX="10.0" layoutY="20.0" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="82.0" prefWidth="2072.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<columnConstraints>
@ -65,7 +61,7 @@
</AnchorPane>
<AnchorPane fx:id="chatinputAnchor" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="92.0" prefWidth="366.0" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.hgrow="ALWAYS" GridPane.valignment="CENTER" GridPane.vgrow="ALWAYS">
<children>
<TextField fx:id="chatMsgField" layoutX="-420.0" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="56.0" prefWidth="1372.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
<TextField fx:id="chatMsgField" layoutX="-420.0" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="56.0" prefWidth="1372.0" promptText="message..." AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
</children>
<GridPane.margin>
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />
@ -86,7 +82,7 @@
</AnchorPane>
</children>
</GridPane>
<GridPane fx:id="vBoxGridPane" alignment="CENTER" disable="true" layoutX="-14.0" layoutY="-235.0" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308">
<GridPane fx:id="vBoxGridPane" alignment="CENTER" disable="true" layoutX="-14.0" layoutY="-235.0" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" pickOnBounds="false">
<columnConstraints>
<ColumnConstraints hgrow="ALWAYS" maxWidth="1.7976931348623157E308" minWidth="10.0" percentWidth="73.0" prefWidth="100.0" />
<ColumnConstraints hgrow="ALWAYS" maxWidth="1.7976931348623157E308" minWidth="10.0" percentWidth="66.0" prefWidth="100.0" />
@ -96,8 +92,8 @@
<RowConstraints fillHeight="false" maxHeight="1.7976931348623157E308" minHeight="10.0" percentHeight="100.0" vgrow="ALWAYS" />
</rowConstraints>
<children>
<ScrollBar orientation="VERTICAL" prefHeight="196.0" prefWidth="16.0" GridPane.columnIndex="2" />
<VBox fx:id="vBoxServerMessage" alignment="TOP_RIGHT" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="184.0" spacing="2.0" GridPane.columnIndex="1" />
<ScrollBar mouseTransparent="true" orientation="VERTICAL" pickOnBounds="false" prefHeight="196.0" prefWidth="16.0" GridPane.columnIndex="2" />
<VBox fx:id="vBoxServerMessage" alignment="TOP_RIGHT" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mouseTransparent="true" pickOnBounds="false" prefHeight="184.0" spacing="2.0" GridPane.columnIndex="1" />
</children>
</GridPane>
</children>

View File

@ -10,45 +10,37 @@
<AnchorPane fx:id="backGroundAnchorPane" pickOnBounds="false" stylesheets="@loungStyle.css" xmlns="http://javafx.com/javafx/18" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ch.unibas.dmi.dbis.cs108.multiplayer.client.gui.lounge.LoungeSceneViewController">
<children>
<AnchorPane fx:id="backGroundAnimationPane" maxHeight="843.75" maxWidth="1500.0" />
<BorderPane fx:id="LoungeSceneBorderPane" layoutX="860.0" layoutY="440.0" pickOnBounds="false" stylesheets="@boarderPane.css" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<top>
<ToolBar fx:id="NTtBToolBar" pickOnBounds="false" prefHeight="30.0" BorderPane.alignment="CENTER">
<items>
<Button fx:id="highScoreButton" mnemonicParsing="false" onAction="#sendHIghScore" pickOnBounds="false" text="High Score" />
<Button fx:id="lobbyPrintButton" mnemonicParsing="false" onAction="#sendLilstle" pickOnBounds="false" text="Lobby List" />
<Button fx:id="LeaveServerButton" mnemonicParsing="false" pickOnBounds="false" text="Leave server" />
<Button fx:id="leaveLobbyButton" mnemonicParsing="false" onAction="#leaveLobby" pickOnBounds="false" text="Leave Lobby" />
<Button fx:id="ChangeNameButton" mnemonicParsing="false" pickOnBounds="false" text="Change Name" />
</items>
</ToolBar>
</top>
<center>
<AnchorPane pickOnBounds="false" BorderPane.alignment="CENTER">
<children>
<Button fx:id="newGameButton" layoutX="36.0" layoutY="105.0" mnemonicParsing="false" pickOnBounds="false" text="New Lobby" />
<AnchorPane fx:id="gameAnchorPane" pickOnBounds="false" />
<Button fx:id="startGame" layoutX="36.0" layoutY="142.0" mnemonicParsing="false" onAction="#startGame" pickOnBounds="false" text="Start Game" />
</children>
</AnchorPane>
</center>
<bottom>
<AnchorPane fx:id="ChatArea" pickOnBounds="false" prefHeight="83.0" prefWidth="578.0" BorderPane.alignment="CENTER" />
</bottom>
<right>
<ListView fx:id="LobbyListView" opacity="0.0" pickOnBounds="false" BorderPane.alignment="CENTER" />
</right>
<left>
<AnchorPane prefHeight="316.0" prefWidth="181.0" BorderPane.alignment="CENTER">
<children>
<Label layoutX="59.0" layoutY="200.0" pickOnBounds="false" text="High Score:" />
<TextFlow fx:id="highScore" layoutX="62.0" layoutY="232.0" pickOnBounds="false" prefHeight="167.0" prefWidth="181.0" AnchorPane.bottomAnchor="1.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="232.0" />
<Label layoutX="67.0" layoutY="6.0" pickOnBounds="false" text="Players:" />
<TextFlow fx:id="lobbyPrint" layoutX="5.0" layoutY="23.0" pickOnBounds="false" prefHeight="178.0" prefWidth="171.0" />
</children>
</AnchorPane>
</left>
</BorderPane>
<AnchorPane fx:id="backGroundAnimationPane" maxHeight="843.75" maxWidth="1500.0" />
<AnchorPane fx:id="gameDisplayAnchorPane" maxHeight="843.75" maxWidth="1500.0" pickOnBounds="false" />
<ToolBar fx:id="NTtBToolBar" pickOnBounds="false" prefHeight="30.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<items>
<Button fx:id="highScoreButton" mnemonicParsing="false" onAction="#sendHIghScore" pickOnBounds="false" text="High Score" />
<Button fx:id="lobbyPrintButton" mnemonicParsing="false" onAction="#sendLilstle" pickOnBounds="false" text="Lobby List" />
<Button fx:id="LeaveServerButton" mnemonicParsing="false" pickOnBounds="false" text="Leave server" />
<Button fx:id="leaveLobbyButton" mnemonicParsing="false" onAction="#leaveLobby" pickOnBounds="false" text="Leave Lobby" />
<Button fx:id="ChangeNameButton" mnemonicParsing="false" pickOnBounds="false" text="Change Name" />
</items>
</ToolBar>
<AnchorPane prefHeight="316.0" prefWidth="181.0" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="35.0">
<children>
<Label layoutX="59.0" layoutY="200.0" pickOnBounds="false" text="High Score:" />
<TextFlow fx:id="highScore" layoutX="62.0" layoutY="232.0" pickOnBounds="false" prefHeight="167.0" prefWidth="181.0" AnchorPane.bottomAnchor="1.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="232.0" />
<Label layoutX="67.0" layoutY="6.0" pickOnBounds="false" text="Players:" />
<TextFlow fx:id="lobbyPrint" layoutX="5.0" layoutY="23.0" pickOnBounds="false" prefHeight="178.0" prefWidth="171.0" />
</children>
</AnchorPane>
<AnchorPane pickOnBounds="false" prefHeight="122.0" prefWidth="85.0" AnchorPane.bottomAnchor="200.0" AnchorPane.rightAnchor="10.0" AnchorPane.topAnchor="35.0">
<children>
<Button fx:id="newGameButton" layoutX="9.0" layoutY="109.0" mnemonicParsing="false" pickOnBounds="false" text="New Lobby" AnchorPane.rightAnchor="0.0" />
<AnchorPane fx:id="gameAnchorPane" pickOnBounds="false" />
<Button fx:id="startGame" alignment="BASELINE_CENTER" layoutX="9.0" layoutY="140.0" mnemonicParsing="false" onAction="#startGame" pickOnBounds="false" text="Start Game" />
</children>
</AnchorPane>
<AnchorPane fx:id="ChatArea" pickOnBounds="false" prefHeight="83.0" prefWidth="578.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" />
</children>
</AnchorPane>

View File

@ -1,5 +1,17 @@
#backGroundAnchorPane{
/*-fx-background-color: black;*/
/*-fx-background-image: url(../game/Day/Full_Wagon.png);*/
#highScore{
-fx-background-color: midnightblue;
}
#lobbyPrint{
-fx-background-color: midnightblue;
}
#buttonPane{
-fx-background-color: midnightblue;
-fx-alignment: center;
}
.anchorPane{
-fx-alignment: center;
}