From 750e44219f246c404b44170001287b1ffb64ec89 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 19 Jan 2016 18:41:35 +0100 Subject: WAGE: Dialog loop --- engines/wage/wage.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'engines/wage/wage.cpp') diff --git a/engines/wage/wage.cpp b/engines/wage/wage.cpp index db7e364fab..b8d0977853 100644 --- a/engines/wage/wage.cpp +++ b/engines/wage/wage.cpp @@ -54,6 +54,7 @@ #include "wage/wage.h" #include "wage/entities.h" #include "wage/gui.h" +#include "wage/dialog.h" #include "wage/script.h" #include "wage/world.h" @@ -139,6 +140,7 @@ void WageEngine::processEvents() { while (_eventMan->pollEvent(event)) { switch (event.type) { case Common::EVENT_QUIT: + gameOver(); _shouldQuit = true; break; case Common::EVENT_MOUSEMOVE: @@ -217,7 +219,15 @@ void WageEngine::appendText(char *str) { } void WageEngine::gameOver() { - warning("STUB: WageEngine::gameOver()"); + DialogButtonArray buttons; + + buttons.push_back(new DialogButton("OK", 112, 67, 68, 28)); + + Dialog gameOver(_gui, _world->_gameOverMessage->c_str(), &buttons); + + gameOver.run(); + + doClose(); } void WageEngine::performInitialSetup() { @@ -278,6 +288,10 @@ void WageEngine::performInitialSetup() { } } +void WageEngine::doClose() { + warning("STUB: doClose()"); +} + Scene *WageEngine::getSceneByName(String &location) { Scene *scene; if (location.equals("random@")) { -- cgit v1.2.3