From 8611b3c1ea3316bfc4740149b8f41c35dacee7c1 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 28 Jun 2012 00:31:06 +0300 Subject: Change texture order drawing in item containers. --- src/gui/widgets/spellshortcutcontainer.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/gui/widgets/spellshortcutcontainer.cpp') diff --git a/src/gui/widgets/spellshortcutcontainer.cpp b/src/gui/widgets/spellshortcutcontainer.cpp index 07ecbfaf0..7818dc8dc 100644 --- a/src/gui/widgets/spellshortcutcontainer.cpp +++ b/src/gui/widgets/spellshortcutcontainer.cpp @@ -111,20 +111,26 @@ void SpellShortcutContainer::draw(gcn::Graphics *graphics) int selectedId = spellShortcut->getSelectedItem(); g->setColor(getForegroundColor()); + if (mBackgroundImg) + { + for (unsigned i = 0; i < mMaxItems; i++) + { + g->drawImage(mBackgroundImg, (i % mGridWidth) * mBoxWidth, + (i / mGridWidth) * mBoxHeight); + } + } + for (unsigned i = 0; i < mMaxItems; i++) { const int itemX = (i % mGridWidth) * mBoxWidth; const int itemY = (i / mGridWidth) * mBoxHeight; - g->drawImage(mBackgroundImg, itemX, itemY); - int itemId = spellShortcut->getItem( (mNumber * SPELL_SHORTCUT_ITEMS) + i); if (selectedId >= 0 && itemId == selectedId) { - g->drawRectangle(gcn::Rectangle( - itemX + 1, itemY + 1, - mBoxWidth - 1, mBoxHeight - 1)); + g->drawRectangle(gcn::Rectangle(itemX + 1, itemY + 1, + mBoxWidth - 1, mBoxHeight - 1)); } if (!spellManager) -- cgit v1.2.3-60-g2f50