summaryrefslogtreecommitdiff
path: root/src/gui/itemcontainer.cpp
diff options
context:
space:
mode:
authorMateusz Kaduk <mateusz.kaduk@gmail.com>2005-04-10 14:30:47 +0000
committerMateusz Kaduk <mateusz.kaduk@gmail.com>2005-04-10 14:30:47 +0000
commit7dae9c05621375350727ad0e385d1ff44ac2e9aa (patch)
tree583a0a504725e150bfb20920a7100d41fffd4a39 /src/gui/itemcontainer.cpp
parentedace9a6b39498ade46f4f44cef1cea0a285a7c0 (diff)
downloadmana-7dae9c05621375350727ad0e385d1ff44ac2e9aa.tar.gz
mana-7dae9c05621375350727ad0e385d1ff44ac2e9aa.tar.bz2
mana-7dae9c05621375350727ad0e385d1ff44ac2e9aa.tar.xz
mana-7dae9c05621375350727ad0e385d1ff44ac2e9aa.zip
New selection in inventory instead of black rectangle
Diffstat (limited to 'src/gui/itemcontainer.cpp')
-rw-r--r--src/gui/itemcontainer.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gui/itemcontainer.cpp b/src/gui/itemcontainer.cpp
index 723cb262..fa949c9a 100644
--- a/src/gui/itemcontainer.cpp
+++ b/src/gui/itemcontainer.cpp
@@ -23,7 +23,6 @@
#include "../main.h"
#include "itemcontainer.h"
-#include "../graphics.h"
#include "../resources/resourcemanager.h"
#include <sstream>
@@ -34,6 +33,9 @@ ItemContainer::ItemContainer()
if (!itemImg) logger.error("Unable to load items.png");
itemset = new Spriteset(itemImg, 20, 20);
+ selImg = resman->getImage("graphics/gui/selection.png", IMG_ALPHA);
+ if (!selImg) logger.error("Unable to load items.png");
+
selectedItem = -1; /**< No item selected */
for (int i = 0; i < INVENTORY_SIZE; i++) {
@@ -84,8 +86,7 @@ void ItemContainer::draw(gcn::Graphics* graphics)
int itemX = (((selectedItem - 2) * 24) % (getWidth() - 24));
int itemY = (((selectedItem - 2) * 24) / (getWidth() - 24)) * 24;
itemX -= itemX % 24;
- graphics->drawRectangle(gcn::Rectangle(itemX, itemY,
- 24, 24));
+ selImg->draw(screen, x + itemX, y+itemY);
}
}