From eb067079bbf5baa3251ab462a85f68154f8c992f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 24 Dec 2017 15:01:05 -0500 Subject: 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 --- engines/xeen/dialogs.cpp | 17 +++++++++++++---- engines/xeen/dialogs.h | 7 ++++++- engines/xeen/map.cpp | 12 ++---------- 3 files changed, 21 insertions(+), 15 deletions(-) (limited to 'engines') 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) { -- cgit v1.2.3