TicTacToeMultiPlayer.fxml (5688B)
1 <?xml version="1.0" encoding="UTF-8"?> 2 3 <?import com.jfoenix.controls.*?> 4 <?import javafx.geometry.*?> 5 <?import javafx.scene.control.*?> 6 <?import javafx.scene.layout.*?> 7 <?import java.lang.*?> 8 9 <?import java.net.URL?> 10 <BorderPane xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="nl.isygameclient.controllers.games.tictactoe.TicTacToeMultiPlayerController"> 11 <styleClass> 12 <String fx:value="surface" /> 13 </styleClass> 14 <left> 15 <VBox prefWidth="200" spacing="20" styleClass="surface-variant"> 16 <padding> 17 <Insets topRightBottomLeft="20" /> 18 </padding> 19 20 <!-- Playing As Controls --> 21 <VBox> 22 <Label text="Playing As"> 23 <styleClass> 24 <String fx:value="headline-small" /> 25 <String fx:value="on-surface-variant-text" /> 26 </styleClass> 27 </Label> 28 <Separator styleClass="on-surface-variant-text" /> 29 <JFXComboBox fx:id="playingAsCombo" onAction="#onPlayingAsComboSelect" prefWidth="Infinity"> 30 <styleClass> 31 <String fx:value="primary" /> 32 --> 33 <String fx:value="on-primary-text" /> 34 <String fx:value="body-large" /> 35 </styleClass> 36 </JFXComboBox> 37 </VBox> 38 <VBox> 39 <Label text="Opponent"> 40 <styleClass> 41 <String fx:value="headline-small" /> 42 <String fx:value="on-surface-variant-text" /> 43 </styleClass> 44 </Label> 45 <Separator styleClass="on-surface-variant-text" /> 46 <Label fx:id="playingAgainstLabel" prefWidth="Infinity"> 47 <styleClass> 48 <String fx:value="headline-small" /> 49 <String fx:value="on-surface-variant-text" /> 50 </styleClass> 51 </Label> 52 </VBox> 53 <VBox> 54 <children> 55 <Label text="Player"> 56 <styleClass> 57 <String fx:value="headline-small" /> 58 <String fx:value="on-surface-variant-text" /> 59 </styleClass> 60 </Label> 61 <Separator styleClass="on-surface-variant-text" /> 62 <TextField fx:id="nameField" promptText="Your Name" /> 63 <TextField fx:id="opponentField" promptText="Opponent (optional)" /> 64 </children> 65 </VBox> 66 67 <!-- Best of Controls --> 68 <VBox> 69 <Label text="Server"> 70 <styleClass> 71 <String fx:value="headline-small" /> 72 <String fx:value="on-surface-variant-text" /> 73 </styleClass> 74 </Label> 75 <Separator styleClass="on-surface-variant-text" /> 76 <HBox prefHeight="100.0" prefWidth="200.0"> 77 <children> 78 <TextField fx:id="hostField" promptText="Host" /> 79 <TextField fx:id="portField" alignment="CENTER_RIGHT" promptText="Port" text="7789" /> 80 </children> 81 </HBox> 82 </VBox> 83 84 <!-- Window Controls --> 85 <Pane VBox.vgrow="ALWAYS" /> 86 <VBox alignment="CENTER" spacing="10"> 87 <JFXButton onAction="#onNewGameButtonClick" prefWidth="Infinity" text="New Game"> 88 <styleClass> 89 <String fx:value="primary" /> 90 <String fx:value="on-primary-text" /> 91 <String fx:value="title-medium" /> 92 </styleClass> 93 </JFXButton> 94 <JFXButton onAction="#onMainMenuButtonClick" prefWidth="Infinity" text="Main Menu"> 95 <styleClass> 96 <String fx:value="primary" /> 97 <String fx:value="on-primary-text" /> 98 <String fx:value="title-medium" /> 99 </styleClass> 100 </JFXButton> 101 </VBox> 102 </VBox> 103 </left> 104 <!-- Game Field --> 105 <center> 106 <HBox alignment="CENTER"> 107 <padding> 108 <Insets topRightBottomLeft="20" /> 109 </padding> 110 111 <!-- Left --> 112 <VBox alignment="TOP_CENTER" maxHeight="800" minWidth="150"> 113 <Label text="Score Player"> 114 <styleClass> 115 <String fx:value="headline-medium" /> 116 <String fx:value="on-surface-text" /> 117 </styleClass> 118 </Label> 119 <Label text="0"> 120 <styleClass> 121 <String fx:value="headline-medium" /> 122 <String fx:value="on-surface-text" /> 123 </styleClass> 124 </Label> 125 <Separator maxWidth="100" /> 126 </VBox> 127 128 <!-- Center --> 129 <VBox alignment="CENTER" minWidth="640"> 130 <HBox alignment="CENTER"> 131 <padding> 132 <Insets topRightBottomLeft="5" /> 133 </padding> 134 <Label text="Current Player: "> 135 <styleClass> 136 <String fx:value="on-surface-text" /> 137 <String fx:value="headline-small" /> 138 </styleClass> 139 </Label> 140 <Label fx:id="currentPlayer"> 141 <styleClass> 142 <String fx:value="on-surface-text" /> 143 <String fx:value="headline-small" /> 144 </styleClass> 145 </Label> 146 </HBox> 147 <Separator maxWidth="100" /> 148 149 <StackPane> 150 <VBox.margin> 151 <Insets left="20" right="20" top="20" /> 152 </VBox.margin> 153 <GridPane fx:id="grid" hgap="10" maxHeight="640" maxWidth="640" styleClass="ttt-grid" vgap="10"> 154 <padding> 155 <Insets topRightBottomLeft="10" /> 156 </padding> 157 </GridPane> 158 <Label fx:id="gameOverText" visible="false"> 159 <padding> 160 <Insets bottom="10" left="20" right="20" top="10" /> 161 </padding> 162 <styleClass> 163 <String fx:value="surface" /> 164 <String fx:value="display-large" /> 165 <String fx:value="on-surface-text" /> 166 </styleClass> 167 </Label> 168 </StackPane> 169 </VBox> 170 171 <!-- Right --> 172 <VBox alignment="TOP_CENTER" maxHeight="800" minWidth="150"> 173 <Label text="Score Opponent"> 174 <styleClass> 175 <String fx:value="headline-medium" /> 176 <String fx:value="on-surface-text" /> 177 </styleClass> 178 </Label> 179 <Label text="0"> 180 <styleClass> 181 <String fx:value="headline-medium" /> 182 <String fx:value="on-surface-text" /> 183 </styleClass> 184 </Label> 185 <Separator maxWidth="100" /> 186 </VBox> 187 </HBox> 188 </center> 189 <stylesheets> 190 <URL value="@../../../css/style.css" /> 191 <URL value="@../../../css/themes/dark.theme.css" /> 192 <!-- <URL value="@../css/themes/light.theme.css" />--> 193 </stylesheets> 194 </BorderPane>