[Orxonox-commit 4030] r8704 - in code/branches/presentation: data/gui/scripts src/libraries/core

dafrick at orxonox.net dafrick at orxonox.net
Mon Jun 13 14:35:18 CEST 2011


Author: dafrick
Date: 2011-06-13 14:35:18 +0200 (Mon, 13 Jun 2011)
New Revision: 8704

Modified:
   code/branches/presentation/data/gui/scripts/NotificationLayer.lua
   code/branches/presentation/src/libraries/core/GUIManager.cc
   code/branches/presentation/src/libraries/core/GUIManager.h
Log:
Only escape [] in CEGUI tetx of version is >= 0.7


Modified: code/branches/presentation/data/gui/scripts/NotificationLayer.lua
===================================================================
--- code/branches/presentation/data/gui/scripts/NotificationLayer.lua	2011-06-12 23:49:05 UTC (rev 8703)
+++ code/branches/presentation/data/gui/scripts/NotificationLayer.lua	2011-06-13 12:35:18 UTC (rev 8704)
@@ -61,7 +61,9 @@
         return
     end
 
-    notification = string.gsub(notification, "%[", "\\%[") -- escape '[' which is used to format text since cegui 0.7
+    if not guiMgr:usingOldCEGUI() then
+        notification = string.gsub(notification, "%[", "\\%[") -- escape '[' which is used to format text since cegui 0.7
+    end
 
     local item = winMgr:createWindow("MenuWidgets/StaticText", "orxonox/NotificationLayer/Root/Queue/" .. queueName .. "/" .. queue.last)
     item:setText(notification)

Modified: code/branches/presentation/src/libraries/core/GUIManager.cc
===================================================================
--- code/branches/presentation/src/libraries/core/GUIManager.cc	2011-06-12 23:49:05 UTC (rev 8703)
+++ code/branches/presentation/src/libraries/core/GUIManager.cc	2011-06-13 12:35:18 UTC (rev 8704)
@@ -261,10 +261,13 @@
 
         COUT(3) << "Initialising CEGUI." << std::endl;
 
+        this->oldCEGUI_ = false;
+        
         // Note: No SceneManager specified yet
 #ifdef ORXONOX_OLD_CEGUI
         guiRenderer_ = new OgreCEGUIRenderer(GraphicsManager::getInstance().getRenderWindow(), Ogre::RENDER_QUEUE_OVERLAY, false, 3000);
         resourceProvider_ = guiRenderer_->createResourceProvider();
+        this->oldCEGUI_ = true;
 #else
         guiRenderer_ = &OgreRenderer::create(*GraphicsManager::getInstance().getRenderWindow());
         // We use our own RenderQueueListener so we can draw UNDER overlays

Modified: code/branches/presentation/src/libraries/core/GUIManager.h
===================================================================
--- code/branches/presentation/src/libraries/core/GUIManager.h	2011-06-12 23:49:05 UTC (rev 8703)
+++ code/branches/presentation/src/libraries/core/GUIManager.h	2011-06-13 12:35:18 UTC (rev 8704)
@@ -134,6 +134,12 @@
 
         static GUIManager& getInstance() { return Singleton<GUIManager>::getInstance(); } // tolua_export
 
+        /**
+        @brief Check whether CEGUI is version < 0.7.
+        @return Returns true if the CEGUI version is < 0.7. False otherwise.
+        */
+        inline bool usingOldCEGUI(void) { return this->oldCEGUI_; } // tolua_export
+
     private:
         GUIManager(const GUIManager& instance); //!< private and undefined copy c'tor (this is a singleton class)
 
@@ -185,7 +191,8 @@
         // The used CEGUI scheme.
         static const std::string defaultScheme_;
         std::string guiScheme_;
-
+        bool oldCEGUI_;
+        
         int numScrollLines_; ///< How many lines to scroll in a list if the scroll wheel is used
 
     }; // tolua_export




More information about the Orxonox-commit mailing list