[Orxonox-commit 4132] r8803 - in code/branches/output/src: libraries/core/command orxonox/overlays

landauf at orxonox.net landauf at orxonox.net
Sat Jul 30 22:05:49 CEST 2011


Author: landauf
Date: 2011-07-30 22:05:49 +0200 (Sat, 30 Jul 2011)
New Revision: 8803

Modified:
   code/branches/output/src/libraries/core/command/ArgumentCompletionFunctions.cc
   code/branches/output/src/libraries/core/command/IOConsolePOSIX.cc
   code/branches/output/src/libraries/core/command/IOConsoleWindows.cc
   code/branches/output/src/libraries/core/command/Shell.cc
   code/branches/output/src/libraries/core/command/Shell.h
   code/branches/output/src/orxonox/overlays/InGameConsole.cc
Log:
no \n needed after executed command in shell.
different color for return value of a command.
fixed width of text InGameConsole (at least on my system).

Modified: code/branches/output/src/libraries/core/command/ArgumentCompletionFunctions.cc
===================================================================
--- code/branches/output/src/libraries/core/command/ArgumentCompletionFunctions.cc	2011-07-30 19:33:29 UTC (rev 8802)
+++ code/branches/output/src/libraries/core/command/ArgumentCompletionFunctions.cc	2011-07-30 20:05:49 UTC (rev 8803)
@@ -89,7 +89,7 @@
             */
             ArgumentCompletionList _groupsandcommands(const std::string& fragment, bool bOnlyShowHidden)
             {
-                // note: this function returns only arguments that begin with "fragment", which would't be necessary for the
+                // note: this function returns only arguments that begin with "fragment", which wouldn't be necessary for the
                 //       auto-completion, but it's necessary to place the line-break "\n" between groups and commands
                 //       only if both groups AND commands are in the list.
 

Modified: code/branches/output/src/libraries/core/command/IOConsolePOSIX.cc
===================================================================
--- code/branches/output/src/libraries/core/command/IOConsolePOSIX.cc	2011-07-30 19:33:29 UTC (rev 8802)
+++ code/branches/output/src/libraries/core/command/IOConsolePOSIX.cc	2011-07-30 20:05:49 UTC (rev 8803)
@@ -381,7 +381,7 @@
     //! Called if a command is about to be executed
     void IOConsole::executed()
     {
-        this->shell_->addOutput(this->promptString_ + this->shell_->getInput() + '\n', Shell::Command);
+        this->shell_->addOutput(this->promptString_ + this->shell_->getInput(), Shell::Command);
     }
 
     //! Called if the console gets closed

Modified: code/branches/output/src/libraries/core/command/IOConsoleWindows.cc
===================================================================
--- code/branches/output/src/libraries/core/command/IOConsoleWindows.cc	2011-07-30 19:33:29 UTC (rev 8802)
+++ code/branches/output/src/libraries/core/command/IOConsoleWindows.cc	2011-07-30 20:05:49 UTC (rev 8803)
@@ -328,7 +328,7 @@
     //! Called if a command is about to be executed
     void IOConsole::executed()
     {
-        this->shell_->addOutput(this->promptString_ + this->shell_->getInput() + '\n', Shell::Command);
+        this->shell_->addOutput(this->promptString_ + this->shell_->getInput(), Shell::Command);
     }
 
     //! Called if the console gets closed

Modified: code/branches/output/src/libraries/core/command/Shell.cc
===================================================================
--- code/branches/output/src/libraries/core/command/Shell.cc	2011-07-30 19:33:29 UTC (rev 8802)
+++ code/branches/output/src/libraries/core/command/Shell.cc	2011-07-30 20:05:49 UTC (rev 8803)
@@ -394,7 +394,7 @@
         }
         else if (result != "")
         {
-            this->addOutput(result, Command);
+            this->addOutput(result, Result);
         }
 
         this->clearInput();

Modified: code/branches/output/src/libraries/core/command/Shell.h
===================================================================
--- code/branches/output/src/libraries/core/command/Shell.h	2011-07-30 19:33:29 UTC (rev 8802)
+++ code/branches/output/src/libraries/core/command/Shell.h	2011-07-30 20:05:49 UTC (rev 8803)
@@ -104,6 +104,7 @@
                 Cout,
                 Input,
                 Command,
+                Result,
                 Hint
             };
 

Modified: code/branches/output/src/orxonox/overlays/InGameConsole.cc
===================================================================
--- code/branches/output/src/orxonox/overlays/InGameConsole.cc	2011-07-30 19:33:29 UTC (rev 8802)
+++ code/branches/output/src/orxonox/overlays/InGameConsole.cc	2011-07-30 20:05:49 UTC (rev 8803)
@@ -58,7 +58,7 @@
 namespace orxonox
 {
     const int LINES = 30;
-    const float CHAR_WIDTH = 7.45f; // fix this please - determine the char-width dynamically
+    const float CHAR_WIDTH = 8.0f; // fix this please - determine the char-width dynamically
 
     SetConsoleCommand("InGameConsole", "openConsole", &InGameConsole::openConsole);
     SetConsoleCommand("InGameConsole", "closeConsole", &InGameConsole::closeConsole);
@@ -338,7 +338,7 @@
     */
     void InGameConsole::executed()
     {
-        this->shell_->addOutput(this->shell_->getInput() + '\n', Shell::Command);
+        this->shell_->addOutput(this->shell_->getInput(), Shell::Command);
     }
 
     /**
@@ -429,7 +429,7 @@
         this->consoleOverlayNoise_->setTiling(consoleOverlayNoise_->getWidth() / (50.0f * this->noiseSize_), consoleOverlayNoise_->getHeight() / (50.0f * this->noiseSize_));
 
         // now adjust the text lines...
-        this->desiredTextWidth_ = static_cast<int>(this->windowW_ * this->relativeWidth) - 12;
+        this->desiredTextWidth_ = static_cast<int>(this->windowW_ * this->relativeWidth) - 24;
 
         if (LINES > 0)
             this->maxCharsPerLine_ = std::max(10U, static_cast<unsigned int>(static_cast<float>(this->desiredTextWidth_) / CHAR_WIDTH));




More information about the Orxonox-commit mailing list