diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-05-10 11:09:03 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-05-10 11:09:03 -0600 |
commit | 46f42999a40f225400f9a0c5168e56ea8024395d (patch) | |
tree | 7ceb8e1247dcf11ee2718b66096fbef5f252e7a3 /src/player.cpp | |
parent | 2f9d09c33429913c103b8832b1082df52f52607b (diff) | |
download | mana-46f42999a40f225400f9a0c5168e56ea8024395d.tar.gz mana-46f42999a40f225400f9a0c5168e56ea8024395d.tar.bz2 mana-46f42999a40f225400f9a0c5168e56ea8024395d.tar.xz mana-46f42999a40f225400f9a0c5168e56ea8024395d.zip |
Color player names more appropriately
Party memebrs use the party color. Text color for local player uses the
local player color.
Diffstat (limited to 'src/player.cpp')
-rw-r--r-- | src/player.cpp | 23 |
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); |