From 4cd59b0f9f30b7104197fa96851b616fb9981caa Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 3 Feb 2013 15:32:33 +0300 Subject: Add support for small screens with on screen top right buttons. Add button "WIN" to buttons list. --- src/gui/windowmenu.h | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'src/gui/windowmenu.h') diff --git a/src/gui/windowmenu.h b/src/gui/windowmenu.h index 6f0cfbdff..cc152f72f 100644 --- a/src/gui/windowmenu.h +++ b/src/gui/windowmenu.h @@ -41,9 +41,9 @@ class Window; struct ButtonInfo final { - ButtonInfo(Button *button0, Window *window0, bool visible0) : + ButtonInfo(Button *const button0, const int key0, const bool visible0) : button(button0), - window(window0), + key(key0), visible(visible0) { } @@ -51,10 +51,24 @@ struct ButtonInfo final A_DELETE_COPY(ButtonInfo) Button *button; - Window *window; + int key; bool visible; }; +struct ButtonText final +{ + ButtonText(const std::string &text0, const int key0) : + text(text0), + key(key0) + { + } + + A_DELETE_COPY(ButtonText) + + std::string text; + int key; +}; + /** * The window menu. Allows showing and hiding many of the different windows * used in the game. @@ -88,6 +102,9 @@ class WindowMenu final : public Container, std::vector &getButtons() A_WARN_UNUSED { return mButtons; } + std::vector &getButtonTexts() A_WARN_UNUSED + { return mButtonTexts; } + void showButton(const std::string &name, const bool visible); void loadButtons(); @@ -103,7 +120,6 @@ class WindowMenu final : public Container, inline void addButton(const char *const text, const std::string &description, int &x, int &h, const int key, - Window *window, const bool visible = true); void updateButtons(); @@ -113,9 +129,11 @@ class WindowMenu final : public Container, int mSpacing; TextPopup *mTextPopup; std::vector mButtons; + std::vector mButtonTexts; std::map mButtonNames; bool mHaveMouse; int mAutoHide; + bool mSmallWindow; }; extern WindowMenu *windowMenu; -- cgit v1.2.3-70-g09d2