From 795cec6e276e7f5df8a25bd8306e6fd87c826502 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Fri, 27 Mar 2009 19:08:25 +0100 Subject: Fixed selection shadow not to overlap the emoticons Also fixed positioning for emoticons above the player sprite. Mantis-issue: 675 --- src/being.cpp | 4 ++-- src/gui/emotecontainer.cpp | 47 +++++++++++++++++++++++----------------------- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/src/being.cpp b/src/being.cpp index 5d840333..d4242df0 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -746,8 +746,8 @@ void Being::drawEmotion(Graphics *graphics, int offsetX, int offsetY) if (!mEmotion) return; - const int px = mPx - offsetX; - const int py = mPy - offsetY - 64; + const int px = mPx - offsetX - 16; + const int py = mPy - offsetY - 64 - 32; const int emotionIndex = mEmotion - 1; if (emotionIndex >= 0 && emotionIndex <= EmoteDB::getLast()) diff --git a/src/gui/emotecontainer.cpp b/src/gui/emotecontainer.cpp index ececd9aa..b4caf4f1 100644 --- a/src/gui/emotecontainer.cpp +++ b/src/gui/emotecontainer.cpp @@ -19,26 +19,26 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include "gui/emotecontainer.h" -#include "emotecontainer.h" +#include "animatedsprite.h" +#include "configuration.h" +#include "emoteshortcut.h" +#include "graphics.h" +#include "localplayer.h" +#include "log.h" -#include "../animatedsprite.h" -#include "../configuration.h" -#include "../emoteshortcut.h" -#include "../graphics.h" -#include "../localplayer.h" -#include "../log.h" +#include "resources/emotedb.h" +#include "resources/image.h" +#include "resources/iteminfo.h" +#include "resources/resourcemanager.h" -#include "../resources/emotedb.h" -#include "../resources/image.h" -#include "../resources/iteminfo.h" -#include "../resources/resourcemanager.h" +#include "utils/dtor.h" +#include "utils/gettext.h" +#include "utils/stringutils.h" -#include "../utils/dtor.h" -#include "../utils/gettext.h" -#include "../utils/stringutils.h" +#include +#include const int EmoteContainer::gridWidth = 34; // emote icon width + 4 const int EmoteContainer::gridHeight = 36; // emote icon height + 4 @@ -57,7 +57,8 @@ EmoteContainer::EmoteContainer(): } mSelImg = resman->getImage("graphics/gui/selection.png"); - if (!mSelImg) logger->error(_("Unable to load selection.png")); + if (!mSelImg) + logger->error(_("Unable to load selection.png")); mSelImg->setAlpha(config.getValue("guialpha", 0.8)); @@ -89,18 +90,18 @@ void EmoteContainer::draw(gcn::Graphics *graphics) for (int i = 0; i < mMaxEmote ; i++) { - int emoteX = ((i) % columns) * gridWidth; - int emoteY = ((i) / columns) * gridHeight; - - // Draw emote icon - mEmoteImg[i]->draw(static_cast(graphics), emoteX, emoteY); + const int emoteX = ((i) % columns) * gridWidth; + const int emoteY = ((i) / columns) * gridHeight; // Draw selection image below selected item if (mSelectedEmoteIndex == i) { static_cast(graphics)->drawImage( - mSelImg, emoteX, emoteY); + mSelImg, emoteX, emoteY + 4); } + + // Draw emote icon + mEmoteImg[i]->draw(static_cast(graphics), emoteX, emoteY); } } -- cgit v1.2.3-60-g2f50