mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-11 19:13:29 +00:00
Revert "Ability to unbind controls in settings menu"
This reverts commit 0836680e36ede07d733eb02f8c9c2027d6555e01. To prevent crashes on empty input bindings config.
This commit is contained in:
parent
6a5bc9f992
commit
ca2bacd47a
@ -79,12 +79,7 @@ namespace MWInput
|
||||
// Disallow binding escape key
|
||||
if (key == SDL_SCANCODE_ESCAPE)
|
||||
{
|
||||
// Unbind if esc pressed
|
||||
if (mDetectingKeyboard)
|
||||
clearAllKeyBindings(mInputBinder, control);
|
||||
else
|
||||
clearAllControllerBindings(mInputBinder, control);
|
||||
control->setInitialValue(0.0f);
|
||||
// Stop binding if esc pressed
|
||||
mInputBinder->cancelDetectingBindingState();
|
||||
MWBase::Environment::get().getWindowManager()->notifyInputActionBound();
|
||||
return;
|
||||
@ -161,14 +156,7 @@ namespace MWInput
|
||||
return;
|
||||
clearAllControllerBindings(mInputBinder, control);
|
||||
control->setInitialValue(0.0f);
|
||||
if (button == SDL_CONTROLLER_BUTTON_START)
|
||||
{
|
||||
// Disallow rebinding SDL_CONTROLLER_BUTTON_START - it is used to open main and without it is not
|
||||
// even possible to exit the game (or change the binding back).
|
||||
mInputBinder->cancelDetectingBindingState();
|
||||
}
|
||||
else
|
||||
ICS::DetectingBindingListener::joystickButtonBindingDetected(ICS, deviceID, control, button, direction);
|
||||
ICS::DetectingBindingListener::joystickButtonBindingDetected(ICS, deviceID, control, button, direction);
|
||||
MWBase::Environment::get().getWindowManager()->notifyInputActionBound();
|
||||
}
|
||||
|
||||
@ -192,11 +180,8 @@ namespace MWInput
|
||||
mListener = std::make_unique<BindingsListener>(mInputBinder.get(), this);
|
||||
mInputBinder->setDetectingBindingListener(mListener.get());
|
||||
|
||||
if (!userFileExists)
|
||||
{
|
||||
loadKeyDefaults();
|
||||
loadControllerDefaults();
|
||||
}
|
||||
loadKeyDefaults();
|
||||
loadControllerDefaults();
|
||||
|
||||
for (int i = 0; i < A_Last; ++i)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user