summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-07-03 17:03:38 +0300
committerAndrei Karas <akaras@inbox.ru>2014-07-03 17:03:38 +0300
commit5d742f63283c4c2c12f1539f1d69ab3bef7be396 (patch)
treecc58a8fd3ebeaa7784ce669259cb14c7db05f224
parent9d33bb1bdaf0f19ccaa742a316af9620b05b825d (diff)
downloadplus-5d742f63283c4c2c12f1539f1d69ab3bef7be396.tar.gz
plus-5d742f63283c4c2c12f1539f1d69ab3bef7be396.tar.bz2
plus-5d742f63283c4c2c12f1539f1d69ab3bef7be396.tar.xz
plus-5d742f63283c4c2c12f1539f1d69ab3bef7be396.zip
Use "useButton" item attribute in inventory window.
-rw-r--r--src/gui/windows/inventorywindow.cpp24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp
index a16543099..ee9641927 100644
--- a/src/gui/windows/inventorywindow.cpp
+++ b/src/gui/windows/inventorywindow.cpp
@@ -62,6 +62,10 @@
#include "net/inventoryhandler.h"
#include "net/net.h"
+#include "resources/iteminfo.h"
+
+#include "resources/db/itemdb.h"
+
#include "utils/delete2.h"
#include <string>
@@ -639,24 +643,8 @@ void InventoryWindow::updateButtons(const Item *item)
if (mUseButton)
{
- if (item->isEquipment())
- {
- if (item->isEquipped())
- {
- // TRANSLATORS: inventory button
- mUseButton->setCaption(_("Unequip"));
- }
- else
- {
- // TRANSLATORS: inventory button
- mUseButton->setCaption(_("Equip"));
- }
- }
- else
- {
- // TRANSLATORS: inventory button
- mUseButton->setCaption(_("Use"));
- }
+ const ItemInfo &info = item->getInfo();
+ mUseButton->setCaption(info.getUseButton());
}
updateDropButton();