mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 22:48:18 +00:00
Merge pull request #1890 from Dune-jr/fix-uid-blend
Properly blend UID in chat
This commit is contained in:
commit
db03a488da
|
@ -909,9 +909,10 @@ void CChat::OnRender()
|
||||||
if(Line.m_Mode == CHAT_WHISPER && Line.m_ClientID == m_pClient->m_LocalClientID && Line.m_TargetID >= 0)
|
if(Line.m_Mode == CHAT_WHISPER && Line.m_ClientID == m_pClient->m_LocalClientID && Line.m_TargetID >= 0)
|
||||||
NameCID = Line.m_TargetID;
|
NameCID = Line.m_TargetID;
|
||||||
|
|
||||||
|
vec4 IdTextColor = vec4(0.1f*Blend, 0.1f*Blend, 0.1f*Blend, 1.0f*Blend);
|
||||||
vec4 BgIdColor = TextColor;
|
vec4 BgIdColor = TextColor;
|
||||||
BgIdColor.a = 0.5f;
|
BgIdColor.a = 0.5f*Blend;
|
||||||
RenderTools()->DrawClientID(TextRender(), &Cursor, NameCID, BgIdColor);
|
RenderTools()->DrawClientID(TextRender(), &Cursor, NameCID, BgIdColor, IdTextColor);
|
||||||
str_format(aBuf, sizeof(aBuf), "%s: ", Line.m_aName);
|
str_format(aBuf, sizeof(aBuf), "%s: ", Line.m_aName);
|
||||||
TextRender()->TextShadowed(&Cursor, aBuf, -1, ShadowOffset, ShadowColor, TextColor);
|
TextRender()->TextShadowed(&Cursor, aBuf, -1, ShadowOffset, ShadowColor, TextColor);
|
||||||
}
|
}
|
||||||
|
|
|
@ -621,8 +621,7 @@ void CRenderTools::DrawClientID(ITextRender* pTextRender, CTextCursor* pCursor,
|
||||||
pCursor->m_X += (ID < 10 ? 0.04f: 0.0f) * FontSize;
|
pCursor->m_X += (ID < 10 ? 0.04f: 0.0f) * FontSize;
|
||||||
|
|
||||||
// TODO: make a simple text one (no shadow)
|
// TODO: make a simple text one (no shadow)
|
||||||
pTextRender->TextShadowed(pCursor, aBuff, -1, vec2(0,0), vec4(0,0,0,0),
|
pTextRender->TextShadowed(pCursor, aBuff, -1, vec2(0,0), vec4(0,0,0,0), TextColor);
|
||||||
vec4(0.1f, 0.1f, 0.1f, 1.0f));
|
|
||||||
|
|
||||||
pCursor->m_X = PrevX + Rect.w + 0.2f * FontSize;
|
pCursor->m_X = PrevX + Rect.w + 0.2f * FontSize;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue