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:
parent
3f181f9a9d
commit
b51c42146f
2 changed files with 4 additions and 6 deletions
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue