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

32 lines
883 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)
{
}
void ActionRead::execute ()
{
ESMS::LiveCellRef<ESM::Book, MWWorld::RefData> *ref =
mObject.get<ESM::Book>();
if (ref->base->data.isScroll)
{
MWBase::Environment::get().getWindowManager()->setGuiMode(MWGui::GM_Scroll);
MWBase::Environment::get().getWindowManager()->getScrollWindow()->open(mObject);
}
else
{
MWBase::Environment::get().getWindowManager()->setGuiMode(MWGui::GM_Book);
MWBase::Environment::get().getWindowManager()->getBookWindow()->open(mObject);
}
}
}