2012-05-24 13:57:23 +00:00
|
|
|
#include "actionalchemy.hpp"
|
|
|
|
|
|
|
|
#include "../mwbase/environment.hpp"
|
2012-08-12 16:11:09 +00:00
|
|
|
#include "../mwbase/windowmanager.hpp"
|
2014-04-25 02:47:45 +00:00
|
|
|
|
2015-09-10 06:48:34 +00:00
|
|
|
#include "../mwmechanics/actorutil.hpp"
|
2012-05-24 13:57:23 +00:00
|
|
|
|
|
|
|
namespace MWWorld
|
|
|
|
{
|
2018-07-09 15:31:40 +00:00
|
|
|
ActionAlchemy::ActionAlchemy(bool force)
|
|
|
|
: Action (false)
|
|
|
|
, mForce(force)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-07-27 10:00:10 +00:00
|
|
|
void ActionAlchemy::executeImp (const Ptr& actor)
|
2012-05-24 13:57:23 +00:00
|
|
|
{
|
2015-09-10 06:48:34 +00:00
|
|
|
if (actor != MWMechanics::getPlayer())
|
2015-09-07 20:13:20 +00:00
|
|
|
return;
|
|
|
|
|
2018-07-09 15:31:40 +00:00
|
|
|
if(!mForce && MWMechanics::isPlayerInCombat())
|
|
|
|
{ //Ensure we're not in combat
|
2014-04-25 02:47:45 +00:00
|
|
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sInventoryMessage3}");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-05-24 13:57:23 +00:00
|
|
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Alchemy);
|
|
|
|
}
|
|
|
|
}
|