diff --git a/racevisionGame/src/main/java/visualiser/Controllers/HostGameController.java b/racevisionGame/src/main/java/visualiser/Controllers/HostGameController.java index 6f82f87d..174ec7da 100644 --- a/racevisionGame/src/main/java/visualiser/Controllers/HostGameController.java +++ b/racevisionGame/src/main/java/visualiser/Controllers/HostGameController.java @@ -70,8 +70,8 @@ public class HostGameController extends Controller { */ public void connectSocket(String address, int port) throws IOException { Socket socket = new Socket(address, port); - RaceStartController rsc = (RaceStartController)loadScene("raceStart.fxml"); - rsc.enterLobby(socket, true); + InGameLobbyController iglc = (InGameLobbyController)loadScene("gameLobby.fxml"); + iglc.enterGameLobby(socket, true); } /** diff --git a/racevisionGame/src/main/java/visualiser/Controllers/InGameLobbyController.java b/racevisionGame/src/main/java/visualiser/Controllers/InGameLobbyController.java index 350b4bf6..71332f48 100644 --- a/racevisionGame/src/main/java/visualiser/Controllers/InGameLobbyController.java +++ b/racevisionGame/src/main/java/visualiser/Controllers/InGameLobbyController.java @@ -41,9 +41,6 @@ public class InGameLobbyController extends Controller { @FXML private ImageView imageView; - @FXML - AnchorPane gameLobbyWrapper; - @FXML GridPane playerContainer; @@ -88,7 +85,7 @@ public class InGameLobbyController extends Controller { private PopulatePlayers lobbyUpdateListener; - public void initialize(URL location, ResourceBundle resources) { + public void initialize() { allPlayerLabels = new ArrayList(Arrays.asList(playerLabel, playerLabel2, playerLabel3, playerLabel4, @@ -186,10 +183,6 @@ public class InGameLobbyController extends Controller { countdownTimer(); } - public AnchorPane gameLobbyWrapper(){ - return gameLobbyWrapper; - } - /** * Initialises the race clock/timer labels for the start time, current time, and remaining time. * @param visualiserRace The race to get data from. @@ -258,11 +251,8 @@ public class InGameLobbyController extends Controller { this.isHost = isHost; this.controllerClient = visualiserRaceEvent.getControllerClient(); - this.visualiserRaceEvent.getVisualiserRaceState().getBoats().addListener(this.lobbyUpdateListener); - - gameLobbyWrapper.setVisible(true); startRace(); } catch (IOException e) { //TODO should probably let this propagate, so that we only enter this scene if everything works diff --git a/racevisionGame/src/main/resources/visualiser/scenes/gameLobby.fxml b/racevisionGame/src/main/resources/visualiser/scenes/gameLobby.fxml index 49b1bce3..e4574ea4 100644 --- a/racevisionGame/src/main/resources/visualiser/scenes/gameLobby.fxml +++ b/racevisionGame/src/main/resources/visualiser/scenes/gameLobby.fxml @@ -20,7 +20,7 @@ - +