Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 30, 2011, 9:31:05 PM (13 years ago)
Author:
landauf
Message:

fixed bug with multiple lines in shell.
adjusted colors in IOConsole and InGameConsole a bit

Location:
code/branches/output/src/libraries/core/command
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/output/src/libraries/core/command/IOConsoleWindows.cc

    r8799 r8801  
    214214
    215215            case Shell::Verbose:         colour = FOREGROUND_INTENSITY | 0              | 0                | FOREGROUND_BLUE; break;
    216             case Shell::VerboseMore:     colour = 0                    | 0              | 0                | FOREGROUND_BLUE; break;
    217             case Shell::VerboseUltra:    colour = 0                    | 0              | 0                | FOREGROUND_BLUE; break;
     216            case Shell::VerboseMore:     colour = FOREGROUND_INTENSITY | 0              | 0                | FOREGROUND_BLUE; break;
     217            case Shell::VerboseUltra:    colour = FOREGROUND_INTENSITY | 0              | 0                | FOREGROUND_BLUE; break;
    218218
    219219            case Shell::Command:         colour = FOREGROUND_INTENSITY | FOREGROUND_RED | 0                | FOREGROUND_BLUE; break;
  • code/branches/output/src/libraries/core/command/Shell.cc

    r8799 r8801  
    3333
    3434#include "Shell.h"
     35
     36#include <boost/preprocessor/stringize.hpp>
    3537
    3638#include "util/Math.h"
     
    4850namespace orxonox
    4951{
     52#pragma message(__FILE__ "("BOOST_PP_STRINGIZE(__LINE__)") : Warning: TODO: add commands again, inspect tcl support (and remove boost include)")
    5053//    SetConsoleCommand("log",     OutputHandler::log    );
    5154//    SetConsoleCommand("error",   OutputHandler::error  ).hide();
     
    251254
    252255    /**
    253         @brief Sends output to the internal output buffer.
     256        @brief Adds multiple lines to the internal output buffer.
    254257    */
    255258    void Shell::addOutput(const std::string& text, LineType type)
    256259    {
     260        std::vector<std::string> lines;
     261        vectorize(text, '\n', &lines);
     262
     263        for (size_t i = 0; i < lines.size(); ++i)
     264            this->addLine(lines[i], type);
     265    }
     266
     267    /**
     268        @brief Adds a line to the internal output buffer.
     269    */
     270    void Shell::addLine(const std::string& line, LineType type)
     271    {
    257272        // yes it was - push the new line to the list
    258         this->outputLines_.push_front(std::make_pair(text, static_cast<LineType>(type)));
     273        this->outputLines_.push_front(std::make_pair(line, static_cast<LineType>(type)));
    259274
    260275        // adjust the scroll position if needed
     
    286301    void Shell::printLine(const std::string& line, OutputLevel level)
    287302    {
    288         this->addOutput(line, static_cast<LineType>(level));
     303        this->addLine(line, static_cast<LineType>(level));
    289304    }
    290305
  • code/branches/output/src/libraries/core/command/Shell.h

    r8799 r8801  
    132132
    133133            void addOutput(const std::string& text, LineType type = DebugOutput);
     134            void addLine(const std::string& line, LineType type = DebugOutput);
    134135            void clearOutput();
    135136
Note: See TracChangeset for help on using the changeset viewer.