- Timestamp:
- Feb 2, 2006, 11:23:43 PM (19 years ago)
- Location:
- trunk/src/story_entities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/story_entities/story_entity.cc
r6992 r6993 66 66 67 67 LoadParam(root, "identifier", this, StoryEntity, setStoryID) 68 68 .describe("A Unique Identifier for this StoryEntity"); 69 69 70 70 LoadParam(root, "path", this, StoryEntity, setLoadFile) 71 71 .describe("DEPRICATED FORM OF file. The Filename of this StoryEntity (relative from the data-dir)"); 72 72 73 73 LoadParam(root, "file", this, StoryEntity, setLoadFile) 74 74 .describe("The Filename of this StoryEntity (relative from the data-dir)"); 75 75 76 76 LoadParam(root, "nextid", this, StoryEntity, setNextStoryID) 77 .describe("Sets the ID of the next StoryEntity"); 78 79 LoadParam(root, "description", this, StoryEntity, setDescription) 80 .describe("Sets the description of this StoryEntity"); 81 82 LoadParam(root, "menu-entry", this, StoryEntity, addToGameMenu) 83 .describe("If this entry is 1, the world is contained in the SimpleGameMenu"); 84 85 LoadParam(root, "menu-item-image", this, StoryEntity, setMenuItemImage) 86 .describe("If this entry is 1, the world is contained in the SimpleGameMenu"); 87 88 LoadParam(root, "screenshoot", this, StoryEntity, setMenuScreenshoot) 89 .describe("If this entry is 1, the world is contained in the SimpleGameMenu"); 77 .describe("Sets the ID of the next StoryEntity"); 90 78 91 79 PRINTF(4)("Loaded StoryEntity specific stuff\n"); … … 108 96 else 109 97 this->loadFile = ResourceManager::getFullName(fileName); 98 99 this->grabWorldInfo(); 110 100 } 111 101 … … 135 125 void StoryEntity::setNextStoryID(int nextStoryID) 136 126 { 137 this->nextStoryID = nextStoryID; 127 this->nextStoryID = nextStoryID; 128 } 129 130 /** 131 * @brief grabs settings needed for displaying a MenuScreen. 132 */ 133 void StoryEntity::grabWorldInfo() 134 { 135 PRINTF(3)("Grabbing the Worlds Settings\n", this->getLoadFile()); 136 if( getLoadFile() == NULL) 137 return; 138 TiXmlDocument XMLDoc(this->getLoadFile()); 139 // load the xml world file for further loading 140 if( !XMLDoc.LoadFile()) 141 { 142 PRINTF(1)("loading XML File: %s @ %s:l%d:c%d\n", XMLDoc.ErrorDesc(), this->getLoadFile(), XMLDoc.ErrorRow(), XMLDoc.ErrorCol()); 143 return; 144 } 145 TiXmlElement* root = XMLDoc.RootElement(); 146 if (root == NULL) 147 return; 148 149 if (root->Value() != NULL && !strcmp(root->Value(), "WorldDataFile")) 150 { 151 LoadParam(root, "description", this, StoryEntity, setDescription) 152 .describe("Sets the description of this StoryEntity"); 153 154 LoadParam(root, "menu-entry", this, StoryEntity, addToGameMenu) 155 .describe("If this entry is 1, the world is contained in the SimpleGameMenu"); 156 157 LoadParam(root, "menu-item-image", this, StoryEntity, setMenuItemImage) 158 .describe("If this entry is 1, the world is contained in the SimpleGameMenu"); 159 160 LoadParam(root, "screenshoot", this, StoryEntity, setMenuScreenshoot) 161 .describe("If this entry is 1, the world is contained in the SimpleGameMenu"); 162 } 138 163 } 139 164 -
trunk/src/story_entities/story_entity.h
r6992 r6993 72 72 inline const char* getDescription() { return this->description; } 73 73 74 75 74 void grabWorldInfo(); 76 75 /** toggle the menu visibility: SimpleMenu specific */ 77 inline void addToGameMenu( int toggle) { this->bMenuEntry = (bool)toggle; }76 inline void addToGameMenu(bool toggle) { this->bMenuEntry = toggle; } 78 77 /** @returns true if the GameWorld should be contained in the SimpleMenu: SimpleMenu specific */ 79 78 inline bool isContainedInMenu() { return this->bMenuEntry; } … … 85 84 /** @returns the menu screenshoot of this StoryEntity */ 86 85 inline const char* getMenuScreenshoot() { return this->menuScreenshoot; } 87 88 86 89 87 protected:
Note: See TracChangeset
for help on using the changeset viewer.