summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-12-13 16:51:38 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-12-13 16:51:38 +0100
commit89c332adbcf584142d49f6829d5227614f2f0968 (patch)
tree1829f476608169d7df9402a01fd5de7b636838df /src/gui
parenta329eb2442bf21eb77ad3c544e8aec656dfb6493 (diff)
downloadmana-client-89c332adbcf584142d49f6829d5227614f2f0968.tar.gz
mana-client-89c332adbcf584142d49f6829d5227614f2f0968.tar.bz2
mana-client-89c332adbcf584142d49f6829d5227614f2f0968.tar.xz
mana-client-89c332adbcf584142d49f6829d5227614f2f0968.zip
Added ability to add equipment to the shurtcut bar
Patch by Nikos, with some improvements. Conflicts: NEWS src/gui/itemcontainer.cpp src/itemshortcut.cpp (cherry picked from eAthena client, not functional here yet)
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/itemcontainer.cpp12
-rw-r--r--src/gui/itemshortcutcontainer.cpp6
2 files changed, 8 insertions, 10 deletions
diff --git a/src/gui/itemcontainer.cpp b/src/gui/itemcontainer.cpp
index 5fb99ffc..141b4360 100644
--- a/src/gui/itemcontainer.cpp
+++ b/src/gui/itemcontainer.cpp
@@ -82,8 +82,7 @@ ItemContainer::~ItemContainer()
mSelImg->decRef();
}
-void
-ItemContainer::draw(gcn::Graphics *graphics)
+void ItemContainer::draw(gcn::Graphics *graphics)
{
Graphics *g = static_cast<Graphics*>(graphics);
@@ -147,8 +146,7 @@ ItemContainer::draw(gcn::Graphics *graphics)
}
}
-void
-ItemContainer::selectNone()
+void ItemContainer::selectNone()
{
setSelectedItem(NULL);
}
@@ -324,8 +322,7 @@ int ItemContainer::getSlotIndex(const int posX, const int posY) const
return Inventory::NO_SLOT_INDEX;
}
-void
-ItemContainer::keyAction()
+void ItemContainer::keyAction()
{
// If there is no highlight then return.
if (!mHighlightedItem)
@@ -362,8 +359,7 @@ ItemContainer::keyAction()
}
}
-void
-ItemContainer::moveHighlight(int direction)
+void ItemContainer::moveHighlight(int direction)
{
if (!mHighlightedItem)
{
diff --git a/src/gui/itemshortcutcontainer.cpp b/src/gui/itemshortcutcontainer.cpp
index 76104e12..e0604c78 100644
--- a/src/gui/itemshortcutcontainer.cpp
+++ b/src/gui/itemshortcutcontainer.cpp
@@ -85,7 +85,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)
@@ -96,9 +96,11 @@ ItemShortcutContainer::draw(gcn::Graphics *graphics)
// Draw item icon.
Image* image = item->getImage();
if (image) {
+ // TODO: Have label indicate equipped status
+ const std::string label = toString(item->getQuantity());
g->drawImage(image, itemX, itemY);
g->drawText(
- toString(item->getQuantity()),
+ label,
itemX + mBoxWidth / 2,
itemY + mBoxHeight - 14,
gcn::Graphics::CENTER);