summaryrefslogtreecommitdiff
path: root/src/player.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-05-12 22:23:58 -0600
committerJared Adams <jaxad0127@gmail.com>2009-05-12 22:23:58 -0600
commit85ce3c416f6d6060c522ef6b3b5834f27f83cc5b (patch)
treec26c060c104881a8875e4141b5d42e7546864c7b /src/player.cpp
parent94716c19748ab87a0a215f05e15ad6cac1008f07 (diff)
downloadmana-client-85ce3c416f6d6060c522ef6b3b5834f27f83cc5b.tar.gz
mana-client-85ce3c416f6d6060c522ef6b3b5834f27f83cc5b.tar.bz2
mana-client-85ce3c416f6d6060c522ef6b3b5834f27f83cc5b.tar.xz
mana-client-85ce3c416f6d6060c522ef6b3b5834f27f83cc5b.zip
Fix up handling of GM status
Diffstat (limited to 'src/player.cpp')
-rw-r--r--src/player.cpp60
1 files changed, 29 insertions, 31 deletions
diff --git a/src/player.cpp b/src/player.cpp
index 453b8bdd..520342e3 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -58,44 +58,34 @@ void Player::setName(const std::string &name)
{
if (!mName && mShowName)
{
- if (mIsGM)
+ mNameColor = &guiPalette->getColor(Palette::PLAYER);
+
+ const gcn::Color *color;
+ if (this == player_node)
+ {
+ color = &guiPalette->getColor(Palette::SELF);
+ }
+ else if (mIsGM)
{
mNameColor = &guiPalette->getColor(Palette::GM);
- mName = new FlashText("(GM) " + name,
- getPixelX(),
- getPixelY(),
- gcn::Graphics::CENTER,
- &guiPalette->getColor(Palette::GM_NAME));
+ color = &guiPalette->getColor(Palette::GM_NAME);
+ }
+ else if (mInParty)
+ {
+ color = &guiPalette->getColor(Palette::PARTY);
}
else
{
- mNameColor = &guiPalette->getColor(Palette::PLAYER);
-
- const gcn::Color *color;
- if (this == player_node)
- {
- color = &guiPalette->getColor(Palette::SELF);
- }
- else if (mIsGM)
- {
- color = &guiPalette->getColor(Palette::GM);
- }
- else if (mInParty)
- {
- color = &guiPalette->getColor(Palette::PARTY);
- }
- else
- {
- color = &guiPalette->getColor(Palette::PC);
- }
-
- mName = new FlashText(name,
- getPixelX(),
- getPixelY(),
- gcn::Graphics::CENTER,
- color);
+ color = &guiPalette->getColor(Palette::PC);
}
+
+ mName = new FlashText(name,
+ getPixelX(),
+ getPixelY(),
+ gcn::Graphics::CENTER,
+ color);
}
+
Being::setName(name);
}
@@ -191,6 +181,14 @@ void Player::setGender(Gender gender)
}
}
+void Player::setGM(bool gm)
+{
+ mIsGM = gm;
+
+ if (gm && mName)
+ mName->setColor(&guiPalette->getColor(Palette::GM));
+}
+
void Player::setHairStyle(int style, int color)
{
style = style < 0 ? mHairStyle : style % mNumberOfHairstyles;