[Scummvm-cvs-logs] scummvm master -> 39930a25c3359955346c487ed59374b193273b38

dreammaster dreammaster at scummvm.org
Tue Jul 21 01:57:04 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:
39930a25c3 SHERLOCK: RT: Implement WidgetLab displayLabNames


Commit: 39930a25c3359955346c487ed59374b193273b38
    https://github.com/scummvm/scummvm/commit/39930a25c3359955346c487ed59374b193273b38
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-07-20T19:56:01-04:00

Commit Message:
SHERLOCK: RT: Implement WidgetLab displayLabNames

Changed paths:
    engines/sherlock/tattoo/widget_lab.cpp
    engines/sherlock/tattoo/widget_lab.h



diff --git a/engines/sherlock/tattoo/widget_lab.cpp b/engines/sherlock/tattoo/widget_lab.cpp
index dfa470f..99f0e87 100644
--- a/engines/sherlock/tattoo/widget_lab.cpp
+++ b/engines/sherlock/tattoo/widget_lab.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "sherlock/tattoo/widget_lab.h"
+#include "sherlock/tattoo/tattoo_fixed_text.h"
 #include "sherlock/tattoo/tattoo_user_interface.h"
 #include "sherlock/tattoo/tattoo.h"
 
@@ -157,7 +158,27 @@ void WidgetLab::handleEvents() {
 }
 
 void WidgetLab::displayLabNames() {
+	TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui;
+
+	// See if thay are pointing at a different object and we need to change the tooltip
+	if (ui._bgFound != ui._oldBgFound) {
+		// See if there is a new object to be displayed
+		if (ui._bgFound == -1) {
+			ui._tooltipWidget.setText("");
+		} else {
+			Common::String str = Common::String::format("%s %s %s %s", FIXED(Use), _labObject->_description.c_str(),
+				FIXED(With), ui._bgShape->_description);
+
+			// Make sure that the Object has a name
+			if (!ui._bgShape->_description.empty() && !ui._bgShape->_description.hasPrefix(" ")) {
+				ui._tooltipWidget.setText(str);
+			} else {
+				ui._tooltipWidget.setText("");
+			}
+		}
+	}
 
+	ui._oldArrowZone = ui._arrowZone;
 }
 
 } // End of namespace Tattoo
diff --git a/engines/sherlock/tattoo/widget_lab.h b/engines/sherlock/tattoo/widget_lab.h
index df2ff34..80ed0f9 100644
--- a/engines/sherlock/tattoo/widget_lab.h
+++ b/engines/sherlock/tattoo/widget_lab.h
@@ -38,7 +38,8 @@ private:
 	Object *_labObject;
 
 	/**
-	 * Display tooltips of using one lab item on another
+	 * Display tooltips of an object being dragged along with any object the dragged
+	 * object is currently over
 	 */
 	void displayLabNames();
 public:






More information about the Scummvm-git-logs mailing list