ScummVM API documentation
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 DGDS_INVENTORY_H
23 #define DGDS_INVENTORY_H
24 
25 #include "common/serializer.h"
26 #include "common/error.h"
27 #include "dgds/request.h"
28 
29 namespace Graphics {
30 class ManagedSurface;
31 }
32 
33 namespace Dgds {
34 
35 class GameItem;
36 
37 class Inventory {
38 public:
39  Inventory();
40 
41  bool isOpen() const { return _isOpen; }
42  void open();
43  void close();
44  void draw(Graphics::ManagedSurface &surf, int itemCount);
45  void drawItems(Graphics::ManagedSurface &surf);
46  void drawTime(Graphics::ManagedSurface &surf);
47  void drawHeader(Graphics::ManagedSurface &surf);
48 
49  void mouseMoved(const Common::Point &pt);
50  void mouseLDown(const Common::Point &pt);
51  void mouseLUp(const Common::Point &pt);
52  void mouseRUp(const Common::Point &pt);
53 
54  void setRequestData(const REQFileData &data);
55  void setShowZoomBox(bool val) { _showZoomBox = val; }
56  bool isZoomVisible() const { return _showZoomBox; }
57 
58  Common::Error syncState(Common::Serializer &s);
59 
60  static const byte HOC_CHARACTER_QUALS[];
61 private:
62  GameItem *itemUnderMouse(const Common::Point &pt);
63  bool isItemInInventory(GameItem &item);
64 
65  uint16 _openedFromSceneNum;
66 
67  bool _showZoomBox;
68  bool _isOpen;
69  ButtonGadget *_prevPageBtn;
70  ButtonGadget *_nextPageBtn;
71  TextAreaGadget *_invClock;
72  Gadget *_itemZoomBox;
73  Gadget *_itemBox;
74  ButtonGadget *_exitButton;
75  ButtonGadget *_clockSkipMinBtn;
76  ButtonGadget *_clockSkipHrBtn;
77  ButtonGadget *_dropBtn;
78  ImageGadget *_itemArea;
79  ButtonGadget *_giveToBtn;
80  ButtonGadget *_changeCharBtn;
81 
82  REQFileData _reqData;
83  int _highlightItemNo; // -1 means no item highlighted.
84  int _itemOffset; // for scrolling through the item list
85  int _fullWidth; // width of the box including zoom
86 };
87 
88 } // end namespace Dgds
89 
90 #endif // DGDS_INVENTORY_H
Definition: managed_surface.h:51
Definition: error.h:84
Definition: inventory.h:37
Definition: ads.h:28
Definition: request.h:63
Definition: request.h:124
Definition: serializer.h:79
Definition: request.h:179
Definition: request.h:112
Definition: formatinfo.h:28
Definition: rect.h:45
Definition: request.h:219
Definition: scene.h:182