diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-07-03 17:03:38 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-07-03 17:03:38 +0300 |
commit | 5d742f63283c4c2c12f1539f1d69ab3bef7be396 (patch) | |
tree | cc58a8fd3ebeaa7784ce669259cb14c7db05f224 /src | |
parent | 9d33bb1bdaf0f19ccaa742a316af9620b05b825d (diff) | |
download | manaverse-5d742f63283c4c2c12f1539f1d69ab3bef7be396.tar.gz manaverse-5d742f63283c4c2c12f1539f1d69ab3bef7be396.tar.bz2 manaverse-5d742f63283c4c2c12f1539f1d69ab3bef7be396.tar.xz manaverse-5d742f63283c4c2c12f1539f1d69ab3bef7be396.zip |
Use "useButton" item attribute in inventory window.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/windows/inventorywindow.cpp | 24 |
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(); |