Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F631480
TitleMenu.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
3 KB
Referenced Files
None
Subscribers
None
TitleMenu.h
View Options
/****************************************************************************
** Copyright (C) 2011 Luka Horvat <redreaper132 at gmail.com>
** Copyright (C) 2011 Edward Lii <edward_iii at myway.com>
** Copyright (C) 2011 O. Bahri Gordebak <gordebak at gmail.com>
**
**
** This file may be used under the terms of the GNU General Public
** License version 3.0 as published by the Free Software Foundation
** and appearing in the file LICENSE.GPL included in the packaging of
** this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**
****************************************************************************/
#ifndef TITLE_MENU_H
#define TITLE_MENU_H
#include
<SDL/SDL.h>
#include
"GameState.h"
//Included for the Options menu.
#include
"GUIObject.h"
#include
"GUIListBox.h"
#include
"GUISlider.h"
//The Main menu.
class
Menu
:
public
GameState
{
private
:
//The title of the main menu.
SDL_Surface
*
title
;
//Array containg pointers to the five main menu entries.
//The last two are the '>' and '<' characters.
SDL_Surface
*
entries
[
7
];
//Integer used for animations.
int
animation
;
public
:
//Constructor.
Menu
();
//Destructor.
~
Menu
();
//Inherited from GameState.
void
handleEvents
();
void
logic
();
void
render
();
void
resize
();
};
//The Options menu.
class
Options
:
public
GameState
,
private
GUIEventCallback
{
private
:
//The title of the options menu.
SDL_Surface
*
title
;
//Slider used to set the music volume
GUISlider
*
musicSlider
;
//Slider used to set the sound volume
GUISlider
*
soundSlider
;
//The jump sound used as reference to configure sound volume.
Mix_Chunk
*
jumpSound
;
//Integer to keep track of the time passed since last playing the test sound.
int
lastJumpSound
;
//ListBox containing the themes the user can choose out.
GUISingleLineListBox
*
theme
;
//Map containing the locations the themes are stored.
//The key is the name of the theme and the value the path.
std
::
map
<
std
::
string
,
std
::
string
>
themeLocations
;
//Available languages
GUISingleLineListBox
*
langs
;
std
::
vector
<
std
::
string
>
langValues
;
//Resolution list
GUISingleLineListBox
*
resolutions
;
//GUI events are handled here.
//name: The name of the element that invoked the event.
//obj: Pointer to the object that invoked the event.
//eventType: Integer containing the type of event.
void
GUIEventCallback_OnEvent
(
std
::
string
name
,
GUIObject
*
obj
,
int
eventType
);
public
:
//Constructor.
Options
();
//Destructor.
~
Options
();
//Method that will create the GUI for the options menu.
void
createGUI
();
//Inherited from GameState.
void
handleEvents
();
void
logic
();
void
render
();
void
resize
();
};
//A very simple structure for resolutions
struct
_res
{
int
w
,
h
;
};
#endif
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Sun, Nov 15, 12:04 PM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
142229
Default Alt Text
TitleMenu.h (3 KB)
Attached To
Mode
R79 meandmyshadow
Attached
Detach File
Event Timeline