1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-08 09:37:53 +00:00
OpenMW/apps/openmw/mwworld/actionread.cpp

30 lines
876 B
C++
Raw Normal View History

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