From 753a810070b6b96d1a90cff399a41f21c31de885 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 29 Jun 2015 07:51:25 -0400 Subject: SHERLOCK: RT: Beginnings of inventory window tooltip class --- engines/sherlock/tattoo/widget_inventory.h | 34 ++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) (limited to 'engines/sherlock/tattoo/widget_inventory.h') diff --git a/engines/sherlock/tattoo/widget_inventory.h b/engines/sherlock/tattoo/widget_inventory.h index 41930779bc..41ba142c53 100644 --- a/engines/sherlock/tattoo/widget_inventory.h +++ b/engines/sherlock/tattoo/widget_inventory.h @@ -35,7 +35,34 @@ namespace Tattoo { #define NUM_INVENTORY_SHOWN 8 // Number of Inventory Items Shown +class WidgetInventory; + +class WidgetInventoryTooltip: public WidgetBase { +private: + WidgetInventory *_owner; + Common::Rect _oldInvGraphicBounds, _invGraphicBounds; +protected: + /** + * Overriden from base class, since tooltips have a completely transparent background + */ + virtual void drawBackground() {} +public: + WidgetInventoryTooltip(SherlockEngine *vm, WidgetInventory *owner); + virtual ~WidgetInventoryTooltip() {} + + /** + * Set the text for the tooltip + */ + void setText(const Common::String &str); + + /** + * Handle updating the tooltip state + */ + virtual void handleEvents(); +}; + class WidgetInventory: public WidgetBase { + friend class WidgetInventoryTooltip; private: int _invVerbMode; int _invSelect, _oldInvSelect; @@ -44,7 +71,7 @@ private: int _dialogTimer; int _scrollHighlight; Common::StringArray _inventCommands; - WidgetTooltip _tooltipWidget; + WidgetInventoryTooltip _tooltipWidget; Common::String _invVerb; Common::String _invTarget; Common::String _action; @@ -59,11 +86,6 @@ private: */ void drawScrollBar(); - /** - * Displays the description of any inventory item the moues cursor is over - */ - void updateDescription(); - /** * Check for keys to mouse the mouse within the inventory dialog */ -- cgit v1.2.3