Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 18, 2008, 1:28:08 AM (16 years ago)
Author:
landauf
Message:

changed some parts of InGameConsole to make it work with Shell, but I couldn't test it yet as there seems to be a bug in InputBuffer.

File:
1 edited

Legend:

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

    r1313 r1317  
    4848
    4949        this->clearLines();
    50 
     50/*
    5151        this->inputBuffer_.registerListener(this, &Shell::inputChanged, true);
    5252        this->inputBuffer_.registerListener(this, &Shell::execute, '\r', false);
     
    6363        this->inputBuffer_.registerListener(this, &Shell::scroll_up, OIS::KC_PGUP);
    6464        this->inputBuffer_.registerListener(this, &Shell::scroll_down, OIS::KC_PGDOWN);
    65 
     65*/
    6666        this->setConfigValues();
    6767    }
     
    141141    {
    142142        if (this->scrollPosition_)
     143        {
    143144            return this->scrollIterator_;
     145        }
    144146        else
    145             return this->lines_.begin();
     147        {
     148            if ((*this->lines_.begin()) == "" && this->lines_.size() > 1)
     149                return (++this->lines_.begin());
     150            else
     151                return this->lines_.begin();
     152        }
    146153    }
    147154
     
    169176        while (this->outputBuffer_.getLine(&output))
    170177        {
     178            bool newline = false;
     179            if ((*this->lines_.begin()) == "")
     180                newline = true;
     181
    171182            (*this->lines_.begin()) += output;
     183
     184            SHELL_UPDATE_LISTENERS(onlyLastLineChanged);
     185
    172186            this->lines_.insert(this->lines_.begin(), "");
    173187
     
    177191                this->scrollIterator_ = this->lines_.begin();
    178192
    179             SHELL_UPDATE_LISTENERS(linesChanged);
    180             SHELL_UPDATE_LISTENERS(lineAdded);
     193            if (newline)
     194            {
     195                SHELL_UPDATE_LISTENERS(lineAdded);
     196            }
    181197        }
    182198
Note: See TracChangeset for help on using the changeset viewer.