ScummVM API documentation
inventorypicture.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  * Additional copyright for this file:
8  * Copyright (C) 1995-1997 Presto Studios, Inc.
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  *
23  */
24 
25 #ifndef PEGASUS_ITEMS_INVENTORYPICTURE_H
26 #define PEGASUS_ITEMS_INVENTORYPICTURE_H
27 
28 #include "pegasus/input.h"
29 #include "pegasus/movie.h"
30 #include "pegasus/surface.h"
31 
32 namespace Pegasus {
33 
34 class Inventory;
35 class Item;
36 class Input;
37 class Transition;
38 
39 class InventoryPicture : public InputHandler, public Picture {
40 public:
41  InventoryPicture(const DisplayElementID, InputHandler *, Inventory *);
42  ~InventoryPicture() override {}
43 
44  void initInventoryImage(Transition *);
45  void throwAwayInventoryImage();
46 
47  void panelUp();
48  void activateInventoryPicture();
49  void deactivateInventoryPicture();
50  void handleInput(const Input &, const Hotspot *) override;
51  bool wantsCursor() override { return false; }
52 
53  InventoryResult addInventoryItem(Item *);
54  InventoryResult removeInventoryItem(Item *);
55  void removeAllItems();
56  Item *getCurrentItem() { return _currentItem; }
57  void setCurrentItemIndex(int32);
58  void setCurrentItemID(ItemID);
59  int32 getCurrentItemIndex() { return _currentItemIndex; }
60  bool itemInInventory(Item *);
61  bool itemInInventory(const ItemID);
62 
63 protected:
64  void getItemXY(uint32, CoordType &, CoordType &);
65  void draw(const Common::Rect &) override;
66  void drawItemHighlight(const Common::Rect &);
67  virtual void highlightCurrentItem();
68  virtual void unhighlightCurrentItem() {}
69  virtual TimeValue getItemPanelTime(Item *) = 0;
70 
71  Inventory *_inventory;
72  uint32 _lastReferenceCount;
73  Frame _highlightImage;
74  Movie _panelMovie;
75  int32 _currentItemIndex;
76  Item *_currentItem;
77  Common::Rect _highlightBounds;
78  bool _active, _shouldDrawHighlight;
79 
80  Common::Path _pictName;
81  Common::Path _movieName;
82  Common::Path _highlightName;
83  uint16 _itemsPerRow;
84  uint16 _numberOfRows;
85  uint16 _itemWidth;
86  uint16 _itemHeight;
87  uint16 _itemX;
88  uint16 _itemY;
89 };
90 
92 public:
93  InventoryItemsPicture(const DisplayElementID, InputHandler *, Inventory *);
94  ~InventoryItemsPicture() override {}
95 
96  void deactivateInventoryPicture();
97 
98  void disableLooping() { _isLooping = false; }
99 
100  void setCommPicture();
101  void playEndMessage(DisplayElement *);
102 
103 protected:
104  void highlightCurrentItem() override;
105  void unhighlightCurrentItem() override;
106  TimeValue getItemPanelTime(Item *) override;
107  void loopCurrentItem();
108 
109  bool _isLooping;
110 };
111 
113 public:
114  BiochipPicture(const DisplayElementID, InputHandler *, Inventory *);
115  ~BiochipPicture() override {}
116 
117 protected:
118  void unhighlightCurrentItem() override;
119  TimeValue getItemPanelTime(Item *) override;
120 };
121 
122 } // End of namespace Pegasus
123 
124 #endif
Definition: transition.h:60
Definition: movie.h:40
Definition: rect.h:144
Definition: path.h:52
Definition: hotspot.h:85
Definition: item.h:294
Definition: input.h:322
Definition: surface.h:105
Definition: inventory.h:41
Definition: elements.h:43
Definition: inventorypicture.h:39
Definition: inventorypicture.h:112
Definition: inventorypicture.h:91
Definition: input.h:410
Definition: ai_action.h:33
Definition: surface.h:125