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:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • 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);
Note: See TracChangeset for help on using the changeset viewer.