Changeset 1594 for code/branches/core3
- Timestamp:
- Jun 12, 2008, 4:14:21 PM (17 years ago)
- Location:
- code/branches/core3/src
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core3/src/core/ConfigFileManager.cc
r1543 r1594 38 38 namespace orxonox 39 39 { 40 SetConsoleCommandShortcutExtern(config). setArgumentCompleter(0, autocompletion::configvalueclasses()).setArgumentCompleter(1, autocompletion::configvalues()).setArgumentCompleter(2, autocompletion::configvalue());41 SetConsoleCommandShortcutExtern(tconfig). setArgumentCompleter(0, autocompletion::configvalueclasses()).setArgumentCompleter(1, autocompletion::configvalues()).setArgumentCompleter(2, autocompletion::configvalue());40 SetConsoleCommandShortcutExtern(config).argumentCompleter(0, autocompletion::configvalueclasses()).argumentCompleter(1, autocompletion::configvalues()).argumentCompleter(2, autocompletion::configvalue()); 41 SetConsoleCommandShortcutExtern(tconfig).argumentCompleter(0, autocompletion::configvalueclasses()).argumentCompleter(1, autocompletion::configvalues()).argumentCompleter(2, autocompletion::configvalue()); 42 42 SetConsoleCommandShortcutExtern(reloadConfig); 43 43 SetConsoleCommandShortcutExtern(cleanConfig); 44 SetConsoleCommandShortcutExtern(loadSettings). setArgumentCompleter(0, autocompletion::files());45 SetConsoleCommandShortcutExtern(loadKeybindings). setArgumentCompleter(0, autocompletion::files());44 SetConsoleCommandShortcutExtern(loadSettings).argumentCompleter(0, autocompletion::files()); 45 SetConsoleCommandShortcutExtern(loadKeybindings).argumentCompleter(0, autocompletion::files()); 46 46 47 47 bool config(const std::string& classname, const std::string& varname, const std::string& value) -
code/branches/core3/src/core/ConsoleCommand.cc
r1505 r1594 45 45 } 46 46 47 ConsoleCommand& ConsoleCommand:: setArgumentCompleter(unsigned int param, ArgumentCompleter* completer)47 ConsoleCommand& ConsoleCommand::argumentCompleter(unsigned int param, ArgumentCompleter* completer) 48 48 { 49 49 if (param < 5) -
code/branches/core3/src/core/ConsoleCommand.h
r1583 r1594 38 38 39 39 40 #define SetConsoleCommand(classname, function, bCreateShortcut) \ 41 SetConsoleCommandGeneric(classname##function##consolecommand__, classname, orxonox::createConsoleCommand(orxonox::createFunctor(&classname::function), #function), bCreateShortcut) 40 #define SetConsoleCommand(classname, function, bCreateShortcut) \ 41 SetConsoleCommandAliasMulti(classname, function, #function, 0, bCreateShortcut) 42 #define SetConsoleCommandAlias(classname, function, name, bCreateShortcut) \ 43 SetConsoleCommandAliasMulti(classname, function, name, 0, bCreateShortcut) 44 #define SetConsoleCommandAliasMulti(classname, function, name, number, bCreateShortcut) \ 45 SetConsoleCommandGeneric(classname##function##consolecommand__##number, classname, orxonox::createConsoleCommand(orxonox::createFunctor(&classname::function), name), bCreateShortcut) 42 46 43 47 #define SetConsoleCommandGeneric(fakevariable, classname, command, bCreateShortcut) \ … … 46 50 47 51 #define SetConsoleCommandShortcut(classname, function) \ 48 SetConsoleCommandShortcutGeneric(function##consolecommand__, orxonox::createConsoleCommand(orxonox::createFunctor(&classname::function), #function)) 52 SetConsoleCommandShortcutAliasMulti(classname, function, #function, 0) 53 #define SetConsoleCommandShortcutAlias(classname, function, name) \ 54 SetConsoleCommandShortcutAliasMulti(classname, function, name, 0) 55 #define SetConsoleCommandShortcutAliasMulti(classname, function, name, number) \ 56 SetConsoleCommandShortcutGeneric(function##consolecommand__##number, orxonox::createConsoleCommand(orxonox::createFunctor(&classname::function), name)) 49 57 50 58 #define SetConsoleCommandShortcutExtern(function) \ 51 SetConsoleCommandShortcutGeneric(function##consolecommand__, orxonox::createConsoleCommand(orxonox::createFunctor(&function), #function)) 59 SetConsoleCommandShortcutExternAliasMulti(function, #function, 0) 60 #define SetConsoleCommandShortcutExternAlias(function, name) \ 61 SetConsoleCommandShortcutExternAliasMulti(function, name, 0) 62 #define SetConsoleCommandShortcutExternAliasMulti(function, name, number) \ 63 SetConsoleCommandShortcutGeneric(function##consolecommand__##number, orxonox::createConsoleCommand(orxonox::createFunctor(&function), name)) 52 64 53 65 #define SetConsoleCommandShortcutGeneric(fakevariable, command) \ … … 75 87 ConsoleCommand(FunctorStatic* functor, const std::string& name = ""); 76 88 77 inline ConsoleCommand& setDescription(const std::string& description)89 inline ConsoleCommand& description(const std::string& description) 78 90 { this->ExecutorStatic::setDescription(description); return (*this); } 79 inline ConsoleCommand& setDescriptionParam(int param, const std::string& description)91 inline ConsoleCommand& descriptionParam(int param, const std::string& description) 80 92 { this->ExecutorStatic::setDescriptionParam(param, description); return (*this); } 81 inline ConsoleCommand& setDescriptionReturnvalue(const std::string& description)93 inline ConsoleCommand& descriptionReturnvalue(const std::string& description) 82 94 { this->ExecutorStatic::setDescriptionReturnvalue(description); return (*this); } 83 inline ConsoleCommand& setDefaultValues(const MultiTypeMath& param1)95 inline ConsoleCommand& defaultValues(const MultiTypeMath& param1) 84 96 { this->ExecutorStatic::setDefaultValues(param1); return (*this); } 85 inline ConsoleCommand& setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2)97 inline ConsoleCommand& defaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2) 86 98 { this->ExecutorStatic::setDefaultValues(param1, param2); return (*this); } 87 inline ConsoleCommand& setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3)99 inline ConsoleCommand& defaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3) 88 100 { this->ExecutorStatic::setDefaultValues(param1, param2, param3); return (*this); } 89 inline ConsoleCommand& setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4)101 inline ConsoleCommand& defaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4) 90 102 { this->ExecutorStatic::setDefaultValues(param1, param2, param3, param4); return (*this); } 91 inline ConsoleCommand& setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4, const MultiTypeMath& param5)103 inline ConsoleCommand& defaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4, const MultiTypeMath& param5) 92 104 { this->ExecutorStatic::setDefaultValues(param1, param2, param3, param4, param5); return (*this); } 93 inline ConsoleCommand& setDefaultValue(unsigned int index, const MultiTypeMath& param)105 inline ConsoleCommand& defaultValue(unsigned int index, const MultiTypeMath& param) 94 106 { this->ExecutorStatic::setDefaultValue(index, param); return (*this); } 95 107 96 inline ConsoleCommand& setAccessLevel(AccessLevel::Level level)108 inline ConsoleCommand& accessLevel(AccessLevel::Level level) 97 109 { this->accessLevel_ = level; return (*this); } 98 110 inline AccessLevel::Level getAccessLevel() const 99 111 { return this->accessLevel_; } 100 112 101 ConsoleCommand& setArgumentCompleter(unsigned int param, ArgumentCompleter* completer);113 ConsoleCommand& argumentCompleter(unsigned int param, ArgumentCompleter* completer); 102 114 ArgumentCompleter* getArgumentCompleter(unsigned int param) const; 103 115 … … 110 122 { return this->argumentList_.end(); } 111 123 112 inline ConsoleCommand& setKeybindMode(KeybindMode::Enum mode)124 inline ConsoleCommand& keybindMode(KeybindMode::Enum mode) 113 125 { this->keybindMode_ = mode; return *this; } 114 126 inline KeybindMode::Enum getKeybindMode() const 115 127 { return this->keybindMode_; } 116 128 117 inline ConsoleCommand& setAxisParamIndex(int index)129 inline ConsoleCommand& axisParamIndex(int index) 118 130 { this->axisParamIndex_ = index; return *this; } 119 131 inline int getAxisParamIndex() const 120 132 { return this->axisParamIndex_; } 121 133 122 inline ConsoleCommand& setIsAxisRelative(bool val)134 inline ConsoleCommand& isAxisRelative(bool val) 123 135 { this->bAxisRelative_ = val; return *this; } 124 136 inline int getIsAxisRelative() const -
code/branches/core3/src/core/ConsoleCommandCompilation.cc
r1586 r1594 34 34 namespace orxonox 35 35 { 36 SetConsoleCommandShortcutExtern(source). setArgumentCompleter(0, autocompletion::files());36 SetConsoleCommandShortcutExtern(source).argumentCompleter(0, autocompletion::files()); 37 37 SetConsoleCommandShortcutExtern(echo); 38 38 SetConsoleCommandShortcutExtern(puts); 39 39 40 SetConsoleCommandShortcutExtern(read). setArgumentCompleter(0, autocompletion::files());41 SetConsoleCommandShortcutExtern(append). setArgumentCompleter(0, autocompletion::files());42 SetConsoleCommandShortcutExtern(write). setArgumentCompleter(0, autocompletion::files());40 SetConsoleCommandShortcutExtern(read).argumentCompleter(0, autocompletion::files()); 41 SetConsoleCommandShortcutExtern(append).argumentCompleter(0, autocompletion::files()); 42 SetConsoleCommandShortcutExtern(write).argumentCompleter(0, autocompletion::files()); 43 43 44 44 SetConsoleCommandShortcutExtern(calculate); -
code/branches/core3/src/core/IRC.cc
r1583 r1594 39 39 namespace orxonox 40 40 { 41 SetConsoleCommand(IRC, say, true). setAccessLevel(AccessLevel::User);42 SetConsoleCommand(IRC, msg, false). setAccessLevel(AccessLevel::User);43 SetConsoleCommand(IRC, nick, false). setAccessLevel(AccessLevel::User);41 SetConsoleCommand(IRC, say, true).accessLevel(AccessLevel::User); 42 SetConsoleCommand(IRC, msg, false).accessLevel(AccessLevel::User); 43 SetConsoleCommand(IRC, nick, false).accessLevel(AccessLevel::User); 44 44 45 45 IRC::IRC() -
code/branches/core3/src/core/Shell.cc
r1591 r1594 45 45 SetConsoleCommand(Shell, history, true); 46 46 47 SetConsoleCommandShortcut Generic(log, createConsoleCommand(createFunctor(&OutputHandler::log), "log" ));48 SetConsoleCommandShortcut Generic(error, createConsoleCommand(createFunctor(&OutputHandler::error), "error" ));49 SetConsoleCommandShortcut Generic(warning, createConsoleCommand(createFunctor(&OutputHandler::warning), "warning"));50 SetConsoleCommandShortcut Generic(info, createConsoleCommand(createFunctor(&OutputHandler::info), "info" ));51 SetConsoleCommandShortcut Generic(debug, createConsoleCommand(createFunctor(&OutputHandler::debug), "debug" ));47 SetConsoleCommandShortcut(OutputHandler, log); 48 SetConsoleCommandShortcut(OutputHandler, error); 49 SetConsoleCommandShortcut(OutputHandler, warning); 50 SetConsoleCommandShortcut(OutputHandler, info); 51 SetConsoleCommandShortcut(OutputHandler, debug); 52 52 53 53 Shell::Shell() -
code/branches/core3/src/core/TclBind.cc
r1586 r1594 39 39 namespace orxonox 40 40 { 41 SetConsoleCommandShortcut Generic(tcl, createConsoleCommand(createFunctor(&TclBind::tcl), "tcl"));42 SetConsoleCommandShortcut Generic(bgerror, createConsoleCommand(createFunctor(&TclBind::bgerror), "bgerror"));41 SetConsoleCommandShortcut(TclBind, tcl); 42 SetConsoleCommandShortcut(TclBind, bgerror); 43 43 44 44 TclBind::TclBind() -
code/branches/core3/src/core/TclThreadManager.cc
r1586 r1594 48 48 namespace orxonox 49 49 { 50 SetConsoleCommandShortcut Generic(tclexecute, createConsoleCommand(createFunctor(&TclThreadManager::execute), "tclexecute")).setArgumentCompleter(0, autocompletion::tclthreads());51 SetConsoleCommandShortcut Generic(tclquery, createConsoleCommand(createFunctor(&TclThreadManager::query), "tclquery" )).setArgumentCompleter(0, autocompletion::tclthreads());50 SetConsoleCommandShortcutAlias(TclThreadManager, execute, "tclexecute").argumentCompleter(0, autocompletion::tclthreads()); 51 SetConsoleCommandShortcutAlias(TclThreadManager, query, "tclquery" ).argumentCompleter(0, autocompletion::tclthreads()); 52 52 SetConsoleCommand(TclThreadManager, create, false); 53 SetConsoleCommand(TclThreadManager, destroy, false). setArgumentCompleter(0, autocompletion::tclthreads());54 SetConsoleCommand(TclThreadManager, execute, false). setArgumentCompleter(0, autocompletion::tclthreads());55 SetConsoleCommand(TclThreadManager, query, false). setArgumentCompleter(0, autocompletion::tclthreads());53 SetConsoleCommand(TclThreadManager, destroy, false).argumentCompleter(0, autocompletion::tclthreads()); 54 SetConsoleCommand(TclThreadManager, execute, false).argumentCompleter(0, autocompletion::tclthreads()); 55 SetConsoleCommand(TclThreadManager, query, false).argumentCompleter(0, autocompletion::tclthreads()); 56 56 SetConsoleCommand(TclThreadManager, status, false); 57 SetConsoleCommand(TclThreadManager, dump, false). setArgumentCompleter(0, autocompletion::tclthreads());58 SetConsoleCommand(TclThreadManager, flush, false). setArgumentCompleter(0, autocompletion::tclthreads());57 SetConsoleCommand(TclThreadManager, dump, false).argumentCompleter(0, autocompletion::tclthreads()); 58 SetConsoleCommand(TclThreadManager, flush, false).argumentCompleter(0, autocompletion::tclthreads()); 59 59 60 60 TclThreadManager::TclThreadManager() -
code/branches/core3/src/orxonox/Orxonox.cc
r1591 r1594 85 85 namespace orxonox 86 86 { 87 SetConsoleCommandShortcut(Orxonox, exit). setKeybindMode(KeybindMode::OnPress);88 SetConsoleCommandShortcut(Orxonox, slomo). setAccessLevel(AccessLevel::Offline).setDefaultValue(0, 1.0).setAxisParamIndex(0).setIsAxisRelative(false);89 SetConsoleCommandShortcut(Orxonox, setTimeFactor). setAccessLevel(AccessLevel::Offline).setDefaultValue(0, 1.0);87 SetConsoleCommandShortcut(Orxonox, exit).keybindMode(KeybindMode::OnPress); 88 SetConsoleCommandShortcut(Orxonox, slomo).accessLevel(AccessLevel::Offline).defaultValue(0, 1.0).axisParamIndex(0).isAxisRelative(false); 89 SetConsoleCommandShortcut(Orxonox, setTimeFactor).accessLevel(AccessLevel::Offline).defaultValue(0, 1.0); 90 90 91 91 /** -
code/branches/core3/src/orxonox/hud/HUD.cc
r1586 r1594 49 49 namespace orxonox 50 50 { 51 SetConsoleCommandShortcut(HUD, cycleNavigationFocus). setAccessLevel(AccessLevel::User);52 SetConsoleCommandShortcut(HUD, releaseNavigationFocus). setAccessLevel(AccessLevel::User);53 SetConsoleCommandShortcut(HUD, toggleFPS). setAccessLevel(AccessLevel::User);54 SetConsoleCommandShortcut(HUD, toggleRenderTime). setAccessLevel(AccessLevel::User);51 SetConsoleCommandShortcut(HUD, cycleNavigationFocus).accessLevel(AccessLevel::User); 52 SetConsoleCommandShortcut(HUD, releaseNavigationFocus).accessLevel(AccessLevel::User); 53 SetConsoleCommandShortcut(HUD, toggleFPS).accessLevel(AccessLevel::User); 54 SetConsoleCommandShortcut(HUD, toggleRenderTime).accessLevel(AccessLevel::User); 55 55 56 56 using namespace Ogre; -
code/branches/core3/src/orxonox/objects/Ambient.cc
r1592 r1594 47 47 namespace orxonox 48 48 { 49 SetConsoleCommand (Ambient, setAmbientLightTest, false).setDefaultValues(ColourValue(1, 1, 1, 1)).setAccessLevel(AccessLevel::Offline);49 SetConsoleCommandAlias(Ambient, setAmbientLightTest, "setAmbientLight", false).defaultValues(ColourValue(1, 1, 1, 1)).accessLevel(AccessLevel::Offline); 50 50 51 51 CreateFactory(Ambient); -
code/branches/core3/src/orxonox/objects/SpaceShip.cc
r1592 r1594 54 54 namespace orxonox 55 55 { 56 SetConsoleCommand(SpaceShip, setMaxSpeedTest, false). setAccessLevel(AccessLevel::Debug);57 SetConsoleCommand(SpaceShip, whereAmI, true). setAccessLevel(AccessLevel::User);58 SetConsoleCommand(SpaceShip, moveLongitudinal, true). setAccessLevel(AccessLevel::User).setDefaultValue(0, 1.0f).setAxisParamIndex(0).setKeybindMode(KeybindMode::OnHold);59 SetConsoleCommand(SpaceShip, moveLateral, true). setAccessLevel(AccessLevel::User).setDefaultValue(0, 1.0f).setAxisParamIndex(0).setKeybindMode(KeybindMode::OnHold);60 SetConsoleCommand(SpaceShip, moveYaw, true). setAccessLevel(AccessLevel::User).setDefaultValue(0, 1.0f).setAxisParamIndex(0).setKeybindMode(KeybindMode::OnHold);61 SetConsoleCommand(SpaceShip, movePitch, true). setAccessLevel(AccessLevel::User).setDefaultValue(0, 1.0f).setAxisParamIndex(0).setKeybindMode(KeybindMode::OnHold);62 SetConsoleCommand(SpaceShip, moveRoll, true). setAccessLevel(AccessLevel::User).setDefaultValue(0, 1.0f).setAxisParamIndex(0).setKeybindMode(KeybindMode::OnHold);63 SetConsoleCommand(SpaceShip, fire, true). setAccessLevel(AccessLevel::User).setKeybindMode(KeybindMode::OnHold);64 SetConsoleCommand Generic(test1, SpaceShip, createConsoleCommand(createFunctor(&SpaceShip::setMaxSpeedTest), "setMaxSpeed"), false).setAccessLevel(AccessLevel::Debug);65 SetConsoleCommand Generic(test2, SpaceShip, createConsoleCommand(createFunctor(&SpaceShip::setMaxSpeedTest), "setMaxBlubber"), false).setAccessLevel(AccessLevel::Debug);66 SetConsoleCommand Generic(test3, SpaceShip, createConsoleCommand(createFunctor(&SpaceShip::setMaxSpeedTest), "setRofl"), false).setAccessLevel(AccessLevel::Debug);56 SetConsoleCommand(SpaceShip, setMaxSpeedTest, false).accessLevel(AccessLevel::Debug); 57 SetConsoleCommand(SpaceShip, whereAmI, true).accessLevel(AccessLevel::User); 58 SetConsoleCommand(SpaceShip, moveLongitudinal, true).accessLevel(AccessLevel::User).defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold); 59 SetConsoleCommand(SpaceShip, moveLateral, true).accessLevel(AccessLevel::User).defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold); 60 SetConsoleCommand(SpaceShip, moveYaw, true).accessLevel(AccessLevel::User).defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold); 61 SetConsoleCommand(SpaceShip, movePitch, true).accessLevel(AccessLevel::User).defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold); 62 SetConsoleCommand(SpaceShip, moveRoll, true).accessLevel(AccessLevel::User).defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold); 63 SetConsoleCommand(SpaceShip, fire, true).accessLevel(AccessLevel::User).keybindMode(KeybindMode::OnHold); 64 SetConsoleCommandAliasMulti(SpaceShip, setMaxSpeedTest, "setMaxSpeed", 1, false).accessLevel(AccessLevel::Debug); 65 SetConsoleCommandAliasMulti(SpaceShip, setMaxSpeedTest, "setMaxBlubber", 2, false).accessLevel(AccessLevel::Debug); 66 SetConsoleCommandAliasMulti(SpaceShip, setMaxSpeedTest, "setRofl", 3, false).accessLevel(AccessLevel::Debug); 67 67 68 68 CreateFactory(SpaceShip); -
code/branches/core3/src/orxonox/objects/SpaceShipAI.cc
r1591 r1594 44 44 namespace orxonox 45 45 { 46 SetConsoleCommand(SpaceShipAI, createEnemy, true). setDefaultValue(0, 1);47 SetConsoleCommand(SpaceShipAI, killEnemies, true). setDefaultValue(0, 0);46 SetConsoleCommand(SpaceShipAI, createEnemy, true).defaultValue(0, 1); 47 SetConsoleCommand(SpaceShipAI, killEnemies, true).defaultValue(0, 0); 48 48 49 49 CreateFactory(SpaceShipAI);
Note: See TracChangeset
for help on using the changeset viewer.