- Timestamp:
- Apr 19, 2007, 4:06:51 PM (18 years ago)
- Location:
- trunk/src
- Files:
-
- 10 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/defs/orxonox_globals.h
r10618 r10638 80 80 #define CONFIG_NAME_PLAYER_UP "Up" 81 81 #define CONFIG_NAME_PLAYER_DOWN "Down" 82 82 #define CONFIG_NAME_PLAYER_STRAFE_LEFT "StrafeLeft" 83 #define CONFIG_NAME_PLAYER_STRAFE_RIGHT "StrafeRight" 84 #define CONFIG_NAME_PLAYER_JUMP "Jump" 85 86 #define CONFIG_NAME_PLAYER_ACTION "Action" 83 87 #define CONFIG_NAME_PLAYER_FIRE "Fire" 88 #define CONFIG_NAME_PLAYER_FIRE2 "Fire2" 84 89 #define CONFIG_NAME_PLAYER_NEXT_WEAPON "Next-Weapon" 85 90 #define CONFIG_NAME_PLAYER_PREV_WEAPON "Previous-Weapon" -
trunk/src/lib/event/key_mapper.cc
r10618 r10638 46 46 int KeyMapper::PEV_STRAFE_RIGHT = EV_UNKNOWN; 47 47 int KeyMapper::PEV_JUMP = EV_UNKNOWN; 48 int KeyMapper::PEV_ACTION = EV_UNKNOWN; 48 49 49 50 int KeyMapper::PEV_FIRE1 = EV_UNKNOWN; … … 82 83 {&KeyMapper::PEV_ROLL_RIGHT, CONFIG_NAME_PLAYER_ROLL_LEFT, SDLK_z}, 83 84 {&KeyMapper::PEV_ROLL_LEFT, CONFIG_NAME_PLAYER_ROLL_RIGHT, SDLK_c}, 84 {&KeyMapper::PEV_STRAFE_LEFT, "StrafeLeft", SDLK_q}, 85 {&KeyMapper::PEV_STRAFE_RIGHT, "StrafeRight", SDLK_e}, 86 {&KeyMapper::PEV_JUMP, "Jump", SDLK_SPACE}, 85 {&KeyMapper::PEV_STRAFE_LEFT, CONFIG_NAME_PLAYER_STRAFE_LEFT, SDLK_q}, 86 {&KeyMapper::PEV_STRAFE_RIGHT, CONFIG_NAME_PLAYER_STRAFE_RIGHT, SDLK_e}, 87 {&KeyMapper::PEV_JUMP, CONFIG_NAME_PLAYER_JUMP, SDLK_SPACE}, 88 {&KeyMapper::PEV_ACTION, CONFIG_NAME_PLAYER_ACTION, SDLK_u}, 87 89 88 90 {&KeyMapper::PEV_FIRE1, CONFIG_NAME_PLAYER_FIRE, EV_MOUSE_BUTTON_LEFT}, 89 {&KeyMapper::PEV_FIRE2, "Fire2",EV_MOUSE_BUTTON_RIGHT},91 {&KeyMapper::PEV_FIRE2, CONFIG_NAME_PLAYER_FIRE2, EV_MOUSE_BUTTON_RIGHT}, 90 92 {&KeyMapper::PEV_NEXT_WEAPON, CONFIG_NAME_PLAYER_NEXT_WEAPON, EV_MOUSE_BUTTON_WHEELUP}, 91 93 {&KeyMapper::PEV_PREVIOUS_WEAPON, CONFIG_NAME_PLAYER_PREV_WEAPON, EV_MOUSE_BUTTON_WHEELDOWN}, -
trunk/src/lib/event/key_mapper.h
r9869 r10638 57 57 58 58 static int PEV_JUMP; //!< jump 59 static int PEV_ACTION; //!< the action (or use) key 59 60 60 61 static int PEV_FIRE1; //!< fire button 1 -
trunk/src/lib/script_engine/script.cc
r10622 r10638 409 409 this->registerClass("TickTrigger"); 410 410 this->registerClass("TimeTrigger"); 411 this->registerClass("ActionTrigger"); 412 411 413 412 414 return success; -
trunk/src/world_entities/WorldEntities.am
r10622 r10638 111 111 world_entities/script_triggers/tick_trigger.cc \ 112 112 world_entities/script_triggers/time_trigger.cc \ 113 world_entities/script_triggers/action_trigger.cc \ 113 114 \ 114 115 \ … … 234 235 script_triggers/tick_trigger.h \ 235 236 script_triggers/time_trigger.h \ 237 script_triggers/action_trigger.h \ 236 238 \ 237 239 \ -
trunk/src/world_entities/script_triggers/script_trigger.cc
r10622 r10638 104 104 105 105 106 void ScriptTrigger::execute Action(float timestep)106 void ScriptTrigger::executeScriptFunction(float timestep) 107 107 { 108 108 if(executionStopped && scriptIsOk) // If the script has been loaded correctly but something is wrong with the settings of the trigger … … 114 114 if(scriptIsOk) 115 115 { 116 //testScriptingFramework();117 116 if(!(script->selectFunction(this->functionName,returnCount)) ) 118 117 { … … 166 165 } 167 166 } 168 169 /*170 void ScriptTrigger::testScriptingFramework()171 {172 std::string file("lunartest2.lua");173 //get script174 Script* script = State::getScriptManager()->getScriptByFile(file);175 printf("-------------------------- top of the stack:%i\n",lua_gettop(script->getLuaState()));176 177 //execute a function178 printf("----------- main -----------\n");179 std::string main("main");180 if( script->selectFunction(main,3))181 printf("function %s selected\n",main.c_str());182 183 script->pushParam(3.14159,main);184 printf("-------------------------- top of the stack:%i\n",lua_gettop(script->getLuaState()));185 script->executeFunction();186 187 int ret = script->getReturnedInt();188 printf("main returned %i\n",ret);189 190 if(script->getReturnedBool())191 printf("main returned true\n");192 else193 printf("main returned false\n");194 195 float retf = script->getReturnedFloat();196 printf("main returned %f\n",retf);197 198 199 printf("-------------------------- top of the stack:%i\n",lua_gettop(script->getLuaState()));200 //execute a 2nd function201 printf("----------- test -----------\n");202 std::string test("test");203 if( script->selectFunction(test,0))204 printf("function %s selected\n",test.c_str());205 206 script->executeFunction();207 208 209 //if(argc>1) lua_dofile(script.getLuaState(), argv[1]);210 printf("-------------------------- top of the stack:%i\n",lua_gettop(script->getLuaState()));211 212 }*/ -
trunk/src/world_entities/script_triggers/script_trigger.h
r10622 r10638 27 27 28 28 /// DO WORK 29 virtual void tick(float timestep) = 0; 30 virtual void executeAction(float timestep); 31 void testScriptingFramework(); 29 virtual void tick(float timestep){} 30 virtual void executeScriptFunction(float timestep); 32 31 33 32 /// SET MEMBER -
trunk/src/world_entities/script_triggers/space_trigger.cc
r10622 r10638 128 128 if(triggerRemains && scriptCalled ) 129 129 { 130 execute Action(timestep);130 executeScriptFunction(timestep); 131 131 return; 132 132 } … … 136 136 if( !invert && this->distance(target) < radius) 137 137 { 138 //printf("Distance is %f \n", this->distance(target)); 139 executeAction(timestep); 138 executeScriptFunction(timestep); 140 139 scriptCalled = true; 141 140 return; … … 144 143 else if( invert && this->distance(target) > radius) 145 144 { 146 execute Action(timestep);145 executeScriptFunction(timestep); 147 146 scriptCalled = true; 148 147 return; -
trunk/src/world_entities/script_triggers/tick_trigger.cc
r10622 r10638 72 72 if( scriptFinished ) return; 73 73 74 this->execute Action(timestep);74 this->executeScriptFunction(timestep); 75 75 76 76 } -
trunk/src/world_entities/script_triggers/time_trigger.cc
r10622 r10638 102 102 if(currentTime < 0) 103 103 { 104 this->execute Action(timestep);104 this->executeScriptFunction(timestep); 105 105 this->stop(); 106 106 }
Note: See TracChangeset
for help on using the changeset viewer.