diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-02-03 15:32:33 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-02-03 20:13:09 +0300 |
commit | 4cd59b0f9f30b7104197fa96851b616fb9981caa (patch) | |
tree | 60f976e0dc4ba9cf50359a0f1a2c1b4233b081ad /src/gui/windowmenu.h | |
parent | 5f4ac032fbf4f7b76a43da11bb1d40b94820a247 (diff) | |
download | manaverse-4cd59b0f9f30b7104197fa96851b616fb9981caa.tar.gz manaverse-4cd59b0f9f30b7104197fa96851b616fb9981caa.tar.bz2 manaverse-4cd59b0f9f30b7104197fa96851b616fb9981caa.tar.xz manaverse-4cd59b0f9f30b7104197fa96851b616fb9981caa.zip |
Add support for small screens with on screen top right buttons.
Add button "WIN" to buttons list.
Diffstat (limited to 'src/gui/windowmenu.h')
-rw-r--r-- | src/gui/windowmenu.h | 26 |
1 files changed, 22 insertions, 4 deletions
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 <Button*> &getButtons() A_WARN_UNUSED { return mButtons; } + std::vector <ButtonText*> &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 <Button*> mButtons; + std::vector <ButtonText*> mButtonTexts; std::map <std::string, ButtonInfo*> mButtonNames; bool mHaveMouse; int mAutoHide; + bool mSmallWindow; }; extern WindowMenu *windowMenu; |