Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 20, 2008, 1:48:40 AM (16 years ago)
Author:
landauf
Message:
  • added colored output in the InGameConsole, depending on the output level (error = red, …).
  • increased performance of InGameConsole and Shell
Location:
code/branches/console/src/core
Files:
5 edited

Legend:

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

    r1317 r1334  
    163163    bool InputBuffer::keyPressed(const OIS::KeyEvent &e)
    164164    {
     165        if (this->keyboard_->isModifierDown(OIS::Keyboard::Alt) && e.key == OIS::KC_TAB)
     166            return true;
     167
    165168        for (std::list<InputBufferListenerTuple>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)
    166169        {
  • code/branches/console/src/core/OutputBuffer.cc

    r1322 r1334  
    7878
    7979        bool eof = this->stream_.eof();
     80        bool fail = this->stream_.fail();
    8081
    8182        if (eof)
     
    8586        }
    8687
    87         return (!eof);
     88        return (!eof && !fail);
    8889    }
    8990
  • code/branches/console/src/core/Script.cc

    r1255 r1334  
    6868    output_ += str;
    6969//    COUT(4) << "Lua_output!:" << std::endl << str << std::endl << "***" << std::endl;
    70     COUT(5) << str << std::endl;
     70    COUT(5) << str;
    7171  }
    7272
  • code/branches/console/src/core/Shell.cc

    r1327 r1334  
    4848        this->historyOffset_ = 0;
    4949        this->finishedLastLine_ = true;
     50        this->bAddOutputLevel_ = false;
    5051
    5152        this->clearLines();
     
    131132    }
    132133
    133     void Shell::addLine(const std::string& line, unsigned int level)
     134    void Shell::addLine(const std::string& line, int level)
    134135    {
    135136        int original_level = OutputHandler::getOutStream().getOutputLevel();
     
    196197            if (this->finishedLastLine_)
    197198            {
     199                if (this->bAddOutputLevel_)
     200                    output.insert(0, 1, (char)OutputHandler::getOutStream().getOutputLevel());
     201
    198202                this->lines_.insert(this->lines_.begin(), output);
    199203
     
    239243    void Shell::hintandcomplete()
    240244    {
    241         this->addLine(CommandExecutor::hint(this->inputBuffer_.get()), 0);
     245        this->addLine(CommandExecutor::hint(this->inputBuffer_.get()), -1);
    242246        this->inputBuffer_.set(CommandExecutor::complete(this->inputBuffer_.get()));
    243247
  • code/branches/console/src/core/Shell.h

    r1326 r1334  
    8383            std::list<std::string>::const_iterator getEndIterator() const;
    8484
    85             void addLine(const std::string& line, unsigned int level);
     85            void addLine(const std::string& line, int level);
    8686            void clearLines();
    8787
     
    9090            inline unsigned int getScrollPosition() const
    9191                { return this->scrollPosition_; }
     92
     93            inline void addOutputLevel(bool bAddOutputLevel)
     94                { this->bAddOutputLevel_ = bAddOutputLevel; }
    9295
    9396        private:
     
    127130            unsigned int historyPosition_;
    128131            unsigned int historyOffset_;
     132            bool bAddOutputLevel_;
    129133    };
    130134}
Note: See TracChangeset for help on using the changeset viewer.