[6501] | 1 | /*! |
---|
[8673] | 2 | * @file game_menu.h |
---|
[6501] | 3 | * a StoryEntity that contains a simple game menu |
---|
| 4 | */ |
---|
| 5 | |
---|
[8673] | 6 | #ifndef _GAME_MENU_H |
---|
| 7 | #define _GAME_MENU_H |
---|
[6501] | 8 | |
---|
| 9 | |
---|
[6502] | 10 | #include "game_world.h" |
---|
| 11 | #include "game_world_data.h" |
---|
[6520] | 12 | #include <vector> |
---|
[8035] | 13 | #include "glgui.h" |
---|
| 14 | |
---|
[7460] | 15 | namespace OrxSound { class SoundSource; } |
---|
[6835] | 16 | |
---|
[6501] | 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 | */ |
---|
[8673] | 22 | class GameMenu : virtual public GameWorld, virtual public EventListener |
---|
[6501] | 23 | { |
---|
| 24 | |
---|
| 25 | public: |
---|
[8673] | 26 | GameMenu(const TiXmlElement* root = NULL); |
---|
| 27 | virtual ~GameMenu(); |
---|
[6501] | 28 | |
---|
[6696] | 29 | virtual void loadParams(const TiXmlElement* root); |
---|
[6501] | 30 | |
---|
[6504] | 31 | virtual ErrorMessage init(); |
---|
[6521] | 32 | virtual ErrorMessage loadData(); |
---|
[6862] | 33 | virtual ErrorMessage unloadData(); |
---|
[6521] | 34 | |
---|
[6504] | 35 | virtual bool start(); |
---|
| 36 | virtual bool stop(); |
---|
| 37 | |
---|
| 38 | virtual void process(const Event &event); |
---|
| 39 | |
---|
| 40 | |
---|
[7919] | 41 | void startLevel(int level); |
---|
[8677] | 42 | |
---|
| 43 | void showMainMenu(); |
---|
| 44 | void showCampaigns(); |
---|
| 45 | void showMultiPlayer(); |
---|
| 46 | void showOptionsMenu(); |
---|
[9059] | 47 | |
---|
| 48 | void showClientMenu(); |
---|
| 49 | void connectToServer(); |
---|
| 50 | |
---|
| 51 | void showServerMenu(); |
---|
| 52 | void createServer(); |
---|
[8677] | 53 | |
---|
[8688] | 54 | |
---|
[7919] | 55 | void quitMenu(); |
---|
| 56 | |
---|
[6504] | 57 | protected: |
---|
[6521] | 58 | virtual void tick(); |
---|
[6502] | 59 | virtual void collide(); |
---|
[6520] | 60 | |
---|
| 61 | |
---|
| 62 | private: |
---|
[8688] | 63 | void showSecondLevelElement(OrxGui::GLGuiBox* element); |
---|
| 64 | |
---|
| 65 | |
---|
[6521] | 66 | void animateScene(float dt); |
---|
[6837] | 67 | void switchMenuLayer(int layer1, int layer2); |
---|
[7063] | 68 | void sliderTo(const Element2D* element, float bias = 0.0f); |
---|
[7318] | 69 | void setSelectorSound(const std::string& selectorSound); |
---|
[6521] | 70 | |
---|
[9059] | 71 | |
---|
[6521] | 72 | |
---|
[9059] | 73 | |
---|
[6521] | 74 | private: |
---|
[8674] | 75 | OrxGui::GLGuiBox* mainMenuBox; |
---|
[8677] | 76 | OrxGui::GLGuiBox* levelsBox; |
---|
| 77 | OrxGui::GLGuiBox* networkBox; |
---|
[9059] | 78 | |
---|
| 79 | OrxGui::GLGuiBox* clientNetworkBox; |
---|
| 80 | OrxGui::GLGuiInputLine* ipInputLine; |
---|
| 81 | |
---|
| 82 | OrxGui::GLGuiBox* serverNetworkBox; |
---|
[8677] | 83 | |
---|
| 84 | OrxGui::GLGuiBox* optionsBox; |
---|
[8688] | 85 | OrxGui::GLGuiBox* generalBox; |
---|
[8673] | 86 | OrxGui::GLGuiBox* audioBox; |
---|
| 87 | OrxGui::GLGuiBox* videoBox; |
---|
| 88 | OrxGui::GLGuiBox* controlBox; |
---|
[6835] | 89 | |
---|
[8688] | 90 | OrxGui::GLGuiBox* currentlyOpened; |
---|
| 91 | |
---|
[6521] | 92 | Vector cameraVector; |
---|
[7318] | 93 | |
---|
[7460] | 94 | OrxSound::SoundSource* selectorSource; |
---|
[6502] | 95 | }; |
---|
[6501] | 96 | |
---|
| 97 | |
---|
| 98 | |
---|
[6502] | 99 | //! the simple game menu data |
---|
[8673] | 100 | class GameMenuData : public GameWorldData |
---|
[6502] | 101 | { |
---|
[6501] | 102 | |
---|
[6502] | 103 | public: |
---|
[8673] | 104 | GameMenuData(); |
---|
| 105 | virtual ~GameMenuData(); |
---|
[6501] | 106 | |
---|
[6502] | 107 | virtual ErrorMessage init(); |
---|
[6501] | 108 | |
---|
[6502] | 109 | |
---|
| 110 | protected: |
---|
[7370] | 111 | virtual ErrorMessage loadGUI(const TiXmlElement* root); |
---|
| 112 | virtual ErrorMessage loadWorldEntities(const TiXmlElement* root); |
---|
| 113 | virtual ErrorMessage loadScene(const TiXmlElement* root); |
---|
[6502] | 114 | |
---|
| 115 | virtual ErrorMessage unloadGUI(); |
---|
| 116 | virtual ErrorMessage unloadWorldEntities(); |
---|
| 117 | virtual ErrorMessage unloadScene(); |
---|
| 118 | |
---|
[6501] | 119 | }; |
---|
| 120 | |
---|
| 121 | |
---|
| 122 | #endif /* _GAME_WORLD_H */ |
---|