From dfcb9beabd1e21d06f66a7c1722acb8642617c11 Mon Sep 17 00:00:00 2001 From: def Date: Sun, 26 Jul 2015 18:52:53 +0200 Subject: [PATCH] Visually tell tees apart that you can't spectate --- src/game/client/components/spectator.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/game/client/components/spectator.cpp b/src/game/client/components/spectator.cpp index d74cf1466..099913cff 100644 --- a/src/game/client/components/spectator.cpp +++ b/src/game/client/components/spectator.cpp @@ -370,7 +370,18 @@ void CSpectator::OnRender() m_SelectedSpectatorID = m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_ClientID; Selected = true; } - TextRender()->TextColor(1.0f, 1.0f, 1.0f, Selected?1.0f:0.5f); + float TeeAlpha; + if(Client()->State() == IClient::STATE_DEMOPLAYBACK && + !m_pClient->m_Snap.m_aCharacters[m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_ClientID].m_Active) + { + TextRender()->TextColor(1.0f, 1.0f, 1.0f, 0.25f); + TeeAlpha = 0.5f; + } + else + { + TextRender()->TextColor(1.0f, 1.0f, 1.0f, Selected?1.0f:0.5f); + TeeAlpha = 1.0f; + } TextRender()->Text(0, Width/2.0f+x+50.0f, Height/2.0f+y+5.0f, FontSize, m_pClient->m_aClients[m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_ClientID].m_aName, 220.0f); // flag @@ -391,8 +402,10 @@ void CSpectator::OnRender() } CTeeRenderInfo TeeInfo = m_pClient->m_aClients[m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_ClientID].m_RenderInfo; + TeeInfo.m_ColorBody.a = TeeAlpha; + TeeInfo.m_ColorFeet.a = TeeAlpha; TeeInfo.m_Size *= TeeSizeMod; - RenderTools()->RenderTee(CAnimState::GetIdle(), &TeeInfo, EMOTE_NORMAL, vec2(1.0f, 0.0f), vec2(Width/2.0f+x+20.0f, Height/2.0f+y+20.0f)); + RenderTools()->RenderTee(CAnimState::GetIdle(), &TeeInfo, EMOTE_NORMAL, vec2(1.0f, 0.0f), vec2(Width/2.0f+x+20.0f, Height/2.0f+y+20.0f), true); y += LineHeight; }