summaryrefslogtreecommitdiff
path: root/src/gui/itemcontainer.cpp
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2005-04-10 16:58:08 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2005-04-10 16:58:08 +0000
commit57c5d96287109fe2034d2860a7309be6e8d0418b (patch)
treeabdda1ec0d2967b2dcf1cbb19a48ee44d588a33f /src/gui/itemcontainer.cpp
parent8ef180d65baff19b712c0dc2d59bdd037a0358a0 (diff)
downloadmana-57c5d96287109fe2034d2860a7309be6e8d0418b.tar.gz
mana-57c5d96287109fe2034d2860a7309be6e8d0418b.tar.bz2
mana-57c5d96287109fe2034d2860a7309be6e8d0418b.tar.xz
mana-57c5d96287109fe2034d2860a7309be6e8d0418b.zip
adding binary version of selection.png and improving look of selection
Diffstat (limited to 'src/gui/itemcontainer.cpp')
-rw-r--r--src/gui/itemcontainer.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gui/itemcontainer.cpp b/src/gui/itemcontainer.cpp
index fa949c9a..616eb0f5 100644
--- a/src/gui/itemcontainer.cpp
+++ b/src/gui/itemcontainer.cpp
@@ -60,6 +60,13 @@ void ItemContainer::draw(gcn::Graphics* graphics)
if (items[selectedItem].quantity <= 0) {
selectedItem = -1;
}
+
+ if (selectedItem >= 0) {
+ int itemX = (((selectedItem - 2) * 24) % (getWidth() - 24));
+ int itemY = (((selectedItem - 2) * 24) / (getWidth() - 24)) * 24;
+ itemX -= itemX % 24;
+ selImg->draw(screen, x + itemX, y+itemY);
+ }
for (int i = 0; i < INVENTORY_SIZE; i++) {
int itemX = (((i - 2) * 24) % (getWidth() - 24));
@@ -81,13 +88,6 @@ void ItemContainer::draw(gcn::Graphics* graphics)
gcn::Graphics::CENTER);
}
}
-
- if (selectedItem >= 0) {
- int itemX = (((selectedItem - 2) * 24) % (getWidth() - 24));
- int itemY = (((selectedItem - 2) * 24) / (getWidth() - 24)) * 24;
- itemX -= itemX % 24;
- selImg->draw(screen, x + itemX, y+itemY);
- }
}
int ItemContainer::getIndex()