You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openmw-tes3mp/apps/openmw/mwworld/actionread.cpp

31 lines
877 B
C++

#include "actionread.hpp"
#include "../mwbase/environment.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwgui/bookwindow.hpp"
#include "../mwgui/scrollwindow.hpp"
namespace MWWorld
{
ActionRead::ActionRead (const MWWorld::Ptr& object) : mObject (object)
{
}
void ActionRead::executeImp (const MWWorld::Ptr& actor)
{
LiveCellRef<ESM::Book> *ref = mObject.get<ESM::Book>();
if (ref->base->data.isScroll)
{
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Scroll);
MWBase::Environment::get().getWindowManager()->getScrollWindow()->open(mObject);
}
else
{
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Book);
MWBase::Environment::get().getWindowManager()->getBookWindow()->open(mObject);
}
}
}