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/GSMainMenu.cc

    r5855 r5863  
    3434#include "core/input/InputManager.h"
    3535#include "core/input/InputState.h"
     36#include "core/input/KeyBinderManager.h"
    3637#include "core/Game.h"
    3738#include "core/ConsoleCommand.h"
     
    5152        inputState_ = InputManager::getInstance().createInputState("mainMenu");
    5253        inputState_->setHandler(GUIManager::getInstancePtr());
     54        inputState_->setKeyHandler(KeyBinderManager::getInstance().getDefaultAsHandler());
    5355        inputState_->setJoyStickHandler(&InputHandler::EMPTY);
    5456        inputState_->setIsExclusiveMouse(false);
     
    8688        CommandExecutor::addConsoleCommandShortcut(this->ccStartMainMenu_);
    8789
     90        KeyBinderManager::getInstance().setToDefault();
    8891        InputManager::getInstance().enterState("mainMenu");
    8992
Note: See TracChangeset for help on using the changeset viewer.