summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-08-23 14:14:51 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-08-23 14:14:51 +0000
commit5b755a2a6afdba9d07703c3bf5447bf314d842ab (patch)
tree9c8c1808283d5ecc954668fc53d76d0252eec430 /src/localplayer.cpp
parent4b8df221acc3bd3e681357df912bdbc7a1ce6c3f (diff)
downloadmana-5b755a2a6afdba9d07703c3bf5447bf314d842ab.tar.gz
mana-5b755a2a6afdba9d07703c3bf5447bf314d842ab.tar.bz2
mana-5b755a2a6afdba9d07703c3bf5447bf314d842ab.tar.xz
mana-5b755a2a6afdba9d07703c3bf5447bf314d842ab.zip
Changed XP gaining effect to appear on the player instead.
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 940934b8..e6a52e10 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -29,13 +29,18 @@
#include "inventory.h"
#include "item.h"
#include "main.h"
+#include "particle.h"
#include "sound.h"
+#include "gui/gui.h"
+
#include "net/messageout.h"
#include "net/protocol.h"
#include "resources/equipmentinfo.h"
+#include "utils/tostring.h"
+
LocalPlayer *player_node = NULL;
LocalPlayer::LocalPlayer(Uint32 id, Uint16 job, Map *map):
@@ -439,11 +444,15 @@ void LocalPlayer::revive()
outMsg.writeInt8(0);
}
-void LocalPlayer::refreshXp(Uint32 xp)
+void LocalPlayer::setXp(int xp)
{
- if (mTarget && xp > mXp)
+ if (mMap && xp > mXp)
{
- mTarget->showXP(xp-mXp);
+ const std::string text = toString(xp - mXp) + " xp";
+
+ // Show XP number
+ particleEngine->addTextRiseFadeOutEffect(text, hitYellowFont,
+ mPx + 16, mPy - 16);
}
mXp = xp;
}