summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-27 19:08:25 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-27 19:09:09 +0100
commit795cec6e276e7f5df8a25bd8306e6fd87c826502 (patch)
tree41c2958ca5471d912f3f172ae1ee01ce9cb1ea9f /src
parent4b70908a529317ce4e57448fe4f4a59e75416537 (diff)
downloadmana-795cec6e276e7f5df8a25bd8306e6fd87c826502.tar.gz
mana-795cec6e276e7f5df8a25bd8306e6fd87c826502.tar.bz2
mana-795cec6e276e7f5df8a25bd8306e6fd87c826502.tar.xz
mana-795cec6e276e7f5df8a25bd8306e6fd87c826502.zip
Fixed selection shadow not to overlap the emoticons
Also fixed positioning for emoticons above the player sprite. Mantis-issue: 675
Diffstat (limited to 'src')
-rw-r--r--src/being.cpp4
-rw-r--r--src/gui/emotecontainer.cpp47
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 <guichan/mouseinput.hpp>
-#include <guichan/selectionlistener.hpp>
+#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 <guichan/mouseinput.hpp>
+#include <guichan/selectionlistener.hpp>
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*>(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*>(graphics)->drawImage(
- mSelImg, emoteX, emoteY);
+ mSelImg, emoteX, emoteY + 4);
}
+
+ // Draw emote icon
+ mEmoteImg[i]->draw(static_cast<Graphics*>(graphics), emoteX, emoteY);
}
}