2012-11-17 17:17:08 +00:00
|
|
|
#include "failedaction.hpp"
|
|
|
|
#include "../mwbase/world.hpp"
|
|
|
|
|
2012-11-19 20:04:49 +00:00
|
|
|
#include "../mwbase/environment.hpp"
|
|
|
|
#include "../mwbase/windowmanager.hpp"
|
|
|
|
|
2012-11-17 17:17:08 +00:00
|
|
|
|
|
|
|
namespace MWWorld
|
|
|
|
{
|
2012-11-19 20:04:49 +00:00
|
|
|
FailedAction::FailedAction (const std::string& msg) : Action (false), message(msg)
|
|
|
|
{ }
|
2012-11-22 16:24:28 +00:00
|
|
|
|
|
|
|
|
2012-11-17 17:17:08 +00:00
|
|
|
void FailedAction::executeImp (const Ptr& actor)
|
|
|
|
{
|
2012-11-22 16:24:28 +00:00
|
|
|
if ( actor.getRefData().getHandle()=="player" && !(message.empty()))
|
2012-11-17 17:17:08 +00:00
|
|
|
{
|
2012-11-19 20:04:49 +00:00
|
|
|
MWBase::Environment::get().getWindowManager() ->messageBox(message, std::vector<std::string>());
|
2012-11-17 17:17:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|