Better team differentiation ingame (colored nameplates and more transparency

This commit is contained in:
def 2014-04-12 16:55:01 +02:00
parent 7fd799f894
commit b731221b2a
2 changed files with 24 additions and 25 deletions

View file

@ -22,13 +22,10 @@ void CNamePlates::RenderNameplate(
bool OtherTeam;
if (m_pClient->m_Snap.m_SpecInfo.m_Active)
{
if (m_pClient->m_Snap.m_SpecInfo.m_SpectatorID == SPEC_FREEVIEW)
OtherTeam = false;
else
OtherTeam = m_pClient->m_Teams.Team(pPlayerInfo->m_ClientID) != m_pClient->m_Teams.Team(m_pClient->m_Snap.m_SpecInfo.m_SpectatorID);
}
if (m_pClient->m_aClients[m_pClient->m_Snap.m_LocalClientID].m_Team == TEAM_SPECTATORS && m_pClient->m_Snap.m_SpecInfo.m_SpectatorID == SPEC_FREEVIEW)
OtherTeam = false;
else if (m_pClient->m_Snap.m_SpecInfo.m_Active && m_pClient->m_Snap.m_SpecInfo.m_SpectatorID != SPEC_FREEVIEW)
OtherTeam = m_pClient->m_Teams.Team(pPlayerInfo->m_ClientID) != m_pClient->m_Teams.Team(m_pClient->m_Snap.m_SpecInfo.m_SpectatorID);
else
OtherTeam = m_pClient->m_Teams.Team(pPlayerInfo->m_ClientID) != m_pClient->m_Teams.Team(m_pClient->m_Snap.m_LocalClientID);
@ -43,15 +40,19 @@ void CNamePlates::RenderNameplate(
const char *pName = m_pClient->m_aClients[pPlayerInfo->m_ClientID].m_aName;
float tw = TextRender()->TextWidth(0, FontSize, pName, -1);
vec3 rgb = vec3(1.0f, 1.0f, 1.0f);
if(g_Config.m_ClNameplatesTeamcolors && m_pClient->m_Teams.Team(pPlayerInfo->m_ClientID))
rgb = HslToRgb(vec3(m_pClient->m_Teams.Team(pPlayerInfo->m_ClientID) / 64.0f, 1.0f, 0.75f));
if (OtherTeam)
{
TextRender()->TextOutlineColor(0.0f, 0.0f, 0.0f, 0.2f);
TextRender()->TextColor(1.0f, 1.0f, 1.0f, 0.4f);
TextRender()->TextColor(rgb.r, rgb.g, rgb.b, 0.4f);
}
else
{
TextRender()->TextOutlineColor(0.0f, 0.0f, 0.0f, 0.5f*a);
TextRender()->TextColor(1.0f, 1.0f, 1.0f, a);
TextRender()->TextColor(rgb.r, rgb.g, rgb.b, a);
}
if(g_Config.m_ClNameplatesTeamcolors && m_pClient->m_Snap.m_pGameInfoObj && m_pClient->m_Snap.m_pGameInfoObj->m_GameFlags&GAMEFLAG_TEAMS)
{

View file

@ -238,13 +238,10 @@ void CPlayers::RenderHook(
bool OtherTeam;
if (m_pClient->m_Snap.m_SpecInfo.m_Active)
{
if (m_pClient->m_Snap.m_SpecInfo.m_SpectatorID == SPEC_FREEVIEW)
OtherTeam = false;
else
OtherTeam = m_pClient->m_Teams.Team(pInfo.m_ClientID) != m_pClient->m_Teams.Team(m_pClient->m_Snap.m_SpecInfo.m_SpectatorID);
}
if (m_pClient->m_aClients[m_pClient->m_Snap.m_LocalClientID].m_Team == TEAM_SPECTATORS && m_pClient->m_Snap.m_SpecInfo.m_SpectatorID == SPEC_FREEVIEW)
OtherTeam = false;
else if (m_pClient->m_Snap.m_SpecInfo.m_Active && m_pClient->m_Snap.m_SpecInfo.m_SpectatorID != SPEC_FREEVIEW)
OtherTeam = m_pClient->m_Teams.Team(pInfo.m_ClientID) != m_pClient->m_Teams.Team(m_pClient->m_Snap.m_SpecInfo.m_SpectatorID);
else
OtherTeam = m_pClient->m_Teams.Team(pInfo.m_ClientID) != m_pClient->m_Teams.Team(m_pClient->m_Snap.m_LocalClientID);
@ -394,13 +391,10 @@ void CPlayers::RenderPlayer(
bool OtherTeam;
if (m_pClient->m_Snap.m_SpecInfo.m_Active)
{
if (m_pClient->m_Snap.m_SpecInfo.m_SpectatorID == SPEC_FREEVIEW)
OtherTeam = false;
else
OtherTeam = m_pClient->m_Teams.Team(pInfo.m_ClientID) != m_pClient->m_Teams.Team(m_pClient->m_Snap.m_SpecInfo.m_SpectatorID);
}
if (m_pClient->m_aClients[m_pClient->m_Snap.m_LocalClientID].m_Team == TEAM_SPECTATORS && m_pClient->m_Snap.m_SpecInfo.m_SpectatorID == SPEC_FREEVIEW)
OtherTeam = false;
else if (m_pClient->m_Snap.m_SpecInfo.m_Active && m_pClient->m_Snap.m_SpecInfo.m_SpectatorID != SPEC_FREEVIEW)
OtherTeam = m_pClient->m_Teams.Team(pInfo.m_ClientID) != m_pClient->m_Teams.Team(m_pClient->m_Snap.m_SpecInfo.m_SpectatorID);
else
OtherTeam = m_pClient->m_Teams.Team(pInfo.m_ClientID) != m_pClient->m_Teams.Team(m_pClient->m_Snap.m_LocalClientID);
@ -849,15 +843,19 @@ void CPlayers::RenderPlayer(
const char *pName = m_pClient->m_aClients[pPlayerInfo->m_ClientID].m_aName;
float tw = TextRender()->TextWidth(0, FontSize, pName, -1);
vec3 rgb = vec3(1.0f, 1.0f, 1.0f);
if(g_Config.m_ClNameplatesTeamcolors && m_pClient->m_Teams.Team(pPlayerInfo->m_ClientID))
rgb = HslToRgb(vec3(m_pClient->m_Teams.Team(pPlayerInfo->m_ClientID) / 64.0f, 1.0f, 0.75f));
if (OtherTeam)
{
TextRender()->TextOutlineColor(0.0f, 0.0f, 0.0f, 0.2f);
TextRender()->TextColor(1.0f, 1.0f, 1.0f, 0.4f);
TextRender()->TextColor(rgb.r, rgb.g, rgb.b, 0.4f);
}
else
{
TextRender()->TextOutlineColor(0.0f, 0.0f, 0.0f, 0.5f*a);
TextRender()->TextColor(1.0f, 1.0f, 1.0f, a);
TextRender()->TextColor(rgb.r, rgb.g, rgb.b, a);
}
if(g_Config.m_ClNameplatesTeamcolors && m_pClient->m_Snap.m_pGameInfoObj && m_pClient->m_Snap.m_pGameInfoObj->m_GameFlags&GAMEFLAG_TEAMS)
{