1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-10 21:40:15 +00:00

Issue #294: disallowed inventory prevents Talk, Open and Take actions

This commit is contained in:
scrawl 2012-05-25 18:45:17 +02:00
parent 750259973e
commit c7010623fb
4 changed files with 16 additions and 1 deletions

View File

@ -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;}

View File

@ -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);
}

View File

@ -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);

View File

@ -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);
}
}