2012-04-15 15:52:39 +00:00
|
|
|
#include "actionopen.hpp"
|
|
|
|
|
2012-05-11 09:52:07 +00:00
|
|
|
#include "../mwbase/environment.hpp"
|
2012-08-12 16:11:09 +00:00
|
|
|
#include "../mwbase/windowmanager.hpp"
|
2012-07-03 10:30:50 +00:00
|
|
|
|
2012-04-15 15:52:39 +00:00
|
|
|
#include "../mwgui/container.hpp"
|
|
|
|
|
2014-01-03 22:33:14 +00:00
|
|
|
#include "../mwmechanics/disease.hpp"
|
|
|
|
|
2012-07-03 10:30:50 +00:00
|
|
|
#include "class.hpp"
|
|
|
|
#include "containerstore.hpp"
|
|
|
|
|
2012-04-15 15:52:39 +00:00
|
|
|
namespace MWWorld
|
|
|
|
{
|
2013-03-07 13:00:13 +00:00
|
|
|
ActionOpen::ActionOpen (const MWWorld::Ptr& container, bool loot)
|
|
|
|
: Action (false, container)
|
|
|
|
, mLoot(loot)
|
2012-09-04 13:29:51 +00:00
|
|
|
{
|
2012-04-15 15:52:39 +00:00
|
|
|
}
|
|
|
|
|
2013-02-17 14:56:22 +00:00
|
|
|
void ActionOpen::executeImp (const MWWorld::Ptr& actor)
|
2012-04-15 15:52:39 +00:00
|
|
|
{
|
2012-05-25 16:45:17 +00:00
|
|
|
if (!MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory))
|
2013-02-17 14:56:22 +00:00
|
|
|
return;
|
2012-05-25 16:45:17 +00:00
|
|
|
|
2014-01-03 22:33:14 +00:00
|
|
|
MWMechanics::diseaseContact(actor, getTarget());
|
|
|
|
|
2012-05-23 10:23:35 +00:00
|
|
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Container);
|
2013-03-07 13:00:13 +00:00
|
|
|
MWBase::Environment::get().getWindowManager()->getContainerWindow()->open(getTarget(), mLoot);
|
2012-04-15 15:52:39 +00:00
|
|
|
}
|
|
|
|
}
|