ScummVM API documentation
widget_inventory.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef SHERLOCK_TATTOO_WIDGET_INVENTORY_H
23 #define SHERLOCK_TATTOO_WIDGET_INVENTORY_H
24 
25 #include "common/scummsys.h"
26 #include "sherlock/tattoo/widget_base.h"
27 #include "sherlock/tattoo/widget_tooltip.h"
28 
29 namespace Sherlock {
30 
31 class SherlockEngine;
32 
33 namespace Tattoo {
34 
35 #define NUM_INVENTORY_SHOWN 8 // Number of Inventory Items Shown
36 
37 class WidgetInventory;
38 
40 private:
41  WidgetInventory *_owner;
42 protected:
46  void drawBackground() override {}
47 public:
49  ~WidgetInventoryTooltip() override {}
50 
54  void setText(const Common::String &str);
55 
59  void handleEvents() override;
60 };
61 
63 private:
64  WidgetInventory *_owner;
65  Common::StringArray _inventCommands;
66 
67  void highlightControls();
68 public:
69  int _invVerbSelect, _oldInvVerbSelect;
70 public:
72  ~WidgetInventoryVerbs() override {}
73 
74  void load();
75 
79  void handleEvents() override;
80 };
81 
82 class WidgetInventory: public WidgetBase {
83  friend class WidgetInventoryTooltip;
84  friend class WidgetInventoryVerbs;
85 private:
86  int _invVerbMode;
87  int _selector, _oldSelector;
88  int _invSelect, _oldInvSelect;
89  WidgetInventoryTooltip _tooltipWidget;
90  WidgetInventoryVerbs _verbList;
91  bool _swapItems;
92  Surface _menuSurface;
93  Common::String _invTarget;
94 
98  void drawBars();
99 
103  void checkInvTabbingKeys();
104 
108  void highlightControls();
109 public:
110  int _invMode;
111  Common::String _action;
112  Common::String _verb;
113 public:
115  ~WidgetInventory() override {}
116 
120  void load(int mode);
121 
125  void drawInventory();
126 
130  void close();
131 
135  void handleEvents() override;
136 
140  void banishWindow() override;
141 
145  void erase() override;
146 
150  void draw() override;
151 };
152 
153 } // End of namespace Tattoo
154 
155 } // End of namespace Sherlock
156 
157 #endif
Definition: surface.h:118
Definition: str.h:59
Definition: animation.h:29
Definition: widget_inventory.h:82
void setText(const Common::String &str)
void drawBackground() override
Definition: widget_inventory.h:46
Definition: sherlock.h:76
Definition: widget_tooltip.h:35
Definition: widget_inventory.h:39
Definition: widget_inventory.h:62
Definition: widget_base.h:37