Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 19, 2008, 2:58:22 PM (17 years ago)
Author:
landauf
Message:

Added a command-history to the console. you can scroll through all previously entered commands by pressing [up] key.
The history is stored in orxonox.ini in the section [Shell]. You can configure the maximal amount of stored commands (default: 100).
This allows you to use the history after orxonox was restarted.
The history uses a cyclic vector (with the configured size), meaning the newest command will overwrite the oldest entry (if the maximal size was reached).

additionally I fixed some bugs in ConfigValueContainer and added a mod-function to Math.h, that does basically the same as %, but without returning a negative value in case of a negative input.

-1 % 10 = -1
-11 % 10 = -1

mod(-1, 10) = 9
mod(-11, 10) = 9

File:
1 edited

Legend:

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

    r1321 r1324  
    107107        if (this->bIsVector_)
    108108        {
    109             return this->callFunctionWithIndex(&ConfigValueContainer::set, input.getString());
     109            return this->callFunctionWithIndex(&ConfigValueContainer::set, input.toString());
    110110        }
    111111        else
     
    113113            if (this->tset(input))
    114114            {
    115                 ConfigFileManager::getSingleton()->setValue(this->type_, this->sectionname_, this->varname_, input.getString(), this->value_.isA(MT_string));
     115                ConfigFileManager::getSingleton()->setValue(this->type_, this->sectionname_, this->varname_, input.toString(), this->value_.isA(MT_string));
    116116                return true;
    117117            }
     
    132132            if (this->tset(index, input))
    133133            {
    134                 ConfigFileManager::getSingleton()->setValue(this->type_, this->sectionname_, this->varname_, index, input.getString(), this->value_.isA(MT_string));
     134                ConfigFileManager::getSingleton()->setValue(this->type_, this->sectionname_, this->varname_, index, input.toString(), this->value_.isA(MT_string));
    135135                return true;
    136136            }
     
    152152        if (this->bIsVector_)
    153153        {
    154             return this->callFunctionWithIndex(&ConfigValueContainer::tset, input.getString());
     154            return this->callFunctionWithIndex(&ConfigValueContainer::tset, input.toString());
    155155        }
    156156        else
     
    160160            {
    161161                this->value_ = temp;
    162 
    163162                if (this->identifier_)
    164163                    this->identifier_->updateConfigValues();
     
    191190                {
    192191                    this->valueVector_.push_back(MultiTypeMath());
    193                     ConfigFileManager::getSingleton()->setValue(this->type_, this->sectionname_, this->varname_, i, this->valueVector_[i], this->value_.isA(MT_string));
    194192                }
    195193            }
    196194
    197             MultiTypeMath temp = this->valueVector_[index];
     195            MultiTypeMath temp = this->value_;
    198196            if (temp.assimilate(input))
    199197            {
Note: See TracChangeset for help on using the changeset viewer.