Merge branch 'develop' into loading_screens

# Conflicts:
#	src/main/resources/views/RaceView.fxml
This commit is contained in:
Kusal Ekanayake
2017-09-27 14:05:46 +13:00
49 changed files with 2922 additions and 626 deletions
@@ -29,6 +29,7 @@ import seng302.utilities.BonjourInstallChecker;
import seng302.utilities.Sounds;
import seng302.visualiser.GameClient;
import seng302.visualiser.controllers.dialogs.KeyBindingDialogController;
import seng302.visualiser.controllers.dialogs.PopupDialogController;
public class ViewManager {
@@ -109,8 +110,6 @@ public class ViewManager {
gameClient.stopGame();
System.exit(0);
});
jfxSnackbar = new JFXSnackbar(decorator);
}
/**
@@ -195,6 +194,7 @@ public class ViewManager {
}
});
jfxSnackbar = new JFXSnackbar(decorator);
}
/**
@@ -228,6 +228,7 @@ public class ViewManager {
.getController();
keyBindingDialogController.setGameClient(this.gameClient);
keyBindingDialog.show();
decorator.requestFocus();
Sounds.playButtonClick();
}
}
@@ -237,6 +238,26 @@ public class ViewManager {
keyBindingDialog.close();
}
public PopupDialogController showPopupDialog() {
FXMLLoader dialogContent = new FXMLLoader(
getClass().getResource("/views/dialogs/PopupDialog.fxml"));
for (Node node : decorator.getChildren()) {
if (node instanceof StackPane) {
try {
JFXDialog dialog = new JFXDialog((StackPane) node, dialogContent.load(),
DialogTransition.CENTER);
PopupDialogController popupDialogController = dialogContent.getController();
popupDialogController.setPopupDialog(dialog);
dialog.show();
return popupDialogController;
} catch (IOException e) {
logger.error("Cannot load Popup dialog");
}
}
}
return null;
}
/**
* Show a snackbar at the bottom of the app for 1 second.
*