WAGE: Made save dialog functional

This commit is contained in:
Eugene Sandulenko 2016-01-21 12:10:06 +01:00
parent f11721d036
commit 6c205ad46d
2 changed files with 18 additions and 5 deletions

View File

@ -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() {

View File

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