Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 1, 2006, 2:48:17 PM (19 years ago)
Author:
snellen
Message:

perpared possibility to add the script object to the lua script itself (so that all objects can be added from within the script ), prepared possibility to create triggers form within a script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/single_player_map/src/lib/script_engine/script.cc

    r8783 r8978  
    2424
    2525#include "class_list.h"
     26// uncommet this when the std:string and the const bug is fixed
     27//CREATE_SCRIPTABLE_CLASS(Script, CL_SCRIPT,
     28//                               addMethod("addObject", ExecutorLua2<Script,std::string,std::string>(&Script::addObject))
     29//                               ):
    2630
    2731Script::Script(const TiXmlElement* root)
     
    7377bool Script::loadFile(const std::string& filename)
    7478 {
    75 
     79   this->setName(filename);
    7680   std::string filedest(ResourceManager::getInstance()->getDataDir());
    7781   filedest += "scripts/" + filename;
     
    9397     {
    9498      currentFile = filename;
     99      //this->addThisScript();
    95100      return true;
    96101     }
     
    323328 }
    324329
     330
     331void Script::addThisScript()
     332{
     333  BaseObject* scriptClass = ClassList::getObject("Script", CL_SCRIPT_CLASS);
     334   if (scriptClass != NULL)
     335   {
     336     static_cast<ScriptClass*>(scriptClass)->registerClass(this);
     337     static_cast<ScriptClass*>(scriptClass)->insertObject(this, this, false);
     338   }
     339}
     340
    325341 int Script::reportError(int error)
    326342 {
Note: See TracChangeset for help on using the changeset viewer.