Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/story_entities/menu/game_menu.h @ 8893

Last change on this file since 8893 was 8717, checked in by bensch, 18 years ago

merged the gui back

File size: 2.4 KB
Line 
1/*!
2 * @file game_menu.h
3 *  a StoryEntity that contains a simple game menu
4 */
5
6#ifndef _GAME_MENU_H
7#define _GAME_MENU_H
8
9
10#include "game_world.h"
11#include "game_world_data.h"
12#include <vector>
13#include "glgui.h"
14
15namespace OrxSound { class SoundSource; }
16
17//! a simple game menu based on a story entity
18/**
19 * This is a simple menu, that is based on the StoryEntity. Therefore this menu is absolutly
20 * loadable and is exchangeable very easely :D
21 */
22class GameMenu : virtual public GameWorld, virtual public EventListener
23{
24
25  public:
26    GameMenu(const TiXmlElement* root = NULL);
27    virtual ~GameMenu();
28
29    virtual void loadParams(const TiXmlElement* root);
30
31    virtual ErrorMessage init();
32    virtual ErrorMessage loadData();
33    virtual ErrorMessage unloadData();
34
35    virtual bool start();
36    virtual bool stop();
37
38    virtual void process(const Event &event);
39
40
41    void startLevel(int level);
42
43    void showMainMenu();
44    void showCampaigns();
45    void showMultiPlayer();
46    void showOptionsMenu();
47
48
49    void quitMenu();
50
51  protected:
52    virtual void tick();
53    virtual void collide();
54
55
56  private:
57    void showSecondLevelElement(OrxGui::GLGuiBox* element);
58
59
60    void animateScene(float dt);
61    void switchMenuLayer(int layer1, int layer2);
62    void sliderTo(const Element2D* element, float bias = 0.0f);
63    void setSelectorSound(const std::string& selectorSound);
64
65
66  private:
67    OrxGui::GLGuiBox*                 mainMenuBox;
68    OrxGui::GLGuiBox*                 levelsBox;
69    OrxGui::GLGuiBox*                 networkBox;
70
71    OrxGui::GLGuiBox*                 optionsBox;
72    OrxGui::GLGuiBox*                 generalBox;
73    OrxGui::GLGuiBox*                 audioBox;
74    OrxGui::GLGuiBox*                 videoBox;
75    OrxGui::GLGuiBox*                 controlBox;
76
77    OrxGui::GLGuiBox*                 currentlyOpened;
78
79    Vector                            cameraVector;
80
81    OrxSound::SoundSource*            selectorSource;
82};
83
84
85
86//! the simple game menu data
87class GameMenuData : public GameWorldData
88{
89
90  public:
91    GameMenuData();
92    virtual ~GameMenuData();
93
94    virtual ErrorMessage init();
95
96
97  protected:
98    virtual ErrorMessage loadGUI(const TiXmlElement* root);
99    virtual ErrorMessage loadWorldEntities(const TiXmlElement* root);
100    virtual ErrorMessage loadScene(const TiXmlElement* root);
101
102    virtual ErrorMessage unloadGUI();
103    virtual ErrorMessage unloadWorldEntities();
104    virtual ErrorMessage unloadScene();
105
106};
107
108
109#endif /* _GAME_WORLD_H */
Note: See TracBrowser for help on using the repository browser.