Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 30, 2009, 11:34:51 PM (15 years ago)
Author:
bknecht
Message:

Including some features to use only mouse or keys in a GUI, also cleaning up the calls to GUIManager, also trying to show and hide a GUI just by tabbing a key. Anyways, more features to come soonsvn status

File:
1 edited

Legend:

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

    r2854 r2869  
    3636#include "core/ConfigValueIncludes.h"
    3737#include "core/Clock.h"
     38#include "core/ConsoleCommand.h"
    3839#include "core/Core.h"
    3940#include "core/CoreIncludes.h"
     
    110111        guiManager_->initialise(renderWindow);
    111112
     113        FunctorMember<GSGraphics>* functor = createFunctor(&GSGraphics::toggleGUI);
     114        functor->setObject(this);
     115        this->ccToggleGUI_ = createConsoleCommand(functor, "toggleGUI");
     116        CommandExecutor::addConsoleCommandShortcut(this->ccToggleGUI_);
     117
     118
    112119        InputManager::getInstance().requestEnterState("master");
    113120    }
     
    115122    void GSGraphics::deactivate()
    116123    {
     124
     125        if (this->ccToggleGUI_)
     126        {
     127            delete this->ccToggleGUI_;
     128            this->ccToggleGUI_ = 0;
     129        }
     130
    117131        masterInputState_->setHandler(0);
    118132        InputManager::getInstance().requestDestroyState("master");
     
    131145
    132146        GameMode::setShowsGraphics(false);
     147    }
     148
     149    void GSGraphics::toggleGUI()
     150    {
     151            GUIManager::getInstance().executeCode("toggleGUI()");
    133152    }
    134153
Note: See TracChangeset for help on using the changeset viewer.