Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10622 in orxonox.OLD


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

merged scriptimprovements back to trunk

Location:
trunk/src
Files:
2 deleted
5 edited
9 copied

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);
  • trunk/src/world_entities/Makefile.am

    r10618 r10622  
    2727                     effects/trail.cc\
    2828                     elements/glgui_energywidget.cc\
    29                      elements/glgui_energywidgetvertical.cc
     29                     elements/glgui_energywidgetvertical.cc\
     30                     script_triggers/script_trigger.cc
    3031
    3132
     
    5152                 effects/wobblegrid.h\
    5253                 elements/glgui_energywidget.h\
    53                  elements/glgui_energywidgetvertical.h
     54                 elements/glgui_energywidgetvertical.h\
     55                 script_triggers/script_trigger.h
    5456
    5557
  • trunk/src/world_entities/WorldEntities.am

    r10618 r10622  
    106106                world_entities/tools/sound_entity.cc \
    107107                world_entities/tools/camera.cc \
    108                 world_entities/tools/script_trigger.cc \
     108                \
     109                world_entities/script_triggers/script_trigger.cc \
     110                world_entities/script_triggers/space_trigger.cc \
     111                world_entities/script_triggers/tick_trigger.cc \
     112                world_entities/script_triggers/time_trigger.cc \
    109113                \
    110114                \
     
    227231                effects/blink.h \
    228232                \
    229                 script_trigger.h \
     233                script_triggers/space_trigger.h \
     234                script_triggers/tick_trigger.h \
     235                script_triggers/time_trigger.h \
    230236                \
    231237                \
Note: See TracChangeset for help on using the changeset viewer.