about summary refs log tree commit diff
path: root/src/game/client/components
diff options
context:
space:
mode:
authorChoupom <andycootlapin@hotmail.fr>2010-12-15 13:31:27 +0100
committeroy <Tom_Adams@web.de>2011-01-03 12:54:58 +0100
commit533d28e35a8f7278456abb6ef1b4d5e9e36063a9 (patch)
tree302a38ae0fa3c2fb1fdada172a224ed9bcd162be /src/game/client/components
parentb565d4ab18e9517e6d20924cf3e05fa2994252f3 (diff)
downloadzcatch-533d28e35a8f7278456abb6ef1b4d5e9e36063a9.tar.gz
zcatch-533d28e35a8f7278456abb6ef1b4d5e9e36063a9.zip
made team colors for nameplates (fixes #207)
Diffstat (limited to 'src/game/client/components')
-rw-r--r--src/game/client/components/nameplates.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/game/client/components/nameplates.cpp b/src/game/client/components/nameplates.cpp
index 1efd8702..cdddddcb 100644
--- a/src/game/client/components/nameplates.cpp
+++ b/src/game/client/components/nameplates.cpp
@@ -23,14 +23,22 @@ void CNamePlates::RenderNameplate(
 	// render name plate
 	if(!pPlayerInfo->m_Local)
 	{
-		//TextRender()->TextColor
 		float a = 1;
 		if(g_Config.m_ClNameplatesAlways == 0)
 			a = clamp(1-powf(distance(m_pClient->m_pControls->m_TargetPos, Position)/200.0f,16.0f), 0.0f, 1.0f);
 			
 		const char *pName = m_pClient->m_aClients[pPlayerInfo->m_ClientId].m_aName;
 		float tw = TextRender()->TextWidth(0, 28.0f, pName, -1);
-		TextRender()->TextColor(1,1,1,a);
+		
+		TextRender()->TextColor(1.0f, 1.0f, 1.0f, a);
+		if(m_pClient->m_Snap.m_pGameobj && m_pClient->m_Snap.m_pGameobj->m_Flags&GAMEFLAG_TEAMS)
+		{
+			if(pPlayerInfo->m_Team == TEAM_RED)
+				TextRender()->TextColor(1.0f, 0.5f, 0.5f, a);
+			else if(pPlayerInfo->m_Team == TEAM_BLUE)
+				TextRender()->TextColor(0.7f, 0.7f, 1.0f, a);
+		}
+		
 		TextRender()->Text(0, Position.x-tw/2.0f, Position.y-60, 28.0f, pName, -1);
 		
 		if(g_Config.m_Debug) // render client id when in debug aswell