aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2015-07-21 08:12:47 -0400
committerPaul Gilbert2015-07-21 08:12:47 -0400
commitc38d8d9617dbea00eb9343233796b80955a0f564 (patch)
tree7a47ad60ef5430ac16902574060b9030231d6e7a /engines
parent959c4eceda2b2f4417e5d24ab7eccadaa30de77d (diff)
downloadscummvm-rg350-c38d8d9617dbea00eb9343233796b80955a0f564.tar.gz
scummvm-rg350-c38d8d9617dbea00eb9343233796b80955a0f564.tar.bz2
scummvm-rg350-c38d8d9617dbea00eb9343233796b80955a0f564.zip
SHERLOCK: RT: Keep lab scene widget active after displaying messages
Diffstat (limited to 'engines')
-rw-r--r--engines/sherlock/talk.cpp5
-rw-r--r--engines/sherlock/tattoo/tattoo_user_interface.cpp7
-rw-r--r--engines/sherlock/tattoo/widget_base.cpp11
-rw-r--r--engines/sherlock/tattoo/widget_base.h5
-rw-r--r--engines/sherlock/tattoo/widget_lab.cpp8
-rw-r--r--engines/sherlock/tattoo/widget_lab.h5
6 files changed, 38 insertions, 3 deletions
diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp
index dc546b4b3a..a1a003d751 100644
--- a/engines/sherlock/talk.cpp
+++ b/engines/sherlock/talk.cpp
@@ -403,9 +403,10 @@ void Talk::talkTo(const Common::String &filename) {
if (!ui._lookScriptFlag) {
ui.drawInterface(2);
- ui.banishWindow();
- ui._windowBounds.top = CONTROLS_Y1;
ui._menuMode = STD_MODE;
+ ui._windowBounds.top = CONTROLS_Y1;
+
+ ui.banishWindow();
}
break;
diff --git a/engines/sherlock/tattoo/tattoo_user_interface.cpp b/engines/sherlock/tattoo/tattoo_user_interface.cpp
index 04be008587..cf93ce20c5 100644
--- a/engines/sherlock/tattoo/tattoo_user_interface.cpp
+++ b/engines/sherlock/tattoo/tattoo_user_interface.cpp
@@ -833,8 +833,15 @@ void TattooUserInterface::drawDialogRect(Surface &s, const Common::Rect &r, bool
}
void TattooUserInterface::banishWindow(bool slideUp) {
+ TattooScene &scene = *(TattooScene *)_vm->_scene;
if (!_widgets.empty())
_widgets.back()->banishWindow();
+
+ if (scene._labTableScene && !_labWidget.active()) {
+ // In the lab table scene, so ensure
+ _labWidget.summonWindow();
+ _menuMode = LAB_MODE;
+ }
}
void TattooUserInterface::freeMenu() {
diff --git a/engines/sherlock/tattoo/widget_base.cpp b/engines/sherlock/tattoo/widget_base.cpp
index 66ade474c2..9d95fed9bf 100644
--- a/engines/sherlock/tattoo/widget_base.cpp
+++ b/engines/sherlock/tattoo/widget_base.cpp
@@ -57,6 +57,17 @@ void WidgetBase::banishWindow() {
ui._widgets.remove(this);
}
+bool WidgetBase::active() const {
+ TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui;
+ for (Common::List<WidgetBase *>::iterator i = ui._widgets.begin(); i != ui._widgets.end(); ++i) {
+ if ((*i) == this)
+ return true;
+ }
+
+ return false;
+}
+
+
void WidgetBase::erase() {
Screen &screen = *_vm->_screen;
diff --git a/engines/sherlock/tattoo/widget_base.h b/engines/sherlock/tattoo/widget_base.h
index e94dbdd742..fcf22cee8e 100644
--- a/engines/sherlock/tattoo/widget_base.h
+++ b/engines/sherlock/tattoo/widget_base.h
@@ -83,6 +83,11 @@ public:
virtual ~WidgetBase() {}
/**
+ * Returns true if the given widget is active in the user interface's widget list
+ */
+ bool active() const;
+
+ /**
* Erase any previous display of the widget on the screen
*/
virtual void erase();
diff --git a/engines/sherlock/tattoo/widget_lab.cpp b/engines/sherlock/tattoo/widget_lab.cpp
index 6ba5dadc7b..cc0bae0e90 100644
--- a/engines/sherlock/tattoo/widget_lab.cpp
+++ b/engines/sherlock/tattoo/widget_lab.cpp
@@ -33,6 +33,11 @@ WidgetLab::WidgetLab(SherlockEngine *vm) : WidgetBase(vm) {
_labObject = nullptr;
}
+void WidgetLab::summonWindow() {
+ WidgetBase::summonWindow();
+ _labObject = nullptr;
+}
+
void WidgetLab::handleEvents() {
Events &events = *_vm->_events;
Scene &scene = *_vm->_scene;
@@ -140,7 +145,8 @@ void WidgetLab::handleEvents() {
_labObject = ui._bgShape;
// Set the mouse cursor to the object
- events.setCursor(_labObject->_imageFrame->_frame, 0, 0);
+ Graphics::Surface &img = _labObject->_imageFrame->_frame;
+ events.setCursor(img, img.w / 2, img.h / 2);
// Hide this object until they are done with it (releasing it)
_labObject->toggleHidden();
diff --git a/engines/sherlock/tattoo/widget_lab.h b/engines/sherlock/tattoo/widget_lab.h
index 80ed0f9da9..2f19200b81 100644
--- a/engines/sherlock/tattoo/widget_lab.h
+++ b/engines/sherlock/tattoo/widget_lab.h
@@ -49,6 +49,11 @@ public:
virtual ~WidgetLab() {}
/**
+ * Summon the window
+ */
+ virtual void summonWindow();
+
+ /**
* Handle event processing
*/
virtual void handleEvents();