summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-07-03 18:13:50 +0300
committerAndrei Karas <akaras@inbox.ru>2014-07-03 18:13:50 +0300
commit7a73a1ce2a20d13fb1e332dc48454d2e5a4a7826 (patch)
tree22862900959920412d6d924b66c3850af9195243 /src
parent87dc57caff1b01f4abe2cc14bfc56f5bc130fbb6 (diff)
downloadplus-7a73a1ce2a20d13fb1e332dc48454d2e5a4a7826.tar.gz
plus-7a73a1ce2a20d13fb1e332dc48454d2e5a4a7826.tar.bz2
plus-7a73a1ce2a20d13fb1e332dc48454d2e5a4a7826.tar.xz
plus-7a73a1ce2a20d13fb1e332dc48454d2e5a4a7826.zip
Use useButton attribute also in popup menu.
Diffstat (limited to 'src')
-rw-r--r--src/gui/popups/popupmenu.cpp28
1 files changed, 9 insertions, 19 deletions
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index 5d0f32f19..687aa38cf 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -2797,29 +2797,19 @@ void PopupMenu::addProtection()
void PopupMenu::addUseDrop(const Item *const item, const bool isProtected)
{
- if (item->isEquipment())
+ const ItemInfo &info = item->getInfo();
+ const std::string &str = (item->isEquipment() && item->isEquipped())
+ ? info.getUseButton2() : info.getUseButton();
+
+ if (str.empty())
{
- if (item->isEquipped())
- {
- // TRANSLATORS: popup menu item
- // TRANSLATORS: unequip item
- mBrowserBox->addRow("use", _("Unequip"));
- }
- else
- {
- // TRANSLATORS: popup menu item
- // TRANSLATORS: use item
- mBrowserBox->addRow("use", _("Equip"));
- }
+ // TRANSLATORS: popup menu item
+ mBrowserBox->addRow("use", _("Use"));
}
else
{
- if (!isProtected)
- {
- // TRANSLATORS: popup menu item
- // TRANSLATORS: use item
- mBrowserBox->addRow("use", _("Use"));
- }
+ // TRANSLATORS: popup menu item
+ mBrowserBox->addRow("use", str.c_str());
}
if (!isProtected)