From 171f1c39d3dbf01a32613ef7d4296aa2ff141353 Mon Sep 17 00:00:00 2001 From: Jordy Ruiz Date: Mon, 17 Dec 2018 11:58:49 +0100 Subject: [PATCH] Properly blend UID in chat --- src/game/client/components/chat.cpp | 5 +++-- src/game/client/render.cpp | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/game/client/components/chat.cpp b/src/game/client/components/chat.cpp index 86e78bb5d..7d46a7c51 100644 --- a/src/game/client/components/chat.cpp +++ b/src/game/client/components/chat.cpp @@ -909,9 +909,10 @@ void CChat::OnRender() if(Line.m_Mode == CHAT_WHISPER && Line.m_ClientID == m_pClient->m_LocalClientID && Line.m_TargetID >= 0) NameCID = Line.m_TargetID; + vec4 IdTextColor = vec4(0.1f*Blend, 0.1f*Blend, 0.1f*Blend, 1.0f*Blend); vec4 BgIdColor = TextColor; - BgIdColor.a = 0.5f; - RenderTools()->DrawClientID(TextRender(), &Cursor, NameCID, BgIdColor); + BgIdColor.a = 0.5f*Blend; + RenderTools()->DrawClientID(TextRender(), &Cursor, NameCID, BgIdColor, IdTextColor); str_format(aBuf, sizeof(aBuf), "%s: ", Line.m_aName); TextRender()->TextShadowed(&Cursor, aBuf, -1, ShadowOffset, ShadowColor, TextColor); } diff --git a/src/game/client/render.cpp b/src/game/client/render.cpp index 397886302..4f08f156c 100644 --- a/src/game/client/render.cpp +++ b/src/game/client/render.cpp @@ -621,8 +621,7 @@ void CRenderTools::DrawClientID(ITextRender* pTextRender, CTextCursor* pCursor, pCursor->m_X += (ID < 10 ? 0.04f: 0.0f) * FontSize; // TODO: make a simple text one (no shadow) - pTextRender->TextShadowed(pCursor, aBuff, -1, vec2(0,0), vec4(0,0,0,0), - vec4(0.1f, 0.1f, 0.1f, 1.0f)); + pTextRender->TextShadowed(pCursor, aBuff, -1, vec2(0,0), vec4(0,0,0,0), TextColor); pCursor->m_X = PrevX + Rect.w + 0.2f * FontSize; }