forked from teamnwah/openmw-tes3coop
Issue #370: replaced custom target handling in read action with base class implementation
This commit is contained in:
parent
3f181f9a9d
commit
b51c42146f
2 changed files with 4 additions and 6 deletions
|
@ -8,23 +8,23 @@
|
||||||
|
|
||||||
namespace MWWorld
|
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)
|
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)
|
if (ref->base->data.isScroll)
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Scroll);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Scroll);
|
||||||
MWBase::Environment::get().getWindowManager()->getScrollWindow()->open(mObject);
|
MWBase::Environment::get().getWindowManager()->getScrollWindow()->open(getTarget());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Book);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Book);
|
||||||
MWBase::Environment::get().getWindowManager()->getBookWindow()->open(mObject);
|
MWBase::Environment::get().getWindowManager()->getBookWindow()->open(getTarget());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,6 @@ namespace MWWorld
|
||||||
{
|
{
|
||||||
class ActionRead : public Action
|
class ActionRead : public Action
|
||||||
{
|
{
|
||||||
Ptr mObject; // book or scroll to read
|
|
||||||
|
|
||||||
virtual void executeImp (const MWWorld::Ptr& actor);
|
virtual void executeImp (const MWWorld::Ptr& actor);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Reference in a new issue