1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-31 21:45:33 +00:00

Issue #370: replaced custom target handling in read action with base class implementation

This commit is contained in:
Marc Zinnschlag 2012-09-04 15:24:55 +02:00
parent 3f181f9a9d
commit b51c42146f
2 changed files with 4 additions and 6 deletions

View file

@ -8,23 +8,23 @@
namespace MWWorld
{
ActionRead::ActionRead (const MWWorld::Ptr& object) : mObject (object)
ActionRead::ActionRead (const MWWorld::Ptr& object) : Action (false, object)
{
}
void ActionRead::executeImp (const MWWorld::Ptr& actor)
{
LiveCellRef<ESM::Book> *ref = mObject.get<ESM::Book>();
LiveCellRef<ESM::Book> *ref = getTarget().get<ESM::Book>();
if (ref->base->data.isScroll)
{
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Scroll);
MWBase::Environment::get().getWindowManager()->getScrollWindow()->open(mObject);
MWBase::Environment::get().getWindowManager()->getScrollWindow()->open(getTarget());
}
else
{
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Book);
MWBase::Environment::get().getWindowManager()->getBookWindow()->open(mObject);
MWBase::Environment::get().getWindowManager()->getBookWindow()->open(getTarget());
}
}
}

View file

@ -8,8 +8,6 @@ namespace MWWorld
{
class ActionRead : public Action
{
Ptr mObject; // book or scroll to read
virtual void executeImp (const MWWorld::Ptr& actor);
public: