[Scummvm-cvs-logs] scummvm master -> b0c1e6efaa09b855d18ee81edc2a79243b5b91b2

dreammaster dreammaster at scummvm.org
Mon Jul 20 01:24:20 CEST 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
b0c1e6efaa SHERLOCK: RT: Implement using items on scene objects


Commit: b0c1e6efaa09b855d18ee81edc2a79243b5b91b2
    https://github.com/scummvm/scummvm/commit/b0c1e6efaa09b855d18ee81edc2a79243b5b91b2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-07-19T19:23:16-04:00

Commit Message:
SHERLOCK: RT: Implement using items on scene objects

Changed paths:
    engines/sherlock/tattoo/tattoo_user_interface.cpp
    engines/sherlock/tattoo/widget_inventory.cpp



diff --git a/engines/sherlock/tattoo/tattoo_user_interface.cpp b/engines/sherlock/tattoo/tattoo_user_interface.cpp
index bffdb55..5972080 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 9afe841..170fb02 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






More information about the Scummvm-git-logs mailing list