From b42e9e23fd6fe4819d34f04124ba66eca6a6c020 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sun, 10 Apr 2005 12:45:41 +0000 Subject: Removed black outline around inventory and cleaned up some tabs. --- src/gui/itemcontainer.cpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'src/gui/itemcontainer.cpp') diff --git a/src/gui/itemcontainer.cpp b/src/gui/itemcontainer.cpp index 0694fc2e..723cb262 100644 --- a/src/gui/itemcontainer.cpp +++ b/src/gui/itemcontainer.cpp @@ -54,39 +54,38 @@ void ItemContainer::draw(gcn::Graphics* graphics) getAbsolutePosition(x, y); w = getWidth(); h = getHeight(); - graphics->setColor(gcn::Color(0, 0, 0)); - graphics->drawRectangle(gcn::Rectangle(0, 0, w, h)); - - if(items[selectedItem].quantity <= 0) + + if (items[selectedItem].quantity <= 0) { selectedItem = -1; - + } + for (int i = 0; i < INVENTORY_SIZE; i++) { int itemX = (((i - 2) * 24) % (getWidth() - 24)); int itemY = (((i - 2) * 24) / (getWidth() - 24)) * 24; - itemX -= itemX % 24; + itemX -= itemX % 24; if (items[i].quantity > 0) { if (items[i].id >= 501 && items[i].id <= 1202) { itemset->spriteset[items[i].id - 501]->draw(screen, - x + itemX, - y + itemY); + x + itemX, + y + itemY); } std::stringstream ss; if(!items[i].equipped) ss << items[i].quantity; graphics->drawText(ss.str(), - itemX + 12, - itemY + 16, - gcn::Graphics::CENTER); + itemX + 12, + itemY + 16, + gcn::Graphics::CENTER); } } if (selectedItem >= 0) { int itemX = (((selectedItem - 2) * 24) % (getWidth() - 24)); int itemY = (((selectedItem - 2) * 24) / (getWidth() - 24)) * 24; - itemX -= itemX % 24; + itemX -= itemX % 24; graphics->drawRectangle(gcn::Rectangle(itemX, itemY, - 24, 24)); + 24, 24)); } } -- cgit v1.2.3-70-g09d2