Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 21, 2009, 1:07:53 AM (16 years ago)
Author:
bknecht
Message:

You can now toggle visibility ingame. Strangely the SceneManager changes after the initial enter()-function of GSStandalone. That's why - for the moment - the SceneManager is set every tick to be able to keep track of the current SceneManager.

Also there are some strange functions defined not having a real purpose aside from debug (the implementation is not clean at all, but rather full of shortcuts and functional). At least it compiles and runs ;-)

File:
1 edited

Legend:

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

    r2801 r2808  
    3939namespace orxonox
    4040{
    41     SetConsoleCommand(GSStandalone, showGUI, true).setAsInputCommand();
    42 
    43     bool GSStandalone::guiShowing_s = false;
    44 
    4541    GSStandalone::GSStandalone()
    4642        : GameState<GSGraphics>("standalone")
     
    5248    }
    5349
    54     void GSStandalone::showGUI()
    55     {
    56         GSStandalone::guiShowing_s = true;
    57     }
    5850
    5951    void GSStandalone::enter()
     
    6658        // not sure if necessary
    6759        // guiManager_->loadScene("IngameMenu");
     60
     61        Ogre::Viewport* viewport = GraphicsManager::getInstance().getViewport();
     62        guiManager_->showGUI("IngameMenu", viewport->getCamera()->getSceneManager());
    6863    }
    6964
     
    7772    void GSStandalone::ticked(const Clock& time)
    7873    {
    79         if (guiShowing_s)
    80         {
    81             Ogre::Viewport* viewport = GraphicsManager::getInstance().getViewport();
    82             guiManager_->showGUI("IngameMenu", viewport->getCamera()->getSceneManager());
    83         }
    84         else
    85         {
    86             if (guiManager_)
    87                 guiManager_->hideGUI();
    88         }
     74        Ogre::Viewport* viewport = GraphicsManager::getInstance().getViewport();
     75        //COUT(0) << "** " << viewport->getCamera()->getSceneManager() << std::endl;
     76        //guiManager_->testFct();
     77        //Ogre::Viewport* viewport = GraphicsManager::getInstance().getViewport();
     78        guiManager_->showGUI("IngameMenu", viewport->getCamera()->getSceneManager());
     79
    8980        // tick CEGUI
    9081        guiManager_->update(time);
Note: See TracChangeset for help on using the changeset viewer.