2013-03-23 07:16:46 +00:00
|
|
|
#include "actionrepair.hpp"
|
|
|
|
|
|
|
|
#include "../mwbase/environment.hpp"
|
|
|
|
#include "../mwbase/windowmanager.hpp"
|
2014-04-25 02:47:45 +00:00
|
|
|
#include "../mwbase/world.hpp"
|
|
|
|
#include "../mwworld/player.hpp"
|
2015-09-10 06:48:34 +00:00
|
|
|
#include "../mwmechanics/actorutil.hpp"
|
2013-03-23 07:16:46 +00:00
|
|
|
|
|
|
|
namespace MWWorld
|
|
|
|
{
|
|
|
|
ActionRepair::ActionRepair(const Ptr &item)
|
|
|
|
: Action(false, item)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void ActionRepair::executeImp (const Ptr& actor)
|
|
|
|
{
|
2015-09-10 06:48:34 +00:00
|
|
|
if (actor != MWMechanics::getPlayer())
|
2015-09-07 20:13:20 +00:00
|
|
|
return;
|
|
|
|
|
2015-09-10 06:48:34 +00:00
|
|
|
if(MWMechanics::isPlayerInCombat()) {
|
2014-04-25 02:47:45 +00:00
|
|
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sInventoryMessage2}");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2017-09-22 19:26:41 +00:00
|
|
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Repair, getTarget());
|
2013-03-23 07:16:46 +00:00
|
|
|
}
|
|
|
|
}
|