Changeset 8795 for code/branches/output/src
- Timestamp:
- Jul 29, 2011, 10:26:45 PM (13 years ago)
- Location:
- code/branches/output/src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/output/src/libraries/core/command/IOConsolePOSIX.cc
r8729 r8795 37 37 #include "util/Clock.h" 38 38 #include "util/Math.h" 39 #include "util/output/ConsoleWriter.h" 39 40 #include "core/Game.h" 40 41 #include "core/input/InputBuffer.h" … … 74 75 75 76 // Disable standard std::cout logging 76 OutputHandler::getInstance().disableCout();77 ConsoleWriter::getInstance().disable(); 77 78 // Redirect std::cout to an ostringstream 78 79 // (Other part is in the initialiser list) … … 88 89 std::cout.flush(); 89 90 if (!this->origCout_.str().empty()) 90 this->shell_->addOutput(this->origCout_.str(), Shell:: None);91 this->shell_->addOutput(this->origCout_.str(), Shell::Cout); 91 92 // Erase input and status lines 92 93 this->cout_ << "\033[1G\033[J"; … … 102 103 std::cout.rdbuf(this->cout_.rdbuf()); 103 104 // Enable standard std::cout logging again 104 OutputHandler::getInstance().enableCout();105 ConsoleWriter::getInstance().enable(); 105 106 } 106 107 … … 229 230 if (!this->origCout_.str().empty()) 230 231 { 231 this->shell_->addOutput(this->origCout_.str(), Shell:: None);232 this->shell_->addOutput(this->origCout_.str(), Shell::Cout); 232 233 this->origCout_.str(""); 233 234 } … … 239 240 switch (type) 240 241 { 241 case Shell::Error: this->cout_ << "\033[91m"; break; 242 case Shell::Warning: this->cout_ << "\033[93m"; break; 243 case Shell::Info: this->cout_ << "\033[90m"; break; 244 case Shell::Debug: this->cout_ << "\033[90m"; break; 245 case Shell::Verbose: this->cout_ << "\033[90m"; break; 246 case Shell::Ultra: this->cout_ << "\033[90m"; break; 247 case Shell::Command: this->cout_ << "\033[36m"; break; 248 case Shell::Hint: this->cout_ << "\033[33m"; break; 249 case Shell::TDebug: this->cout_ << "\033[95m"; break; 250 default: break; 242 case Shell::DebugOutput: this->cout_ << "\033[0m"; break; 243 244 case Shell::UserError: this->cout_ << "\033[91m"; break; 245 case Shell::UserWarning: this->cout_ << "\033[93m"; break; 246 case Shell::UserStatus: this->cout_ << "\033[92m"; break; 247 case Shell::UserInfo: this->cout_ << "\033[96m"; break; 248 249 case Shell::InternalError: this->cout_ << "\033[31m"; break; 250 case Shell::InternalWarning: this->cout_ << "\033[33m"; break; 251 case Shell::InternalStatus: this->cout_ << "\033[32m"; break; 252 case Shell::InternalInfo: this->cout_ << "\033[36m"; break; 253 254 case Shell::Verbose: this->cout_ << "\033[94m"; break; 255 case Shell::VerboseMore: this->cout_ << "\033[34m"; break; 256 case Shell::VerboseUltra: this->cout_ << "\033[34m"; break; 257 258 case Shell::Command: this->cout_ << "\033[95m"; break; 259 case Shell::Hint: this->cout_ << "\033[35m"; break; 260 261 default: this->cout_ << "\033[37m"; break; 251 262 } 252 263 -
code/branches/output/src/libraries/core/command/IOConsoleWindows.cc
r8729 r8795 34 34 #include "util/Clock.h" 35 35 #include "util/Math.h" 36 #include "util/output/ConsoleWriter.h" 36 37 #include "core/Game.h" 37 38 #include "core/input/InputBuffer.h" … … 52 53 { 53 54 // Disable standard this->cout_ logging 54 OutputHandler::getInstance().disableCout();55 ConsoleWriter::getInstance().disable(); 55 56 // Redirect std::cout to an ostringstream 56 57 // (Other part is in the initialiser list) … … 95 96 std::cout.flush(); 96 97 if (!this->origCout_.str().empty()) 97 this->shell_->addOutput(this->origCout_.str(), Shell:: None);98 this->shell_->addOutput(this->origCout_.str(), Shell::Cout); 98 99 99 100 this->shell_->unregisterListener(this); … … 108 109 std::cout.rdbuf(this->cout_.rdbuf()); 109 110 // Enable standard this->cout_ logging again 110 OutputHandler::getInstance().enableCout();111 ConsoleWriter::getInstance().enable(); 111 112 112 113 resetTerminalMode(); … … 188 189 if (!this->origCout_.str().empty()) 189 190 { 190 this->shell_->addOutput(this->origCout_.str(), Shell:: None);191 this->shell_->addOutput(this->origCout_.str(), Shell::Cout); 191 192 this->origCout_.str(""); 192 193 } … … 200 201 switch (type) 201 202 { 202 case Shell::Error: colour = FOREGROUND_INTENSITY | FOREGROUND_RED; break; 203 case Shell::Warning: colour = FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_RED; break; 204 case Shell::Info: 205 case Shell::Debug: 206 case Shell::Verbose: 207 case Shell::Ultra: colour = FOREGROUND_INTENSITY ; break; 208 case Shell::Command: colour = FOREGROUND_GREEN | FOREGROUND_BLUE; break; 209 case Shell::Hint: colour = FOREGROUND_GREEN | FOREGROUND_RED ; break; 210 case Shell::TDebug: colour = FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_BLUE; break; 211 default: colour = FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE; break; 203 case Shell::DebugOutput: colour = FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE; break; 204 205 case Shell::UserError: colour = FOREGROUND_INTENSITY | FOREGROUND_RED | 0 | 0 ; break; 206 case Shell::UserWarning: colour = FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN | 0 ; break; 207 case Shell::UserStatus: colour = FOREGROUND_INTENSITY | 0 | FOREGROUND_GREEN | 0 ; break; 208 case Shell::UserInfo: colour = FOREGROUND_INTENSITY | 0 | FOREGROUND_GREEN | FOREGROUND_BLUE; break; 209 210 case Shell::InternalError: colour = 0 | FOREGROUND_RED | 0 | 0 ; break; 211 case Shell::InternalWarning: colour = 0 | FOREGROUND_RED | FOREGROUND_GREEN | 0 ; break; 212 case Shell::InternalStatus: colour = 0 | 0 | FOREGROUND_GREEN | 0 ; break; 213 case Shell::InternalInfo: colour = 0 | 0 | FOREGROUND_GREEN | FOREGROUND_BLUE; break; 214 215 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; 218 219 case Shell::Command: colour = FOREGROUND_INTENSITY | FOREGROUND_RED | 0 | FOREGROUND_BLUE; break; 220 case Shell::Hint: colour = 0 | FOREGROUND_RED | 0 | FOREGROUND_BLUE; break; 221 222 default: colour = 0 | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE; break; 212 223 } 213 224 -
code/branches/output/src/libraries/core/command/Shell.cc
r8729 r8795 35 35 36 36 #include "util/Math.h" 37 #include "util/OutputHandler.h"38 37 #include "util/StringUtils.h" 39 38 #include "util/SubString.h" 39 #include "util/output/MemoryWriter.h" 40 40 #include "core/CoreIncludes.h" 41 41 #include "core/ConfigFileManager.h" … … 48 48 namespace orxonox 49 49 { 50 SetConsoleCommand("log", OutputHandler::log );51 SetConsoleCommand("error", OutputHandler::error ).hide();52 SetConsoleCommand("warning", OutputHandler::warning).hide();53 SetConsoleCommand("info", OutputHandler::info ).hide();54 SetConsoleCommand("debug", OutputHandler::debug ).hide();50 // SetConsoleCommand("log", OutputHandler::log ); 51 // SetConsoleCommand("error", OutputHandler::error ).hide(); 52 // SetConsoleCommand("warning", OutputHandler::warning).hide(); 53 // SetConsoleCommand("info", OutputHandler::info ).hide(); 54 // SetConsoleCommand("debug", OutputHandler::debug ).hide(); 55 55 56 56 unsigned int Shell::cacheSize_s; 57 57 58 58 /** 59 @brief Constructor: Initializes the values and registers itself at OutputHandler.59 @brief Constructor: Initializes the values. 60 60 @param consoleName The name of the shell - used to define the name of the soft-debug-level config-value 61 61 @param bScrollable If true, the user is allowed to scroll through the output-lines 62 62 */ 63 63 Shell::Shell(const std::string& consoleName, bool bScrollable) 64 : OutputListener(consoleName) 65 , inputBuffer_(new InputBuffer()) 64 : inputBuffer_(new InputBuffer()) 66 65 , consoleName_(consoleName) 67 66 , bScrollable_(bScrollable) … … 73 72 this->historyPosition_ = 0; 74 73 this->historyOffset_ = 0; 75 this->bFinishedLastLine_ = true;76 74 77 75 this->clearOutput(); … … 81 79 ConfigFileManager::getInstance().setFilename(ConfigFileType::CommandHistory, "commandHistory.ini"); 82 80 83 // Use a stringstream object to buffer the output84 this->outputStream_ = &this->outputBuffer_;85 86 81 this->setConfigValues(); 87 82 88 83 // Get the previous output and add it to the Shell 89 OutputHandler::OutputVector::const_iterator it = OutputHandler::getInstance().getOutput().begin(); 90 for (;it != OutputHandler::getInstance().getOutput().end(); ++it) 91 { 92 if (it->first <= debugLevel_) 93 { 94 this->outputBuffer_ << it->second; 95 this->outputChanged(it->first); 96 } 97 } 98 99 // Register the shell as output listener 100 OutputHandler::getInstance().registerOutputListener(this); 101 OutputHandler::getInstance().setSoftDebugLevel(consoleName_, debugLevel_); 102 } 103 104 /** 105 @brief Destructor: Unregisters the shell from OutputHandler. 84 MemoryWriter::getInstance().resendOutput(this); 85 } 86 87 /** 88 @brief Destructor 106 89 */ 107 90 Shell::~Shell() 108 91 { 109 OutputHandler::getInstance().unregisterOutputListener(this);110 92 this->inputBuffer_->destroy(); 111 93 } … … 113 95 namespace DefaultLogLevel 114 96 { 115 const OutputLevel ::Value Dev = OutputLevel::Info;116 const OutputLevel ::Value User = OutputLevel::Error;97 const OutputLevel Dev = level::internal_warning; 98 const OutputLevel User = level::user_info; 117 99 } 118 100 … … 130 112 131 113 // Choose the default level according to the path Orxonox was started (build directory or not) 132 OutputLevel ::ValuedefaultDebugLevel = (PathConfig::buildDirectoryRun() ? DefaultLogLevel::Dev : DefaultLogLevel::User);114 OutputLevel defaultDebugLevel = (PathConfig::buildDirectoryRun() ? DefaultLogLevel::Dev : DefaultLogLevel::User); 133 115 SetConfigValueExternal(debugLevel_, "OutputHandler", "debugLevel" + consoleName_, defaultDebugLevel) 134 116 .description("The maximum level of debug output shown in the " + consoleName_); 135 OutputHandler::getInstance().setSoftDebugLevel(consoleName_,debugLevel_);117 this->setLevelMax(this->debugLevel_); 136 118 } 137 119 … … 172 154 else 173 155 { 174 OutputLevel ::Valuelevel = (value ? DefaultLogLevel::Dev : DefaultLogLevel::User);156 OutputLevel level = (value ? DefaultLogLevel::Dev : DefaultLogLevel::User); 175 157 ModifyConfigValueExternal(debugLevel_, "debugLevel" + consoleName_, tset, level); 176 158 } … … 256 238 void Shell::addOutput(const std::string& text, LineType type) 257 239 { 258 this->outputBuffer_ << text; 259 this->outputChanged(type); 240 // yes it was - push the new line to the list 241 this->outputLines_.push_front(std::make_pair(text, static_cast<LineType>(type))); 242 243 // adjust the scroll position if needed 244 if (this->scrollPosition_) 245 this->scrollPosition_++; 246 else 247 this->scrollIterator_ = this->outputLines_.begin(); 248 249 if (!this->scrollPosition_) 250 this->updateListeners<&ShellListener::lineAdded>(); 260 251 } 261 252 … … 269 260 270 261 this->scrollPosition_ = 0; 271 this->bFinishedLastLine_ = true;272 262 273 263 this->updateListeners<&ShellListener::linesChanged>(); 264 } 265 266 /** 267 @brief Inherited from BaseWriter (LogListener), called if a new line of output was sent. 268 */ 269 void Shell::printLine(const std::string& line, OutputLevel level) 270 { 271 this->addOutput(line, static_cast<LineType>(level)); 274 272 } 275 273 … … 323 321 324 322 /** 325 @brief Called by OutputHandler or internally whenever output was sent to the output buffer. Reads from the buffer and writes the new output-lines to the list.326 */327 void Shell::outputChanged(int lineType)328 {329 bool newline = false;330 do331 {332 // get the first line from the buffer333 std::string output;334 std::getline(this->outputBuffer_, output);335 336 // check the state of the buffer337 bool eof = this->outputBuffer_.eof();338 bool fail = this->outputBuffer_.fail();339 if (eof)340 this->outputBuffer_.flush(); // check if more output was received in the meantime341 if (eof || fail)342 this->outputBuffer_.clear(); // clear the error flags343 344 // the line is terminated with a line-break if neither an error occurred nor the end of the file was reached345 newline = (!eof && !fail);346 347 // no output retrieved - break the loop348 if (!newline && output.empty())349 break;350 351 // check if the last line was terminated with a line-break352 if (this->bFinishedLastLine_)353 {354 // yes it was - push the new line to the list355 this->outputLines_.push_front(std::make_pair(output, static_cast<LineType>(lineType)));356 357 // adjust the scroll position if needed358 if (this->scrollPosition_)359 this->scrollPosition_++;360 else361 this->scrollIterator_ = this->outputLines_.begin();362 363 if (!this->scrollPosition_)364 this->updateListeners<&ShellListener::lineAdded>();365 }366 else367 {368 // no it wasn't - add the new output to the last line369 this->outputLines_.front().first += output;370 this->updateListeners<&ShellListener::onlyLastLineChanged>();371 }372 373 // remember if the last line was terminated with a line-break374 this->bFinishedLastLine_ = newline;375 376 } while (newline); // loop as long as more lines are in the buffer377 }378 379 /**380 323 @brief Clears the text in the input buffer. 381 324 */ … … 412 355 switch (error) 413 356 { 414 case CommandExecutor::Error: this-> outputBuffer_ << "Error: Can't execute \"" << this->inputBuffer_->get() << "\", command doesn't exist. (S)" << std::endl; break;415 case CommandExecutor::Incomplete: this-> outputBuffer_ << "Error: Can't execute \"" << this->inputBuffer_->get() << "\", not enough arguments given. (S)" << std::endl; break;416 case CommandExecutor::Deactivated: this-> outputBuffer_ << "Error: Can't execute \"" << this->inputBuffer_->get() << "\", command is not active. (S)" << std::endl; break;417 case CommandExecutor::Denied: this-> outputBuffer_ << "Error: Can't execute \"" << this->inputBuffer_->get() << "\", access denied. (S)" << std::endl; break;357 case CommandExecutor::Error: this->addOutput("Error: Can't execute \"" + this->inputBuffer_->get() + "\", command doesn't exist. (S)", UserError); break; 358 case CommandExecutor::Incomplete: this->addOutput("Error: Can't execute \"" + this->inputBuffer_->get() + "\", not enough arguments given. (S)", UserError); break; 359 case CommandExecutor::Deactivated: this->addOutput("Error: Can't execute \"" + this->inputBuffer_->get() + "\", command is not active. (S)", UserError); break; 360 case CommandExecutor::Denied: this->addOutput("Error: Can't execute \"" + this->inputBuffer_->get() + "\", access denied. (S)", UserError); break; 418 361 } 419 this->outputChanged(Error);420 362 } 421 363 else if (result != "") 422 364 { 423 this->outputBuffer_ << result << std::endl; 424 this->outputChanged(Command); 365 this->addOutput(result, Command); 425 366 } 426 367 … … 432 373 { 433 374 this->inputBuffer_->set(CommandExecutor::evaluate(this->inputBuffer_->get()).complete()); 434 this->outputBuffer_ << CommandExecutor::evaluate(this->inputBuffer_->get()).hint() << std::endl; 435 this->outputChanged(Hint); 375 this->addOutput(CommandExecutor::evaluate(this->inputBuffer_->get()).hint(), Hint); 436 376 437 377 this->inputChanged(); -
code/branches/output/src/libraries/core/command/Shell.h
r8729 r8795 48 48 #include <vector> 49 49 50 #include "util/ OutputHandler.h"50 #include "util/output/BaseWriter.h" 51 51 #include "core/Core.h" 52 52 #include "core/OrxonoxClass.h" … … 78 78 @brief The Shell is the logical component of the console that displays output to the user and allows him to enter commands. 79 79 80 The Shell gathers output sent from Output Handler by inheriting from OutputListener.80 The Shell gathers output sent from OutputManager by inheriting from BaseWriter. 81 81 The output-lines are stored in the shell, so they can be displayed in a graphical 82 82 console. Additionally the Shell has an InputBuffer which is needed by the user to … … 85 85 Different graphical consoles build upon a Shell, for example InGameConsole and IOConsole. 86 86 */ 87 class _CoreExport Shell : public OutputListener, public DevModeListener87 class _CoreExport Shell : public BaseWriter, public DevModeListener 88 88 { 89 89 public: … … 91 91 enum LineType 92 92 { 93 TDebug = OutputLevel::TDebug, 94 None = OutputLevel::None, 95 Warning = OutputLevel::Warning, 96 Error = OutputLevel::Error, 97 Info = OutputLevel::Info, 98 Debug = OutputLevel::Debug, 99 Verbose = OutputLevel::Verbose, 100 Ultra = OutputLevel::Ultra, 93 DebugOutput = debug_output, 94 UserError = user_error, 95 UserWarning = user_warning, 96 UserStatus = user_status, 97 UserInfo = user_info, 98 InternalError = internal_error, 99 InternalWarning = internal_warning, 100 InternalStatus = internal_status, 101 InternalInfo = internal_info, 102 Verbose = verbose, 103 VerboseMore = verbose_more, 104 VerboseUltra = verbose_ultra, 105 Cout, 101 106 Input, 102 107 Command, … … 127 132 LineList::const_iterator getEndIterator() const; 128 133 129 void addOutput(const std::string& text, LineType type = None);134 void addOutput(const std::string& text, LineType type = DebugOutput); 130 135 void clearOutput(); 131 136 … … 150 155 const std::string& getFromHistory() const; 151 156 void clearInput(); 152 // OutputListener153 v oid outputChanged(intlevel);157 // BaseWriter 158 virtual void printLine(const std::string& line, OutputLevel level); 154 159 155 160 void configureInputBuffer(); … … 183 188 std::list<ShellListener*> listeners_; ///< The registered shell listeners 184 189 InputBuffer* inputBuffer_; ///< The input buffer that is needed by the user to enter text 185 std::stringstream outputBuffer_; ///< The output buffer that is used to retrieve lines of output from OutputListener186 bool bFinishedLastLine_; ///< Stores if the most recent output-line was terminated with a line-break or if more output is expected for this line187 190 LineList outputLines_; ///< A list of all output-lines that were displayed in the shell so far 188 191 LineList::const_iterator scrollIterator_; ///< An iterator to an entry of the list of output-lines, changes if the user scrolls through the output in the shell … … 197 200 unsigned int historyOffset_; ///< The command history is a circular buffer, this variable defines the current write-offset 198 201 std::vector<std::string> commandHistory_; ///< The history of commands that were entered by the user 199 intdebugLevel_; //!< The maximum level of output that is displayed in the shell (will be passed to OutputListener to filter output)202 OutputLevel debugLevel_; //!< The maximum level of output that is displayed in the shell (will be passed to OutputListener to filter output) 200 203 static unsigned int cacheSize_s; ///< The maximum cache size of the CommandExecutor - this is stored here for better readability of the config file and because CommandExecutor is no OrxonoxClass 201 204 }; -
code/branches/output/src/libraries/util/output/BaseWriter.cc
r8794 r8795 47 47 48 48 for (size_t i = 0; i < lines.size(); ++i) 49 this->printLine((i == 0 ? prefix : blanks) + lines[i] );49 this->printLine((i == 0 ? prefix : blanks) + lines[i], level); 50 50 } 51 51 } -
code/branches/output/src/libraries/util/output/BaseWriter.h
r8794 r8795 45 45 46 46 private: 47 virtual void printLine(const std::string& line ) = 0;47 virtual void printLine(const std::string& line, OutputLevel level) = 0; 48 48 }; 49 49 } -
code/branches/output/src/libraries/util/output/ConsoleWriter.cc
r8794 r8795 37 37 ConsoleWriter::ConsoleWriter() 38 38 { 39 #ifdef ORXONOX_RELEASE 39 40 this->setLevelMax(level::user_info); 41 #else 42 this->setLevelMax(level::internal_warning); 43 #endif 40 44 this->bEnabled_ = true; 41 45 } … … 51 55 } 52 56 53 void ConsoleWriter::printLine(const std::string& line )57 void ConsoleWriter::printLine(const std::string& line, OutputLevel) 54 58 { 55 59 std::cout << line << std::endl; -
code/branches/output/src/libraries/util/output/ConsoleWriter.h
r8794 r8795 44 44 45 45 protected: 46 virtual void printLine(const std::string& line );46 virtual void printLine(const std::string& line, OutputLevel level); 47 47 48 48 private: -
code/branches/output/src/libraries/util/output/LogWriter.cc
r8794 r8795 74 74 75 75 if (this->file_.is_open()) 76 this->printLine("Log file opened" );76 this->printLine("Log file opened", level::none); 77 77 else 78 78 OutputManager::getInstance().pushMessage(level::user_warning, context::output(), "Failed to open log file. File logging disabled."); … … 83 83 if (this->file_.is_open()) 84 84 { 85 this->printLine("Log file closed" );85 this->printLine("Log file closed", level::none); 86 86 this->file_.close(); 87 87 } … … 100 100 } 101 101 102 void LogWriter::printLine(const std::string& line )102 void LogWriter::printLine(const std::string& line, OutputLevel) 103 103 { 104 104 if (!this->file_.is_open()) -
code/branches/output/src/libraries/util/output/LogWriter.h
r8794 r8795 46 46 47 47 protected: 48 virtual void printLine(const std::string& line );48 virtual void printLine(const std::string& line, OutputLevel level); 49 49 50 50 private: -
code/branches/output/src/orxonox/overlays/InGameConsole.cc
r8729 r8795 46 46 #include "util/DisplayStringConversions.h" 47 47 #include "util/ScopedSingletonManager.h" 48 #include "util/output/MemoryWriter.h" 48 49 #include "core/CoreIncludes.h" 49 50 #include "core/ConfigValueIncludes.h" … … 94 95 // Output buffering is not anymore needed. Not the best solution to do 95 96 // this here, but there isn't much of another way. 96 OutputHandler::getInstance().disableMemoryLog();97 MemoryWriter::getInstance().disable(); 97 98 } 98 99 … … 288 289 289 290 for (int i = LINES - 1; i > max; --i) 290 this->print("", Shell:: None, i, true);291 this->print("", Shell::DebugOutput, i, true); 291 292 292 293 for (int i = max; i >= 1; --i) … … 566 567 switch (type) 567 568 { 568 case Shell::Error: colourTop = ColourValue(0.95f, 0.25f, 0.25f, 1.00f); 569 colourBottom = ColourValue(1.00f, 0.50f, 0.50f, 1.00f); break; 570 571 case Shell::Warning: colourTop = ColourValue(0.95f, 0.50f, 0.20f, 1.00f); 572 colourBottom = ColourValue(1.00f, 0.70f, 0.50f, 1.00f); break; 573 574 case Shell::Info: colourTop = ColourValue(0.50f, 0.50f, 0.95f, 1.00f); 575 colourBottom = ColourValue(0.80f, 0.80f, 1.00f, 1.00f); break; 576 577 case Shell::Debug: colourTop = ColourValue(0.65f, 0.48f, 0.44f, 1.00f); 578 colourBottom = ColourValue(1.00f, 0.90f, 0.90f, 1.00f); break; 579 580 case Shell::Verbose: colourTop = ColourValue(0.40f, 0.20f, 0.40f, 1.00f); 581 colourBottom = ColourValue(0.80f, 0.60f, 0.80f, 1.00f); break; 582 583 case Shell::Ultra: colourTop = ColourValue(0.21f, 0.69f, 0.21f, 1.00f); 584 colourBottom = ColourValue(0.80f, 1.00f, 0.80f, 1.00f); break; 585 586 case Shell::Command: colourTop = ColourValue(0.80f, 0.80f, 0.80f, 1.00f); 587 colourBottom = ColourValue(0.90f, 0.90f, 0.90f, 0.90f); break; 588 589 case Shell::Hint: colourTop = ColourValue(0.80f, 0.80f, 0.80f, 1.00f); 590 colourBottom = ColourValue(0.90f, 0.90f, 0.90f, 1.00f); break; 591 592 case Shell::TDebug: colourTop = ColourValue(0.90f, 0.00f, 0.90f, 1.00f); 593 colourBottom = ColourValue(1.00f, 0.00f, 1.00f, 1.00f); break; 594 595 default: colourTop = ColourValue(0.90f, 0.90f, 0.90f, 1.00f); 596 colourBottom = ColourValue(1.00f, 1.00f, 1.00f, 1.00f); break; 597 } 569 case Shell::DebugOutput: colourTop = ColourValue(0.9f, 0.9f, 0.9f); break; 570 571 case Shell::UserError: colourTop = ColourValue(0.9f, 0.2f, 0.2f); break; 572 case Shell::UserWarning: colourTop = ColourValue(0.9f, 0.5f, 0.2f); break; 573 case Shell::UserStatus: colourTop = ColourValue(0.2f, 0.9f, 0.2f); break; 574 case Shell::UserInfo: colourTop = ColourValue(0.2f, 0.8f, 0.8f); break; 575 576 case Shell::InternalError: colourTop = ColourValue(0.5f, 0.0f, 0.0f); break; 577 case Shell::InternalWarning: colourTop = ColourValue(0.5f, 0.2f, 0.0f); break; 578 case Shell::InternalStatus: colourTop = ColourValue(0.0f, 0.5f, 0.0f); break; 579 case Shell::InternalInfo: colourTop = ColourValue(0.0f, 0.4f, 0.4f); break; 580 581 case Shell::Verbose: colourTop = ColourValue(0.2f, 0.2f, 0.9f); break; 582 case Shell::VerboseMore: colourTop = ColourValue(0.1f, 0.1f, 0.6f); break; 583 case Shell::VerboseUltra: colourTop = ColourValue(0.0f, 0.0f, 0.4f); break; 584 585 case Shell::Command: colourTop = ColourValue(0.8f, 0.2f, 0.8f); break; 586 case Shell::Hint: colourTop = ColourValue(0.4f, 0.0f, 0.4f); break; 587 case Shell::Input: colourTop = ColourValue(0.9f, 0.9f, 0.9f); break; 588 589 default: colourTop = ColourValue(0.5f, 0.5f, 0.5f); break; 590 } 591 592 colourBottom = ColourValue(sqrt(colourTop.r), sqrt(colourTop.g), sqrt(colourTop.b)); 598 593 599 594 this->consoleOverlayTextAreas_[index]->setColourTop (colourTop);
Note: See TracChangeset
for help on using the changeset viewer.