Changeset 8164 in orxonox.OLD for branches/script_engine/src/lib
- Timestamp:
- Jun 5, 2006, 9:20:48 PM (19 years ago)
- Location:
- branches/script_engine/src/lib/script_engine
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/script_engine/src/lib/script_engine/script_manager.cc
r8163 r8164 74 74 while( script != NULL) 75 75 { 76 { // scope to make the Loadparam work 76 77 LoadParam(script, "file", this, ScriptManager, setCurrentScriptFile) 77 78 .describe("the fileName of the script, that should be loaded into this world") 78 79 .defaultValues(""); 80 } 79 81 80 82 if(!currentScript.name.empty()) // if LoadParam didn't fail... fill the object list with the needed objects 81 83 { 82 object = script->FirstChildElement("object");84 /*object = script->FirstChildElement("object"); 83 85 84 86 while(object != NULL) 85 87 { 86 addObjectToScript(std::string(object->Value()), currentScript); 88 LoadParam(object, "object", this, ScriptManager, setCurrentScriptFile) 89 .describe("the fileName of the script, that should be loaded into this world") 90 .defaultValues(""); 87 91 object = object->NextSiblingElement("object"); 88 92 } 93 */ 94 95 LOAD_PARAM_START_CYCLE(script, object); 96 { 97 LoadParam_CYCLE(object, "object", this, ScriptManager, addObjectToScript) 98 .describe("The name of an object that is needed by a script"); 99 } 100 LOAD_PARAM_END_CYCLE(object); 101 89 102 90 103 scriptList.push_back(currentScript); … … 106 119 } 107 120 108 void ScriptManager::addObjectToScript(const std::string object , LuaScript& script)121 void ScriptManager::addObjectToScript(const std::string object) 109 122 { 110 if(!objectIsInObjectList(object, script))111 script.objectList.push_back(object);123 if(!objectIsInObjectList(object,currentScript)) 124 currentScript.objectList.push_back(object); 112 125 } 113 126 -
branches/script_engine/src/lib/script_engine/script_manager.h
r8163 r8164 39 39 void createScriptList(const TiXmlElement* scripts); 40 40 void setCurrentScriptFile(const std::string& file); 41 void addObjectToScript(const std::string object , LuaScript& script);41 void addObjectToScript(const std::string object); 42 42 43 43 bool fileIsInScriptList(const std::string& file);
Note: See TracChangeset
for help on using the changeset viewer.