forked from teamnwah/openmw-tes3coop
Disable QuickKeysMenu in werewolf form
This commit is contained in:
parent
a3ea7cb956
commit
666dbc6ddc
1 changed files with 20 additions and 1 deletions
|
@ -26,7 +26,7 @@
|
|||
#include "../mwworld/inventorystore.hpp"
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include "../mwmechanics/creaturestats.hpp"
|
||||
#include "../mwmechanics/npcstats.hpp"
|
||||
|
||||
#include "../mwdialogue/dialoguemanagerimp.hpp"
|
||||
|
||||
|
@ -826,6 +826,14 @@ namespace MWInput
|
|||
|
||||
void InputManager::quickKey (int index)
|
||||
{
|
||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||
if (player.getClass().getNpcStats(player).isWerewolf())
|
||||
{
|
||||
// Cannot use items or spells while in werewolf form
|
||||
MWBase::Environment::get().getWindowManager()->messageBox("#{sWerewolfRefusal}");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!MWBase::Environment::get().getWindowManager()->isGuiMode())
|
||||
MWBase::Environment::get().getWindowManager()->activateQuickKey (index);
|
||||
}
|
||||
|
@ -834,7 +842,18 @@ namespace MWInput
|
|||
{
|
||||
if (!MWBase::Environment::get().getWindowManager()->isGuiMode ()
|
||||
&& MWBase::Environment::get().getWorld()->getGlobalFloat ("chargenstate")==-1)
|
||||
{
|
||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||
if (player.getClass().getNpcStats(player).isWerewolf())
|
||||
{
|
||||
// Cannot use items or spells while in werewolf form
|
||||
MWBase::Environment::get().getWindowManager()->messageBox("#{sWerewolfRefusal}");
|
||||
return;
|
||||
}
|
||||
|
||||
MWBase::Environment::get().getWindowManager()->pushGuiMode (MWGui::GM_QuickKeysMenu);
|
||||
|
||||
}
|
||||
else if (MWBase::Environment::get().getWindowManager()->getMode () == MWGui::GM_QuickKeysMenu) {
|
||||
while(MyGUI::InputManager::getInstance().isModalAny()) { //Handle any open Modal windows
|
||||
MWBase::Environment::get().getWindowManager()->getCurrentModal()->exit();
|
||||
|
|
Loading…
Reference in a new issue