💄 Added dialog for starting a new game

main
Isabell Pflug 1 year ago
parent b016f77cae
commit e3c2f36358

@ -10,7 +10,12 @@ void MainWindow::buttonPressed(QPushButton *button) {
} }
void MainWindow::newGame() { void MainWindow::newGame() {
initialiseGame(); QMessageBox newGameDialog;
newGameDialog.setText("Do you really want to start a new game?");
newGameDialog.setStandardButtons(QMessageBox::Yes | QMessageBox::Cancel);
if (newGameDialog.exec() == QMessageBox::Yes) {
initialiseGame();
}
} }
// initialisation functions // initialisation functions

@ -7,6 +7,7 @@
#include <QDebug> #include <QDebug>
#include <QGenericMatrix> #include <QGenericMatrix>
#include <QMainWindow> #include <QMainWindow>
#include <QMessageBox>
#include <QPushButton> #include <QPushButton>
#include <QSettings> #include <QSettings>

Loading…
Cancel
Save