diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-02-15 15:08:47 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-02-15 15:18:20 +0300 |
commit | 77a52b24c88dd113a74ff55cecb63a7214193fdf (patch) | |
tree | 218897c6979c994f9fb5d50ec976dc90075b8576 /src/gui/popups/popupmenu.cpp | |
parent | e59fc67ba665be08a9d9a3fa27139d31168d324a (diff) | |
download | plus-77a52b24c88dd113a74ff55cecb63a7214193fdf.tar.gz plus-77a52b24c88dd113a74ff55cecb63a7214193fdf.tar.bz2 plus-77a52b24c88dd113a74ff55cecb63a7214193fdf.tar.xz plus-77a52b24c88dd113a74ff55cecb63a7214193fdf.zip |
Show buy or sell in player context menu based on enabled shop types.
Diffstat (limited to 'src/gui/popups/popupmenu.cpp')
-rw-r--r-- | src/gui/popups/popupmenu.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index 188c8ae9a..d596f1a50 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -2366,20 +2366,27 @@ void PopupMenu::addBuySell(const Being *const being) if (player_relations.getDefault() & PlayerRelation::TRADE) { mBrowserBox->addRow("##3---"); - if (being->isShopEnabled()) + const bool haveVending = serverFeatures->haveVending(); + if (being->isSellShopEnabled()) { // TRANSLATORS: popup menu item // TRANSLATORS: buy item mBrowserBox->addRow("/buy 'NAME'", _("Buy")); - // TRANSLATORS: popup menu item - // TRANSLATORS: sell item - mBrowserBox->addRow("/sell 'NAME'", _("Sell")); } - else + else if (!haveVending) { // TRANSLATORS: popup menu item // TRANSLATORS: buy item mBrowserBox->addRow("/buy 'NAME'", _("Buy (?)")); + } + if (being->isBuyShopEnabled()) + { + // TRANSLATORS: popup menu item + // TRANSLATORS: sell item + mBrowserBox->addRow("/sell 'NAME'", _("Sell")); + } + else if (!haveVending) + { // TRANSLATORS: popup menu item // TRANSLATORS: sell item mBrowserBox->addRow("/sell 'NAME'", _("Sell (?)")); |