Resolved issue #69 and added dock icon for splash screen.

This commit is contained in:
Kusal Ekanayake
2017-09-27 19:27:13 +13:00
parent 2a523a5664
commit efc71f2003
2 changed files with 2 additions and 11 deletions
@@ -96,7 +96,6 @@ public class GameClient {
socketThread.addDisconnectionListener((cause) -> { socketThread.addDisconnectionListener((cause) -> {
showConnectionError(cause); showConnectionError(cause);
tearDownConnection(); tearDownConnection();
Platform.runLater(this::loadStartScreen);
}); });
socketThread.addStreamObserver(this::parsePackets); socketThread.addStreamObserver(this::parsePackets);
@@ -159,16 +158,6 @@ public class GameClient {
} }
} }
private void loadStartScreen() {
FXMLLoader fxmlLoader = new FXMLLoader(
getClass().getResource("/views/StartScreenView.fxml"));
try {
holderPane.getChildren().clear();
holderPane.getChildren().add(fxmlLoader.load());
} catch (IOException e) {
showConnectionError("JavaFX crashed. Please restart the app");
}
}
private void showConnectionError (String message) { private void showConnectionError (String message) {
Platform.runLater(() -> { Platform.runLater(() -> {
@@ -64,6 +64,8 @@ public class ViewManager {
this.stage = stage; this.stage = stage;
Parent root = FXMLLoader.load(getClass().getResource("/views/SplashScreen.fxml")); Parent root = FXMLLoader.load(getClass().getResource("/views/SplashScreen.fxml"));
Scene scene = new Scene(root); Scene scene = new Scene(root);
stage.setTitle("Party Parrots At Sea");
stage.getIcons().add(new Image(getClass().getResourceAsStream("/PP.png")));
stage.setScene(scene); stage.setScene(scene);
stage.initStyle(StageStyle.UNDECORATED); stage.initStyle(StageStyle.UNDECORATED);
stage.show(); stage.show();