Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5129 in orxonox.OLD for trunk/src/util/shell.cc


Ignore:
Timestamp:
Aug 25, 2005, 10:52:11 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: minor extension-addition to the Shell.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/util/shell.cc

    r5128 r5129  
    1717
    1818#include "shell.h"
     19#include "shell_command.h"
    1920
    2021#include "text_engine.h"
     
    2223#include "graphics_engine.h"
    2324#include "event_handler.h"
    24 
    25 #include "load_param.h"
     25#include "debug.h"
    2626#include "class_list.h"
    2727
    2828#include "key_names.h"
    29 #include "debug.h"
    3029#include <stdarg.h>
    3130#include <stdio.h>
     
    4847  this->buffer = new tList<char>;
    4948  this->bufferIterator = this->buffer->getIterator();
     49
     50  this->inputHistory = new tList<char>;
     51  //this->commandList = new tList<ShellCommand>;
    5052
    5153  this->textSize = 15;
     
    7375  for (int i = 1; i < SDLK_LAST; i++)
    7476    evh->subscribe(this, ES_SHELL, i);
     77
     78
     79//  this->registerCommand("clear", Shell::)
    7580}
    7681
     
    105110  Shell::singletonRef = NULL;
    106111}
    107 
    108112
    109113/**
     
    448452  this->addBufferLineStatic("Execute Command: %s\n", this->inputLine);
    449453
     454  char* newCommand = new char[strlen(this->inputLine)+1];
     455  strcpy(newCommand, this->inputLine);
     456  this->inputHistory->add(newCommand);
     457
    450458  if (!strcmp(this->inputLine, "clear"))
    451459  {
     
    501509    else if (event.type == SDLK_RETURN)
    502510      this->executeCommand();
     511    /*
     512    else if (event.type == SDLK_UP)
     513    {
     514//      this->flushInputLine();
     515      tIterator<char>* iterator = this->commandList->getIterator();
     516      char* command = iterator->lastElement();
     517      while (command)
     518      {
     519        if (!strcmp (command, inputLine))
     520        {
     521          inputLine = iterator->prevElement();
     522          return;
     523        }
     524        command = iterator->prevElement();
     525      }
     526      inputLine = iterator->lastElement();
     527    }
     528    */
    503529    else if (likely(event.type < 127))
    504530    {
Note: See TracChangeset for help on using the changeset viewer.