Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 25, 2008, 9:58:14 PM (16 years ago)
Author:
landauf
Message:

finally got a good approach for the CommandExecutor parser. more to come.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/console/src/core/Shell.cc

    r1334 r1424  
    3232#include "ConfigValueIncludes.h"
    3333#include "CoreSettings.h"
     34#include "ConsoleCommand.h"
    3435
    3536#define SHELL_UPDATE_LISTENERS(function) \
     
    3940namespace orxonox
    4041{
     42    SetConsoleCommand(Shell, clearShell, true);
     43    SetConsoleCommand(Shell, history, true);
     44
    4145    Shell::Shell()
    4246    {
     
    104108    }
    105109
     110    void Shell::clearShell()
     111    {
     112        Shell::getInstance().clearLines();
     113    }
     114
     115    void Shell::history()
     116    {
     117        Shell& instance = Shell::getInstance();
     118
     119        for (int i = instance.historyOffset_; i < (int)instance.commandHistory_.size(); ++i)
     120            instance.addLine(instance.commandHistory_[i], -1);
     121        for (int i =  0; i < (int)instance.historyOffset_; ++i)
     122            instance.addLine(instance.commandHistory_[i], -1);
     123    }
     124
    106125    void Shell::registerListener(ShellListener* listener)
    107126    {
     
    243262    void Shell::hintandcomplete()
    244263    {
     264        this->inputBuffer_.set(CommandExecutor::complete(this->inputBuffer_.get()));
    245265        this->addLine(CommandExecutor::hint(this->inputBuffer_.get()), -1);
    246         this->inputBuffer_.set(CommandExecutor::complete(this->inputBuffer_.get()));
    247266
    248267        this->inputChanged();
Note: See TracChangeset for help on using the changeset viewer.