1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 08:53:52 +00:00

Merge pull request #2531 from akortunov/guifixes

Check if related menus are allowed when using cycle hotkeys
This commit is contained in:
Alexei Dobrohotov 2019-09-20 20:04:51 +03:00 committed by GitHub
commit 2d20905d93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View file

@ -147,6 +147,7 @@
Bug #5161: Creature companions can't be activated when they are knocked down Bug #5161: Creature companions can't be activated when they are knocked down
Bug #5164: Faction owned items handling is incorrect Bug #5164: Faction owned items handling is incorrect
Bug #5166: Scripts still should be executed after player's death Bug #5166: Scripts still should be executed after player's death
Bug #5167: Player can select and cast spells before magic menu is enabled
Bug #5168: Force1stPerson and Force3rdPerson commands are not really force view change Bug #5168: Force1stPerson and Force3rdPerson commands are not really force view change
Feature #1774: Handle AvoidNode Feature #1774: Handle AvoidNode
Feature #2229: Improve pathfinding AI Feature #2229: Improve pathfinding AI

View file

@ -471,19 +471,19 @@ namespace MWInput
quickLoad(); quickLoad();
break; break;
case A_CycleSpellLeft: case A_CycleSpellLeft:
if (checkAllowedToUseItems()) if (checkAllowedToUseItems() && MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Magic))
MWBase::Environment::get().getWindowManager()->cycleSpell(false); MWBase::Environment::get().getWindowManager()->cycleSpell(false);
break; break;
case A_CycleSpellRight: case A_CycleSpellRight:
if (checkAllowedToUseItems()) if (checkAllowedToUseItems() && MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Magic))
MWBase::Environment::get().getWindowManager()->cycleSpell(true); MWBase::Environment::get().getWindowManager()->cycleSpell(true);
break; break;
case A_CycleWeaponLeft: case A_CycleWeaponLeft:
if (checkAllowedToUseItems()) if (checkAllowedToUseItems() && MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory))
MWBase::Environment::get().getWindowManager()->cycleWeapon(false); MWBase::Environment::get().getWindowManager()->cycleWeapon(false);
break; break;
case A_CycleWeaponRight: case A_CycleWeaponRight:
if (checkAllowedToUseItems()) if (checkAllowedToUseItems() && MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory))
MWBase::Environment::get().getWindowManager()->cycleWeapon(true); MWBase::Environment::get().getWindowManager()->cycleWeapon(true);
break; break;
case A_Sneak: case A_Sneak:
@ -1312,6 +1312,9 @@ namespace MWInput
if (!checkAllowedToUseItems()) if (!checkAllowedToUseItems())
return; return;
if (MWBase::Environment::get().getWorld()->getGlobalFloat ("chargenstate")!=-1)
return;
if (!MWBase::Environment::get().getWindowManager()->isGuiMode()) if (!MWBase::Environment::get().getWindowManager()->isGuiMode())
MWBase::Environment::get().getWindowManager()->activateQuickKey (index); MWBase::Environment::get().getWindowManager()->activateQuickKey (index);
} }