Finished implementing room codes.

- Fixed bug where room code wasn't parsed correctly
- Added room code selection to server list screen.
- Added room code to hosts lobby.
- Implemented communication protocols on the game client.

Tags: #story[1281]
This commit is contained in:
Michael Rausch
2017-09-21 22:48:33 +12:00
parent e17e9749d8
commit 95ad7a4840
10 changed files with 167 additions and 53 deletions
+6 -6
View File
@@ -38,30 +38,30 @@
-fx-font-size: 23px;
}
#connectButton {
#connectButton, #roomConnectButton {
-fx-background-color: -fx-pp-light-text-color; /* inverted */
-fx-text-fill: -fx-pp-theme-color; /* inverted */
-fx-font-size: 20px;
-fx-pref-height: 65px;
-fx-pref-height: 45px;
}
#connectButton:hover {
#connectButton:hover, #roomConnectButton:hover {
-fx-font-size: 23px;
}
#connectLabel, #serverPortNumber, #serverHostName {
#connectLabel, #connectLabel1, #serverPortNumber, #roomNumber, #serverHostName {
-fx-text-fill: -fx-pp-light-text-color;
-fx-font-size: 18px;
}
#serverHostName, #serverPortNumber {
#serverHostName, #serverPortNumber, #roomNumber {
-jfx-focus-color: -fx-pp-light-text-color;
-jfx-unfocus-color: -fx-pp-light-text-color;
-fx-prompt-text-fill: -fx-pp-light-text-color;
}
#serverHostName .error-label, #serverPortNumber .error-label {
#serverHostName .error-label, #serverPortNumber .error-label, #roomNumber .error-label {
-fx-font-size: 12px;
-fx-text-fill: lightblue;
}
+31 -14
View File
@@ -1,5 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import com.jfoenix.controls.*?>
<?import java.lang.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<?import com.jfoenix.controls.JFXButton?>
<?import com.jfoenix.controls.JFXTextField?>
<?import java.lang.String?>
@@ -12,35 +18,48 @@
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<StackPane fx:id="serverListMainStackPane" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng302.visualiser.controllers.ServerListController">
<children>
<GridPane fx:id="serverListMainGridPane" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308">
<children>
<GridPane fx:id="connectGridPane" GridPane.rowIndex="2">
<children>
<JFXButton fx:id="connectButton" buttonType="RAISED" prefHeight="45.0"
prefWidth="220.0" ripplerFill="#3493e3" text="CONNECT" textFill="WHITE"
GridPane.columnIndex="5" GridPane.halignment="RIGHT"
GridPane.valignment="CENTER">
<JFXButton fx:id="connectButton" buttonType="RAISED" prefHeight="45.0" prefWidth="220.0" ripplerFill="#3493e3" text="CONNECT" textFill="WHITE" GridPane.columnIndex="5" GridPane.halignment="RIGHT" GridPane.rowIndex="1" GridPane.valignment="CENTER">
<GridPane.margin>
<Insets right="50.0" />
</GridPane.margin>
</JFXButton>
<JFXTextField fx:id="serverHostName" maxHeight="30.0" minHeight="30.0" prefHeight="30.0" promptText="Host Name" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.valignment="CENTER">
<JFXTextField fx:id="serverHostName" maxHeight="30.0" minHeight="30.0" prefHeight="30.0" promptText="Host Name" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="1" GridPane.valignment="CENTER">
<GridPane.margin>
<Insets left="20.0" right="20.0" />
</GridPane.margin>
</JFXTextField>
<JFXTextField fx:id="serverPortNumber" maxHeight="30.0" minHeight="30.0" prefHeight="30.0" promptText="Port Number" GridPane.columnIndex="3" GridPane.halignment="CENTER" GridPane.valignment="CENTER">
<JFXTextField fx:id="serverPortNumber" maxHeight="30.0" minHeight="30.0" prefHeight="30.0" promptText="Port Number" GridPane.columnIndex="3" GridPane.halignment="CENTER" GridPane.rowIndex="1" GridPane.valignment="CENTER">
<GridPane.margin>
<Insets left="20.0" right="20.0" />
</GridPane.margin>
</JFXTextField>
<Label fx:id="connectLabel" text="Direct Connect:" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.valignment="CENTER">
<Label fx:id="connectLabel" text="Direct Connect:" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="1" GridPane.valignment="CENTER">
<GridPane.margin>
<Insets right="45.0" />
</GridPane.margin>
</Label>
<Label fx:id="connectLabel1" text="Connect to Room:" GridPane.columnIndex="2" GridPane.halignment="RIGHT" GridPane.valignment="CENTER">
<GridPane.margin>
<Insets right="45.0" top="5.0" />
</GridPane.margin>
</Label>
<JFXButton fx:id="roomConnectButton" buttonType="RAISED" prefHeight="45.0" prefWidth="220.0" text="CONNECT" GridPane.columnIndex="5" GridPane.halignment="RIGHT" GridPane.valignment="CENTER">
<GridPane.margin>
<Insets right="50.0" top="5.0" />
</GridPane.margin>
</JFXButton>
<JFXTextField fx:id="roomNumber" maxHeight="30.0" minHeight="30.0" prefHeight="30.0" promptText="Room Number" GridPane.columnIndex="3" GridPane.halignment="CENTER" GridPane.valignment="CENTER">
<GridPane.margin>
<Insets left="20.0" right="20.0" top="5.0" />
</GridPane.margin>
</JFXTextField>
</children>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" />
@@ -51,6 +70,7 @@
<ColumnConstraints hgrow="SOMETIMES" maxWidth="273.0" minWidth="250.0" prefWidth="273.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
</GridPane>
@@ -76,12 +96,9 @@
<Insets left="35.0" top="5.0" />
</padding>
</Label>
<JFXButton id="hostButton" fx:id="serverListHostButton" buttonType="RAISED"
prefHeight="45.0" prefWidth="220.0"
text="HOST" GridPane.columnIndex="1" GridPane.halignment="RIGHT"
GridPane.valignment="CENTER">
<JFXButton id="hostButton" fx:id="serverListHostButton" buttonType="RAISED" prefHeight="45.0" prefWidth="220.0" text="HOST" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.valignment="CENTER">
<GridPane.margin>
<Insets right="50.0"/>
<Insets right="50.0" />
</GridPane.margin>
</JFXButton>
</children>
@@ -100,10 +117,10 @@
<rowConstraints>
<RowConstraints maxHeight="80.0" minHeight="80.0" prefHeight="80.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="1.7976931348623157E308" minHeight="400.0" prefHeight="400.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="80.0" minHeight="80.0" prefHeight="80.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="80.0" minHeight="125.0" prefHeight="80.0" vgrow="SOMETIMES" />
</rowConstraints>
<stylesheets>
<String fx:value="/css/Master.css"/>
<String fx:value="/css/Master.css" />
<String fx:value="/css/ServerListView.css" />
</stylesheets>
</GridPane>