From 1bddbbcfa0f296d36900849ead682a5cd82ef21f Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Thu, 19 Sep 2019 22:43:53 +0400 Subject: [PATCH 1/2] Check if related menus are allowed when using cycle hotkeys (bug #5167) --- CHANGELOG.md | 1 + apps/openmw/mwinput/inputmanagerimp.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d9104199..c65129702 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -145,6 +145,7 @@ Bug #5161: Creature companions can't be activated when they are knocked down Bug #5164: Faction owned items handling is incorrect Bug #5166: Scripts still should be executed after player's death + Bug #5167: Player can select and cast spells before magic menu is enabled Feature #1774: Handle AvoidNode Feature #2229: Improve pathfinding AI Feature #3025: Analogue gamepad movement controls diff --git a/apps/openmw/mwinput/inputmanagerimp.cpp b/apps/openmw/mwinput/inputmanagerimp.cpp index edc45b884..c0ec74015 100644 --- a/apps/openmw/mwinput/inputmanagerimp.cpp +++ b/apps/openmw/mwinput/inputmanagerimp.cpp @@ -471,19 +471,19 @@ namespace MWInput quickLoad(); break; case A_CycleSpellLeft: - if (checkAllowedToUseItems()) + if (checkAllowedToUseItems() && MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Magic)) MWBase::Environment::get().getWindowManager()->cycleSpell(false); break; case A_CycleSpellRight: - if (checkAllowedToUseItems()) + if (checkAllowedToUseItems() && MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Magic)) MWBase::Environment::get().getWindowManager()->cycleSpell(true); break; case A_CycleWeaponLeft: - if (checkAllowedToUseItems()) + if (checkAllowedToUseItems() && MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory)) MWBase::Environment::get().getWindowManager()->cycleWeapon(false); break; case A_CycleWeaponRight: - if (checkAllowedToUseItems()) + if (checkAllowedToUseItems() && MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory)) MWBase::Environment::get().getWindowManager()->cycleWeapon(true); break; case A_Sneak: From 7cb6a9c1e98bb283818fa74b57b84202b72b9a2e Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Thu, 19 Sep 2019 23:03:29 +0400 Subject: [PATCH 2/2] Do not allow to use quick keys during chargen --- apps/openmw/mwinput/inputmanagerimp.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/openmw/mwinput/inputmanagerimp.cpp b/apps/openmw/mwinput/inputmanagerimp.cpp index c0ec74015..6e0f3375b 100644 --- a/apps/openmw/mwinput/inputmanagerimp.cpp +++ b/apps/openmw/mwinput/inputmanagerimp.cpp @@ -1312,6 +1312,9 @@ namespace MWInput if (!checkAllowedToUseItems()) return; + if (MWBase::Environment::get().getWorld()->getGlobalFloat ("chargenstate")!=-1) + return; + if (!MWBase::Environment::get().getWindowManager()->isGuiMode()) MWBase::Environment::get().getWindowManager()->activateQuickKey (index); }