diff options
author | Eugene Sandulenko | 2016-01-21 12:10:06 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2016-02-14 17:12:50 +0100 |
commit | 6c205ad46df457c6e2dca56413c85a0e7a424ec4 (patch) | |
tree | 4fba90ebc1dcd4de35ed1e02dd203b90ae58b27d /engines | |
parent | f11721d036eac47c3e69725f40fb8961093d8869 (diff) | |
download | scummvm-rg350-6c205ad46df457c6e2dca56413c85a0e7a424ec4.tar.gz scummvm-rg350-6c205ad46df457c6e2dca56413c85a0e7a424ec4.tar.bz2 scummvm-rg350-6c205ad46df457c6e2dca56413c85a0e7a424ec4.zip |
WAGE: Made save dialog functional
Diffstat (limited to 'engines')
-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; |