mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 20:53:50 +00:00
Make Activate key accept GUI buttons
This commit is contained in:
parent
76ddf8d794
commit
ca3b08b852
1 changed files with 6 additions and 6 deletions
|
@ -162,14 +162,13 @@ namespace MWInput
|
||||||
|
|
||||||
void InputManager::setPlayerControlsEnabled(bool enabled)
|
void InputManager::setPlayerControlsEnabled(bool enabled)
|
||||||
{
|
{
|
||||||
int nPlayerChannels = 18;
|
int playerChannels[] = {A_AutoMove, A_AlwaysRun, A_ToggleWeapon,
|
||||||
int playerChannels[] = {A_Activate, A_AutoMove, A_AlwaysRun, A_ToggleWeapon,
|
|
||||||
A_ToggleSpell, A_Rest, A_QuickKey1, A_QuickKey2,
|
A_ToggleSpell, A_Rest, A_QuickKey1, A_QuickKey2,
|
||||||
A_QuickKey3, A_QuickKey4, A_QuickKey5, A_QuickKey6,
|
A_QuickKey3, A_QuickKey4, A_QuickKey5, A_QuickKey6,
|
||||||
A_QuickKey7, A_QuickKey8, A_QuickKey9, A_QuickKey10,
|
A_QuickKey7, A_QuickKey8, A_QuickKey9, A_QuickKey10,
|
||||||
A_Use, A_Journal};
|
A_Use, A_Journal};
|
||||||
|
|
||||||
for(int i = 0; i < nPlayerChannels; i++) {
|
for(size_t i = 0; i < sizeof(playerChannels)/sizeof(playerChannels[0]); i++) {
|
||||||
int pc = playerChannels[i];
|
int pc = playerChannels[i];
|
||||||
mInputBinder->getChannel(pc)->setEnabled(enabled);
|
mInputBinder->getChannel(pc)->setEnabled(enabled);
|
||||||
}
|
}
|
||||||
|
@ -234,7 +233,6 @@ namespace MWInput
|
||||||
break;
|
break;
|
||||||
case A_Activate:
|
case A_Activate:
|
||||||
resetIdleTime();
|
resetIdleTime();
|
||||||
if (!MWBase::Environment::get().getWindowManager()->isGuiMode())
|
|
||||||
activate();
|
activate();
|
||||||
break;
|
break;
|
||||||
case A_Journal:
|
case A_Journal:
|
||||||
|
@ -1080,7 +1078,9 @@ namespace MWInput
|
||||||
|
|
||||||
void InputManager::activate()
|
void InputManager::activate()
|
||||||
{
|
{
|
||||||
if (mControlSwitch["playercontrols"])
|
if (MWBase::Environment::get().getWindowManager()->isGuiMode())
|
||||||
|
MWBase::Environment::get().getWindowManager()->injectKeyPress(MyGUI::KeyCode::Return, 0);
|
||||||
|
else if (mControlSwitch["playercontrols"])
|
||||||
mPlayer->activate();
|
mPlayer->activate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue