From 7a73a1ce2a20d13fb1e332dc48454d2e5a4a7826 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 3 Jul 2014 18:13:50 +0300 Subject: Use useButton attribute also in popup menu. --- src/gui/popups/popupmenu.cpp | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) (limited to 'src/gui/popups') 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) -- cgit v1.2.3-70-g09d2