summaryrefslogtreecommitdiff
path: root/src/player.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/player.cpp')
-rw-r--r--src/player.cpp23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/player.cpp b/src/player.cpp
index 382008e2..d6f1a43f 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -31,6 +31,7 @@
#include "text.h"
#include "gui/palette.h"
+#include "gui/partywindow.h"
#include "resources/colordb.h"
#include "resources/itemdb.h"
@@ -68,15 +69,27 @@ void Player::setName(const std::string &name)
&guiPalette->getColor(Palette::GM_NAME));
}
else
- {
- mNameColor = &guiPalette->getColor(Palette::PLAYER);
+ {
+ const gcn::Color *color;
+ if (this == player_node)
+ {
+ color = mNameColor = &guiPalette->getColor(Palette::SELF);
+ }
+ else if (partyWindow->findMember(getId()))
+ {
+ color = mNameColor = &guiPalette->getColor(Palette::PARTY);
+ }
+ else
+ {
+ mNameColor = &guiPalette->getColor(Palette::PLAYER);
+ color = &guiPalette->getColor(Palette::PC);
+ }
+
mName = new FlashText(name,
getPixelX(),
getPixelY(),
gcn::Graphics::CENTER,
- (this == player_node) ?
- &guiPalette->getColor(Palette::SELF) :
- &guiPalette->getColor(Palette::PC));
+ color);
}
}
Being::setName(name);