- Fixed JFXDialog initialised in lobby, raceview, serverlist controller by default. Now, dialog only appears when called.

- [WIP] Created keybindingdialog fxml. CSS not yet done.
 - Removed top most anchorpane on raceview so parent is stackpane like other views.

#story[1278]
This commit is contained in:
Zhi You Tan
2017-09-19 18:40:01 +12:00
parent 73799954e4
commit 027324cc4f
7 changed files with 380 additions and 266 deletions
@@ -112,16 +112,23 @@ public class ServerListController implements Initializable, ServerListenerDelega
serverListVBox.getChildren().add(noServersFound);
// Set up dialog for server creation
serverListHostButton.setOnAction(action -> {
showServerCreationDialog();
});
}
/**
* Shows Server Creation Dialog when "Host" button is clicked.
*/
private void showServerCreationDialog() {
Platform.runLater(() -> {
FXMLLoader dialogContent = new FXMLLoader(getClass().getResource(
"/views/dialogs/ServerCreationDialog.fxml"));
try {
JFXDialog dialog = new JFXDialog(serverListMainStackPane, dialogContent.load(),
DialogTransition.CENTER);
serverListHostButton.setOnAction(action -> {
dialog.show();
Sounds.playButtonClick();
});
dialog.show();
Sounds.playButtonClick();
} catch (IOException e) {
logger.warn("Could not create Server Creation Dialog.");
}