💄 Added dialog for starting a new game

main
Isabell Pflug 1 year ago
parent b016f77cae
commit e3c2f36358

@ -10,8 +10,13 @@ void MainWindow::buttonPressed(QPushButton *button) {
} }
void MainWindow::newGame() { void MainWindow::newGame() {
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(); initialiseGame();
} }
}
// initialisation functions // initialisation functions
void MainWindow::initialiseGame() { void MainWindow::initialiseGame() {

@ -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