Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2840


Ignore:
Timestamp:
Mar 25, 2009, 11:15:28 AM (15 years ago)
Author:
bknecht
Message:

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.

Location:
code/branches/gui/src/orxonox/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gui/src/orxonox/gui/GUIManager.cc

    r2834 r2840  
    187187
    188188            state_ = Ready;
     189
    189190        }
    190191
     
    249250        {
    250251            this->scriptModule_->executeScriptFile("loadGUI.lua", "GUI");
     252            lua_pushfstring(this->scriptModule_->getLuaState(), Core::getMediaPathString().c_str());
     253            lua_setglobal(this->scriptModule_->getLuaState(), "datapath");
    251254        }
    252255        catch (CEGUI::Exception& ex)
     
    264267    {
    265268        //COUT(0) << "********* TOGGLE TOGGLE **********" << std::endl;
    266         getInstance().scriptModule_->executeScriptGlobal("toggleGUI");
     269        if (getInstance().scriptModule_->executeScriptGlobal("toggleGUI"))
     270            InputManager::getInstance().requestEnterState("gui");
     271        else
     272            InputManager::getInstance().requestLeaveState("gui");
    267273    }
    268274
    269275    void GUIManager::setCamera(Ogre::Camera* camera)
    270276    {
    271         this->showGUI("default", camera->getSceneManager());
     277        this->guiRenderer_->setTargetSceneManager(camera->getSceneManager());
    272278    }
    273279
     
    304310                }
    305311
    306                 this->scriptModule_->executeScriptGlobal("showMainMenu");
     312                lua_pushfstring(this->scriptModule_->getLuaState(), "mainmenu.lua");
     313                lua_setglobal(this->scriptModule_->getLuaState(), "filename");
     314
     315                this->scriptModule_->executeScriptGlobal("showGUI");
    307316
    308317                InputManager::getInstance().requestEnterState("gui");
     
    325334    }
    326335
    327     void GUIManager::testFct()
     336    /*void GUIManager::testFct()
    328337    {
    329338        //COUT(0) << "**** " << currentSceneManager_ << std::endl;
     
    334343    {
    335344        COUT(0) << "***" << str << "***" << std::endl;
    336     }
     345    }*/
    337346
    338347    void GUIManager::hideGUI()
  • code/branches/gui/src/orxonox/gui/GUIManager.h

    r2834 r2840  
    7979        void showGUI(const std::string& name, Ogre::SceneManager* sceneManager);// bool showBackground); // tolua_export
    8080        void hideGUI(); // tolua_export
    81         void testOutput(const std::string& str); // tolua_export
     81        //void testOutput(const std::string& str); // tolua_export
    8282
    8383        static void toggleGUI();
     
    9292
    9393        // please remove
    94         void testFct();
     94        //void testFct();
    9595
    9696        static GUIManager& getInstance()    { assert(singletonRef_s); return *singletonRef_s; } // tolua_export
Note: See TracChangeset for help on using the changeset viewer.