mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-10 03:39:55 +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();
|
||||
}
|
||||
|
||||
bool isAllowed(GuiWindow wnd)
|
||||
{
|
||||
return allowed & wnd;
|
||||
}
|
||||
|
||||
MWGui::DialogueWindow* getDialogueWindow() {return mDialogueWindow;}
|
||||
MWGui::ContainerWindow* getContainerWindow() {return mContainerWindow;}
|
||||
MWGui::InventoryWindow* getInventoryWindow() {return mInventoryWindow;}
|
||||
|
@ -16,6 +16,9 @@ namespace MWWorld
|
||||
|
||||
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()->getContainerWindow()->open(mContainer);
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include "actiontake.hpp"
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwgui/window_manager.hpp"
|
||||
|
||||
#include "class.hpp"
|
||||
#include "world.hpp"
|
||||
@ -13,6 +14,9 @@ namespace MWWorld
|
||||
|
||||
void ActionTake::execute()
|
||||
{
|
||||
if (!MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory))
|
||||
return;
|
||||
|
||||
// insert into player's inventory
|
||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPtr ("player", true);
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "actiontalk.hpp"
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
|
||||
#include "../mwgui/window_manager.hpp"
|
||||
#include "../mwdialogue/dialoguemanager.hpp"
|
||||
|
||||
namespace MWWorld
|
||||
@ -11,6 +11,9 @@ namespace MWWorld
|
||||
|
||||
void ActionTalk::execute()
|
||||
{
|
||||
if (!MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory))
|
||||
return;
|
||||
|
||||
MWBase::Environment::get().getDialogueManager()->startDialogue (mActor);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user