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/popupmenu.cpp | |
parent | 5f4ac032fbf4f7b76a43da11bb1d40b94820a247 (diff) | |
download | manaplus-4cd59b0f9f30b7104197fa96851b616fb9981caa.tar.gz manaplus-4cd59b0f9f30b7104197fa96851b616fb9981caa.tar.bz2 manaplus-4cd59b0f9f30b7104197fa96851b616fb9981caa.tar.xz manaplus-4cd59b0f9f30b7104197fa96851b616fb9981caa.zip |
Add support for small screens with on screen top right buttons.
Add button "WIN" to buttons list.
Diffstat (limited to 'src/gui/popupmenu.cpp')
-rw-r--r-- | src/gui/popupmenu.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp index b71676b15..2c25cceaf 100644 --- a/src/gui/popupmenu.cpp +++ b/src/gui/popupmenu.cpp @@ -27,6 +27,7 @@ #include "game.h" #include "guild.h" #include "guildmanager.h" +#include "inputmanager.h" #include "item.h" #include "itemshortcut.h" #include "localplayer.h" @@ -1620,6 +1621,12 @@ void PopupMenu::handleLink(const std::string &link, if (miniStatusWindow) miniStatusWindow->showBar(link.substr(9), true); } + else if (!link.compare(0, 12, "show window_")) + { + const int id = atoi(link.substr(12).c_str()); + if (id >= 0) + inputManager.executeAction(id); + } // Unknown actions else if (link != "cancel") { @@ -2104,6 +2111,30 @@ void PopupMenu::showLinkPopup(const int x, const int y, showPopup(x, y); } +void PopupMenu::showWindowsPopup(const int x, const int y) +{ + mX = x; + mY = y; + + mBrowserBox->clearRows(); + const std::vector<ButtonText*> &names = windowMenu->getButtonTexts(); + mBrowserBox->addRow(_("Show window")); + + FOR_EACH (std::vector<ButtonText*>::const_iterator, it, names) + { + const ButtonText *const btn = *it; + if (!btn) + continue; + + mBrowserBox->addRow(strprintf("show window_%d", btn->key), + btn->text.c_str()); + } + mBrowserBox->addRow("##3---"); + mBrowserBox->addRow("cancel", _("Cancel")); + + showPopup(x, y); +} + void PopupMenu::showPopup(int x, int y) { const int pad2 = 2 * getPadding(); |