ScummVM API documentation
mainmenu.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
/*
23
* This code is based on the CRAB engine
24
*
25
* Copyright (c) Arvind Raja Yadav
26
*
27
* Licensed under MIT
28
*
29
*/
30
31
#ifndef CRAB_MAINMENU_H
32
#define CRAB_MAINMENU_H
33
34
#include "crab/ui/AlphaImage.h"
35
#include "crab/ui/CreditScreen.h"
36
#include "crab/ui/FileMenu.h"
37
#include "crab/ui/ImageData.h"
38
#include "crab/ui/KeyBindMenu.h"
39
#include "crab/ui/ModMenu.h"
40
#include "crab/ui/OptionMenu.h"
41
#include "crab/ui/SlideShow.h"
42
#include "crab/ui/StateButton.h"
43
#include "crab/input/cursor.h"
44
#include "crab/gamestate_container.h"
45
#include "crab/gamestates.h"
46
#include "crab/ui/menu.h"
47
#include "crab/ui/slider.h"
48
#include "crab/ui/textarea.h"
49
50
namespace
Crab
{
51
52
// #define UNREST_DEMO
53
54
//------------------------------------------------------------------------
55
// Purpose: Main Menu class
56
//------------------------------------------------------------------------
57
class
MainMenu
:
public
GameState
{
58
enum
MenuState {
59
STATE_NORMAL,
60
STATE_OPTIONS,
61
STATE_CREDITS,
62
STATE_LOAD,
63
STATE_DIFF,
64
STATE_SAVENAME,
65
STATE_MOD,
66
STATE_HELP
67
} _state;
68
69
// This image covers the whole screen and is drawn centered on screen
70
pyrodactyl::ui::ImageData
_bg;
71
72
// The lights on the background image
73
Common::Array<pyrodactyl::ui::AlphaImage>
_lights;
74
75
// The game logo
76
pyrodactyl::ui::ImageData
_logo;
77
78
// Data for the difficulty menu
79
struct
{
80
pyrodactyl::ui::ImageData
_bg;
81
pyrodactyl::ui::HoverInfo
_heading;
82
pyrodactyl::ui::ButtonMenu
_menu;
83
} _diff;
84
85
// Main menu
86
pyrodactyl::ui::Menu<pyrodactyl::ui::StateButton>
_meMain;
87
88
// The back button is common and is used for all menus here (except credits and main menu)
89
pyrodactyl::ui::Button
_back;
90
91
// Mod menu
92
pyrodactyl::ui::ModMenu
_mod;
93
94
// Game credits
95
pyrodactyl::ui::CreditScreen
_credits;
96
97
// The save game name prompt for iron man
98
pyrodactyl::ui::TextArea
_save;
99
100
// The background image and position of the prompt, along with the warning message displayed
101
// and buttons for accept and cancel
102
pyrodactyl::ui::ImageData
_bgSave;
103
pyrodactyl::ui::HoverInfo
_warning;
104
pyrodactyl::ui::Button
_accept, _cancel;
105
106
// Music for the main menu
107
struct
MainMenuMusic {
108
pyrodactyl::music::MusicKey _normal, _credits;
109
110
MainMenuMusic() {
111
_normal = -1;
112
_credits = -1;
113
}
114
} _musicKey;
115
116
// UI elements related to the demo
117
pyrodactyl::ui::Button
_steam, _direct;
118
119
public
:
120
MainMenu
();
121
~
MainMenu
() {}
122
123
void
handleEvents(
Common::Event
&event,
bool
&shouldChangeState, GameStateID &newStateId);
124
void
internalEvents(
bool
&shouldChangeState, GameStateID &newStateId);
125
126
void
draw();
127
128
void
changeState(MenuState ms,
const
bool
&start =
false
);
129
void
setUI();
130
131
// We don't need to save game state here
132
void
autoSave() {}
133
};
134
135
}
// End of namespace Crab
136
137
#endif // CRAB_MAINMENU_H
Crab::pyrodactyl::ui::CreditScreen
Definition:
CreditScreen.h:42
Crab::MainMenu
Definition:
mainmenu.h:57
Crab::pyrodactyl::ui::TextArea
Definition:
textarea.h:45
Common::Array
Definition:
array.h:52
Crab::pyrodactyl::ui::ImageData
Definition:
ImageData.h:40
Crab::pyrodactyl::ui::Menu< Button >
Crab::GameState
Definition:
gamestate_container.h:46
Crab::pyrodactyl::ui::ModMenu
Definition:
ModMenu.h:40
Common::Event
Definition:
events.h:199
Crab
Definition:
moveeffect.h:37
Crab::pyrodactyl::ui::Button
Definition:
button.h:86
Crab::pyrodactyl::ui::HoverInfo
Definition:
HoverInfo.h:41
engines
crab
mainmenu.h
Generated on Sun Dec 22 2024 09:09:39 for ScummVM API documentation by
1.8.13