X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fmainwin.cpp;h=c71e89728d8b0fd3557d52d452219c7aa9aeee29;hb=6f13016fe0742df2abfbf4ee08b3a0f27211a993;hp=3c37a7bc4f5342cd005338dde6304820e5bcf478;hpb=98faaadc703b743d2f4e1540e827e19e3c31eeb4;p=warehouse-man-deluxe diff --git a/src/mainwin.cpp b/src/mainwin.cpp index 3c37a7b..c71e897 100644 --- a/src/mainwin.cpp +++ b/src/mainwin.cpp @@ -25,20 +25,19 @@ MainWin::MainWin() { + // We create the EditorWindow 1st because the GameWidget will crash if there + // is no level data loaded... + editorWindow = new EditorWindow(this); gameWidget = new GameWidget(this); setCentralWidget(gameWidget); gameWidget->setFocusPolicy(Qt::StrongFocus); // Without this, it gets no keys setWindowTitle("Warehouse Man Deluxe"); setWindowIcon(QIcon(":/wmd-icon.png")); -// editor = new QWindow(this); - editorWindow = new EditorWindow(this); -// editor->setCentralWidget(editorWidget); -// editorWidget->setFocusPolicy(Qt::StrongFocus); // Without this, it gets no keys editorWindow->show(); newGame = CreateAction(tr("&New"), tr("New Game"), tr("Start a new game of Warehouse Man Deluxe"), QIcon(), QKeySequence(tr("ctrl+n"))); -// connect(newGame, SIGNAL(triggered()), this, SLOT(OnNewGame())); + connect(newGame, SIGNAL(triggered()), this, SLOT(HandleNewGame())); undoAction = CreateAction(tr("&Undo"), tr(""), tr(""), QIcon(), QKeySequence(tr("ctrl+z"))); connect(undoAction, SIGNAL(triggered()), this, SLOT(HandleUndo())); @@ -283,9 +282,17 @@ void MainWin::ResetGame(void) } +void MainWin::HandleNewGame(void) +{ +// ResetGame(); + gameWidget->level = 0; + gameWidget->NextLevel(); +} + + void MainWin::AboutGame(void) { - QMessageBox::about(this, tr("About Warehouse Man Deluxe"), tr("Warehouse Man Deluxe Version 1.0\n\nCopyright (C) 2014 Underground Software\n\nWritten by James L. Hammons")); + QMessageBox::about(this, tr("About Warehouse Man Deluxe"), tr("Warehouse Man Deluxe Version 1.0\n\nCopyright (C) 2014 Underground Software\n\nWritten by James Hammons")); }