2012-05-03 03:26:05 +00:00
|
|
|
#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)
|
2012-05-03 03:26:05 +00:00
|
|
|
{
|
2012-06-29 16:54:23 +00:00
|
|
|
LiveCellRef<ESM::Book> *ref = mObject.get<ESM::Book>();
|
2012-05-03 03:26:05 +00:00
|
|
|
|
|
|
|
if (ref->base->data.isScroll)
|
|
|
|
{
|
2012-05-23 10:23:35 +00:00
|
|
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Scroll);
|
2012-05-03 03:26:05 +00:00
|
|
|
MWBase::Environment::get().getWindowManager()->getScrollWindow()->open(mObject);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-05-23 10:23:35 +00:00
|
|
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Book);
|
2012-05-03 03:26:05 +00:00
|
|
|
MWBase::Environment::get().getWindowManager()->getBookWindow()->open(mObject);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|