Merge pull request #1890 from Dune-jr/fix-uid-blend

Properly blend UID in chat
This commit is contained in:
oy 2018-12-17 15:47:08 +01:00 committed by GitHub
commit db03a488da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -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);
}

View file

@ -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;
}