|
|
|
@ -231,6 +231,7 @@ public class InGameLobbyController extends Controller {
|
|
|
|
//Get the current race status.
|
|
|
|
//Get the current race status.
|
|
|
|
RaceStatusEnum raceStatus = visualiserRaceEvent.getVisualiserRaceState().getRaceStatusEnum();
|
|
|
|
RaceStatusEnum raceStatus = visualiserRaceEvent.getVisualiserRaceState().getRaceStatusEnum();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Try catch for getting interval times
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
long interval = ChronoUnit.MILLIS.between(visualiserRaceEvent.getVisualiserRaceState().getRaceClock().getCurrentTime(), visualiserRaceEvent.getVisualiserRaceState().getRaceClock().getStartingTime());
|
|
|
|
long interval = ChronoUnit.MILLIS.between(visualiserRaceEvent.getVisualiserRaceState().getRaceClock().getCurrentTime(), visualiserRaceEvent.getVisualiserRaceState().getRaceClock().getStartingTime());
|
|
|
|
if(interval<=10000){
|
|
|
|
if(interval<=10000){
|
|
|
|
@ -286,13 +287,14 @@ public class InGameLobbyController extends Controller {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Menu button pressed. Prompt alert then return to menu
|
|
|
|
* Menu button pressed. Prompt alert then return to menu
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public void menuBtnPressed(){
|
|
|
|
public void menuBtnPressed() throws IOException {
|
|
|
|
Alert alert = new Alert(Alert.AlertType.CONFIRMATION);
|
|
|
|
Alert alert = new Alert(Alert.AlertType.CONFIRMATION);
|
|
|
|
alert.setTitle("Quitting race");
|
|
|
|
alert.setTitle("Quitting race");
|
|
|
|
alert.setContentText("Do you wish to quit the race?");
|
|
|
|
alert.setContentText("Do you wish to quit the race?");
|
|
|
|
alert.setHeaderText("You are about to quit the race");
|
|
|
|
alert.setHeaderText("You are about to quit the race");
|
|
|
|
Optional<ButtonType> result = alert.showAndWait();
|
|
|
|
Optional<ButtonType> result = alert.showAndWait();
|
|
|
|
if(result.get() == ButtonType.OK){
|
|
|
|
if(result.get() == ButtonType.OK){
|
|
|
|
|
|
|
|
parent.endEvent();
|
|
|
|
visualiserRaceEvent.terminate();
|
|
|
|
visualiserRaceEvent.terminate();
|
|
|
|
gameLobbyWrapper.setVisible(false);
|
|
|
|
gameLobbyWrapper.setVisible(false);
|
|
|
|
parent.enterTitle();
|
|
|
|
parent.enterTitle();
|
|
|
|
@ -322,6 +324,7 @@ public class InGameLobbyController extends Controller {
|
|
|
|
|
|
|
|
|
|
|
|
//Do nothing if 5 seconds or less to go
|
|
|
|
//Do nothing if 5 seconds or less to go
|
|
|
|
if (interval <=5000){
|
|
|
|
if (interval <=5000){
|
|
|
|
|
|
|
|
countdownTenPane.setVisible(false);
|
|
|
|
//countdownTenText.setText("5");
|
|
|
|
//countdownTenText.setText("5");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|