Qubet  1.0
The ultimate QGL addicting videogame!
 All Classes Functions Variables Pages
Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
Menu Class Reference

Menu class used to show and manage the game menu. More...

#include <menu.h>

Inheritance diagram for Menu:
Inheritance graph
Collaboration diagram for Menu:
Collaboration graph

Signals

void playStory (GLint skinId)
 Signal emitted to show the gameView in story mode. More...
 
void playArcade (GLint skinId, GLint levelId)
 Signal emitted to show the gameView in arcade mode. More...
 
void showLevelEditor (GLint levelId)
 Signal emitted to show the levelEditor.
 
void setMouseMovementTracking (int mode)
 This signal is emitted to set the Qubet's Mouse Move Tracking sensibility. The modes are: 0 - no signal emitted. 1 - the signal mouseMoved is emitted only when the mouse is moved and one of the mouse buttons are clicked. 2 - the signal mouseMoved is emitted always when the mouse is moved. More...
 
void enableAudio (bool enabled)
 Signal emitted to enable or disable the audio. More...
 
void playAmbientMusic (QString filename)
 Signal emitted to play the ambient music. More...
 
void stopAmbientMusic ()
 Signal emitted to stop the current ambient music.
 
void playEffect (QString effectName)
 Signal emitted to play an effect. More...
 
void setSkybox (QString skyboxName)
 Signal emitted to set the Skybox. More...
 

Public Member Functions

 Menu (QMap< GLint, Skin * > &_skinsList, QMap< GLint, Level * > &_levelsList, QMap< GLint, GLuint > &_iconsList, Alphabet *_alphabet, QObject *_parent, bool _audioEnabled=true, bool showIntro=true)
 Create a Menu object used to show and manage the game menu. More...
 
 ~Menu ()
 Disconnect and Destroy a Menu object.
 
GLvoid draw (GLboolean simplifyForPicking=false)
 Method to draw the menu. More...
 

Private Slots

void itemClicked (QMouseEvent *event, QList< GLuint > listNames)
 Slot invoked when the user clicks on a item. More...
 
void mouseReleased (QMouseEvent *event)
 Slot invoked when the user releases the mouse button. More...
 
void mouseMoved (QMouseEvent *event, QList< GLuint > listNames)
 Slot invoked when the user moves the mouse. More...
 
void wheelScrolled (QWheelEvent *event)
 Slot invoked when the user scrolls the wheel of the mouse button. More...
 
void keyPressed (QKeyEvent *event)
 Slot invoked when the user presses a key on the keyboard. More...
 

Private Member Functions

GLvoid previousSkin ()
 Change the current skin and select the previous one.
 
GLvoid nextSkin ()
 Change the current skin and select the next one.
 
GLvoid previousLevel ()
 Select the previous level.
 
GLvoid nextLevel ()
 Select the next level.
 
GLvoid buttonPlayStoryTriggered ()
 This function is invoked when playStoryButton is triggered.
 
GLvoid buttonPlayArcadeTriggered ()
 This function is invoked when playArcadeButton is triggered.
 
GLvoid buttonEditorTriggered ()
 This function is invoked when editorButton is triggered.
 
GLvoid buttonBackTriggered ()
 This function is invoked when backButton is triggered.
 
GLvoid buttonNextTriggered ()
 This function is invoked when nextButton is triggered.
 
GLvoid buttonPreviousSkinTriggered ()
 This function is invoked when previousSkinButton is triggered.
 
GLvoid buttonNextSkinTriggered ()
 This function is invoked when nextSkinButton is triggered.
 

Private Attributes

QObjectparent
 
GLint currentSkin
 
GLint currentLevel
 
QMap< GLint, Skin * > skinsList
 
QMap< GLint, Level * > levelsList
 
QMap< GLint, GLuint > iconsList
 
Alphabetalphabet
 
GLint itemSelected
 
GLboolean isMoving
 
Vector3fcameraOffset
 
ActionListcurrentActions
 
GLint gameType
 
GLfloat angleRotCube
 
GLfloat spinCube
 
GLfloat angleRotVolumeCube
 
GLboolean audioEnabled
 
SkinvolumeSkin
 
GLint currentView
 
GLint currentSection
 
GLint waitCounter
 
CubeStringListmainMenuButtons
 
CubeStringskinName
 
CubeStringListlevelName
 
CubeStringbackButton
 
CubeStringplayButton
 
CubeStringlevelsButton
 
CubeStringeditButton
 
CubeStringListcubeStudiosLabel
 
CubeStringListteam34Label
 
CubeStringqubetLabel
 

Detailed Description

Menu class used to show and manage the game menu.

Version
1.0
Author
#34

Constructor & Destructor Documentation

Menu::Menu ( QMap< GLint, Skin * > &  _skinsList,
QMap< GLint, Level * > &  _levelsList,
QMap< GLint, GLuint > &  _iconsList,
Alphabet _alphabet,
QObject _parent,
bool  _audioEnabled = true,
bool  showIntro = true 
)
explicit

Create a Menu object used to show and manage the game menu.

Postcondition
You have to connect parent's signals to this object's slots. For Qubet check the connectInputEvents function.
Parameters
_skinsListis the reference to Qubet's skinsList.
_levelsListis the reference to Qubet's levelsList.
_iconsListis the reference to Qubet's iconsList.
_alphabetis the reference to Qubet's alphabet.
_parentis a callback variable to the parent of the parent.
_audioEnabledis a variable to states if the audio is enabled or not.
showIntrostates if you want to show the intro. [default = true]

Here is the call graph for this function:

Member Function Documentation

GLvoid Menu::draw ( GLboolean  simplifyForPicking = false)

Method to draw the menu.

Parameters
simplifyForPicking[default = false] is used to draw a simplified scene used for the picking function.

Here is the call graph for this function:

Here is the caller graph for this function:

void Menu::enableAudio ( bool  enabled)
signal

Signal emitted to enable or disable the audio.

Parameters
enabledis the variable that states if the audio is to enable or not.

Here is the caller graph for this function:

void Menu::itemClicked ( QMouseEvent *  event,
QList< GLuint >  listNames 
)
privateslot

Slot invoked when the user clicks on a item.

Parameters
eventis the QMouseEvent.
listNamesis the QList<GLuint> of item's names.

Here is the call graph for this function:

void Menu::keyPressed ( QKeyEvent *  event)
privateslot

Slot invoked when the user presses a key on the keyboard.

Parameters
eventis the QKeyEvent*.

Here is the call graph for this function:

void Menu::mouseMoved ( QMouseEvent *  event,
QList< GLuint >  listNames 
)
privateslot

Slot invoked when the user moves the mouse.

Parameters
eventis the QMouseEvent*.
listNamesis the QList<GLuint> of item's names.

Here is the call graph for this function:

void Menu::mouseReleased ( QMouseEvent *  event)
privateslot

Slot invoked when the user releases the mouse button.

Parameters
eventis the QMouseEvent*.
void Menu::playAmbientMusic ( QString  filename)
signal

Signal emitted to play the ambient music.

Parameters
filenameis the filename to play.

Here is the caller graph for this function:

void Menu::playArcade ( GLint  skinId,
GLint  levelId 
)
signal

Signal emitted to show the gameView in arcade mode.

Parameters
skinId
levelId

Here is the caller graph for this function:

void Menu::playEffect ( QString  effectName)
signal

Signal emitted to play an effect.

Parameters
effectNameis the name of the effect to play.

Here is the caller graph for this function:

void Menu::playStory ( GLint  skinId)
signal

Signal emitted to show the gameView in story mode.

Parameters
skinId

Here is the caller graph for this function:

void Menu::setMouseMovementTracking ( int  mode)
signal

This signal is emitted to set the Qubet's Mouse Move Tracking sensibility. The modes are: 0 - no signal emitted. 1 - the signal mouseMoved is emitted only when the mouse is moved and one of the mouse buttons are clicked. 2 - the signal mouseMoved is emitted always when the mouse is moved.

Parameters
modeIt is the selected mode.

Here is the caller graph for this function:

void Menu::setSkybox ( QString  skyboxName)
signal

Signal emitted to set the Skybox.

Parameters
skyboxNameis the name of the Skybox to apply.

Here is the caller graph for this function:

void Menu::wheelScrolled ( QWheelEvent *  event)
privateslot

Slot invoked when the user scrolls the wheel of the mouse button.

Parameters
eventis the QWheelEvent*.

Member Data Documentation

Alphabet* Menu::alphabet
private

It is the alphabet provided by Qubet.

GLfloat Menu::angleRotCube
private

It is the current rotation angle of the cube.

GLfloat Menu::angleRotVolumeCube
private

It is the current rotation angle of the volume icon.

GLboolean Menu::audioEnabled
private

It is the state of the audio.

CubeString* Menu::backButton
private

It is the backButton CubeString.

Vector3f* Menu::cameraOffset
private

It is the camera offset for the menu.

CubeStringList* Menu::cubeStudiosLabel
private

It is the Cube studios distribution CubeStringList.

ActionList* Menu::currentActions
private

It is the list of the current menu steps.

GLint Menu::currentLevel
private

It is the id of the current choosen level.

GLint Menu::currentSection
private

It is used to states the menu to draw the introduction or the menu.

GLint Menu::currentSkin
private

It is the id of the current choosen skin.

GLint Menu::currentView
private

It is the value of the current view

CubeString* Menu::editButton
private

It is the editButton CubeString.

GLint Menu::gameType
private

It is the selected gameType.

QMap<GLint,GLuint> Menu::iconsList
private

It is the iconsList provided by Qubet object.

GLboolean Menu::isMoving
private

It is the variable that states if the menu is moving or not.

GLint Menu::itemSelected
private

It is the id of the current menu action selected.

CubeStringList* Menu::levelName
private

It is the levelName CubeString.

CubeString* Menu::levelsButton
private

It is the levelsButton CubeString.

QMap<GLint,Level*> Menu::levelsList
private

It is the levelsList provided by Qubet object.

CubeStringList* Menu::mainMenuButtons
private

It is the main menu buttons stringList.

QObject* Menu::parent
private

It is a callback variable to the parent of the widget.

CubeString* Menu::playButton
private

It is the playButton CubeString.

CubeString* Menu::qubetLabel
private

It is the Qubet CubeString.

CubeString* Menu::skinName
private

It is the skinName CubeString.

QMap<GLint,Skin*> Menu::skinsList
private

It is the skinsList provided by Qubet object.

GLfloat Menu::spinCube
private

It is the spin step of the skin selection cube.

CubeStringList* Menu::team34Label
private

It is the team 34 CubeStringList.

Skin* Menu::volumeSkin
private

It is the skin of the volume button

GLint Menu::waitCounter
private

It is an incremental variable to wait from intro screens.


The documentation for this class was generated from the following files: