[Orxonox-commit 160] r2840 - branches/gui/src/orxonox/gui

bknecht at orxonox.net bknecht at orxonox.net
Wed Mar 25 11:15:28 CET 2009


Author: bknecht
Date: 2009-03-25 10:15:28 +0000 (Wed, 25 Mar 2009)
New Revision: 2840

Modified:
   branches/gui/src/orxonox/gui/GUIManager.cc
   branches/gui/src/orxonox/gui/GUIManager.h
Log:
GUIManager now behaves how it should. Most things seem to work fine.

However I guess with the new media all other branches stopped working. Sorry if that's the case.

Modified: branches/gui/src/orxonox/gui/GUIManager.cc
===================================================================
--- branches/gui/src/orxonox/gui/GUIManager.cc	2009-03-25 02:26:06 UTC (rev 2839)
+++ branches/gui/src/orxonox/gui/GUIManager.cc	2009-03-25 10:15:28 UTC (rev 2840)
@@ -186,6 +186,7 @@
             }
 
             state_ = Ready;
+
         }
 
         return true;
@@ -248,6 +249,8 @@
         try
         {
             this->scriptModule_->executeScriptFile("loadGUI.lua", "GUI");
+            lua_pushfstring(this->scriptModule_->getLuaState(), Core::getMediaPathString().c_str());
+            lua_setglobal(this->scriptModule_->getLuaState(), "datapath");
         }
         catch (CEGUI::Exception& ex)
         {
@@ -263,12 +266,15 @@
     void GUIManager::toggleGUI()
     {
         //COUT(0) << "********* TOGGLE TOGGLE **********" << std::endl;
-        getInstance().scriptModule_->executeScriptGlobal("toggleGUI");
+        if (getInstance().scriptModule_->executeScriptGlobal("toggleGUI"))
+            InputManager::getInstance().requestEnterState("gui");
+        else
+            InputManager::getInstance().requestLeaveState("gui");
     }
 
     void GUIManager::setCamera(Ogre::Camera* camera)
     {
-        this->showGUI("default", camera->getSceneManager());
+        this->guiRenderer_->setTargetSceneManager(camera->getSceneManager());
     }
 
     void GUIManager::showGUI(const std::string& name, Ogre::SceneManager* sceneManager)// bool showBackground)
@@ -303,8 +309,11 @@
                     lua_setglobal(this->scriptModule_->getLuaState(), "showBackground");
                 }
 
-                this->scriptModule_->executeScriptGlobal("showMainMenu");
+                lua_pushfstring(this->scriptModule_->getLuaState(), "mainmenu.lua");
+                lua_setglobal(this->scriptModule_->getLuaState(), "filename");
 
+                this->scriptModule_->executeScriptGlobal("showGUI");
+
                 InputManager::getInstance().requestEnterState("gui");
 
                 this->state_ = OnDisplay;
@@ -324,7 +333,7 @@
         }
     }
 
-    void GUIManager::testFct()
+    /*void GUIManager::testFct()
     {
         //COUT(0) << "**** " << currentSceneManager_ << std::endl;
         this->showGUI("IngameMenu", currentSceneManager_);
@@ -333,7 +342,7 @@
     void GUIManager::testOutput(const std::string& str)
     {
         COUT(0) << "***" << str << "***" << std::endl;
-    }
+    }*/
 
     void GUIManager::hideGUI()
     {

Modified: branches/gui/src/orxonox/gui/GUIManager.h
===================================================================
--- branches/gui/src/orxonox/gui/GUIManager.h	2009-03-25 02:26:06 UTC (rev 2839)
+++ branches/gui/src/orxonox/gui/GUIManager.h	2009-03-25 10:15:28 UTC (rev 2840)
@@ -78,7 +78,7 @@
         }
         void showGUI(const std::string& name, Ogre::SceneManager* sceneManager);// bool showBackground); // tolua_export
         void hideGUI(); // tolua_export
-        void testOutput(const std::string& str); // tolua_export
+        //void testOutput(const std::string& str); // tolua_export
 
         static void toggleGUI();
 
@@ -91,7 +91,7 @@
         }
 
         // please remove
-        void testFct();
+        //void testFct();
 
         static GUIManager& getInstance()    { assert(singletonRef_s); return *singletonRef_s; } // tolua_export
         static GUIManager* getInstancePtr() { return singletonRef_s; }




More information about the Orxonox-commit mailing list