2012-11-17 18:17:08 +01:00
|
|
|
#include "failedaction.hpp"
|
|
|
|
|
2012-11-19 21:04:49 +01:00
|
|
|
#include "../mwbase/environment.hpp"
|
|
|
|
#include "../mwbase/windowmanager.hpp"
|
|
|
|
|
2015-08-21 21:12:39 +12:00
|
|
|
#include "../mwmechanics/actorutil.hpp"
|
2012-11-17 18:17:08 +01:00
|
|
|
|
|
|
|
namespace MWWorld
|
|
|
|
{
|
2022-08-23 22:14:27 +02:00
|
|
|
FailedAction::FailedAction(std::string_view msg, const Ptr& target)
|
2016-08-10 21:02:17 +09:00
|
|
|
: Action(false, target), mMessage(msg)
|
2012-11-19 21:04:49 +01:00
|
|
|
{ }
|
2012-11-22 17:24:28 +01:00
|
|
|
|
2013-08-08 22:34:53 -07:00
|
|
|
void FailedAction::executeImp(const Ptr &actor)
|
2012-11-17 18:17:08 +01:00
|
|
|
{
|
2015-08-21 21:12:39 +12:00
|
|
|
if(actor == MWMechanics::getPlayer() && !mMessage.empty())
|
2013-08-08 22:34:53 -07:00
|
|
|
MWBase::Environment::get().getWindowManager()->messageBox(mMessage);
|
2012-11-17 18:17:08 +01:00
|
|
|
}
|
|
|
|
}
|