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/libraries/core/GraphicsManager.cc

    r6524 r7284  
    5252#include "util/StringUtils.h"
    5353#include "util/SubString.h"
    54 #include "ConsoleCommand.h"
    5554#include "ConfigValueIncludes.h"
    5655#include "CoreIncludes.h"
     
    6261#include "WindowEventListener.h"
    6362#include "XMLFile.h"
     63#include "command/ConsoleCommand.h"
    6464
    6565namespace orxonox
    6666{
     67    static const std::string __CC_printScreen_name = "printScreen";
     68    DeclareConsoleCommand(__CC_printScreen_name, &prototype::void__void);
     69
    6770    class OgreWindowEventListener : public Ogre::WindowEventListener
    6871    {
     
    131134
    132135        Ogre::WindowEventUtilities::removeWindowEventListener(renderWindow_, ogreWindowEventListener_.get());
    133         // TODO: Destroy the console command
     136        ModifyConsoleCommand(__CC_printScreen_name).resetFunction();
    134137
    135138        // Undeclare the resources
     
    290293        boost::filesystem::path folder(ogrePluginsDirectory_);
    291294        // Do some SubString magic to get the comma separated list of plugins
    292         SubString plugins(ogrePlugins_, ",", " ", false, '\\', false, '"', false, '(', ')', false, '\0');
     295        SubString plugins(ogrePlugins_, ",", " ", false, '\\', false, '"', false, '{', '}', false, '\0');
    293296        // Use backslash paths on Windows! file_string() already does that though.
    294297        for (unsigned int i = 0; i < plugins.size(); ++i)
     
    321324
    322325        // add console commands
    323         ccPrintScreen_ = createConsoleCommand(createFunctor(&GraphicsManager::printScreen, this), "printScreen");
    324         CommandExecutor::addConsoleCommandShortcut(ccPrintScreen_);
     326        ModifyConsoleCommand(__CC_printScreen_name).setFunction(&GraphicsManager::printScreen, this);
    325327    }
    326328
Note: See TracChangeset for help on using the changeset viewer.