ScummVM API documentation
pet_starfield.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_STARFIELD_H
23 #define TITANIC_PET_STARFIELD_H
24 
25 #include "titanic/pet_control/pet_section.h"
26 #include "titanic/gfx/text_control.h"
27 #include "titanic/pet_control/pet_gfx_element.h"
28 
29 namespace Titanic {
30 
31 enum MarkerState { MS_BLANK = 0, MS_FLICKERING = 1, MS_HIGHLIGHTED = 2};
32 
33 class CPetStarfield : public CPetSection {
34 private:
35  CPetGfxElement _imgStarfield;
36  CPetGfxElement _imgPhoto;
37  CPetGfxElement _imgStarCtrl;
38  CPetGfxElement _btnSetDest;
39  MarkerState _markerStates[3];
40  CPetGfxElement _leds[6];
41  Rect _rect1;
42  int _flickerCtr;
43  CTextControl _text;
44  bool _photoOn;
45  bool _hasReference;
46 private:
50  bool setupControl(CPetControl *petControl);
51 
55  void drawButton(MarkerState state, int index, CScreenManager *screenManager);
56 
60  bool markersMouseDown(CMouseButtonDownMsg *msg);
61 
65  bool markerMouseDown(int index, CMouseButtonDownMsg *msg, const Rect &rect);
66 public:
67  CPetStarfield();
68 
72  bool setup(CPetControl *petControl) override;
73 
77  bool reset() override;
78 
82  void draw(CScreenManager *screenManager) override;
83 
88  bool MouseButtonDownMsg(CMouseButtonDownMsg *msg) override;
89  bool MouseButtonUpMsg(CMouseButtonUpMsg *msg) override;
90 
94  bool isValid(CPetControl *petControl) override;
95 
99  void load(SimpleFile *file, int param) override;
100 
104  void postLoad() override;
105 
109  void save(SimpleFile *file, int indent) override;
110 
114  void setButtons(int matchIndex, bool isMarkerClose);
115 
119  void setHasReference(bool hasRef) { _hasReference = hasRef; }
120 
124  void makePetDirty();
125 };
126 
127 } // End of namespace Titanic
128 
129 #endif /* TITANIC_PET_STARFIELD_H */
Definition: text_control.h:35
Definition: pet_section.h:51
Definition: simple_file.h:49
void load(SimpleFile *file, int param) override
bool isValid(CPetControl *petControl) override
void setButtons(int matchIndex, bool isMarkerClose)
void save(SimpleFile *file, int indent) override
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg) override
Definition: screen_manager.h:49
Definition: pet_gfx_element.h:29
Definition: pet_starfield.h:33
Definition: rect.h:35
Definition: arm.h:30
void postLoad() override
Definition: mouse_messages.h:87
bool setup(CPetControl *petControl) override
Definition: mouse_messages.h:71
void setHasReference(bool hasRef)
Definition: pet_starfield.h:119
void draw(CScreenManager *screenManager) override
bool reset() override
Definition: pet_control.h:45