diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/xeen/dialogs.cpp | 17 | ||||
-rw-r--r-- | engines/xeen/dialogs.h | 7 | ||||
-rw-r--r-- | engines/xeen/map.cpp | 12 |
3 files changed, 21 insertions, 15 deletions
diff --git a/engines/xeen/dialogs.cpp b/engines/xeen/dialogs.cpp index d44a361c3c..3062bec908 100644 --- a/engines/xeen/dialogs.cpp +++ b/engines/xeen/dialogs.cpp @@ -201,13 +201,22 @@ void CreditsScreen::execute() { /*------------------------------------------------------------------------*/ -void PleaseWait::show(XeenEngine *vm) { - Windows &windows = *vm->_windows; +PleaseWait::PleaseWait(bool isOops) { + _msg = isOops ? Res.OOPS : Res.PLEASE_WAIT; +} + +PleaseWait::~PleaseWait() { + Windows &windows = *g_vm->_windows; + windows[9].close(); +} + +void PleaseWait::show() { + Windows &windows = *g_vm->_windows; Window &w = windows[9]; - if (vm->_mode != MODE_0) { + if (g_vm->_mode != MODE_0) { w.open(); - w.writeString(Res.PLEASE_WAIT); + w.writeString(_msg); w.update(); } } diff --git a/engines/xeen/dialogs.h b/engines/xeen/dialogs.h index 680963f907..92e2d3ba6d 100644 --- a/engines/xeen/dialogs.h +++ b/engines/xeen/dialogs.h @@ -113,8 +113,13 @@ public: }; class PleaseWait { +private: + Common::String _msg; public: - static void show(XeenEngine *vm); + PleaseWait(bool isOops = false); + ~PleaseWait(); + + void show(); }; } // End of namespace Xeen diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp index 688e46a568..369202bedc 100644 --- a/engines/xeen/map.cpp +++ b/engines/xeen/map.cpp @@ -949,17 +949,11 @@ void Map::load(int mapId) { Interface &intf = *g_vm->_interface; Party &party = *g_vm->_party; Sound &sound = *g_vm->_sound; - Windows &windows = *g_vm->_windows; IndoorDrawList &indoorList = intf._indoorList; OutdoorDrawList &outdoorList = intf._outdoorList; - if (intf._falling) { - Window &w = windows[9]; - w.open(); - w.writeString(Res.OOPS); - } else { - PleaseWait::show(_vm); - } + PleaseWait waitMsg(intf._falling); + waitMsg.show(); intf._objNumber = 0; party._stepped = true; @@ -1313,8 +1307,6 @@ void Map::load(int mapId) { loadSky(); files.setGameCc(isDarkCc); - if (windows[9]._enabled) - windows[9].close(); } int Map::mazeLookup(const Common::Point &pt, int layerShift, int wallMask) { |