Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 6874 was 6874, checked in by patrick, 18 years ago

trunk: the menu control better implemented

File size: 2.9 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
17class SimpleGameMenuData;
[6502]18class TiXmlElement;
[6520]19class ImageEntity;
[6501]20
[6835]21
22
23class MenuLayer
24{
25  public:
26    MenuLayer() {}
27    ~MenuLayer() {}
28
29
30  public:
31    std::vector<ImageEntity*>         menuList;                        //!< the list of the menu items
[6839]32    std::vector<StoryEntity*>         storyList;                       //!< the list of the StoryEntities for the menu
[6874]33    std::vector<ImageEntity*>         screenshootList;                 //!< list of the screen shoots FIXME: make a better structure for this stuff
[6835]34};
35
36
[6501]37//! a simple game menu based on a story entity
38/**
39 * This is a simple menu, that is based on the StoryEntity. Therefore this menu is absolutly
40 * loadable and is exchangeable very easely :D
41 */
[6504]42class SimpleGameMenu : virtual public GameWorld, virtual public EventListener
[6501]43{
44
45  public:
[6502]46    SimpleGameMenu(const TiXmlElement* root = NULL);
[6501]47    virtual ~SimpleGameMenu();
48
[6696]49    virtual void loadParams(const TiXmlElement* root);
[6501]50
[6504]51    virtual ErrorMessage init();
[6521]52    virtual ErrorMessage loadData();
[6862]53    virtual ErrorMessage unloadData();
[6521]54
[6504]55    virtual bool start();
56    virtual bool stop();
57
58    virtual void process(const Event &event);
59
60
61  protected:
[6521]62    virtual void tick();
[6502]63    virtual void collide();
[6520]64
65
66  private:
[6521]67    void animateScene(float dt);
[6837]68    void switchMenuLayer(int layer1, int layer2);
[6521]69
70
71  private:
[6835]72    std::vector<MenuLayer*>           menuLayer;                       //!< the menu layer
73    MenuLayer*                        selectedLayer;                   //!< the selected menu layer
[6837]74    int                               layerIndex;
[6835]75
76    //std::vector<ImageEntity*>         menuList;                        //!< the list of the menu items
[6520]77    ImageEntity*                      menuSelected;                    //!< ref to the selected menu entity
78    ImageEntity*                      menuSelector;                    //!< ref to the selector image
79    ImageEntity*                      menuStartGame;
80    ImageEntity*                      menuStartMultiplayerGame;
81    ImageEntity*                      menuQuitGame;
82    int                               menuSelectedIndex;
[6521]83
84    Vector                            cameraVector;
[6502]85};
[6501]86
87
88
[6502]89//! the simple game menu data
90class SimpleGameMenuData : public GameWorldData
91{
[6501]92
[6502]93  public:
94    SimpleGameMenuData();
95    virtual ~SimpleGameMenuData();
[6501]96
[6502]97    virtual ErrorMessage init();
[6501]98
[6502]99
100  protected:
101    virtual ErrorMessage loadGUI(TiXmlElement* root);
102    virtual ErrorMessage loadWorldEntities(TiXmlElement* root);
103    virtual ErrorMessage loadScene(TiXmlElement* root);
104
105    virtual ErrorMessage unloadGUI();
106    virtual ErrorMessage unloadWorldEntities();
107    virtual ErrorMessage unloadScene();
108
[6501]109};
110
111
112#endif /* _GAME_WORLD_H */
Note: See TracBrowser for help on using the repository browser.