ScummVM API documentation
title.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 ULTIMA2_VIEWS_TITLE_H
23#define ULTIMA2_VIEWS_TITLE_H
24
25#include "graphics/managed_surface.h"
26#include "graphics/palette.h"
27#include "ultima/shared/engine/view.h"
28#include "ultima/ultima2/gfx/text_cursor.h"
29
30namespace Ultima {
31namespace Ultima2 {
32namespace Views {
33
34using namespace Graphics::Views;
35
45class Title : public Shared::View {
46private:
47 enum State {
48 TEXT1, TEXT2, PICDRA, MENU,
49 DEMO_OUT, DEMO_TWN, DEMO_CAS, DEMO_DNG, DEMO_SPA, DEMO_MIN
50 };
51 State _state = TEXT1;
52 bool _demoMode = false;
53
54 // The single picture currently on screen, if any (loaded lazily per state)
56
57 // Blinking cursor shown after "CHOICE:" while the menu is active
58 Gfx::TextCursor _cursor;
59
60 void loadPic(const Common::String &filename);
61 void showMenu();
62 void showState(State state);
63
64public:
65 Title();
66 ~Title() override {}
67
68 bool msgFocus(const FocusMessage &msg) override;
69 bool msgUnfocus(const UnfocusMessage &msg) override;
70 void draw() override;
71 void timeout() override;
72
73 bool msgKeypress(const KeypressMessage &msg) override;
74 bool msgAction(const ActionMessage &msg) override;
75};
76
77} // namespace Views
78} // namespace Ultima2
79} // namespace Ultima
80
81#endif
Definition: str.h:59
Definition: managed_surface.h:51
Definition: view.h:35
Definition: text_cursor.h:36
Definition: title.h:45
Definition: messages.h:118
Definition: messages.h:42
Definition: messages.h:54
Definition: messages.h:50