1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-07 12:54:00 +00:00
OpenMW/apps/openmw/mwgui/bookwindow.hpp
scrawl 1718d735b5 Fix menu/journal/book/scroll buttons when using localised MW-installations
This patch implements a custom widget that can switch its texture on-the-fly, making it obsolete having to use an atlas to get a hover animation. This also removes the predefined size restriction and should now work with all button texture sizes.
2013-01-03 01:09:03 +01:00

48 lines
1.2 KiB
C++

#ifndef MWGUI_BOOKWINDOW_H
#define MWGUI_BOOKWINDOW_H
#include "window_base.hpp"
#include "../mwworld/ptr.hpp"
#include "imagebutton.hpp"
namespace MWGui
{
class BookWindow : public WindowBase
{
public:
BookWindow(MWBase::WindowManager& parWindowManager);
void open(MWWorld::Ptr book);
void setTakeButtonShow(bool show);
protected:
void onNextPageButtonClicked (MyGUI::Widget* sender);
void onPrevPageButtonClicked (MyGUI::Widget* sender);
void onCloseButtonClicked (MyGUI::Widget* sender);
void onTakeButtonClicked (MyGUI::Widget* sender);
void updatePages();
void clearPages();
private:
MWGui::ImageButton* mCloseButton;
MWGui::ImageButton* mTakeButton;
MWGui::ImageButton* mNextPageButton;
MWGui::ImageButton* mPrevPageButton;
MyGUI::TextBox* mLeftPageNumber;
MyGUI::TextBox* mRightPageNumber;
MyGUI::Widget* mLeftPage;
MyGUI::Widget* mRightPage;
unsigned int mCurrentPage; // 0 is first page
std::vector<MyGUI::Widget*> mPages;
MWWorld::Ptr mBook;
};
}
#endif