Merged in development.

main
David Wu 9 years ago
parent 288979be3b
commit 9f813ab7aa

@ -144,7 +144,7 @@ public class RaceController extends Controller {
if (result.get() == ButtonType.OK) {
parent.endEvent();
race.setVisible(false);
App.app.loadStart(App.getStage());
App.app.showMainStage(App.getStage());
}
} else {
Alert alert = new Alert(Alert.AlertType.CONFIRMATION);
@ -153,11 +153,13 @@ public class RaceController extends Controller {
Optional<ButtonType> result = alert.showAndWait();
if (result.get() == ButtonType.OK) {
race.setVisible(false);
App.app.loadStart(App.getStage());
App.app.showMainStage(App.getStage());
}
}
} catch (IOException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
});
@ -469,9 +471,11 @@ public class RaceController extends Controller {
race.setVisible(false);
//parent.enterTitle();
try {
App.app.loadStart(App.getStage());
App.app.showMainStage(App.getStage());
} catch (IOException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
//TODO currently this doesn't work correctly - the title screen remains visible after clicking join game
//TODO we should display an error to the user

@ -116,7 +116,7 @@ public class App extends Application {
boatTask,
() -> {
try {
showMainStage();
showMainStage(new Stage());
} catch (Exception e) {
e.printStackTrace();
}
@ -146,8 +146,9 @@ public class App extends Application {
* Show the main stage after the splash screen
* @throws Exception
*/
private void showMainStage() throws Exception {
stage = new Stage(StageStyle.DECORATED);
public void showMainStage(Stage stage) throws Exception {
App.stage = stage;
App.app = this;
FXMLLoader loader = new FXMLLoader(getClass().getResource("/visualiser/scenes/main.fxml"));
Parent root = loader.load();
stage.setResizable(false);

Loading…
Cancel
Save