summaryrefslogtreecommitdiff
path: root/src/net/inventoryhandler.h
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-08-30 21:04:12 +0200
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-08-30 21:04:12 +0200
commitaa8a8adb90c17e2a61c5245ea0dc3552ea78794f (patch)
tree52df77ded5c1621fc10e6d762f05235e029a46cc /src/net/inventoryhandler.h
parentebe29a9410458abac19c4ba10d5dce476e7ca34b (diff)
downloadmana-aa8a8adb90c17e2a61c5245ea0dc3552ea78794f.tar.gz
mana-aa8a8adb90c17e2a61c5245ea0dc3552ea78794f.tar.bz2
mana-aa8a8adb90c17e2a61c5245ea0dc3552ea78794f.tar.xz
mana-aa8a8adb90c17e2a61c5245ea0dc3552ea78794f.zip
Added a way to specify where the equipment boxes will display.
A <box> sub tag was added to the <slot> tag with a x and y parameter to do so.
Diffstat (limited to 'src/net/inventoryhandler.h')
-rw-r--r--src/net/inventoryhandler.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/net/inventoryhandler.h b/src/net/inventoryhandler.h
index f1dea956..83ef91a7 100644
--- a/src/net/inventoryhandler.h
+++ b/src/net/inventoryhandler.h
@@ -24,11 +24,27 @@
#include "inventory.h"
#include "item.h"
+#include "position.h"
#include <iosfwd>
namespace Net {
+// Default positions of the boxes, 2nd dimension is X and Y respectively.
+const int fallBackBoxesPosition[][2] = {
+ { 90, 40 }, // EQUIP_TORSO_SLOT
+ { 8, 78 }, // EQUIP_GLOVES_SLOT
+ { 70, 0 }, // EQUIP_HEAD_SLOT
+ { 50, 208 }, // EQUIP_LEGS_SLOT
+ { 90, 208 }, // EQUIP_FEET_SLOT
+ { 8, 168 }, // EQUIP_RING1_SLOT
+ { 129, 168 }, // EQUIP_RING2_SLOT
+ { 50, 40 }, // EQUIP_NECK_SLOT
+ { 8, 123 }, // EQUIP_FIGHT1_SLOT
+ { 129, 123 }, // EQUIP_FIGHT2_SLOT
+ { 129, 78 } // EQUIP_PROJECTILE_SLOT
+};
+
class InventoryHandler
{
public:
@@ -45,6 +61,15 @@ class InventoryHandler
virtual unsigned int getVisibleSlotsNumber() const
{ return 0; }
+
+ virtual Position getBoxPosition(unsigned int slotIndex) const
+ {
+ if (slotIndex < (sizeof(fallBackBoxesPosition)
+ / sizeof(fallBackBoxesPosition[0][0])))
+ return Position(fallBackBoxesPosition[slotIndex][0],
+ fallBackBoxesPosition[slotIndex][1]);
+ return Position(0,0);
+ }
};
} // namespace Net