aboutsummaryrefslogtreecommitdiff
path: root/src/content_cao.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/content_cao.cpp')
-rw-r--r--src/content_cao.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/content_cao.cpp b/src/content_cao.cpp
index a8b107b49..5bf4d8e9c 100644
--- a/src/content_cao.cpp
+++ b/src/content_cao.cpp
@@ -552,6 +552,7 @@ GenericCAO::GenericCAO(IGameDef *gamedef, ClientEnvironment *env):
m_animated_meshnode(NULL),
m_wield_meshnode(NULL),
m_spritenode(NULL),
+ m_nametag_color(video::SColor(255, 255, 255, 255)),
m_textnode(NULL),
m_position(v3f(0,10*BS,0)),
m_velocity(v3f(0,0,0)),
@@ -962,7 +963,7 @@ void GenericCAO::addToScene(scene::ISceneManager *smgr, ITextureSource *tsrc,
gui::IGUIEnvironment* gui = irr->getGUIEnvironment();
std::wstring wname = narrow_to_wide(m_name);
m_textnode = smgr->addTextSceneNode(gui->getSkin()->getFont(),
- wname.c_str(), video::SColor(255,255,255,255), node);
+ wname.c_str(), m_nametag_color, node);
m_textnode->grab();
m_textnode->setPosition(v3f(0, BS*1.1, 0));
}
@@ -1714,6 +1715,11 @@ void GenericCAO::processMessage(const std::string &data)
int rating = readS16(is);
m_armor_groups[name] = rating;
}
+ } else if (cmd == GENERIC_CMD_SET_NAMETAG_COLOR) {
+ m_nametag_color = readARGB8(is);
+ if (m_textnode != NULL) {
+ m_textnode->setTextColor(m_nametag_color);
+ }
}
}