[Scummvm-cvs-logs] scummvm master -> c38d8d9617dbea00eb9343233796b80955a0f564
dreammaster
dreammaster at scummvm.org
Tue Jul 21 14:13:59 CEST 2015
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
959c4eceda SHERLOCK: RT: Fix clicking on Exit button in Lab scene
c38d8d9617 SHERLOCK: RT: Keep lab scene widget active after displaying messages
Commit: 959c4eceda2b2f4417e5d24ab7eccadaa30de77d
https://github.com/scummvm/scummvm/commit/959c4eceda2b2f4417e5d24ab7eccadaa30de77d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-07-21T08:12:04-04:00
Commit Message:
SHERLOCK: RT: Fix clicking on Exit button in Lab scene
Changed paths:
engines/sherlock/tattoo/widget_lab.cpp
diff --git a/engines/sherlock/tattoo/widget_lab.cpp b/engines/sherlock/tattoo/widget_lab.cpp
index 2d4a4dc..6ba5dad 100644
--- a/engines/sherlock/tattoo/widget_lab.cpp
+++ b/engines/sherlock/tattoo/widget_lab.cpp
@@ -108,7 +108,8 @@ void WidgetLab::handleEvents() {
scene.toggleObject(_labObject->_use[idx]._names[nameNum]);
}
}
- } else if (ui._bgShape->_name.compareToIgnoreCase("Exit")) {
+ } else if (!ui._bgShape->_name.compareToIgnoreCase("Exit")) {
+ // Eexecut the Exit button's script, which will leave the scene
ui.lookAtObject();
}
} else {
Commit: c38d8d9617dbea00eb9343233796b80955a0f564
https://github.com/scummvm/scummvm/commit/c38d8d9617dbea00eb9343233796b80955a0f564
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-07-21T08:12:47-04:00
Commit Message:
SHERLOCK: RT: Keep lab scene widget active after displaying messages
Changed paths:
engines/sherlock/talk.cpp
engines/sherlock/tattoo/tattoo_user_interface.cpp
engines/sherlock/tattoo/widget_base.cpp
engines/sherlock/tattoo/widget_base.h
engines/sherlock/tattoo/widget_lab.cpp
engines/sherlock/tattoo/widget_lab.h
diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp
index dc546b4..a1a003d 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 04be008..cf93ce2 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 66ade47..9d95fed 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 e94dbdd..fcf22ce 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 6ba5dad..cc0bae0 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 80ed0f9..2f19200 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();
More information about the Scummvm-git-logs
mailing list