Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 31, 2010, 3:37:40 AM (14 years ago)
Author:
landauf
Message:

merged consolecommands3 branch back to trunk.

note: the console command interface has changed completely, but the documentation is not yet up to date. just copy an existing command and change it to your needs, it's pretty self-explanatory. also the include files related to console commands are now located in core/command/. in the game it should work exactly like before, except for some changes in the auto-completion.

Location:
code/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/controllers/AIController.cc

    r7184 r7284  
    3131#include "util/Math.h"
    3232#include "core/CoreIncludes.h"
    33 #include "core/Executor.h"
     33#include "core/command/Executor.h"
    3434#include "worldentities/ControllableEntity.h"
    3535#include "worldentities/pawns/Pawn.h"
  • code/trunk/src/orxonox/controllers/ArtificialController.cc

    r7184 r7284  
    3333
    3434#include "util/Math.h"
    35 #include "core/ConsoleCommand.h"
    3635#include "core/CoreIncludes.h"
    3736#include "core/XMLPort.h"
     37#include "core/command/ConsoleCommand.h"
    3838#include "worldentities/ControllableEntity.h"
    3939#include "worldentities/pawns/Pawn.h"
     
    4747namespace orxonox
    4848{
    49     SetConsoleCommand(ArtificialController, formationflight, true);
    50     SetConsoleCommand(ArtificialController, masteraction, true);
    51     SetConsoleCommand(ArtificialController, followme, true);
    52     SetConsoleCommand(ArtificialController, passivebehaviour, true);
    53     SetConsoleCommand(ArtificialController, formationsize, true);
     49    SetConsoleCommand("ArtificialController", "formationflight",  &ArtificialController::formationflight);
     50    SetConsoleCommand("ArtificialController", "masteraction",     &ArtificialController::masteraction);
     51    SetConsoleCommand("ArtificialController", "followme",         &ArtificialController::followme);
     52    SetConsoleCommand("ArtificialController", "passivebehaviour", &ArtificialController::passivebehaviour);
     53    SetConsoleCommand("ArtificialController", "formationsize",    &ArtificialController::formationsize);
    5454
    5555    static const unsigned int STANDARD_MAX_FORMATION_SIZE = 7;
  • code/trunk/src/orxonox/controllers/DroneController.cc

    r7163 r7284  
    3232
    3333#include "core/CoreIncludes.h"
    34 #include "core/Executor.h"
     34#include "core/command/Executor.h"
    3535#include "worldentities/ControllableEntity.h"
    3636
  • code/trunk/src/orxonox/controllers/HumanController.cc

    r7163 r7284  
    3030
    3131#include "core/CoreIncludes.h"
    32 #include "core/ConsoleCommand.h"
     32#include "core/command/ConsoleCommand.h"
    3333#include "worldentities/ControllableEntity.h"
    3434#include "worldentities/pawns/Pawn.h"
     
    4040namespace orxonox
    4141{
    42     SetConsoleCommand(HumanController, moveFrontBack, true).setAsInputCommand();
    43     SetConsoleCommand(HumanController, moveRightLeft, true).setAsInputCommand();
    44     SetConsoleCommand(HumanController, moveUpDown,    true).setAsInputCommand();
    45     SetConsoleCommand(HumanController, rotateYaw,     true).setAsInputCommand();
    46     SetConsoleCommand(HumanController, rotatePitch,   true).setAsInputCommand();
    47     SetConsoleCommand(HumanController, rotateRoll,    true).setAsInputCommand();
    48     SetConsoleCommand(HumanController, fire,          true).keybindMode(KeybindMode::OnHold);
    49     SetConsoleCommand(HumanController, reload,        true);
    50     SetConsoleCommand(HumanController, boost,         true).keybindMode(KeybindMode::OnHold);
    51     SetConsoleCommand(HumanController, greet,         true);
    52     SetConsoleCommand(HumanController, switchCamera,  true);
    53     SetConsoleCommand(HumanController, mouseLook,     true);
    54     SetConsoleCommand(HumanController, suicide,       true);
    55     SetConsoleCommand(HumanController, toggleGodMode, true);
    56     SetConsoleCommand(HumanController, addBots,       true).defaultValues(1);
    57     SetConsoleCommand(HumanController, killBots,      true).defaultValues(0);
    58     SetConsoleCommand(HumanController, dropItems,     true);
    59     SetConsoleCommand(HumanController, useItem,       true);
    60     SetConsoleCommand(HumanController, cycleNavigationFocus,   true);
    61     SetConsoleCommand(HumanController, releaseNavigationFocus, true);
     42    SetConsoleCommand("HumanController", "moveFrontBack",          &HumanController::moveFrontBack ).addShortcut().setAsInputCommand();
     43    SetConsoleCommand("HumanController", "moveRightLeft",          &HumanController::moveRightLeft ).addShortcut().setAsInputCommand();
     44    SetConsoleCommand("HumanController", "moveUpDown",             &HumanController::moveUpDown    ).addShortcut().setAsInputCommand();
     45    SetConsoleCommand("HumanController", "rotateYaw",              &HumanController::rotateYaw     ).addShortcut().setAsInputCommand();
     46    SetConsoleCommand("HumanController", "rotatePitch",            &HumanController::rotatePitch   ).addShortcut().setAsInputCommand();
     47    SetConsoleCommand("HumanController", "rotateRoll",             &HumanController::rotateRoll    ).addShortcut().setAsInputCommand();
     48    SetConsoleCommand("HumanController", "fire",                   &HumanController::fire          ).addShortcut().keybindMode(KeybindMode::OnHold);
     49    SetConsoleCommand("HumanController", "reload",                 &HumanController::reload        ).addShortcut();
     50    SetConsoleCommand("HumanController", "boost",                  &HumanController::boost         ).addShortcut().keybindMode(KeybindMode::OnHold);
     51    SetConsoleCommand("HumanController", "greet",                  &HumanController::greet         ).addShortcut();
     52    SetConsoleCommand("HumanController", "switchCamera",           &HumanController::switchCamera  ).addShortcut();
     53    SetConsoleCommand("HumanController", "mouseLook",              &HumanController::mouseLook     ).addShortcut();
     54    SetConsoleCommand("HumanController", "suicide",                &HumanController::suicide       ).addShortcut();
     55    SetConsoleCommand("HumanController", "toggleGodMode",          &HumanController::toggleGodMode ).addShortcut();
     56    SetConsoleCommand("HumanController", "addBots",                &HumanController::addBots       ).addShortcut().defaultValues(1);
     57    SetConsoleCommand("HumanController", "killBots",               &HumanController::killBots      ).addShortcut().defaultValues(0);
     58    SetConsoleCommand("HumanController", "dropItems",              &HumanController::dropItems     ).addShortcut();
     59    SetConsoleCommand("HumanController", "useItem",                &HumanController::useItem       ).addShortcut();
     60    SetConsoleCommand("HumanController", "cycleNavigationFocus",   &HumanController::cycleNavigationFocus).addShortcut();
     61    SetConsoleCommand("HumanController", "releaseNavigationFocus", &HumanController::releaseNavigationFocus).addShortcut();
    6262
    6363    CreateUnloadableFactory(HumanController);
  • code/trunk/src/orxonox/controllers/NewHumanController.cc

    r7184 r7284  
    3737
    3838#include "core/CoreIncludes.h"
    39 #include "core/ConsoleCommand.h"
     39#include "core/command/ConsoleCommand.h"
    4040#include "worldentities/ControllableEntity.h"
    4141#include "worldentities/pawns/Pawn.h"
     
    4949namespace orxonox
    5050{
    51     SetConsoleCommand(NewHumanController, changeMode, false).keybindMode(KeybindMode::OnPress);
    52     SetConsoleCommand(NewHumanController, accelerate, false).keybindMode(KeybindMode::OnPress);
    53     SetConsoleCommand(NewHumanController, decelerate, false).keybindMode(KeybindMode::OnPress);
    54     SetConsoleCommand(NewHumanController, unfire,      true).keybindMode(KeybindMode::OnRelease);
     51    SetConsoleCommand("NewHumanController", "changeMode", &NewHumanController::changeMode).keybindMode(KeybindMode::OnPress);
     52    SetConsoleCommand("NewHumanController", "accelerate", &NewHumanController::accelerate).keybindMode(KeybindMode::OnPress);
     53    SetConsoleCommand("NewHumanController", "decelerate", &NewHumanController::decelerate).keybindMode(KeybindMode::OnPress);
     54    SetConsoleCommand("NewHumanController", "unfire",     &NewHumanController::unfire    ).keybindMode(KeybindMode::OnRelease).addShortcut();
    5555
    5656    CreateUnloadableFactory(NewHumanController);
Note: See TracChangeset for help on using the changeset viewer.