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