# Conflicts: # racevisionGame/src/main/java/visualiser/Controllers/HostController.javamain
commit
63e2cc1fd0
@ -0,0 +1,209 @@
|
|||||||
|
package visualiser.Controllers;
|
||||||
|
|
||||||
|
import javafx.animation.AnimationTimer;
|
||||||
|
import javafx.application.Platform;
|
||||||
|
import javafx.fxml.FXML;
|
||||||
|
import javafx.scene.control.*;
|
||||||
|
import javafx.scene.image.ImageView;
|
||||||
|
import javafx.scene.layout.AnchorPane;
|
||||||
|
import javafx.scene.layout.GridPane;
|
||||||
|
import javafx.scene.layout.Pane;
|
||||||
|
import mock.app.Event;
|
||||||
|
import network.Messages.Enums.RaceStatusEnum;
|
||||||
|
import network.Messages.Enums.RequestToJoinEnum;
|
||||||
|
import visualiser.gameController.ControllerClient;
|
||||||
|
import visualiser.model.View3D;
|
||||||
|
import visualiser.model.VisualiserRaceEvent;
|
||||||
|
import visualiser.model.VisualiserRaceState;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.Socket;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.ResourceBundle;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Controller for Hosting a game.
|
||||||
|
*/
|
||||||
|
public class InGameLobby extends Controller {
|
||||||
|
|
||||||
|
|
||||||
|
// @FXML
|
||||||
|
// TextField gameNameField;
|
||||||
|
//
|
||||||
|
// @FXML
|
||||||
|
// TextField hostNameField;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private ImageView imageView;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
AnchorPane gameLobbyWrapper;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
AnchorPane imagePane;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
SplitPane splitPane;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
AnchorPane specPane;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
GridPane playerContainer;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private Pane playerPane;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private Pane playerPane4;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private Button startButton;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private Label countdownLable;
|
||||||
|
|
||||||
|
private Event game;
|
||||||
|
|
||||||
|
private View3D fancyStuff;
|
||||||
|
|
||||||
|
private VisualiserRaceEvent visualiserRaceEvent;
|
||||||
|
|
||||||
|
private boolean isHost;
|
||||||
|
|
||||||
|
private ControllerClient controllerClient;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initialize(URL location, ResourceBundle resources) {
|
||||||
|
fancyStuff = new View3D();
|
||||||
|
playerPane4.getChildren().add(fancyStuff);
|
||||||
|
|
||||||
|
//centering the 3d object
|
||||||
|
fancyStuff.layoutXProperty().bind(playerPane4.widthProperty().subtract(fancyStuff.widthProperty()).divide(2));
|
||||||
|
fancyStuff.layoutYProperty().bind(playerPane4.heightProperty().subtract(fancyStuff.heightProperty()).divide(2));
|
||||||
|
//playerContainer.add(fancyStuff, 0,0);
|
||||||
|
|
||||||
|
fancyStuff.spinBox();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Starts the race.
|
||||||
|
*/
|
||||||
|
private void startRace() {
|
||||||
|
initialiseRaceClock(this.visualiserRaceEvent.getVisualiserRaceState());
|
||||||
|
//Starts the race countdown timer.
|
||||||
|
countdownTimer();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialises the race clock/timer labels for the start time, current time, and remaining time.
|
||||||
|
* @param visualiserRace The race to get data from.
|
||||||
|
*/
|
||||||
|
private void initialiseRaceClock(VisualiserRaceState visualiserRace) {
|
||||||
|
//Remaining time.
|
||||||
|
initialiseRaceClockDuration(visualiserRace);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialises the race duration label.
|
||||||
|
* @param visualiserRace The race to get data from.
|
||||||
|
*/
|
||||||
|
private void initialiseRaceClockDuration(VisualiserRaceState visualiserRace) {
|
||||||
|
|
||||||
|
visualiserRace.getRaceClock().durationProperty().addListener((observable, oldValue, newValue) -> {
|
||||||
|
Platform.runLater(() -> {
|
||||||
|
countdownLable.setText(newValue);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Countdown timer until race starts.
|
||||||
|
*/
|
||||||
|
private void countdownTimer() {
|
||||||
|
new AnimationTimer() {
|
||||||
|
@Override
|
||||||
|
public void handle(long arg0) {
|
||||||
|
|
||||||
|
//Get the current race status.
|
||||||
|
RaceStatusEnum raceStatus = visualiserRaceEvent.getVisualiserRaceState().getRaceStatusEnum();
|
||||||
|
|
||||||
|
|
||||||
|
//If the race has reached the preparatory phase, or has started...
|
||||||
|
if (raceStatus == RaceStatusEnum.PREPARATORY || raceStatus == RaceStatusEnum.STARTED) {
|
||||||
|
//Stop this timer.
|
||||||
|
stop();
|
||||||
|
|
||||||
|
//Hide this, and display the race controller.
|
||||||
|
gameLobbyWrapper.setVisible(false);
|
||||||
|
|
||||||
|
parent.beginRace(visualiserRaceEvent, controllerClient, isHost);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hosts a game.
|
||||||
|
*/
|
||||||
|
public void enterGameLobby(Socket socket, boolean isHost){
|
||||||
|
splitPane.setResizableWithParent(specPane, false);
|
||||||
|
splitPane.lookupAll(".split-pane-divider").stream().forEach(div -> div.setMouseTransparent(true));
|
||||||
|
imageView.fitWidthProperty().bind(imagePane.widthProperty());
|
||||||
|
imageView.fitHeightProperty().bind(imagePane.heightProperty());
|
||||||
|
this.isHost = isHost;
|
||||||
|
this.controllerClient = visualiserRaceEvent.getControllerClient();
|
||||||
|
|
||||||
|
if (!isHost){
|
||||||
|
startButton.setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
this.visualiserRaceEvent = new VisualiserRaceEvent(socket, RequestToJoinEnum.PARTICIPANT);
|
||||||
|
gameLobbyWrapper.setVisible(true);
|
||||||
|
startRace();
|
||||||
|
|
||||||
|
} catch (IOException e) {
|
||||||
|
//TODO should probably let this propagate, so that we only enter this scene if everything works
|
||||||
|
Logger.getGlobal().log(Level.WARNING, "Could not connect to server.", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Menu button pressed. Prompt alert then return to menu
|
||||||
|
*/
|
||||||
|
public void menuBtnPressed(){
|
||||||
|
Alert alert = new Alert(Alert.AlertType.CONFIRMATION);
|
||||||
|
alert.setTitle("Quitting race");
|
||||||
|
alert.setContentText("Do you wish to quit the race?");
|
||||||
|
alert.setHeaderText("You are about to quit the race");
|
||||||
|
Optional<ButtonType> result = alert.showAndWait();
|
||||||
|
if(result.get() == ButtonType.OK){
|
||||||
|
gameLobbyWrapper.setVisible(false);
|
||||||
|
parent.enterTitle();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Start button pressed. Currently only prints out start
|
||||||
|
*/
|
||||||
|
public void startBtnPressed(){
|
||||||
|
System.out.println("Should start the race. This button is only visible for the host");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void joinSpecPressed(){
|
||||||
|
System.out.println("Spectator list pressed. Joining spectators");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void joinRacePressed(){
|
||||||
|
System.out.println("Empty race user pane pressed. Joining racers");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
package visualiser.model;
|
||||||
|
|
||||||
|
import com.interactivemesh.jfx.importer.Importer;
|
||||||
|
import javafx.scene.layout.Pane;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by fwy13 on 29/08/17.
|
||||||
|
*/
|
||||||
|
public class BoatDisplay3D extends Pane {
|
||||||
|
|
||||||
|
|
||||||
|
public BoatDisplay3D(String filePath){
|
||||||
|
super();
|
||||||
|
// Shape3D
|
||||||
|
// this.getChildren().add();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,49 @@
|
|||||||
|
package visualiser.model;
|
||||||
|
|
||||||
|
import javafx.animation.AnimationTimer;
|
||||||
|
import javafx.scene.Group;
|
||||||
|
import javafx.scene.PerspectiveCamera;
|
||||||
|
import javafx.scene.SubScene;
|
||||||
|
import javafx.scene.layout.Pane;
|
||||||
|
import javafx.scene.shape.Box;
|
||||||
|
import javafx.scene.shape.CullFace;
|
||||||
|
import javafx.scene.transform.Rotate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by connortaylorbrown on 30/08/17.
|
||||||
|
*/
|
||||||
|
public class View3D extends Pane {
|
||||||
|
SubScene scene;
|
||||||
|
PerspectiveCamera camera;
|
||||||
|
Box box;
|
||||||
|
|
||||||
|
public View3D() {
|
||||||
|
scene = new SubScene(this, 500, 500);
|
||||||
|
camera = new PerspectiveCamera();
|
||||||
|
scene.setCamera(camera);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void spinBox() {
|
||||||
|
camera.getTransforms().add(new Rotate(-20, Rotate.X_AXIS));
|
||||||
|
|
||||||
|
box = new Box(50,50,50);
|
||||||
|
box.setTranslateX(100);
|
||||||
|
box.setTranslateY(100);
|
||||||
|
box.setCullFace(CullFace.BACK);
|
||||||
|
|
||||||
|
Rotate ry = new Rotate(0, 0,0,0, Rotate.Y_AXIS);
|
||||||
|
box.getTransforms().add(ry);
|
||||||
|
|
||||||
|
this.getChildren().add(camera);
|
||||||
|
this.getChildren().add(box);
|
||||||
|
|
||||||
|
AnimationTimer rotation = new AnimationTimer() {
|
||||||
|
@Override
|
||||||
|
public void handle(long now) {
|
||||||
|
ry.setAngle(ry.getAngle() + 0.1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
rotation.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 18 KiB |
@ -1,40 +1,44 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<!--<?xml version="1.0" encoding="UTF-8"?>-->
|
||||||
|
|
||||||
<?import javafx.scene.control.Button?>
|
<!--<?import java.lang.*?>-->
|
||||||
<?import javafx.scene.control.Label?>
|
<!--<?import javafx.scene.control.*?>-->
|
||||||
<?import javafx.scene.layout.*?>
|
<!--<?import javafx.scene.text.*?>-->
|
||||||
<?import javafx.scene.text.Font?>
|
<!--<?import javafx.scene.control.Button?>-->
|
||||||
<AnchorPane fx:id="hostWrapper" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="780.0" visible="false" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="visualiser.Controllers.HostController">
|
<!--<?import javafx.scene.control.Label?>-->
|
||||||
<children>
|
<!--<?import javafx.scene.layout.*?>-->
|
||||||
<GridPane AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
<!--<?import javafx.scene.text.Font?>-->
|
||||||
<columnConstraints>
|
|
||||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
<!--<AnchorPane fx:id="hostWrapper" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="780.0" visible="false" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">-->
|
||||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
<!--<children>-->
|
||||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
<!--<GridPane AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">-->
|
||||||
</columnConstraints>
|
<!--<columnConstraints>-->
|
||||||
<rowConstraints>
|
<!--<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />-->
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<!--<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />-->
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<!--<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />-->
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<!--</columnConstraints>-->
|
||||||
</rowConstraints>
|
<!--<rowConstraints>-->
|
||||||
<children>
|
<!--<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />-->
|
||||||
<Button fx:id="hostGameBtn" mnemonicParsing="false" onAction="#hostGamePressed" text="Start Game" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="2">
|
<!--<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />-->
|
||||||
<font>
|
<!--<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />-->
|
||||||
<Font size="20.0" />
|
<!--</rowConstraints>-->
|
||||||
</font>
|
<!--<children>-->
|
||||||
</Button>
|
<!--<Button fx:id="hostGameBtn" mnemonicParsing="false" onAction="#hostGamePressed" text="Start Game" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="2">-->
|
||||||
<Label text="Address: 127.0.0.1" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="1" GridPane.valignment="TOP">
|
<!--<font>-->
|
||||||
<font>
|
<!--<Font size="20.0" />-->
|
||||||
<Font size="17.0" />
|
<!--</font>-->
|
||||||
</font>
|
<!--</Button>-->
|
||||||
</Label>
|
<!--<Label text="Address: 127.0.0.1" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="1" GridPane.valignment="TOP">-->
|
||||||
<Label text="Port: 4942" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="1">
|
<!--<font>-->
|
||||||
<font>
|
<!--<Font size="17.0" />-->
|
||||||
<Font size="17.0" />
|
<!--</font>-->
|
||||||
</font>
|
<!--</Label>-->
|
||||||
</Label>
|
<!--<Label text="Port: 4942" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="1">-->
|
||||||
<Button mnemonicParsing="false" onAction="#menuBtnPressed" text="Main Menu" GridPane.halignment="CENTER" />
|
<!--<font>-->
|
||||||
</children>
|
<!--<Font size="17.0" />-->
|
||||||
</GridPane>
|
<!--</font>-->
|
||||||
</children>
|
<!--</Label>-->
|
||||||
</AnchorPane>
|
<!--<Button mnemonicParsing="false" onAction="#menuBtnPressed" text="Main Menu" GridPane.halignment="CENTER" />-->
|
||||||
|
<!--</children>-->
|
||||||
|
<!--</GridPane>-->
|
||||||
|
<!--</children>-->
|
||||||
|
<!--</AnchorPane>-->
|
||||||
|
|||||||
@ -0,0 +1,182 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import javafx.scene.image.*?>
|
||||||
|
<?import java.lang.*?>
|
||||||
|
<?import javafx.geometry.*?>
|
||||||
|
<?import javafx.scene.control.*?>
|
||||||
|
<?import javafx.scene.layout.*?>
|
||||||
|
<?import javafx.scene.text.*?>
|
||||||
|
<?import javafx.geometry.Insets?>
|
||||||
|
<?import javafx.scene.control.Button?>
|
||||||
|
<?import javafx.scene.control.Label?>
|
||||||
|
<?import javafx.scene.control.SplitPane?>
|
||||||
|
<?import javafx.scene.control.TableColumn?>
|
||||||
|
<?import javafx.scene.control.TableView?>
|
||||||
|
<?import javafx.scene.image.Image?>
|
||||||
|
<?import javafx.scene.image.ImageView?>
|
||||||
|
<?import javafx.scene.layout.AnchorPane?>
|
||||||
|
<?import javafx.scene.layout.ColumnConstraints?>
|
||||||
|
<?import javafx.scene.layout.GridPane?>
|
||||||
|
<?import javafx.scene.layout.RowConstraints?>
|
||||||
|
<?import javafx.scene.text.Font?>
|
||||||
|
|
||||||
|
<AnchorPane fx:id="hostWrapper" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="780.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="visualiser.Controllers.InGameLobby">
|
||||||
|
<children>
|
||||||
|
<SplitPane fx:id="splitPane" dividerPositions="0.7724935732647815" layoutX="580.0" layoutY="129.0" prefHeight="160.0" prefWidth="200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
|
<items>
|
||||||
|
<AnchorPane fx:id="imagePane" minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0">
|
||||||
|
<children>
|
||||||
|
<ImageView fx:id="imageView" fitHeight="376.0" fitWidth="597.0" nodeOrientation="INHERIT" pickOnBounds="true" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
|
<image>
|
||||||
|
<Image url="@../images/lobby.gif" />
|
||||||
|
</image></ImageView>
|
||||||
|
<GridPane style="-fx-background-color: rgba(0, 0, 0, 0.5);" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
|
<columnConstraints>
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||||
|
</columnConstraints>
|
||||||
|
<rowConstraints>
|
||||||
|
<RowConstraints maxHeight="50.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
|
<RowConstraints maxHeight="1.7976931348623157E308" minHeight="10.0" prefHeight="173.0" vgrow="SOMETIMES" />
|
||||||
|
<RowConstraints maxHeight="50.0" minHeight="10.0" prefHeight="50.0" vgrow="SOMETIMES" />
|
||||||
|
<RowConstraints maxHeight="1.7976931348623157E308" minHeight="10.0" prefHeight="173.0" vgrow="SOMETIMES" />
|
||||||
|
<RowConstraints maxHeight="50.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
|
</rowConstraints>
|
||||||
|
<children>
|
||||||
|
<AnchorPane GridPane.rowIndex="1">
|
||||||
|
<children>
|
||||||
|
<Pane fx:id="playerPane" layoutX="22.0" layoutY="28.0" onMouseClicked="#joinRacePressed" prefHeight="150.0" prefWidth="156.0" style="-fx-border-color: black; -fx-background-color: rgba(100, 100, 100, 0.8);" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="20.0" AnchorPane.rightAnchor="20.0" AnchorPane.topAnchor="0.0" GridPane.rowIndex="1">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets left="20.0" right="20.0" />
|
||||||
|
</GridPane.margin>
|
||||||
|
<padding>
|
||||||
|
<Insets left="20.0" right="20.0" />
|
||||||
|
</padding>
|
||||||
|
<opaqueInsets>
|
||||||
|
<Insets />
|
||||||
|
</opaqueInsets>
|
||||||
|
</Pane>
|
||||||
|
<Label alignment="CENTER" contentDisplay="CENTER" text="No Player" AnchorPane.bottomAnchor="10.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" />
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
|
<AnchorPane layoutX="10.0" layoutY="78.0" GridPane.columnIndex="1" GridPane.rowIndex="1">
|
||||||
|
<children>
|
||||||
|
<Pane layoutX="22.0" layoutY="28.0" onMouseClicked="#joinRacePressed" prefHeight="150.0" prefWidth="156.0" style="-fx-border-color: black; -fx-background-color: rgba(100, 100, 100, 0.8);" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="20.0" AnchorPane.rightAnchor="20.0" AnchorPane.topAnchor="0.0" GridPane.rowIndex="1">
|
||||||
|
<opaqueInsets>
|
||||||
|
<Insets />
|
||||||
|
</opaqueInsets>
|
||||||
|
<padding>
|
||||||
|
<Insets left="20.0" right="20.0" />
|
||||||
|
</padding>
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets left="20.0" right="20.0" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</Pane>
|
||||||
|
<Label alignment="CENTER" contentDisplay="CENTER" text="No Player" AnchorPane.bottomAnchor="10.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" />
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
|
<AnchorPane layoutX="209.0" layoutY="78.0" GridPane.columnIndex="2" GridPane.rowIndex="1">
|
||||||
|
<children>
|
||||||
|
<Pane layoutX="22.0" layoutY="28.0" onMouseClicked="#joinRacePressed" prefHeight="150.0" prefWidth="156.0" style="-fx-border-color: black; -fx-background-color: rgba(100, 100, 100, 0.8);" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="20.0" AnchorPane.rightAnchor="20.0" AnchorPane.topAnchor="0.0" GridPane.rowIndex="1">
|
||||||
|
<opaqueInsets>
|
||||||
|
<Insets />
|
||||||
|
</opaqueInsets>
|
||||||
|
<padding>
|
||||||
|
<Insets left="20.0" right="20.0" />
|
||||||
|
</padding>
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets left="20.0" right="20.0" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</Pane>
|
||||||
|
<Label alignment="CENTER" contentDisplay="CENTER" text="No Player" AnchorPane.bottomAnchor="10.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" />
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
|
<AnchorPane layoutX="408.0" layoutY="78.0" GridPane.rowIndex="3">
|
||||||
|
<children>
|
||||||
|
<Pane fx:id="playerPane4" layoutX="22.0" layoutY="28.0" onMouseClicked="#joinRacePressed" prefHeight="150.0" prefWidth="156.0" style="-fx-border-color: black; -fx-background-color: rgba(100, 100, 100, 0.8);" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="20.0" AnchorPane.rightAnchor="20.0" AnchorPane.topAnchor="0.0" GridPane.rowIndex="1">
|
||||||
|
<opaqueInsets>
|
||||||
|
<Insets />
|
||||||
|
</opaqueInsets>
|
||||||
|
<padding>
|
||||||
|
<Insets left="20.0" right="20.0" />
|
||||||
|
</padding>
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets left="20.0" right="20.0" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</Pane>
|
||||||
|
<Label alignment="CENTER" contentDisplay="CENTER" text="No Player" AnchorPane.bottomAnchor="10.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" />
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
|
<AnchorPane layoutX="10.0" layoutY="334.0" GridPane.columnIndex="1" GridPane.rowIndex="3">
|
||||||
|
<children>
|
||||||
|
<Pane layoutX="22.0" layoutY="28.0" onMouseClicked="#joinRacePressed" prefHeight="150.0" prefWidth="156.0" style="-fx-border-color: black; -fx-background-color: rgba(100, 100, 100, 0.8);" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="20.0" AnchorPane.rightAnchor="20.0" AnchorPane.topAnchor="0.0" GridPane.rowIndex="1">
|
||||||
|
<opaqueInsets>
|
||||||
|
<Insets />
|
||||||
|
</opaqueInsets>
|
||||||
|
<padding>
|
||||||
|
<Insets left="20.0" right="20.0" />
|
||||||
|
</padding>
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets left="20.0" right="20.0" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</Pane>
|
||||||
|
<Label alignment="CENTER" contentDisplay="CENTER" text="No Player" AnchorPane.bottomAnchor="10.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" />
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
|
<AnchorPane layoutX="209.0" layoutY="334.0" GridPane.columnIndex="2" GridPane.rowIndex="3">
|
||||||
|
<children>
|
||||||
|
<Pane layoutX="22.0" layoutY="28.0" onMouseClicked="#joinRacePressed" prefHeight="150.0" prefWidth="156.0" style="-fx-border-color: black; -fx-background-color: rgba(100, 100, 100, 0.8);" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="20.0" AnchorPane.rightAnchor="20.0" AnchorPane.topAnchor="0.0" GridPane.rowIndex="1">
|
||||||
|
<opaqueInsets>
|
||||||
|
<Insets />
|
||||||
|
</opaqueInsets>
|
||||||
|
<padding>
|
||||||
|
<Insets left="20.0" right="20.0" />
|
||||||
|
</padding>
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets left="20.0" right="20.0" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</Pane>
|
||||||
|
<Label alignment="CENTER" contentDisplay="CENTER" text="No Player" AnchorPane.bottomAnchor="10.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" />
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
|
<Button mnemonicParsing="false" onAction="#menuBtnPressed" text="Quit" GridPane.rowIndex="4">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets left="20.0" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</Button>
|
||||||
|
<Button alignment="CENTER_RIGHT" contentDisplay="RIGHT" mnemonicParsing="false" onAction="#startBtnPressed" text="Start Game" GridPane.columnIndex="2" GridPane.halignment="RIGHT" GridPane.rowIndex="4">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets right="20.0" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</Button>
|
||||||
|
<Label alignment="CENTER" contentDisplay="CENTER" text="Map: MapNameHere" textFill="WHITE" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="2">
|
||||||
|
<font>
|
||||||
|
<Font size="16.0" />
|
||||||
|
</font>
|
||||||
|
</Label>
|
||||||
|
</children>
|
||||||
|
</GridPane>
|
||||||
|
<Label alignment="TOP_CENTER" text="Get Ready For The Next Race" textFill="#fffdfd" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="20.0">
|
||||||
|
<font>
|
||||||
|
<Font size="22.0" />
|
||||||
|
</font>
|
||||||
|
</Label>
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
|
<AnchorPane fx:id="specPane" minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0">
|
||||||
|
<children>
|
||||||
|
<TableView onMouseClicked="#joinSpecPressed" prefHeight="200.0" prefWidth="200.0" style="-fx-background-color: rgba(60, 60, 60, 1);" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
|
<columns>
|
||||||
|
<TableColumn prefWidth="173.0" text="Spectators" />
|
||||||
|
</columns>
|
||||||
|
<columnResizePolicy>
|
||||||
|
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
|
||||||
|
</columnResizePolicy>
|
||||||
|
</TableView>
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
|
</items>
|
||||||
|
</SplitPane>
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
@ -1,61 +1,61 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<!--<?xml version="1.0" encoding="UTF-8"?>-->
|
||||||
|
|
||||||
<?import javafx.geometry.*?>
|
<!--<?import javafx.geometry.*?>-->
|
||||||
<?import javafx.scene.control.*?>
|
<!--<?import javafx.scene.control.*?>-->
|
||||||
<?import javafx.scene.layout.*?>
|
<!--<?import javafx.scene.layout.*?>-->
|
||||||
<?import javafx.scene.text.Font?>
|
<!--<?import javafx.scene.text.Font?>-->
|
||||||
<AnchorPane fx:id="connectionWrapper" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="780.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="visualiser.Controllers.ConnectionController">
|
<!--<AnchorPane fx:id="connectionWrapper" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="780.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="visualiser.Controllers.ConnectionController">-->
|
||||||
<children>
|
<!--<children>-->
|
||||||
<GridPane AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
<!--<GridPane AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">-->
|
||||||
<columnConstraints>
|
<!--<columnConstraints>-->
|
||||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
<!--<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />-->
|
||||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
<!--<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />-->
|
||||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
<!--<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />-->
|
||||||
</columnConstraints>
|
<!--</columnConstraints>-->
|
||||||
<rowConstraints>
|
<!--<rowConstraints>-->
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<!--<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />-->
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<!--<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />-->
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<!--<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />-->
|
||||||
</rowConstraints>
|
<!--</rowConstraints>-->
|
||||||
<children>
|
<!--<children>-->
|
||||||
<Button fx:id="hostGameTitleBtn" maxWidth="204.0" mnemonicParsing="false" text="Host Game" GridPane.halignment="LEFT" GridPane.rowIndex="1">
|
<!--<Button fx:id="hostGameTitleBtn" maxWidth="204.0" mnemonicParsing="false" text="Host Game" GridPane.halignment="LEFT" GridPane.rowIndex="1">-->
|
||||||
<font>
|
<!--<font>-->
|
||||||
<Font size="20.0" />
|
<!--<Font size="20.0" />-->
|
||||||
</font>
|
<!--</font>-->
|
||||||
<GridPane.margin>
|
<!--<GridPane.margin>-->
|
||||||
<Insets left="50.0" />
|
<!--<Insets left="50.0" />-->
|
||||||
</GridPane.margin>
|
<!--</GridPane.margin>-->
|
||||||
</Button>
|
<!--</Button>-->
|
||||||
<Button fx:id="connectGameBtn" maxWidth="204.0" mnemonicParsing="false" text="Connect to Game" GridPane.columnIndex="2" GridPane.halignment="RIGHT" GridPane.rowIndex="1">
|
<!--<Button fx:id="connectGameBtn" maxWidth="204.0" mnemonicParsing="false" text="Connect to Game" GridPane.columnIndex="2" GridPane.halignment="RIGHT" GridPane.rowIndex="1">-->
|
||||||
<font>
|
<!--<font>-->
|
||||||
<Font size="20.0" />
|
<!--<Font size="20.0" />-->
|
||||||
</font>
|
<!--</font>-->
|
||||||
<GridPane.margin>
|
<!--<GridPane.margin>-->
|
||||||
<Insets right="50.0" />
|
<!--<Insets right="50.0" />-->
|
||||||
</GridPane.margin>
|
<!--</GridPane.margin>-->
|
||||||
</Button>
|
<!--</Button>-->
|
||||||
<RadioButton fx:id="nightRadioBtn" mnemonicParsing="false" text="Night Mode" GridPane.columnIndex="1" GridPane.halignment="LEFT" GridPane.rowIndex="2">
|
<!--<RadioButton fx:id="nightRadioBtn" mnemonicParsing="false" text="Night Mode" GridPane.columnIndex="1" GridPane.halignment="LEFT" GridPane.rowIndex="2">-->
|
||||||
<padding>
|
<!--<padding>-->
|
||||||
<Insets bottom="-50.0" />
|
<!--<Insets bottom="-50.0" />-->
|
||||||
</padding>
|
<!--</padding>-->
|
||||||
<GridPane.margin>
|
<!--<GridPane.margin>-->
|
||||||
<Insets left="80.0" />
|
<!--<Insets left="80.0" />-->
|
||||||
</GridPane.margin>
|
<!--</GridPane.margin>-->
|
||||||
</RadioButton>
|
<!--</RadioButton>-->
|
||||||
<RadioButton fx:id="dayRadioBtn" mnemonicParsing="false" text="Day Mode" GridPane.columnIndex="1" GridPane.halignment="LEFT" GridPane.rowIndex="2">
|
<!--<RadioButton fx:id="dayRadioBtn" mnemonicParsing="false" text="Day Mode" GridPane.columnIndex="1" GridPane.halignment="LEFT" GridPane.rowIndex="2">-->
|
||||||
<padding>
|
<!--<padding>-->
|
||||||
<Insets top="-50.0" />
|
<!--<Insets top="-50.0" />-->
|
||||||
</padding>
|
<!--</padding>-->
|
||||||
<GridPane.margin>
|
<!--<GridPane.margin>-->
|
||||||
<Insets left="80.0" />
|
<!--<Insets left="80.0" />-->
|
||||||
</GridPane.margin>
|
<!--</GridPane.margin>-->
|
||||||
</RadioButton>
|
<!--</RadioButton>-->
|
||||||
<Label text="Game" textAlignment="CENTER" GridPane.columnIndex="1" GridPane.halignment="CENTER">
|
<!--<Label text="Game" textAlignment="CENTER" GridPane.columnIndex="1" GridPane.halignment="CENTER">-->
|
||||||
<font>
|
<!--<font>-->
|
||||||
<Font size="60.0" />
|
<!--<Font size="60.0" />-->
|
||||||
</font>
|
<!--</font>-->
|
||||||
</Label>
|
<!--</Label>-->
|
||||||
</children>
|
<!--</children>-->
|
||||||
</GridPane>
|
<!--</GridPane>-->
|
||||||
</children>
|
<!--</children>-->
|
||||||
</AnchorPane>
|
<!--</AnchorPane>-->
|
||||||
|
|||||||
Loading…
Reference in new issue