summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-08-13 17:30:59 -0600
committerJared Adams <jaxad0127@gmail.com>2009-08-13 17:33:08 -0600
commitf46cfb91278b27f4943f5512778129fe985c678e (patch)
tree0be219d66e723bcca8de2d584d66bc65d040fb26 /src/localplayer.cpp
parentbe85ca9d91ff867faf140328d0bcbb2062b58cdf (diff)
downloadmana-f46cfb91278b27f4943f5512778129fe985c678e.tar.gz
mana-f46cfb91278b27f4943f5512778129fe985c678e.tar.bz2
mana-f46cfb91278b27f4943f5512778129fe985c678e.tar.xz
mana-f46cfb91278b27f4943f5512778129fe985c678e.zip
Clean up Being and it's derivatives
Move stuff only needed for Players into Player (like slots and sprite limits). Move name handling into Being (no need for three copies of this code). Clean up terminology (including Map terminology). Remove hair-related variables.
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 57dc8981..8fbfe70a 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -118,7 +118,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()
@@ -241,20 +246,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)
@@ -1087,3 +1078,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));
+ }
+}