1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 18:35:20 +00:00
OpenMW/apps/openmw/mwworld/actionrepair.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
719 B
C++
Raw Normal View History

2013-03-23 08:16:46 +01:00
#include "actionrepair.hpp"
#include "../mwbase/environment.hpp"
#include "../mwbase/windowmanager.hpp"
2015-09-10 18:48:34 +12:00
#include "../mwmechanics/actorutil.hpp"
2013-03-23 08:16:46 +01:00
namespace MWWorld
{
ActionRepair::ActionRepair(const Ptr& item, bool force)
: Action(false, item)
, mForce(force)
2013-03-23 08:16:46 +01:00
{
}
void ActionRepair::executeImp(const Ptr& actor)
{
2015-09-10 18:48:34 +12:00
if (actor != MWMechanics::getPlayer())
return;
if (!mForce && MWMechanics::isPlayerInCombat())
{
MWBase::Environment::get().getWindowManager()->messageBox("#{sInventoryMessage2}");
return;
}
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Repair, getTarget());
2013-03-23 08:16:46 +01:00
}
}