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

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/overlays/InGameConsole.cc

    r6502 r7284  
    4545#include "util/Math.h"
    4646#include "util/DisplayStringConversions.h"
     47#include "util/ScopedSingletonManager.h"
    4748#include "core/CoreIncludes.h"
    4849#include "core/ConfigValueIncludes.h"
    49 #include "core/ConsoleCommand.h"
    50 #include "core/ScopedSingletonManager.h"
     50#include "core/command/ConsoleCommand.h"
    5151#include "core/input/InputManager.h"
    5252#include "core/input/InputState.h"
     
    5858    const float CHAR_WIDTH = 7.45f; // fix this please - determine the char-width dynamically
    5959
    60     SetConsoleCommand(InGameConsole, openConsole, true);
    61     SetConsoleCommand(InGameConsole, closeConsole, true);
     60    SetConsoleCommand("InGameConsole", "openConsole", &InGameConsole::openConsole).addShortcut();
     61    SetConsoleCommand("InGameConsole", "closeConsole", &InGameConsole::closeConsole).addShortcut();
    6262
    6363    ManageScopedSingleton(InGameConsole, ScopeID::Graphics, false);
  • code/trunk/src/orxonox/overlays/InGameConsole.h

    r6417 r7284  
    3737#include "util/OgreForwardRefs.h"
    3838#include "util/Singleton.h"
    39 #include "core/Shell.h"
    4039#include "core/WindowEventListener.h"
     40#include "core/command/Shell.h"
    4141
    4242namespace orxonox
  • code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc

    r7184 r7284  
    4848#include "core/CoreIncludes.h"
    4949#include "core/XMLPort.h"
    50 #include "core/ConsoleCommand.h"
     50#include "core/command/ConsoleCommand.h"
    5151
    5252#include "OverlayGroup.h"
     
    5757    std::map<std::string, OrxonoxOverlay*> OrxonoxOverlay::overlays_s;
    5858
    59     SetConsoleCommand(OrxonoxOverlay, scaleOverlay, false).accessLevel(AccessLevel::User);
    60     SetConsoleCommand(OrxonoxOverlay, scrollOverlay, false).accessLevel(AccessLevel::User);
    61     SetConsoleCommand(OrxonoxOverlay, toggleVisibility, false).accessLevel(AccessLevel::User);
    62     SetConsoleCommand(OrxonoxOverlay, rotateOverlay, false).accessLevel(AccessLevel::User);
     59    SetConsoleCommand("OrxonoxOverlay", "scaleOverlay",     &OrxonoxOverlay::scaleOverlay);
     60    SetConsoleCommand("OrxonoxOverlay", "scrollOverlay",    &OrxonoxOverlay::scrollOverlay);
     61    SetConsoleCommand("OrxonoxOverlay", "toggleVisibility", &OrxonoxOverlay::toggleVisibility);
     62    SetConsoleCommand("OrxonoxOverlay", "rotateOverlay",    &OrxonoxOverlay::rotateOverlay);
    6363
    6464    OrxonoxOverlay::OrxonoxOverlay(BaseObject* creator)
  • code/trunk/src/orxonox/overlays/OverlayGroup.cc

    r6417 r7284  
    3434#include "OverlayGroup.h"
    3535
    36 #include "core/ConsoleCommand.h"
    3736#include "core/CoreIncludes.h"
    3837#include "core/XMLPort.h"
     38#include "core/command/ConsoleCommand.h"
    3939#include "OrxonoxOverlay.h"
    4040
     
    4343    CreateFactory(OverlayGroup);
    4444
    45     SetConsoleCommand(OverlayGroup, toggleVisibility, false).accessLevel(AccessLevel::User);
    46     SetConsoleCommand(OverlayGroup, scaleGroup, false).accessLevel(AccessLevel::User);
    47     SetConsoleCommand(OverlayGroup, scrollGroup, false).accessLevel(AccessLevel::User);
     45    SetConsoleCommand("OverlayGroup", "toggleVisibility", &OverlayGroup::toggleVisibility);
     46    SetConsoleCommand("OverlayGroup", "scaleGroup",       &OverlayGroup::scaleGroup);
     47    SetConsoleCommand("OverlayGroup", "scrollGroup",      &OverlayGroup::scrollGroup);
    4848
    4949    OverlayGroup::OverlayGroup(BaseObject* creator)
Note: See TracChangeset for help on using the changeset viewer.