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 ;-)

File:
1 edited

Legend:

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

    r2801 r2808  
    6363namespace orxonox
    6464{
    65     SetConsoleCommandShortcut(GUIManager, showGUI_s).keybindMode(KeybindMode::OnPress);
     65    SetConsoleCommandShortcut(GUIManager, toggleGUI).keybindMode(KeybindMode::OnPress);
    6666
    6767    GUIManager* GUIManager::singletonRef_s = 0;
     
    143143
    144144                // Note: No SceneManager specified yet
    145                 this->guiRenderer_ = new OgreCEGUIRenderer(renderWindow_, Ogre::RENDER_QUEUE_MAIN, true, 3000);
     145                this->guiRenderer_ = new OgreCEGUIRenderer(renderWindow_, Ogre::RENDER_QUEUE_OVERLAY, true, 3000);
    146146                this->resourceProvider_ = guiRenderer_->createResourceProvider();
    147147                this->resourceProvider_->setDefaultResourceGroup("GUI");
     
    172172
    173173                // load the background scene
    174                 //loadScenes();
     174                loadScenes();
    175175                //CEGUI::KeyEventArgs e;
    176176                //e.codepoint
     
    204204                tolua_Orxonox_open(this->scriptModule_->getLuaState());
    205205                */
    206                 this->scriptModule_->executeScriptFile("ingameGUI.lua", "GUI");
     206                this->scriptModule_->executeScriptFile("loadGUI.lua", "GUI");
    207207            }
    208208            catch (CEGUI::Exception& ex)
     
    261261    }
    262262
     263    void GUIManager::toggleGUI()
     264    {
     265        //COUT(0) << "********* TOGGLE TOGGLE **********" << std::endl;
     266        getInstance().scriptModule_->executeScriptGlobal("toggleGUI");
     267    }
     268
    263269    void GUIManager::showGUI(const std::string& name, Ogre::SceneManager* sceneManager)// bool showBackground)
    264270    {
     
    271277            try
    272278            {
    273 //                COUT (0) << "************* sceneManager: " << sceneManager << std::endl;
     279                // COUT (0) << "************* sceneManager: " << sceneManager << std::endl;
    274280                if (!sceneManager)
    275281                {
     
    286292                    //this->viewport_->setClearEveryFrame(false);
    287293                    this->guiRenderer_->setTargetSceneManager(sceneManager);
     294                    currentSceneManager_ = sceneManager;
    288295                    //this->viewport_->setCamera(this->emptyCamera_);
    289296
     
    311318            COUT(2) << "Warning: GUI Manager not yet initialised, cannot load a GUI" << std::endl;
    312319        }
     320    }
     321
     322    void GUIManager::testFct()
     323    {
     324        //COUT(0) << "**** " << currentSceneManager_ << std::endl;
     325        this->showGUI("IngameMenu", currentSceneManager_);
     326    }
     327
     328    void GUIManager::testOutput(const std::string& str)
     329    {
     330        COUT(0) << "***" << str << "***" << std::endl;
    313331    }
    314332
Note: See TracChangeset for help on using the changeset viewer.