Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8164 in orxonox.OLD


Ignore:
Timestamp:
Jun 5, 2006, 9:20:48 PM (18 years ago)
Author:
snellen
Message:

changes in script manager

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  
    7474  while( script != NULL)
    7575  {
     76    { // scope to make the Loadparam work
    7677    LoadParam(script, "file", this, ScriptManager, setCurrentScriptFile)
    7778        .describe("the fileName of the script, that should be loaded into this world")
    7879        .defaultValues("");
     80    }
    7981
    8082    if(!currentScript.name.empty()) // if LoadParam didn't fail... fill the object list with the needed objects
    8183    {
    82     object = script->FirstChildElement("object");
     84    /*object = script->FirstChildElement("object");
    8385
    8486    while(object != NULL)
    8587    {
    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("");
    8791      object = object->NextSiblingElement("object");
    8892    }
     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
    89102
    90103    scriptList.push_back(currentScript);
     
    106119 }
    107120
    108 void  ScriptManager::addObjectToScript(const std::string object, LuaScript& script)
     121void  ScriptManager::addObjectToScript(const std::string object)
    109122{
    110   if(!objectIsInObjectList(object,script))
    111     script.objectList.push_back(object);
     123  if(!objectIsInObjectList(object,currentScript))
     124    currentScript.objectList.push_back(object);
    112125}
    113126
  • branches/script_engine/src/lib/script_engine/script_manager.h

    r8163 r8164  
    3939   void  createScriptList(const TiXmlElement* scripts);
    4040   void  setCurrentScriptFile(const std::string& file);
    41    void  addObjectToScript(const std::string object, LuaScript& script);
     41   void  addObjectToScript(const std::string object);
    4242
    4343   bool fileIsInScriptList(const std::string& file);
Note: See TracChangeset for help on using the changeset viewer.