summaryrefslogtreecommitdiff
path: root/src/gui
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
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')
-rw-r--r--src/gui/itemcontainer.cpp7
-rw-r--r--src/gui/itemcontainer.h2
2 files changed, 6 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);
}
}
diff --git a/src/gui/itemcontainer.h b/src/gui/itemcontainer.h
index 0857ac9f..2cc0ed13 100644
--- a/src/gui/itemcontainer.h
+++ b/src/gui/itemcontainer.h
@@ -26,6 +26,7 @@
#include <iostream>
#include <guichan.hpp>
+#include "../graphics.h"
#include "../resources/image.h"
#include "../graphic/spriteset.h"
@@ -48,6 +49,7 @@ class ItemContainer : public gcn::Widget
private:
Spriteset *itemset;
+ Image *selImg;
int selectedItem;
int itemNumber;
ITEM_HOLDER items[INVENTORY_SIZE]; /**< this is the holder of items */