mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-15 20:19:56 +00:00
29 lines
876 B
C++
29 lines
876 B
C++
#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::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);
|
|
}
|
|
}
|
|
}
|