summaryrefslogtreecommitdiff
path: root/src/itemshortcut.h
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-11-01 14:55:54 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-11-01 14:55:54 +0000
commit55e0ddd7e1d60a56ece679a4c2563bef854e892b (patch)
tree322df9b8661f379990b3b526e5aa41f0e23ec9e2 /src/itemshortcut.h
parent3d85803d9a43c779f522a936df068a24ca6f7f2d (diff)
downloadMana-55e0ddd7e1d60a56ece679a4c2563bef854e892b.tar.gz
Mana-55e0ddd7e1d60a56ece679a4c2563bef854e892b.tar.bz2
Mana-55e0ddd7e1d60a56ece679a4c2563bef854e892b.tar.xz
Mana-55e0ddd7e1d60a56ece679a4c2563bef854e892b.zip
Merged revisions 4180-4181 via svnmerge from
https://themanaworld.svn.sourceforge.net/svnroot/themanaworld/tmw/branches/0.0 ........ r4180 | peaveydk | 2008-04-24 22:49:30 +0200 (Thu, 24 Apr 2008) | 1 line Make shortcut container ID based instead of slot based. Fixes items shifting around often causing equipment to be lost. ........ r4181 | peaveydk | 2008-04-25 02:25:59 +0200 (Fri, 25 Apr 2008) | 1 line Document anti-trade function. ........
Diffstat (limited to 'src/itemshortcut.h')
-rw-r--r--src/itemshortcut.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/itemshortcut.h b/src/itemshortcut.h
index fecb7d86..d75db2e8 100644
--- a/src/itemshortcut.h
+++ b/src/itemshortcut.h
@@ -50,11 +50,11 @@ class ItemShortcut
void load();
/**
- * Returns the shortcut item specified by the index.
+ * Returns the shortcut item ID specified by the index.
*
* @param index Index of the shortcut item.
*/
- Item* getItem(int index) const
+ int getItem(int index) const
{ return mItems[index]; }
/**
@@ -64,13 +64,13 @@ class ItemShortcut
{ return SHORTCUT_ITEMS; }
/**
- * Returns the item that is currently selected.
+ * Returns the item ID that is currently selected.
*/
- Item* getItemSelected() const
+ int getItemSelected() const
{ return mItemSelected; }
/**
- * Adds the selected item to the items specified by the index.
+ * Adds the selected item ID to the items specified by the index.
*
* @param index Index of the items.
*/
@@ -80,31 +80,31 @@ class ItemShortcut
/**
* Adds an item to the items store specified by the index.
*
- * @param index Index of the items.
- * @param item Item to store.
+ * @param index Index of the item.
+ * @param itemId ID of the item.
*/
- void setItems(int index, Item *item)
- { mItems[index] = item; }
+ void setItems(int index, int itemId)
+ { mItems[index] = itemId; }
/**
* Set the item that is selected.
*
- * @param item The item that is to be assigned.
+ * @param itemId The ID of the item that is to be assigned.
*/
- void setItemSelected(Item* item)
- { mItemSelected = item; }
+ void setItemSelected(int itemId)
+ { mItemSelected = itemId; }
/**
* A flag to check if the item is selected.
*/
bool isItemSelected()
- { return mItemSelected; }
+ { return mItemSelected > -1; }
/**
* Remove a item from the shortcut.
*/
void removeItem(int index)
- { mItems[index] = 0; }
+ { mItems[index] = -1; }
/**
* Try to use the item specified by the index.
@@ -119,8 +119,8 @@ class ItemShortcut
*/
void save();
- Item* mItems[SHORTCUT_ITEMS]; /**< The items stored. */
- Item* mItemSelected; /**< The item held by cursor. */
+ int mItems[SHORTCUT_ITEMS]; /**< The items stored. */
+ int mItemSelected; /**< The item held by cursor. */
};