diff options
-rw-r--r-- | engines/wage/wage.cpp | 20 | ||||
-rw-r--r-- | engines/wage/wage.h | 3 |
2 files changed, 18 insertions, 5 deletions
diff --git a/engines/wage/wage.cpp b/engines/wage/wage.cpp index 9ecd4c7d5b..620f1b5bb9 100644 --- a/engines/wage/wage.cpp +++ b/engines/wage/wage.cpp @@ -140,8 +140,8 @@ void WageEngine::processEvents() { while (_eventMan->pollEvent(event)) { switch (event.type) { case Common::EVENT_QUIT: - saveDialog(); - _shouldQuit = true; + if (saveDialog()) + _shouldQuit = true; break; case Common::EVENT_MOUSEMOVE: _gui->mouseMove(event.mouse.x, event.mouse.y); @@ -230,7 +230,7 @@ void WageEngine::gameOver() { doClose(); } -void WageEngine::saveDialog() { +bool WageEngine::saveDialog() { DialogButtonArray buttons; buttons.push_back(new DialogButton("No", 19, 67, 68, 28)); @@ -239,9 +239,21 @@ void WageEngine::saveDialog() { Dialog save(_gui, 291, "Save changes before closing?", &buttons, 1); - save.run(); + int button = save.run(); + + if (button == 2) // Cancel + return false; + + if (button == 1) + saveGame(); doClose(); + + return true; +} + +void WageEngine::saveGame() { + warning("STUB: saveGame()"); } void WageEngine::performInitialSetup() { diff --git a/engines/wage/wage.h b/engines/wage/wage.h index 122eced2a2..fa52c2440e 100644 --- a/engines/wage/wage.h +++ b/engines/wage/wage.h @@ -162,7 +162,7 @@ public: void appendText(String &str); void appendText(char *str); void gameOver(); - void saveDialog(); + bool saveDialog(); Obj *getOffer(); Chr *getMonster(); void processEvents(); @@ -170,6 +170,7 @@ public: void onMove(Designed *what, Designed *from, Designed *to); void encounter(Chr *player, Chr *chr); void redrawScene(); + void saveGame(); private: Console *_console; |