1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 11:49:56 +00:00
openmw-tes3mp/apps/openmw/mwgui/bookwindow.cpp

59 lines
1.8 KiB
C++
Raw Normal View History

2012-05-03 01:33:33 +00:00
#include "bookwindow.hpp"
#include "../mwbase/environment.hpp"
#include "../mwinput/inputmanager.hpp"
#include "../mwsound/soundmanager.hpp"
#include "../mwworld/actiontake.hpp"
2012-05-03 01:33:33 +00:00
using namespace MWGui;
BookWindow::BookWindow (WindowManager& parWindowManager) :
2012-05-03 01:33:33 +00:00
WindowBase("openmw_book_layout.xml", parWindowManager)
{
getWidget(mCloseButton, "CloseButton");
mCloseButton->eventMouseButtonClick += MyGUI::newDelegate(this, &BookWindow::onCloseButtonClicked);
getWidget(mTakeButton, "TakeButton");
mTakeButton->eventMouseButtonClick += MyGUI::newDelegate(this, &BookWindow::onTakeButtonClicked);
getWidget(mNextPageButton, "NextPageBTN");
mNextPageButton->eventMouseButtonClick += MyGUI::newDelegate(this, &BookWindow::onNextPageButtonClicked);
getWidget(mPrevPageButton, "PrevPageBTN");
mPrevPageButton->eventMouseButtonClick += MyGUI::newDelegate(this, &BookWindow::onPrevPageButtonClicked);
2012-05-03 01:33:33 +00:00
center();
}
void BookWindow::open (MWWorld::Ptr book)
{
MWBase::Environment::get().getSoundManager()->playSound3D (book, "book open", 1.0, 1.0);
mBook = book;
}
void BookWindow::onCloseButtonClicked (MyGUI::Widget* _sender)
{
MWBase::Environment::get().getSoundManager()->playSound3D (mBook, "book close", 1.0, 1.0);
MWBase::Environment::get().getInputManager()->setGuiMode(MWGui::GM_Game);
}
void BookWindow::onTakeButtonClicked (MyGUI::Widget* _sender)
{
MWBase::Environment::get().getSoundManager()->playSound3D (mBook, "Item Book Up", 1.0, 1.0, MWSound::Play_NoTrack);
MWWorld::ActionTake take(mBook);
take.execute();
MWBase::Environment::get().getInputManager()->setGuiMode (GM_Game);
}
void BookWindow::onNextPageButtonClicked (MyGUI::Widget* _sender)
2012-05-03 01:33:33 +00:00
{
}
void BookWindow::onPrevPageButtonClicked (MyGUI::Widget* _sender)
{
}