2012-05-03 01:33:33 +00:00
|
|
|
#ifndef MWGUI_BOOKWINDOW_H
|
|
|
|
#define MWGUI_BOOKWINDOW_H
|
|
|
|
|
2013-04-10 04:32:05 +00:00
|
|
|
#include "windowbase.hpp"
|
2012-05-03 01:33:33 +00:00
|
|
|
|
|
|
|
#include "../mwworld/ptr.hpp"
|
|
|
|
|
2014-09-12 03:14:21 +00:00
|
|
|
#include <components/widgets/imagebutton.hpp>
|
2013-01-03 00:09:03 +00:00
|
|
|
|
2012-05-03 01:33:33 +00:00
|
|
|
namespace MWGui
|
|
|
|
{
|
2019-04-01 17:47:12 +00:00
|
|
|
class BookWindow : public BookWindowBase
|
2012-05-03 01:33:33 +00:00
|
|
|
{
|
|
|
|
public:
|
2013-04-10 18:46:21 +00:00
|
|
|
BookWindow();
|
2012-05-15 16:05:53 +00:00
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
void setPtr(const MWWorld::Ptr& book) override;
|
2013-02-17 14:56:22 +00:00
|
|
|
void setInventoryAllowed(bool allowed);
|
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
void onResChange(int, int) override { center(); }
|
2017-09-23 20:07:30 +00:00
|
|
|
|
2023-07-09 06:42:09 +00:00
|
|
|
std::string_view getWindowIdForLua() const override { return "Book"; }
|
|
|
|
|
2012-05-03 03:26:05 +00:00
|
|
|
protected:
|
2013-01-03 00:09:03 +00:00
|
|
|
void onNextPageButtonClicked(MyGUI::Widget* sender);
|
|
|
|
void onPrevPageButtonClicked(MyGUI::Widget* sender);
|
|
|
|
void onCloseButtonClicked(MyGUI::Widget* sender);
|
|
|
|
void onTakeButtonClicked(MyGUI::Widget* sender);
|
2014-01-04 00:13:19 +00:00
|
|
|
void onMouseWheel(MyGUI::Widget* _sender, int _rel);
|
2015-03-11 19:33:55 +00:00
|
|
|
void setTakeButtonShow(bool show);
|
|
|
|
|
2017-09-23 22:23:08 +00:00
|
|
|
void onKeyButtonPressed(MyGUI::Widget* sender, MyGUI::KeyCode key, MyGUI::Char character);
|
|
|
|
|
2015-03-11 19:33:55 +00:00
|
|
|
void nextPage();
|
|
|
|
void prevPage();
|
2012-05-03 03:26:05 +00:00
|
|
|
|
2012-05-10 09:03:27 +00:00
|
|
|
void updatePages();
|
|
|
|
void clearPages();
|
|
|
|
|
2012-05-03 03:26:05 +00:00
|
|
|
private:
|
2014-09-19 22:11:04 +00:00
|
|
|
typedef std::pair<int, int> Page;
|
|
|
|
typedef std::vector<Page> Pages;
|
|
|
|
|
2014-09-12 03:14:21 +00:00
|
|
|
Gui::ImageButton* mCloseButton;
|
|
|
|
Gui::ImageButton* mTakeButton;
|
|
|
|
Gui::ImageButton* mNextPageButton;
|
|
|
|
Gui::ImageButton* mPrevPageButton;
|
2014-09-19 22:11:04 +00:00
|
|
|
|
2012-05-10 09:03:27 +00:00
|
|
|
MyGUI::TextBox* mLeftPageNumber;
|
|
|
|
MyGUI::TextBox* mRightPageNumber;
|
|
|
|
MyGUI::Widget* mLeftPage;
|
|
|
|
MyGUI::Widget* mRightPage;
|
|
|
|
|
|
|
|
unsigned int mCurrentPage; // 0 is first page
|
2014-09-19 22:11:04 +00:00
|
|
|
Pages mPages;
|
2012-05-03 03:26:05 +00:00
|
|
|
|
|
|
|
MWWorld::Ptr mBook;
|
2013-02-17 14:56:22 +00:00
|
|
|
|
|
|
|
bool mTakeButtonShow;
|
|
|
|
bool mTakeButtonAllowed;
|
2012-05-03 01:33:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|