mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Resolved issue #69 and added dock icon for splash screen.
This commit is contained in:
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user