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#include "common/events.h"
29
30namespace Titanic {
31
32#define SAVEGAME_SLOTS_COUNT 5
33
34class CPetLoadSave : public CPetGlyph {
35private:
39 Rect getSlotBounds(int index);
40
44 void highlightChange();
45
49 bool checkSlotsHighlight(const Point &pt);
50
54 bool isSlotHighlighted(int index, const Point &pt);
55protected:
56 CTextControl _slotNames[SAVEGAME_SLOTS_COUNT];
57 bool _slotInUse[SAVEGAME_SLOTS_COUNT];
58 CPetGfxElement _btnLoadSave;
59 CPetGfxElement _gutter;
60 static int _savegameSlotNum;
61protected:
65 void resetSlots();
66
70 void highlightSlot(int index);
71public:
75 bool setup(CPetControl *petControl, CPetGlyphs *owner) override;
76
80 bool reset() override;
81
85 void draw2(CScreenManager *screenManager) override;
86
90 bool MouseButtonDownMsg(const Point &pt) override;
91
95 bool ActionMsg(CActionMsg *msg) override;
96
100 virtual void resetSaves() { resetSlots(); }
101
105 virtual void highlightSave(int index) = 0;
106
110 virtual void unhighlightSave(int index) = 0;
111
115 virtual void execute() = 0;
116};
117
118} // End of namespace Titanic
119
120#endif
Definition: messages.h:410
Definition: pet_control.h:45
Definition: pet_gfx_element.h:29
Definition: pet_glyphs.h:53
Definition: pet_glyphs.h:244
Definition: pet_load_save.h:34
void draw2(CScreenManager *screenManager) override
bool reset() override
void highlightSlot(int index)
virtual void unhighlightSave(int index)=0
virtual void execute()=0
bool setup(CPetControl *petControl, CPetGlyphs *owner) override
virtual void highlightSave(int index)=0
virtual void resetSaves()
Definition: pet_load_save.h:100
bool ActionMsg(CActionMsg *msg) override
bool MouseButtonDownMsg(const Point &pt) override
Definition: screen_manager.h:49
Definition: text_control.h:35
Definition: rect.h:35
Definition: rect.h:144