aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/wage/gui-console.cpp4
-rw-r--r--engines/wage/gui.cpp23
-rw-r--r--engines/wage/gui.h7
-rw-r--r--engines/wage/menu.cpp6
-rw-r--r--engines/wage/menu.h1
-rw-r--r--engines/wage/wage.cpp3
6 files changed, 38 insertions, 6 deletions
diff --git a/engines/wage/gui-console.cpp b/engines/wage/gui-console.cpp
index f1095de3ca..18f6b25291 100644
--- a/engines/wage/gui-console.cpp
+++ b/engines/wage/gui-console.cpp
@@ -395,4 +395,8 @@ void Gui::disableUndo() {
_menu->enableCommand(kMenuEdit, kMenuActionUndo, false);
}
+void Gui::disableAllMenus() {
+ _menu->disableAllMenus();
+}
+
} // End of namespace Wage
diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp
index a2931f9abc..afb30c78a3 100644
--- a/engines/wage/gui.cpp
+++ b/engines/wage/gui.cpp
@@ -218,14 +218,29 @@ const Graphics::Font *Gui::getTitleFont() {
return getFont("Chicago-12", Graphics::FontManager::kBigGUIFont);
}
+void Gui::drawDesktop() {
+ // Draw desktop
+ Common::Rect r(0, 0, _screen.w - 1, _screen.h - 1);
+ Design::drawFilledRoundRect(&_screen, r, kDesktopArc, kColorBlack, _patterns, kPatternCheckers);
+ g_system->copyRectToScreen(_screen.getPixels(), _screen.pitch, 0, 0, _screen.w, _screen.h);
+}
+
void Gui::draw() {
+ if (_engine->_isGameOver) {
+ if (_menuDirty) {
+ drawDesktop();
+ _menu->render();
+ }
+
+ _menuDirty = false;
+
+ return;
+ }
+
if (_scene != _engine->_world->_player->_currentScene || _sceneDirty) {
_scene = _engine->_world->_player->_currentScene;
- // Draw desktop
- Common::Rect r(0, 0, _screen.w - 1, _screen.h - 1);
- Design::drawFilledRoundRect(&_screen, r, kDesktopArc, kColorBlack, _patterns, kPatternCheckers);
- g_system->copyRectToScreen(_screen.getPixels(), _screen.pitch, 0, 0, _screen.w, _screen.h);
+ drawDesktop();
_sceneDirty = true;
_consoleDirty = true;
diff --git a/engines/wage/gui.h b/engines/wage/gui.h
index 8cdc827bf0..d611579307 100644
--- a/engines/wage/gui.h
+++ b/engines/wage/gui.h
@@ -110,9 +110,11 @@ public:
void actionClear();
void actionCut();
void disableUndo();
+ void disableAllMenus();
private:
void undrawCursor();
+ void drawDesktop();
void paintBorder(Graphics::Surface *g, Common::Rect &r, WindowType windowType);
void renderConsole(Graphics::Surface *g, Common::Rect &r);
void drawBox(Graphics::Surface *g, int x, int y, int w, int h);
@@ -131,7 +133,6 @@ public:
int _cursorX, _cursorY;
bool _cursorState;
Common::Rect _consoleTextArea;
- bool _cursorOff;
bool _builtInFonts;
WageEngine *_engine;
@@ -140,6 +141,9 @@ public:
bool _cursorDirty;
Common::Rect _cursorRect;
+ bool _cursorOff;
+
+ bool _menuDirty;
private:
Graphics::Surface _console;
@@ -148,7 +152,6 @@ private:
bool _sceneDirty;
bool _consoleDirty;
bool _bordersDirty;
- bool _menuDirty;
Common::StringArray _out;
Common::StringArray _lines;
diff --git a/engines/wage/menu.cpp b/engines/wage/menu.cpp
index b859867e9a..dfb042dd15 100644
--- a/engines/wage/menu.cpp
+++ b/engines/wage/menu.cpp
@@ -560,4 +560,10 @@ void Menu::enableCommand(int menunum, int action, bool state) {
_items[menunum]->subitems[i]->enabled = state;
}
+void Menu::disableAllMenus() {
+ for (uint i = 1; i < _items.size(); i++) // Leave About menu on
+ for (uint j = 0; j < _items[i]->subitems.size(); j++)
+ _items[i]->subitems[j]->enabled = false;
+}
+
} // End of namespace Wage
diff --git a/engines/wage/menu.h b/engines/wage/menu.h
index cee7611664..3550356bc6 100644
--- a/engines/wage/menu.h
+++ b/engines/wage/menu.h
@@ -104,6 +104,7 @@ public:
void regenWeaponsMenu();
void processMenuShortCut(byte flags, uint16 ascii);
void enableCommand(int menunum, int action, bool state);
+ void disableAllMenus();
bool _menuActivated;
Common::Rect _bbox;
diff --git a/engines/wage/wage.cpp b/engines/wage/wage.cpp
index 5f79d9852b..8dd578e20d 100644
--- a/engines/wage/wage.cpp
+++ b/engines/wage/wage.cpp
@@ -215,6 +215,9 @@ void WageEngine::gameOver() {
gameOverDialog.run();
doClose();
+
+ _gui->disableAllMenus();
+ _gui->_menuDirty = true;
}
bool WageEngine::saveDialog() {