Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/story_entities/simple_game_menu.h @ 9115

Last change on this file since 9115 was 8035, checked in by bensch, 18 years ago

gui: merged the gui back to the trunk

File size: 3.5 KB
RevLine 
[6501]1/*!
2 * @file simple_game_menu.h
3 *  a StoryEntity that contains a simple game menu
4 */
5
6#ifndef _SIMPLE_GAME_MENU_H
7#define _SIMPLE_GAME_MENU_H
8
9
[6502]10#include "game_world.h"
[6504]11#include "event_listener.h"
[6502]12#include "game_world_data.h"
[6520]13#include <vector>
[6521]14#include "vector.h"
[6501]15
16
[7019]17#include "elements/text_element.h"
18
[8035]19#include "glgui.h"
20
[6501]21class SimpleGameMenuData;
[6502]22class TiXmlElement;
[6520]23class ImageEntity;
[6501]24
[7460]25namespace OrxSound { class SoundSource; }
[6835]26
27class MenuLayer
28{
29  public:
30    MenuLayer() {}
[6981]31    virtual ~MenuLayer() {}
[6835]32
33
34  public:
[8035]35    std::vector<TextElement*>         menuList;                        //!< the list of the menu items
[6839]36    std::vector<StoryEntity*>         storyList;                       //!< the list of the StoryEntities for the menu
[6874]37    std::vector<ImageEntity*>         screenshootList;                 //!< list of the screen shoots FIXME: make a better structure for this stuff
[6835]38};
39
40
[6501]41//! a simple game menu based on a story entity
42/**
43 * This is a simple menu, that is based on the StoryEntity. Therefore this menu is absolutly
44 * loadable and is exchangeable very easely :D
45 */
[6504]46class SimpleGameMenu : virtual public GameWorld, virtual public EventListener
[6501]47{
48
49  public:
[6502]50    SimpleGameMenu(const TiXmlElement* root = NULL);
[6501]51    virtual ~SimpleGameMenu();
52
[7919]53    /// TODO TAKE THIS OUT
54    void enterGui();
55    void execURL() const;
56    static int startURL(void* data);
[8035]57
58    void setImage(int i);
59    OrxGui::GLGuiImage* image;
60    OrxGui::GLGuiInputLine* imageName;
[7919]61    ///
[6696]62    virtual void loadParams(const TiXmlElement* root);
[6501]63
[6504]64    virtual ErrorMessage init();
[6521]65    virtual ErrorMessage loadData();
[6862]66    virtual ErrorMessage unloadData();
[6521]67
[6504]68    virtual bool start();
69    virtual bool stop();
70
71    virtual void process(const Event &event);
72
73
[7919]74    void startLevel(int level);
75    void quitMenu();
76
[8035]77    void TEST(int val) { printf("TEST %d\n", val); }
[7919]78
[6504]79  protected:
[6521]80    virtual void tick();
[6502]81    virtual void collide();
[6520]82
83
84  private:
[6521]85    void animateScene(float dt);
[6837]86    void switchMenuLayer(int layer1, int layer2);
[7063]87    void sliderTo(const Element2D* element, float bias = 0.0f);
[7318]88    void setSelectorSound(const std::string& selectorSound);
[6521]89
90
91  private:
[6991]92    std::vector<MenuLayer>            menuLayers;                      //!< the menu layer
[6835]93    MenuLayer*                        selectedLayer;                   //!< the selected menu layer
[6837]94    int                               layerIndex;
[6835]95
96    //std::vector<ImageEntity*>         menuList;                        //!< the list of the menu items
[6520]97    ImageEntity*                      menuSelector;                    //!< ref to the selector image
[7019]98    TextElement*                      menuSelected;                    //!< ref to the selected menu entity
99    TextElement*                      menuStartGame;
100    TextElement*                      menuStartMultiplayerGame;
101    TextElement*                      menuQuitGame;
[6520]102    int                               menuSelectedIndex;
[6521]103
104    Vector                            cameraVector;
[7318]105
[7460]106    OrxSound::SoundSource*            selectorSource;
[6502]107};
[6501]108
109
110
[6502]111//! the simple game menu data
112class SimpleGameMenuData : public GameWorldData
113{
[6501]114
[6502]115  public:
116    SimpleGameMenuData();
117    virtual ~SimpleGameMenuData();
[6501]118
[6502]119    virtual ErrorMessage init();
[6501]120
[6502]121
122  protected:
[7370]123    virtual ErrorMessage loadGUI(const TiXmlElement* root);
124    virtual ErrorMessage loadWorldEntities(const TiXmlElement* root);
125    virtual ErrorMessage loadScene(const TiXmlElement* root);
[6502]126
127    virtual ErrorMessage unloadGUI();
128    virtual ErrorMessage unloadWorldEntities();
129    virtual ErrorMessage unloadScene();
130
[6501]131};
132
133
134#endif /* _GAME_WORLD_H */
Note: See TracBrowser for help on using the repository browser.