Skip to content

Commit

Permalink
Small bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Schnick committed Jan 6, 2021
1 parent 625413a commit 708a299
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ private static Node createRightBar() {
});
importB.setGraphic(new FontIcon());
importB.getStyleClass().add(GuiStyle.CLASS_IMPORT);
importB.setDisable(GameIntegration.current() == null);
GameIntegration.currentGameProperty().addListener((c, o, n) -> {
Platform.runLater(() -> importB.setDisable(n == null));
});

JFXButton launch = new JFXButton("Launch");
launch.setOnAction(e -> {
Expand All @@ -141,6 +145,10 @@ private static Node createRightBar() {
});
launch.setGraphic(new FontIcon());
launch.getStyleClass().add(GuiStyle.CLASS_LAUNCH);
launch.setDisable(GameIntegration.current() == null);
GameIntegration.currentGameProperty().addListener((c, o, n) -> {
Platform.runLater(() -> launch.setDisable(n == null));
});

var box = new HBox(m, importB, launch);
box.setAlignment(Pos.CENTER);
Expand Down

0 comments on commit 708a299

Please sign in to comment.