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
71 
72  // The lights on the background image
74 
75  // The game logo
77 
78  // Data for the difficulty menu
79  struct {
83  } _diff;
84 
85  // Main menu
87 
88  // The back button is common and is used for all menus here (except credits and main menu)
90 
91  // Mod menu
93 
94  // Game credits
96 
97  // The save game name prompt for iron man
99 
100  // The background image and position of the prompt, along with the warning message displayed
101  // and buttons for accept and cancel
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
Definition: CreditScreen.h:42
Definition: mainmenu.h:57
Definition: textarea.h:45
Definition: array.h:52
Definition: ImageData.h:40
Definition: gamestate_container.h:46
Definition: ModMenu.h:40
Definition: events.h:199
Definition: moveeffect.h:37
Definition: button.h:86
Definition: HoverInfo.h:41