diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-11-13 00:33:01 +0100 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-11-13 19:50:00 +0100 |
commit | a0973bc302f2972c4c70d973090c4d29ea2f7c6d (patch) | |
tree | e840f5807aa8b3cfc69b17a17ac3bf9cba317485 /src/net/inventoryhandler.h | |
parent | 253c660d8e3341ad2d78658a23e599d5aaa84c00 (diff) | |
download | mana-client-a0973bc302f2972c4c70d973090c4d29ea2f7c6d.tar.gz mana-client-a0973bc302f2972c4c70d973090c4d29ea2f7c6d.tar.bz2 mana-client-a0973bc302f2972c4c70d973090c4d29ea2f7c6d.tar.xz mana-client-a0973bc302f2972c4c70d973090c4d29ea2f7c6d.zip |
Added background support to the equipment boxes.
The background images are auto-centered.
Also, for Manaserv, a new background parameter has been
added in the box node of the equip.xml file
to specify the background image.
Note that the filename is relative to the gui theme
folder.
Reviewed-by: Thorbjorn Lindeijer
Resolves: TMW-Mantis #769.
Diffstat (limited to 'src/net/inventoryhandler.h')
-rw-r--r-- | src/net/inventoryhandler.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/net/inventoryhandler.h b/src/net/inventoryhandler.h index 83ef91a7..24e6dd43 100644 --- a/src/net/inventoryhandler.h +++ b/src/net/inventoryhandler.h @@ -45,6 +45,22 @@ const int fallBackBoxesPosition[][2] = { { 129, 78 } // EQUIP_PROJECTILE_SLOT }; +const std::string fallBackBoxesBackground[] = { + "equip-box-chest.png", + "equip-box-hands.png", + "equip-box-head.png", + "equip-box-legs.png", + "equip-box-feet.png", + "equip-box-ring.png", + "equip-box-ring.png", + "equip-box-neck.png", + "equip-box-weapon.png", + "equip-box-shield.png", + "equip-box-ammo.png" +}; + +static const std::string empty = std::string(); + class InventoryHandler { public: @@ -70,6 +86,13 @@ class InventoryHandler fallBackBoxesPosition[slotIndex][1]); return Position(0,0); } + + virtual const std::string& getBoxBackground(unsigned int slotIndex) const + { + if (slotIndex < sizeof(fallBackBoxesBackground)) + return fallBackBoxesBackground[slotIndex]; + return empty; // The empty string + } }; } // namespace Net |