diff options
author | Nikos Giagtzoglou <gnikos21@yahoo.gr> | 2008-11-22 11:43:53 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2008-11-22 14:40:26 +0100 |
commit | 124aef95eff5b9fe3692d847d288e6470f33f812 (patch) | |
tree | 2e6744763e1cd0cbff0f98f27675d7b34bf70439 /src/gui/itemshortcutcontainer.cpp | |
parent | f7179cdca447c534029bb36a776595bbe3fc999e (diff) | |
download | mana-124aef95eff5b9fe3692d847d288e6470f33f812.tar.gz mana-124aef95eff5b9fe3692d847d288e6470f33f812.tar.bz2 mana-124aef95eff5b9fe3692d847d288e6470f33f812.tar.xz mana-124aef95eff5b9fe3692d847d288e6470f33f812.zip |
Added ability to add equipment to the shurtcut bar
Patch by Nikos, with some improvements.
Diffstat (limited to 'src/gui/itemshortcutcontainer.cpp')
-rw-r--r-- | src/gui/itemshortcutcontainer.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/itemshortcutcontainer.cpp b/src/gui/itemshortcutcontainer.cpp index 687f8d16..2ea5d584 100644 --- a/src/gui/itemshortcutcontainer.cpp +++ b/src/gui/itemshortcutcontainer.cpp @@ -86,7 +86,7 @@ ItemShortcutContainer::draw(gcn::Graphics *graphics) // Draw item keyboard shortcut. const char *key = SDL_GetKeyName( - (SDLKey) keyboard.getKeyValue(keyboard.KEY_SHORTCUT_0+i)); + (SDLKey) keyboard.getKeyValue(keyboard.KEY_SHORTCUT_0 + i)); g->drawText(key, itemX + 2, itemY + 2, gcn::Graphics::LEFT); if (itemShortcut->getItem(i) < 0) @@ -98,9 +98,11 @@ ItemShortcutContainer::draw(gcn::Graphics *graphics) // Draw item icon. Image* image = item->getImage(); if (image) { + const std::string label = + item->isEquipped() ? "Eq." : toString(item->getQuantity()); g->drawImage(image, itemX, itemY); g->drawText( - toString(item->getQuantity()), + label, itemX + mBoxWidth / 2, itemY + mBoxHeight - 14, gcn::Graphics::CENTER); |