mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-15 18:39:51 +00:00
Issue #294: disallowed inventory prevents Talk, Open and Take actions
This commit is contained in:
parent
750259973e
commit
c7010623fb
@ -133,6 +133,11 @@ namespace MWGui
|
|||||||
updateVisible();
|
updateVisible();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isAllowed(GuiWindow wnd)
|
||||||
|
{
|
||||||
|
return allowed & wnd;
|
||||||
|
}
|
||||||
|
|
||||||
MWGui::DialogueWindow* getDialogueWindow() {return mDialogueWindow;}
|
MWGui::DialogueWindow* getDialogueWindow() {return mDialogueWindow;}
|
||||||
MWGui::ContainerWindow* getContainerWindow() {return mContainerWindow;}
|
MWGui::ContainerWindow* getContainerWindow() {return mContainerWindow;}
|
||||||
MWGui::InventoryWindow* getInventoryWindow() {return mInventoryWindow;}
|
MWGui::InventoryWindow* getInventoryWindow() {return mInventoryWindow;}
|
||||||
|
@ -16,6 +16,9 @@ namespace MWWorld
|
|||||||
|
|
||||||
void ActionOpen::execute ()
|
void ActionOpen::execute ()
|
||||||
{
|
{
|
||||||
|
if (!MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory))
|
||||||
|
return;
|
||||||
|
|
||||||
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Container);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Container);
|
||||||
MWBase::Environment::get().getWindowManager()->getContainerWindow()->open(mContainer);
|
MWBase::Environment::get().getWindowManager()->getContainerWindow()->open(mContainer);
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#include "actiontake.hpp"
|
#include "actiontake.hpp"
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
|
#include "../mwgui/window_manager.hpp"
|
||||||
|
|
||||||
#include "class.hpp"
|
#include "class.hpp"
|
||||||
#include "world.hpp"
|
#include "world.hpp"
|
||||||
@ -13,6 +14,9 @@ namespace MWWorld
|
|||||||
|
|
||||||
void ActionTake::execute()
|
void ActionTake::execute()
|
||||||
{
|
{
|
||||||
|
if (!MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory))
|
||||||
|
return;
|
||||||
|
|
||||||
// insert into player's inventory
|
// insert into player's inventory
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPtr ("player", true);
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPtr ("player", true);
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#include "actiontalk.hpp"
|
#include "actiontalk.hpp"
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
|
#include "../mwgui/window_manager.hpp"
|
||||||
#include "../mwdialogue/dialoguemanager.hpp"
|
#include "../mwdialogue/dialoguemanager.hpp"
|
||||||
|
|
||||||
namespace MWWorld
|
namespace MWWorld
|
||||||
@ -11,6 +11,9 @@ namespace MWWorld
|
|||||||
|
|
||||||
void ActionTalk::execute()
|
void ActionTalk::execute()
|
||||||
{
|
{
|
||||||
|
if (!MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory))
|
||||||
|
return;
|
||||||
|
|
||||||
MWBase::Environment::get().getDialogueManager()->startDialogue (mActor);
|
MWBase::Environment::get().getDialogueManager()->startDialogue (mActor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user