From 7dae9c05621375350727ad0e385d1ff44ac2e9aa Mon Sep 17 00:00:00 2001 From: Mateusz Kaduk Date: Sun, 10 Apr 2005 14:30:47 +0000 Subject: New selection in inventory instead of black rectangle --- src/gui/itemcontainer.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/gui/itemcontainer.cpp') 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 @@ -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); } } -- cgit v1.2.3-70-g09d2