aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2015-07-19 19:23:16 -0400
committerPaul Gilbert2015-07-19 19:23:16 -0400
commitb0c1e6efaa09b855d18ee81edc2a79243b5b91b2 (patch)
tree9f0adc2accafce518b8c81de74edf6346df1d49c
parent48f5ef847fed6ef97a92c059f8f93bd453051144 (diff)
downloadscummvm-rg350-b0c1e6efaa09b855d18ee81edc2a79243b5b91b2.tar.gz
scummvm-rg350-b0c1e6efaa09b855d18ee81edc2a79243b5b91b2.tar.bz2
scummvm-rg350-b0c1e6efaa09b855d18ee81edc2a79243b5b91b2.zip
SHERLOCK: RT: Implement using items on scene objects
-rw-r--r--engines/sherlock/tattoo/tattoo_user_interface.cpp1
-rw-r--r--engines/sherlock/tattoo/widget_inventory.cpp20
2 files changed, 11 insertions, 10 deletions
diff --git a/engines/sherlock/tattoo/tattoo_user_interface.cpp b/engines/sherlock/tattoo/tattoo_user_interface.cpp
index bffdb550cf..597208078b 100644
--- a/engines/sherlock/tattoo/tattoo_user_interface.cpp
+++ b/engines/sherlock/tattoo/tattoo_user_interface.cpp
@@ -583,6 +583,7 @@ void TattooUserInterface::putMessage(const char *formatStr, ...) {
va_end(args);
// Open the message widget
+ _menuMode = MESSAGE_MODE;
_messageWidget.load(str, 25);
_messageWidget.summonWindow();
}
diff --git a/engines/sherlock/tattoo/widget_inventory.cpp b/engines/sherlock/tattoo/widget_inventory.cpp
index 9afe841fa9..170fb02481 100644
--- a/engines/sherlock/tattoo/widget_inventory.cpp
+++ b/engines/sherlock/tattoo/widget_inventory.cpp
@@ -430,10 +430,10 @@ void WidgetInventoryVerbs::handleEvents() {
ImageFrame &imgFrame = (*inv._invShapes[_owner->_invSelect - inv._invIndex])[0];
events.setCursor(ARROW, imgFrame._frame);
- // Close the inventory dialog as well, then add the tooltip directly to the UI
- // so that it will receive events even though the inventory dialog is now closed
- _owner->close();
- _owner->_tooltipWidget.summonWindow();
+ // Close the inventory dialog without banishing it, so it can keep getting events
+ // to handle tooltips and actually making the selection of what object to use them item on
+ inv.freeInv();
+ _owner->_surface.free();
}
}
}
@@ -607,10 +607,7 @@ void WidgetInventory::handleEvents() {
if (_invVerbMode == 3) {
// Selecting object after inventory verb has been selected
_tooltipWidget.banishWindow();
- inv.freeInv();
-
- ui._menuMode = scene._labTableScene ? LAB_MODE : STD_MODE;
- events.clearEvents();
+ close();
if (ui._keyState.keycode != Common::KEYCODE_ESCAPE) {
// If user pointed at an item, use the selected inventory item with this item
@@ -641,8 +638,6 @@ void WidgetInventory::handleEvents() {
} else if ((_outsideMenu && !_bounds.contains(mousePos)) || ui._keyState.keycode == Common::KEYCODE_ESCAPE) {
// Want to close the window (clicked outside of it). So close the window and return to Standard
close();
- events.setCursor(ARROW);
- ui._menuMode = scene._labTableScene ? LAB_MODE : STD_MODE;
} else if (_bounds.contains(mousePos)) {
// Mouse button was released inside the inventory window
@@ -751,10 +746,15 @@ void WidgetInventory::erase() {
void WidgetInventory::close() {
Events &events = *_vm->_events;
Inventory &inv = *_vm->_inventory;
+ TattooScene &scene = *(TattooScene *)_vm->_scene;
+ TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui;
banishWindow();
inv.freeInv();
events.clearEvents();
+
+ events.setCursor(ARROW);
+ ui._menuMode = scene._labTableScene ? LAB_MODE : STD_MODE;
}
} // End of namespace Tattoo