ScummVM API documentation
pet_load_save.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_LOAD_SAVE_H
23 #define TITANIC_PET_LOAD_SAVE_H
24 
25 #include "titanic/pet_control/pet_glyphs.h"
26 #include "titanic/gfx/text_control.h"
27 
28 namespace Titanic {
29 
30 #define SAVEGAME_SLOTS_COUNT 5
31 
32 class CPetLoadSave : public CPetGlyph {
33 private:
37  Rect getSlotBounds(int index);
38 
42  void highlightChange();
43 
47  bool checkSlotsHighlight(const Point &pt);
48 
52  bool isSlotHighlighted(int index, const Point &pt);
53 protected:
54  CTextControl _slotNames[SAVEGAME_SLOTS_COUNT];
55  bool _slotInUse[SAVEGAME_SLOTS_COUNT];
56  CPetGfxElement _btnLoadSave;
57  CPetGfxElement _gutter;
58  static int _savegameSlotNum;
59 protected:
63  void resetSlots();
64 
68  void highlightSlot(int index);
69 public:
73  bool setup(CPetControl *petControl, CPetGlyphs *owner) override;
74 
78  bool reset() override;
79 
83  void draw2(CScreenManager *screenManager) override;
84 
88  bool MouseButtonDownMsg(const Point &pt) override;
89 
93  bool KeyCharMsg(int key) override;
94 
98  virtual void resetSaves() { resetSlots(); }
99 
103  virtual void highlightSave(int index) = 0;
104 
108  virtual void unhighlightSave(int index) = 0;
109 
113  virtual void execute() = 0;
114 };
115 
116 } // End of namespace Titanic
117 
118 #endif
virtual void unhighlightSave(int index)=0
void draw2(CScreenManager *screenManager) override
Definition: pet_load_save.h:32
Definition: text_control.h:35
bool setup(CPetControl *petControl, CPetGlyphs *owner) override
virtual void highlightSave(int index)=0
virtual void resetSaves()
Definition: pet_load_save.h:98
void highlightSlot(int index)
Definition: screen_manager.h:49
Definition: pet_gfx_element.h:29
bool reset() override
bool MouseButtonDownMsg(const Point &pt) override
Definition: pet_glyphs.h:53
bool KeyCharMsg(int key) override
Definition: rect.h:35
Definition: rect.h:45
Definition: arm.h:30
Definition: pet_glyphs.h:244
virtual void execute()=0
Definition: pet_control.h:45