ScummVM API documentation
pet_inventory_glyphs.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 TITANIC_PET_INVENTORY_GLYPHS_H
23 #define TITANIC_PET_INVENTORY_GLYPHS_H
24 
25 #include "titanic/carry/carry.h"
26 #include "titanic/pet_control/pet_glyphs.h"
27 #include "titanic/support/screen_manager.h"
28 
29 namespace Titanic {
30 
31 class CPetInventoryGlyph : public CPetGlyph {
32 private:
36  int populateItem(CGameObject *item, bool isLoading);
37 
43  int getItemIndex(CGameObject *item, bool isLoading);
44 
48  void startRepeatedMovie();
49 
54  void startSingularMovie();
55 
59  void stopMovie();
60 
64  void reposition(const Point &pt);
65 public:
66  CGameObject *_item;
67  bool _active;
68  CGameObject *_repeated;
69  CGameObject *_singular;
70 public:
71  CPetInventoryGlyph() : _item(nullptr), _active(true),
72  _repeated(nullptr), _singular(nullptr) {}
73  CPetInventoryGlyph(CCarry *item, bool active) : _item(item),
74  _active(active), _repeated(nullptr), _singular(nullptr) {}
75 
79  void enter() override;
80 
84  void leave() override;
85 
89  void drawAt(CScreenManager *screenManager, const Point &pt, bool isHighlighted) override;
90 
94  void unhighlightCurrent() override;
95 
99  void highlightCurrent(const Point &pt) override;
100 
104  void glyphFocused(const Point &topLeft, bool flag) override;
105 
109  bool dragGlyph(const Point &topLeft, CMouseDragStartMsg *msg) override;
110 
114  void getTooltip(CTextControl *text) override;
115 
119  bool isValid() const override { return _item && _repeated; }
120 
124  CGameObject *getObjectAt() override { return _item; }
125 
129  bool doAction(CGlyphAction *action) override;
130 
134  void setItem(CGameObject *item, bool isLoading);
135 };
136 
138 public:
139  CGameObject *_item;
140 public:
141  CInventoryGlyphAction(CGameObject *item, GlyphActionMode mode) :
142  CGlyphAction(mode), _item(item) {}
143 };
144 
146  friend class CPetInventoryGlyph;
147 private:
148  CGameObject *getBackground(int index);
149 public:
153  bool doAction(CInventoryGlyphAction *item);
154 };
155 
156 } // End of namespace Titanic
157 
158 #endif /* TITANIC_PET_INVENTORY_GLYPHS_H */
Definition: mouse_messages.h:150
Definition: pet_inventory_glyphs.h:31
Definition: text_control.h:35
Definition: pet_inventory_glyphs.h:137
void setItem(CGameObject *item, bool isLoading)
bool dragGlyph(const Point &topLeft, CMouseDragStartMsg *msg) override
void drawAt(CScreenManager *screenManager, const Point &pt, bool isHighlighted) override
Definition: carry.h:31
void getTooltip(CTextControl *text) override
bool isHighlighted() const
void highlightCurrent(const Point &pt) override
void glyphFocused(const Point &topLeft, bool flag) override
Definition: screen_manager.h:49
Definition: game_object.h:79
Definition: pet_glyphs.h:53
Definition: rect.h:45
Definition: arm.h:30
Definition: pet_glyphs.h:244
void unhighlightCurrent() override
bool isValid() const override
Definition: pet_inventory_glyphs.h:119
CGameObject * getObjectAt() override
Definition: pet_inventory_glyphs.h:124
bool doAction(CGlyphAction *action) override
Definition: pet_inventory_glyphs.h:145
Definition: pet_glyphs.h:43