Qubet  1.0
The ultimate QGL addicting videogame!
 All Classes Functions Variables Pages
menu.h
1 // Qubet - Copyright (C) 2011
2 // Enrico Bacis
3 // Daniele Ciriello
4 
5 // Qubet is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 
15 // You should have received a copy of the GNU General Public License
16 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18 
19 #ifndef MENU_H
20 #define MENU_H
21 
22 #include "skin.h"
23 #include "level.h"
24 #include "actionlist.h"
25 #include "cubestringlist.h"
26 
33 class Menu : public QObject
34 {
35  Q_OBJECT
36 
37 public:
38 
53  explicit Menu(QMap<GLint,Skin*> &_skinsList, QMap<GLint,Level*> &_levelsList, QMap<GLint,GLuint> &_iconsList, Alphabet *_alphabet, QObject *_parent, bool _audioEnabled = true, bool showIntro = true);
54 
58  ~Menu();
59 
66  GLvoid draw(GLboolean simplifyForPicking = false);
67 
68 
69 private:
70 
72  GLint currentSkin;
73  GLint currentLevel;
74  QMap<GLint,Skin*> skinsList;
75  QMap<GLint,Level*> levelsList;
76  QMap<GLint,GLuint> iconsList;
78  GLint itemSelected;
79  GLboolean isMoving;
82  GLint gameType;
83  GLfloat angleRotCube;
84  GLfloat spinCube;
86  GLboolean audioEnabled;
88  GLint currentView;
90  GLint waitCounter;
108  GLvoid previousSkin();
109 
113  GLvoid nextSkin();
114 
118  GLvoid previousLevel();
119 
123  GLvoid nextLevel();
124 
128  GLvoid buttonPlayStoryTriggered();
129 
133  GLvoid buttonPlayArcadeTriggered();
134 
138  GLvoid buttonEditorTriggered();
139 
143  GLvoid buttonBackTriggered();
144 
148  GLvoid buttonNextTriggered();
149 
154 
158  GLvoid buttonNextSkinTriggered();
159 
160 
161 private slots:
162 
169  void itemClicked(QMouseEvent *event, QList<GLuint> listNames);
170 
176  void mouseReleased(QMouseEvent *event);
177 
184  void mouseMoved(QMouseEvent *event, QList<GLuint> listNames);
185 
191  void wheelScrolled(QWheelEvent *event);
192 
198  void keyPressed(QKeyEvent *event);
199 
200 
201 signals:
207  void playStory(GLint skinId);
208 
215  void playArcade(GLint skinId, GLint levelId);
216 
221  void showLevelEditor(GLint levelId);
222 
234  void setMouseMovementTracking(int mode);
235 
241  void enableAudio(bool enabled);
242 
248  void playAmbientMusic(QString filename);
249 
253  void stopAmbientMusic();
254 
260  void playEffect(QString effectName);
261 
267  void setSkybox(QString skyboxName);
268 
269 };
270 
271 #endif // MENU_H
CubeString * skinName
Definition: menu.h:93
CubeStringList * team34Label
Definition: menu.h:101
void mouseReleased(QMouseEvent *event)
Slot invoked when the user releases the mouse button.
Definition: menu.cpp:716
GLint waitCounter
Definition: menu.h:90
GLboolean isMoving
Definition: menu.h:79
CubeStringList * cubeStudiosLabel
Definition: menu.h:100
~Menu()
Disconnect and Destroy a Menu object.
Definition: menu.cpp:111
GLvoid buttonBackTriggered()
This function is invoked when backButton is triggered.
Definition: menu.cpp:578
This class is used to draw a vertical list of CubeString. Look at CubeString to have a better specifi...
Definition: cubestringlist.h:31
Skin * volumeSkin
Definition: menu.h:87
Menu class used to show and manage the game menu.
Definition: menu.h:33
void playArcade(GLint skinId, GLint levelId)
Signal emitted to show the gameView in arcade mode.
CubeString * qubetLabel
Definition: menu.h:102
CubeString * levelsButton
Definition: menu.h:97
GLint currentSection
Definition: menu.h:89
This class is used to keep track of actions to do. For example it can keep track of current view scro...
Definition: actionlist.h:50
GLint currentLevel
Definition: menu.h:73
GLfloat angleRotCube
Definition: menu.h:83
CubeString * editButton
Definition: menu.h:98
void stopAmbientMusic()
Signal emitted to stop the current ambient music.
QMap< GLint, Level * > levelsList
Definition: menu.h:75
GLvoid buttonPreviousSkinTriggered()
This function is invoked when previousSkinButton is triggered.
Definition: menu.cpp:639
GLvoid previousSkin()
Change the current skin and select the previous one.
Definition: menu.cpp:488
GLvoid buttonPlayArcadeTriggered()
This function is invoked when playArcadeButton is triggered.
Definition: menu.cpp:549
GLvoid nextSkin()
Change the current skin and select the next one.
Definition: menu.cpp:500
This class is used to draw, a string composed the horizontal justapposition of Different cubes on whi...
Definition: cubestring.h:37
It is the Skin Class.
Definition: skin.h:30
GLint currentSkin
Definition: menu.h:72
QMap< GLint, GLuint > iconsList
Definition: menu.h:76
QObject * parent
Definition: menu.h:71
ActionList * currentActions
Definition: menu.h:81
GLvoid buttonNextTriggered()
This function is invoked when nextButton is triggered.
Definition: menu.cpp:603
void keyPressed(QKeyEvent *event)
Slot invoked when the user presses a key on the keyboard.
Definition: menu.cpp:757
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.
Definition: menu.cpp:24
void setSkybox(QString skyboxName)
Signal emitted to set the Skybox.
CubeString * backButton
Definition: menu.h:95
void playStory(GLint skinId)
Signal emitted to show the gameView in story mode.
GLvoid buttonEditorTriggered()
This function is invoked when editorButton is triggered.
Definition: menu.cpp:560
GLint gameType
Definition: menu.h:82
GLfloat spinCube
Definition: menu.h:84
Structure that rapresents a Vector of float in a 3-D space.
Definition: vector3f.h:31
GLvoid buttonNextSkinTriggered()
This function is invoked when nextSkinButton is triggered.
Definition: menu.cpp:648
void playEffect(QString effectName)
Signal emitted to play an effect.
void itemClicked(QMouseEvent *event, QList< GLuint > listNames)
Slot invoked when the user clicks on a item.
Definition: menu.cpp:657
void enableAudio(bool enabled)
Signal emitted to enable or disable the audio.
void showLevelEditor(GLint levelId)
Signal emitted to show the levelEditor.
GLint currentView
Definition: menu.h:88
CubeStringList * levelName
Definition: menu.h:94
GLboolean audioEnabled
Definition: menu.h:86
QMap< GLint, Skin * > skinsList
Definition: menu.h:74
GLvoid nextLevel()
Select the next level.
Definition: menu.cpp:526
Vector3f * cameraOffset
Definition: menu.h:80
CubeStringList * mainMenuButtons
Definition: menu.h:92
CubeString * playButton
Definition: menu.h:96
This class is used to keep a list of Letter (from this the name Alphabet) It provide access to Letter...
Definition: alphabet.h:33
GLvoid draw(GLboolean simplifyForPicking=false)
Method to draw the menu.
Definition: menu.cpp:150
void setMouseMovementTracking(int mode)
This signal is emitted to set the Qubet's Mouse Move Tracking sensibility. The modes are: 0 - no sign...
void playAmbientMusic(QString filename)
Signal emitted to play the ambient music.
void mouseMoved(QMouseEvent *event, QList< GLuint > listNames)
Slot invoked when the user moves the mouse.
Definition: menu.cpp:721
GLint itemSelected
Definition: menu.h:78
Alphabet * alphabet
Definition: menu.h:77
GLvoid buttonPlayStoryTriggered()
This function is invoked when playStoryButton is triggered.
Definition: menu.cpp:538
GLvoid previousLevel()
Select the previous level.
Definition: menu.cpp:512
GLfloat angleRotVolumeCube
Definition: menu.h:85
void wheelScrolled(QWheelEvent *event)
Slot invoked when the user scrolls the wheel of the mouse button.
Definition: menu.cpp:752