|
|
|
@ -5,6 +5,8 @@
|
|
|
|
|
#include "../mwbase/windowmanager.hpp"
|
|
|
|
|
#include "../mwbase/mechanicsmanager.hpp"
|
|
|
|
|
|
|
|
|
|
#include "../mwgui/inventorywindow.hpp"
|
|
|
|
|
|
|
|
|
|
#include "class.hpp"
|
|
|
|
|
#include "containerstore.hpp"
|
|
|
|
|
|
|
|
|
@ -14,6 +16,17 @@ namespace MWWorld
|
|
|
|
|
|
|
|
|
|
void ActionTake::executeImp (const Ptr& actor)
|
|
|
|
|
{
|
|
|
|
|
// When in GUI mode, we should use drag and drop
|
|
|
|
|
if (actor == MWBase::Environment::get().getWorld()->getPlayerPtr())
|
|
|
|
|
{
|
|
|
|
|
MWGui::GuiMode mode = MWBase::Environment::get().getWindowManager()->getMode();
|
|
|
|
|
if (mode == MWGui::GM_Inventory || mode == MWGui::GM_Container)
|
|
|
|
|
{
|
|
|
|
|
MWBase::Environment::get().getWindowManager()->getInventoryWindow()->pickUpObject(getTarget());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MWBase::Environment::get().getMechanicsManager()->itemTaken(
|
|
|
|
|
actor, getTarget(), MWWorld::Ptr(), getTarget().getRefData().getCount());
|
|
|
|
|
MWWorld::Ptr newitem = *actor.getClass().getContainerStore (actor).add (getTarget(), getTarget().getRefData().getCount(), actor);
|
|
|
|
|