Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 5, 2008, 3:40:10 AM (16 years ago)
Author:
landauf
Message:
  • added exit command: quits orxonox (no, it's not a hidden segfault :D)
  • added exec command: executes files (that contain other commands)

funny: use the log function to write commands into orxonox.log and then use 'exec orxonox.log' - it works. I've even added a recursion-blocker to avoid an (almost) endless loop after logging 'exec orxonox.log' ;)

I'm currently thinking about more complex commands (what about delayed commands? or commands with returnvalue and a pipeline symbol?).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core2/src/orxonox/Orxonox.cc

    r972 r993  
    8686#include "objects/test3.h"
    8787
     88#include "core/ConsoleCommand.h"
    8889#include "core/CommandExecutor.h"
    8990#include "core/InputBuffer.h"
     
    9394namespace orxonox
    9495{
     96    ConsoleCommandShortcut(Orxonox, exit, AccessLevel::None);
     97
    9598    class Testlistener : public InputBufferListener
    9699    {
     
    150153
    151154        mKeyboard->capture();
    152         return !mKeyboard->isKeyDown(OIS::KC_ESCAPE);
     155        return (!mKeyboard->isKeyDown(OIS::KC_ESCAPE) && !Orxonox::getSingleton()->shouldExit());
    153156      }
    154157/*
     
    185188    this->frameListener_ = 0;
    186189    this->root_ = 0;
     190    this->bExit_ = false;
    187191  }
    188192
Note: See TracChangeset for help on using the changeset viewer.