summaryrefslogtreecommitdiff
path: root/src/itemshortcut.cpp
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/itemshortcut.cpp
parenta329eb2442bf21eb77ad3c544e8aec656dfb6493 (diff)
downloadmana-89c332adbcf584142d49f6829d5227614f2f0968.tar.gz
mana-89c332adbcf584142d49f6829d5227614f2f0968.tar.bz2
mana-89c332adbcf584142d49f6829d5227614f2f0968.tar.xz
mana-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/itemshortcut.cpp')
-rw-r--r--src/itemshortcut.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/itemshortcut.cpp b/src/itemshortcut.cpp
index a89da974..bea14864 100644
--- a/src/itemshortcut.cpp
+++ b/src/itemshortcut.cpp
@@ -61,14 +61,8 @@ void ItemShortcut::save()
{
for (int i = 0; i < SHORTCUT_ITEMS; i++)
{
- if (mItems[i])
- {
- config.setValue("shortcut" + toString(i), mItems[i]);
- }
- else
- {
- config.setValue("shortcut" + toString(i), -1);
- }
+ const int itemId = mItems[i] ? mItems[i] : -1;
+ config.setValue("shortcut" + toString(i), itemId);
}
}
@@ -77,9 +71,20 @@ void ItemShortcut::useItem(int index)
if (mItems[index])
{
Item *item = player_node->searchForItem(mItems[index]);
- if (item && item->getQuantity()) {
+ if (item && item->getQuantity())
+ {
// TODO: Fix this (index vs. pointer mismatch)
- //player_node->useItem(item);
+ /*
+ if (item->isEquipment()) {
+ if (item->isEquipped()) {
+ player_node->unequipItem(item);
+ } else {
+ player_node->equipItem(item);
+ }
+ } else {
+ player_node->useItem(item);
+ }
+ */
}
}
}