ScummVM API documentation
pet_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 TITANIC_PET_INVENTORY_H
23 #define TITANIC_PET_INVENTORY_H
24 
25 #include "titanic/support/simple_file.h"
26 #include "titanic/pet_control/pet_section.h"
27 #include "titanic/pet_control/pet_inventory_glyphs.h"
28 #include "titanic/gfx/text_control.h"
29 
30 namespace Titanic {
31 
35 class CPetInventory : public CPetSection {
36 private:
37  CTextControl _text;
38  CPetInventoryGlyphs _items;
39  CGameObject *_itemBackgrounds[46];
40  CGameObject *_movie;
41  bool _isLoading;
42  int _titaniaBitFlags;
43 private:
47  bool setPetControl(CPetControl *petControl);
48 
52  int getItemIndex(CGameObject *item) const;
53 
57  void removeInvalid();
58 public:
59  CPetInventory();
60 
64  bool setup(CPetControl *petControl) override;
65 
69  bool reset() override;
70 
74  void draw(CScreenManager *screenManager) override;
75 
79  Rect getBounds() const override;
80 
84  void changed(int changeType) override;
85 
89  void enterRoom(CRoomItem *room) override;
90 
95  bool MouseButtonDownMsg(CMouseButtonDownMsg *msg) override;
96  bool MouseDragStartMsg(CMouseDragStartMsg *msg) override;
97  bool MouseButtonUpMsg(CMouseButtonUpMsg *msg) override;
98  bool MouseDoubleClickMsg(CMouseDoubleClickMsg *msg) override;
99  bool VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) override;
100  bool MouseWheelMsg(CMouseWheelMsg *msg) override;
101 
105  CGameObject *dragEnd(const Point &pt) const override;
106 
110  bool isValid(CPetControl *petControl) override;
111 
115  void load(SimpleFile *file, int param) override;
116 
120  void postLoad() override;
121 
125  void save(SimpleFile *file, int indent) override;
126 
130  void enter(PetArea oldArea) override;
131 
135  void leave() override;
136 
140  CTextControl *getText() override { return &_text; }
141 
145  CGameObject *getBackground(int index) const override;
146 
150  void change(CGameObject *item);
151 
155  void itemRemoved(CGameObject *item);
156 
160  void itemsChanged();
161 
165  void highlightItem(CGameObject *item);
166 
172 
176  void playMovie(CGameObject *movie, bool repeat = true);
177 };
178 
179 } // End of namespace Titanic
180 
181 #endif /* TITANIC_PET_INVENTORY_H */
Definition: mouse_messages.h:150
Rect getBounds() const override
Definition: text_control.h:35
void changed(int changeType) override
bool reset() override
void save(SimpleFile *file, int indent) override
CGameObject * dragEnd(const Point &pt) const override
Definition: mouse_messages.h:117
Definition: pet_section.h:51
void itemRemoved(CGameObject *item)
Definition: pet_inventory.h:35
void postLoad() override
CGameObject * getTransformAnimation(int index)
Definition: simple_file.h:49
void load(SimpleFile *file, int param) override
Definition: room_item.h:33
Definition: screen_manager.h:49
void highlightItem(CGameObject *item)
Definition: game_object.h:79
Definition: messages.h:408
void draw(CScreenManager *screenManager) override
void enter(PetArea oldArea) override
Definition: rect.h:35
Definition: mouse_messages.h:103
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg) override
CTextControl * getText() override
Definition: pet_inventory.h:140
Definition: rect.h:45
Definition: arm.h:30
bool setup(CPetControl *petControl) override
Definition: mouse_messages.h:87
Definition: mouse_messages.h:71
void enterRoom(CRoomItem *room) override
bool isValid(CPetControl *petControl) override
void playMovie(CGameObject *movie, bool repeat=true)
CGameObject * getBackground(int index) const override
Definition: pet_inventory_glyphs.h:145
Definition: pet_control.h:45
void leave() override