summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <crush@themanaworld.org>2009-08-16 18:25:55 +0200
committerPhilipp Sehmisch <crush@themanaworld.org>2009-08-16 18:25:55 +0200
commit4263962e947b4914de8d1750f21cc7cc82567b4d (patch)
tree32340098913c302fdb33f88ffea65fb36920db75 /src/localplayer.cpp
parentdd0844b6ac01293e7afd0dd85e695b8d77b8e4be (diff)
parent7e2673a3b9460fdcd646e23c3bd9039de854565f (diff)
downloadmana-4263962e947b4914de8d1750f21cc7cc82567b4d.tar.gz
mana-4263962e947b4914de8d1750f21cc7cc82567b4d.tar.bz2
mana-4263962e947b4914de8d1750f21cc7cc82567b4d.tar.xz
mana-4263962e947b4914de8d1750f21cc7cc82567b4d.zip
More merges and conflict resolves
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 1cc0ae34..68b70db4 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -119,7 +119,12 @@ LocalPlayer::LocalPlayer(int id, int job, Map *map):
mUpdateName = true;
+ mTextColor = &guiPalette->getColor(Palette::PLAYER);
+ mNameColor = &guiPalette->getColor(Palette::SELF);
+
initTargetCursor();
+
+ config.addListener("showownname", this);
}
LocalPlayer::~LocalPlayer()
@@ -129,6 +134,8 @@ LocalPlayer::~LocalPlayer()
delete mStorage;
#endif
+ config.removeListener("showownname", this);
+
for (int i = Being::TC_SMALL; i < Being::NUM_TC; i++)
{
delete mTargetCursor[0][i];
@@ -258,20 +265,6 @@ void LocalPlayer::setGMLevel(int level)
setGM(true);
}
-void LocalPlayer::setName(const std::string &name)
-{
- if (mName)
- {
- delete mName;
- mName = 0;
- }
-
- if (config.getValue("showownname", false) && mMapInitialized)
- Player::setName(name);
- else
- Being::setName(name);
-}
-
void LocalPlayer::nextStep()
{
// TODO: Fix picking up when reaching target (this method is obsolete)
@@ -1113,3 +1106,11 @@ void LocalPlayer::addMessageToQueue(const std::string &message,
{
mMessages.push_back(MessagePair(message, color));
}
+
+void LocalPlayer::optionChanged(const std::string &value)
+{
+ if (value == "showownname")
+ {
+ setShowName(config.getValue("showownname", 1));
+ }
+}