Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10622 in orxonox.OLD for trunk/src/lib


Ignore:
Timestamp:
Apr 6, 2007, 6:54:15 PM (18 years ago)
Author:
snellen
Message:

merged scriptimprovements back to trunk

Location:
trunk/src/lib/script_engine
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/script_engine/script.cc

    r10381 r10622  
    106106   filedest += "scripts/" + directory + file;
    107107
    108    this->addThisScript();
     108   this->addStandartObjects();
    109109   this->registerStandartClasses();
    110110
     
    406406   bool success = false;
    407407
    408    //this->registerClass(std::string("Vector"));
    409     this->registerClass("ScriptTrigger");
    410   //  this->registerClass("AttractorMine");
     408    this->registerClass("SpaceTrigger");
     409    this->registerClass("TickTrigger");
     410    this->registerClass("TimeTrigger");
     411
     412   return success;
     413 }
     414
     415bool Script::addStandartObjects()
     416 {
     417   bool success = true;
     418
     419   this->addThisScript();
    411420
    412421   return success;
  • trunk/src/lib/script_engine/script.h

    r10381 r10622  
    6868    int  reportError(int error);                      //!< Get errormessage from the lua stack and print it.
    6969    bool registerStandartClasses();                   //!< Register all the classes that the script might need
     70    bool addStandartObjects();                        //!< Add all the objects that the script might need
    7071    bool classIsRegistered(const std::string& type);  //!< Checks wheter the class "type" has already been registered with the script
    7172    bool objectIsAdded(const std::string& name);      //!< Checks wheter the object "name" has already been added to the script
  • trunk/src/lib/script_engine/script_manager.cc

    r10618 r10622  
    2525
    2626#include "script.h"
    27 #include "tools/script_trigger.h"
     27#include "script_triggers/script_trigger.h"
    2828#include "luaincl.h"
    2929#include "loading/load_param_xml.h"
     30#include "util/loading/factory.h"
    3031
    3132
     
    5051{
    5152  BaseObject::loadParams(root);
    52   {
    53     LoadParamXML(root, "Scripts", this, ScriptManager, createScripts);
    5453
    55     LoadParamXML(root, "ScriptTriggers", this, ScriptManager, createTriggers);
    56   } // make shure that the loading process is finished
     54  LoadParamXML(root, "Scripts", this, ScriptManager, createScripts);
    5755
    58   // fill the scripts and triggers (doing that on runtime is very slow!)
     56  LoadParamXML(root, "ScriptTriggers", this, ScriptManager, createTriggers);
     57
    5958}
    6059
     
    8584void ScriptManager::createTriggers(const TiXmlElement* triggers)
    8685{
     86   
    8787  LOAD_PARAM_START_CYCLE(triggers, object);
    8888  {
    89     new ScriptTrigger(object);
     89   Factory::fabricate(object);
    9090  }
    9191  LOAD_PARAM_END_CYCLE(object);
Note: See TracChangeset for help on using the changeset viewer.