Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 25, 2009, 11:53:04 PM (16 years ago)
Author:
rgrieder
Message:
  • Started working on cleaning up the GameState mess ;)
  • Cleaned out GUIManager
  • Renamed GSGUI to GSMainMenu
  • "—state blah" has been changed to —server, —client, —standalone, —dedicated
  • —console starts the game in the console (no level loading there yet, but "loadMenu")
  • adjusted run scripts
File:
1 edited

Legend:

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

    r2848 r2850  
    4949#include "LevelManager.h"
    5050#include "PlayerManager.h"
     51#include "gui/GUIManager.h"
    5152
    5253namespace orxonox
     
    8687        if (GameMode::showsGraphics())
    8788        {
     89            {
     90                FunctorMember<GSLevel>* functor = createFunctor(&GSLevel::toggleGUI);
     91                functor->setObject(this);
     92                this->ccToggleGUI_ = createConsoleCommand(functor, "toggleGUI");
     93                CommandExecutor::addConsoleCommandShortcut(this->ccToggleGUI_);
     94            }
     95
    8896            inputState_ = InputManager::getInstance().createInputState<SimpleInputState>("game");
    8997            keyBinder_ = new KeyBinder();
     
    110118        if (GameMode::showsGraphics())
    111119        {
    112             // TODO: insert slomo console command with
    113             // .accessLevel(AccessLevel::Offline).defaultValue(0, 1.0).axisParamIndex(0).isAxisRelative(false);
    114 
    115120            // keybind console command
    116121            FunctorMember<GSLevel>* functor1 = createFunctor(&GSLevel::keybind);
     
    125130            InputManager::getInstance().setKeyDetectorCallback(std::string("keybind ") + keyDetectorCallbackCode_);
    126131
     132            // InGame GUI test
     133            GUIManager::getInstance().showGUI("inGameTest");
     134
    127135            // level is loaded: we can start capturing the input
    128136            InputManager::getInstance().requestEnterState("game");
     
    143151            this->ccTkeybind_ = 0;
    144152        }
     153        if (this->ccToggleGUI_)
     154        {
     155            delete this->ccToggleGUI_;
     156            this->ccToggleGUI_ = 0;
     157        }
     158
    145159
    146160        // this call will delete every BaseObject!
     
    219233
    220234        delete this->startFile_;
     235    }
     236
     237    void GSLevel::toggleGUI()
     238    {
     239        if (GameMode::showsGraphics())
     240        {
     241            GUIManager::getInstance().executeCode("toggleGUI()");
     242        }
    221243    }
    222244
Note: See TracChangeset for help on using the changeset viewer.