- Timestamp:
- Jan 29, 2006, 11:59:39 PM (19 years ago)
- Location:
- trunk/src/story_entities
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/story_entities/game_world.cc
r6827 r6835 112 112 113 113 LoadParam(root, "path", this, GameWorld, setPath) 114 .describe("The Filename of this GameWorld (relative from the data-dir)"); 114 .describe("The Filename of this GameWorld (relative from the data-dir)"); 115 LoadParam(root, "menu-entry", this, GameWorld, addToGameMenu) 116 .describe("If this entry is 1, the world is contained in the SimpleGameMenu"); 117 115 118 116 119 // LoadParam(root, "soundtrack", this->dataTank, GameWorldData, setSoundTrack); -
trunk/src/story_entities/game_world.h
r6512 r6835 55 55 void toggleBVVisibility() { this->showBV = !this->showBV; }; 56 56 57 /** toggle the menu visibility: SimpleMenu specific */ 58 inline void addToGameMenu(int toggle) { this->bMenuEntry = (bool)toggle; } 59 /** @returns true if the GameWorld should be contained in the SimpleMenu: SimpleMenu specific */ 60 inline bool isContainedInMenu() { return this->bMenuEntry; } 61 57 62 58 63 inline void setSky(WorldEntity* sky) { this->dataTank->sky = sky; } … … 93 98 /* external modules interfaces */ 94 99 Shell* shell; 100 101 bool bMenuEntry; //!< If true, this GameWorld apears in the SimpleMenu: SimpleMenu specific 95 102 }; 96 103 -
trunk/src/story_entities/simple_game_menu.cc
r6696 r6835 55 55 56 56 this->cameraVector = Vector(50.0, 0.0, 0.0); 57 this->menuLayer.push_back(new MenuLayer()); 57 58 58 59 this->loadParams(root); … … 127 128 { 128 129 this->menuSelector = dynamic_cast<ImageEntity*>(*entity); 129 PRINTF(0)("Found the selector: %s\n", (*entity)->getName());130 130 } 131 131 else if( !strcmp( "StartGame_Menu", (*entity)->getName())) 132 132 { 133 PRINTF(0)("Found a StartItem: %s\n", (*entity)->getName());134 133 this->menuStartGame = dynamic_cast<ImageEntity*>(*entity); 135 this->menuList.push_back(dynamic_cast<ImageEntity*>(*entity)); 134 this->menuLayer[0]->menuList.push_back(dynamic_cast<ImageEntity*>(*entity)); 135 136 136 } 137 137 else if( !strcmp( "Multiplayer_Menu", (*entity)->getName())) 138 138 { 139 PRINTF(0)("Found a MultiplayerItem: %s\n", (*entity)->getName());140 139 this->menuStartMultiplayerGame = dynamic_cast<ImageEntity*>(*entity); 141 this->menuL ist.push_back(dynamic_cast<ImageEntity*>(*entity));140 this->menuLayer[0]->menuList.push_back(dynamic_cast<ImageEntity*>(*entity)); 142 141 } 143 142 else if( !strcmp( "Quit_Menu", (*entity)->getName())) 144 143 { 145 PRINTF(0)("Found a QuitItem: %s\n", (*entity)->getName());146 144 this->menuQuitGame = dynamic_cast<ImageEntity*>(*entity); 147 this->menuL ist.push_back(dynamic_cast<ImageEntity*>(*entity));145 this->menuLayer[0]->menuList.push_back(dynamic_cast<ImageEntity*>(*entity)); 148 146 } 149 147 } 150 148 this->menuSelectedIndex = 0; 151 this->menuSelected = this->menuL ist[this->menuSelectedIndex];149 this->menuSelected = this->menuLayer[0]->menuList[this->menuSelectedIndex]; 152 150 this->menuSelector->setAbsCoor(this->menuSelected->getAbsCoor()); 153 151 } … … 233 231 { 234 232 // ImageEntity* 235 if(this->menuSelectedIndex < (this->menuL ist.size() - 1))236 { 237 this->menuSelected = this->menuL ist[++this->menuSelectedIndex];233 if(this->menuSelectedIndex < (this->menuLayer[0]->menuList.size() - 1)) 234 { 235 this->menuSelected = this->menuLayer[0]->menuList[++this->menuSelectedIndex]; 238 236 this->menuSelector->setAbsCoor(this->menuSelected->getAbsCoor()); 239 237 } … … 243 241 if(this->menuSelectedIndex > 0) 244 242 { 245 this->menuSelected = this->menuL ist[--this->menuSelectedIndex];243 this->menuSelected = this->menuLayer[0]->menuList[--this->menuSelectedIndex]; 246 244 this->menuSelector->setAbsCoor(this->menuSelected->getAbsCoor()); 247 245 } -
trunk/src/story_entities/simple_game_menu.h
r6696 r6835 18 18 class TiXmlElement; 19 19 class ImageEntity; 20 21 22 23 class MenuLayer 24 { 25 public: 26 MenuLayer() {} 27 ~MenuLayer() {} 28 29 30 public: 31 std::vector<ImageEntity*> menuList; //!< the list of the menu items 32 }; 33 20 34 21 35 //! a simple game menu based on a story entity … … 52 66 53 67 private: 54 std::vector<ImageEntity*> menuList; //!< the list of the menu items 68 std::vector<MenuLayer*> menuLayer; //!< the menu layer 69 MenuLayer* selectedLayer; //!< the selected menu layer 70 71 //std::vector<ImageEntity*> menuList; //!< the list of the menu items 55 72 ImageEntity* menuSelected; //!< ref to the selected menu entity 56 73 ImageEntity* menuSelector; //!< ref to the selector image -
trunk/src/story_entities/story_entity.cc
r6512 r6835 65 65 .describe("Sets the ID of the next StoryEntity"); 66 66 67 LoadParam(root, "name", this, StoryEntity, setName) 68 .describe("Sets the name of this StoryEntity"); 69 67 70 PRINTF(4)("Loaded StoryEntity specific stuff\n"); 68 71 } -
trunk/src/story_entities/story_entity.h
r6634 r6835 67 67 /** gets the story id of the current entity @returns story id */ 68 68 inline int getNextStoryID() { return this->nextStoryID; } 69 69 /** sets the name of this StoryEntity @param name name */ 70 inline void setName(const char* name) { this->name = name; } 71 /** @returns the name of this StoryEntity */ 72 inline const char* getName() { return this->name; } 70 73 71 74 … … 79 82 int storyID; //!< this is the number of this entity, identifying it in a list/tree... 80 83 int nextStoryID; //!< if this entity has finished, this entity shall be called 84 const char* name; //!< name of this StoryEntity 81 85 }; 82 86
Note: See TracChangeset
for help on using the changeset viewer.