[Orxonox-commit 2056] r6772 - in code/branches/skybox2/src: libraries/core modules/overlays/hud

gionc at orxonox.net gionc at orxonox.net
Thu Apr 22 16:27:25 CEST 2010


Author: gionc
Date: 2010-04-22 16:27:25 +0200 (Thu, 22 Apr 2010)
New Revision: 6772

Modified:
   code/branches/skybox2/src/libraries/core/Core.cc
   code/branches/skybox2/src/libraries/core/Core.h
   code/branches/skybox2/src/modules/overlays/hud/GametypeStatus.cc
Log:
update Skybox Generator

Modified: code/branches/skybox2/src/libraries/core/Core.cc
===================================================================
--- code/branches/skybox2/src/libraries/core/Core.cc	2010-04-22 14:16:09 UTC (rev 6771)
+++ code/branches/skybox2/src/libraries/core/Core.cc	2010-04-22 14:27:25 UTC (rev 6772)
@@ -77,6 +77,8 @@
     Core* Core::singletonPtr_s  = 0;
 
     SetCommandLineArgument(settingsFile, "orxonox.ini").information("THE configuration file");
+    SetCommandLineSwitch(noGametypeCaptions).information("Use this if you don't want to use Gametype captions.");
+
 #ifdef ORXONOX_PLATFORM_WINDOWS
     SetCommandLineArgument(limitToCPU, 1).information("Limits the program to one CPU/core (1, 2, 3, etc.). Default is the first core (faster than off)");
 #endif
@@ -147,6 +149,12 @@
         ClassIdentifier<Core>::getIdentifier("Core")->initialiseObject(this, "Core", true);
         this->setConfigValues();
 
+        // no captions in gametype.
+        if(CommandLineParser::getValue("noGametypeCaptions").getBool())
+        {
+            ModifyConfigValue(bGametypeCaptions_, tset, false);
+        }
+
         // create persistent io console
         this->ioConsole_.reset(new IOConsole());
 
@@ -192,6 +200,8 @@
         SetConfigValue(bInitRandomNumberGenerator_, true)
             .description("If true, all random actions are different each time you start the game")
             .callback(this, &Core::initRandomNumberGenerator);
+        SetConfigValue(bGametypeCaptions_, true)
+            .description("Set to false if you don't want to use Gametype captions.");
     }
 
     //! Callback function if the language has changed.

Modified: code/branches/skybox2/src/libraries/core/Core.h
===================================================================
--- code/branches/skybox2/src/libraries/core/Core.h	2010-04-22 14:16:09 UTC (rev 6771)
+++ code/branches/skybox2/src/libraries/core/Core.h	2010-04-22 14:27:25 UTC (rev 6772)
@@ -66,6 +66,9 @@
 
             void setConfigValues();
 
+            inline bool hasGametypeCaptions(void)
+                { return this->bGametypeCaptions_; }
+
             //! Returns the configured language.
             const std::string& getLanguage()
                 { return this->language_; }
@@ -107,6 +110,7 @@
             int                           softDebugLevelLogFile_;      //!< The debug level for the log file (belongs to OutputHandler)
             std::string                   language_;                   //!< The language
             bool                          bInitRandomNumberGenerator_; //!< If true, srand(time(0)) is called
+            bool                          bGametypeCaptions_;
 
             static Core*                  singletonPtr_s;
     };

Modified: code/branches/skybox2/src/modules/overlays/hud/GametypeStatus.cc
===================================================================
--- code/branches/skybox2/src/modules/overlays/hud/GametypeStatus.cc	2010-04-22 14:16:09 UTC (rev 6771)
+++ code/branches/skybox2/src/modules/overlays/hud/GametypeStatus.cc	2010-04-22 14:27:25 UTC (rev 6772)
@@ -29,6 +29,7 @@
 #include "GametypeStatus.h"
 
 #include "util/Convert.h"
+#include "core/Core.h"
 #include "core/CoreIncludes.h"
 #include "infos/GametypeInfo.h"
 #include "infos/PlayerInfo.h"
@@ -59,6 +60,9 @@
             const GametypeInfo* gtinfo = this->owner_->getGametypeInfo();
             ControllableEntity* ce = this->owner_->getControllableEntity();
 
+            if(!Core::getInstance().hasGametypeCaptions()) // No captions are displayed.
+                return;
+
             if (!gtinfo->hasStarted() && !gtinfo->isStartCountdownRunning())
             {
                 if (!this->owner_->isReadyToSpawn())




More information about the Orxonox-commit mailing list