diff options
author | Paul Gilbert | 2017-12-24 15:01:05 -0500 |
---|---|---|
committer | Paul Gilbert | 2017-12-25 00:03:37 -0500 |
commit | eb067079bbf5baa3251ab462a85f68154f8c992f (patch) | |
tree | ac6e35daeccc4978a6460cce58a49fe2acb63320 /engines/xeen | |
parent | 7a8d99f33292a00f9d654341abf4189dc3bd71d3 (diff) | |
download | scummvm-rg350-eb067079bbf5baa3251ab462a85f68154f8c992f.tar.gz scummvm-rg350-eb067079bbf5baa3251ab462a85f68154f8c992f.tar.bz2 scummvm-rg350-eb067079bbf5baa3251ab462a85f68154f8c992f.zip |
XEEN: Fix Please Wait dialog not removing when changing maps
Technically, the dialog now doesn't even show up, since loading
the new maps are so fast these days. I've decided against adding
in an explicit delay, because it's less jarring for players to
now be able to walk transparently between maps without interruption
Diffstat (limited to 'engines/xeen')
-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) { |