Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 3, 2009, 5:33:31 PM (15 years ago)
Author:
rgrieder
Message:

New class: KeyBinderManager (yes, it really was necessary, I'm not such a Fan of zillions of classes as well) and moved the keybind command to it from GSLevel.
This new Singleton simply maps the keybind command to the right KeyBinder, selected by KeyBinderManager::setCurrent().
There is also a default KeyBinder (with keybindings.ini as file), which should do the Trick for now. Other Keybinders should only server special purposes (like in mini games or so).

DELETE YOUR keybindings.ini FILE! =
File:
1 edited

Legend:

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

    r5855 r5863  
    4141#include "core/Game.h"
    4242#include "core/GUIManager.h"
    43 #include "core/input/InputManager.h"
    44 #include "core/input/KeyBinder.h"
    45 #include "core/input/InputState.h"
    4643#include "core/Loader.h"
    4744#include "core/XMLFile.h"
     
    5653    GSGraphics::GSGraphics(const GameStateInfo& info)
    5754        : GameState(info)
    58         , masterKeyBinder_(0)
    59         , masterInputState_(0)
    6055        , debugOverlay_(0)
    6156    {
    62         // load master key bindings
    63         masterInputState_ = InputManager::getInstance().createInputState("master", true);
    64         masterKeyBinder_ = new KeyBinder();
    65         masterInputState_->setKeyHandler(masterKeyBinder_);
    6657    }
    6758
    6859    GSGraphics::~GSGraphics()
    6960    {
    70         InputManager::getInstance().destroyState("master");
    71         this->masterKeyBinder_->destroy();
    7261    }
    7362
     
    9483        Loader::open(debugOverlay_);
    9584
    96         masterKeyBinder_->loadBindings("masterKeybindings.ini");
    97 
    9885        // add console command to toggle GUI
    9986        this->ccToggleGUI_ = createConsoleCommand(createFunctor(&GSGraphics::toggleGUI, this), "toggleGUI");
    10087        CommandExecutor::addConsoleCommandShortcut(this->ccToggleGUI_);
    101 
    102         // enable master input
    103         InputManager::getInstance().enterState("master");
    10488    }
    10589
Note: See TracChangeset for help on using the changeset viewer.