Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 21, 2009, 1:07:53 AM (15 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 ;-)

Location:
code/branches/gui/src/orxonox/gamestates
Files:
3 edited

Legend:

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

    r2801 r2808  
    5353
    5454        // show main menu
    55         guiManager_->loadScene("MainMenu");
     55        //guiManager_->loadScene("MainMenu");
    5656        guiManager_->showGUI("MainMenu", 0);
    5757        GraphicsManager::getInstance().getViewport()->setCamera(guiManager_->getCamera());
  • 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);
  • code/branches/gui/src/orxonox/gamestates/GSStandalone.h

    r2790 r2808  
    4141        GSStandalone();
    4242        ~GSStandalone();
    43         static void showGUI();
    4443
    4544    private:
     
    4948
    5049        GUIManager*     guiManager_;
    51         static bool     guiShowing_s;
    5250    };
    5351}
Note: See TracChangeset for help on using the changeset viewer.