Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 9, 2008, 4:25:52 AM (16 years ago)
Author:
landauf
Message:

merged core3 back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/core/Shell.cc

    r1540 r1747  
    3434#include "ConsoleCommand.h"
    3535#include "input/InputInterfaces.h"
     36#include "util/OutputHandler.h"
    3637
    3738#define SHELL_UPDATE_LISTENERS(function) \
     
    4344    SetConsoleCommand(Shell, clearShell, true);
    4445    SetConsoleCommand(Shell, history, true);
     46
     47    SetConsoleCommandShortcut(OutputHandler, log);
     48    SetConsoleCommandShortcut(OutputHandler, error);
     49    SetConsoleCommandShortcut(OutputHandler, warning);
     50    SetConsoleCommandShortcut(OutputHandler, info);
     51    SetConsoleCommandShortcut(OutputHandler, debug);
    4552
    4653    Shell::Shell()
     
    6168
    6269        this->outputBuffer_.registerListener(this);
     70        OutputHandler::getOutStream().setOutputBuffer(this->outputBuffer_);
    6371
    6472        this->setConfigValues();
     
    8290    void Shell::setConfigValues()
    8391    {
    84         SetConfigValue(maxHistoryLength_, 100);
    85         SetConfigValue(historyOffset_, 0);
     92        SetConfigValue(maxHistoryLength_, 100).callback(this, &Shell::commandHistoryLengthChanged);
     93        SetConfigValue(historyOffset_, 0).callback(this, &Shell::commandHistoryOffsetChanged);
    8694        SetConfigValueVector(commandHistory_, std::vector<std::string>());
    87 
     95    }
     96
     97    void Shell::commandHistoryOffsetChanged()
     98    {
    8899        if (this->historyOffset_ >= this->maxHistoryLength_)
    89100            this->historyOffset_ = 0;
     101    }
     102
     103    void Shell::commandHistoryLengthChanged()
     104    {
     105        this->commandHistoryOffsetChanged();
    90106
    91107        while (this->commandHistory_.size() > this->maxHistoryLength_)
Note: See TracChangeset for help on using the changeset viewer.