summaryrefslogtreecommitdiff
path: root/src/gui/widgets/spellshortcutcontainer.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/spellshortcutcontainer.cpp
parent81b52381745a96fcbae36aa744585ac1a1ff5d18 (diff)
downloadmv-8611b3c1ea3316bfc4740149b8f41c35dacee7c1.tar.gz
mv-8611b3c1ea3316bfc4740149b8f41c35dacee7c1.tar.bz2
mv-8611b3c1ea3316bfc4740149b8f41c35dacee7c1.tar.xz
mv-8611b3c1ea3316bfc4740149b8f41c35dacee7c1.zip
Change texture order drawing in item containers.
Diffstat (limited to 'src/gui/widgets/spellshortcutcontainer.cpp')
-rw-r--r--src/gui/widgets/spellshortcutcontainer.cpp16
1 files changed, 11 insertions, 5 deletions
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)