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/emoteshortcutcontainer.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'src/gui/widgets/emoteshortcutcontainer.cpp') diff --git a/src/gui/widgets/emoteshortcutcontainer.cpp b/src/gui/widgets/emoteshortcutcontainer.cpp index f1f040966..aaf22c066 100644 --- a/src/gui/widgets/emoteshortcutcontainer.cpp +++ b/src/gui/widgets/emoteshortcutcontainer.cpp @@ -109,23 +109,34 @@ void EmoteShortcutContainer::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); + } + } + for (unsigned i = 0; i < mMaxItems; i++) { const int emoteX = (i % mGridWidth) * mBoxWidth; const int emoteY = (i / mGridWidth) * mBoxHeight; - if (mBackgroundImg) - g->drawImage(mBackgroundImg, emoteX, emoteY); - // Draw emote keyboard shortcut. std::string key = inputManager.getKeyValueString( Input::KEY_EMOTE_1 + i); graphics->setColor(getForegroundColor()); g->drawText(key, emoteX + 2, emoteY + 2, gcn::Graphics::LEFT); - + } + for (unsigned i = 0; i < mMaxItems; i++) + { if (i < mEmoteImg.size() && mEmoteImg[i] && mEmoteImg[i]->sprite) - mEmoteImg[i]->sprite->draw(g, emoteX + 2, emoteY + 10); + { + mEmoteImg[i]->sprite->draw(g, (i % mGridWidth) * mBoxWidth + 2, + (i / mGridWidth) * mBoxHeight + 10); + } } if (mEmoteMoved && mEmoteMoved < static_cast( -- cgit v1.2.3-70-g09d2