summaryrefslogtreecommitdiff
path: root/src/gui/widgets/dropshortcutcontainer.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-06-28 00:31:06 +0300
committerAndrei Karas <akaras@inbox.ru>2012-06-28 00:31:06 +0300
commit8611b3c1ea3316bfc4740149b8f41c35dacee7c1 (patch)
treed2af4e3af305ea451ed4072d52b45212ddc3c884 /src/gui/widgets/dropshortcutcontainer.cpp
parent81b52381745a96fcbae36aa744585ac1a1ff5d18 (diff)
downloadmanaplus-8611b3c1ea3316bfc4740149b8f41c35dacee7c1.tar.gz
manaplus-8611b3c1ea3316bfc4740149b8f41c35dacee7c1.tar.bz2
manaplus-8611b3c1ea3316bfc4740149b8f41c35dacee7c1.tar.xz
manaplus-8611b3c1ea3316bfc4740149b8f41c35dacee7c1.zip
Change texture order drawing in item containers.
Diffstat (limited to 'src/gui/widgets/dropshortcutcontainer.cpp')
-rw-r--r--src/gui/widgets/dropshortcutcontainer.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/gui/widgets/dropshortcutcontainer.cpp b/src/gui/widgets/dropshortcutcontainer.cpp
index 167ba2b5a..af3b78a31 100644
--- a/src/gui/widgets/dropshortcutcontainer.cpp
+++ b/src/gui/widgets/dropshortcutcontainer.cpp
@@ -103,21 +103,27 @@ void DropShortcutContainer::draw(gcn::Graphics *graphics)
graphics->setFont(getFont());
+ if (mBackgroundImg)
+ {
+ for (unsigned i = 0; i < mMaxItems; i++)
+ {
+ g->drawImage(mBackgroundImg, (i % mGridWidth) * mBoxWidth,
+ (i / mGridWidth) * mBoxHeight);
+ }
+ }
+
+ Inventory *inv = PlayerInfo::getInventory();
+ if (!inv)
+ return;
+
for (unsigned i = 0; i < mMaxItems; i++)
{
const int itemX = (i % mGridWidth) * mBoxWidth;
const int itemY = (i / mGridWidth) * mBoxHeight;
- if (mBackgroundImg)
- g->drawImage(mBackgroundImg, itemX, itemY);
-
if (dropShortcut->getItem(i) < 0)
continue;
- Inventory *inv = PlayerInfo::getInventory();
- if (!inv)
- return;
-
Item *item = inv->findItem(dropShortcut->getItem(i),
dropShortcut->getItemColor(i));