3306: Respect friend color in spectate mode ♥ too r=Jupeyy a=def-

As suggested by Cøke
![screenshot_2020-11-12_19-17-01](https://user-images.githubusercontent.com/2335377/98979616-d7cfda00-251b-11eb-857d-b592655ef538.png)

## Checklist

- [x] Tested the change ingame
- [x] Provided screenshots if it is a visual change
- [x] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [x] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [x] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: def <dennis@felsin9.de>
This commit is contained in:
bors[bot] 2020-11-13 10:20:08 +00:00 committed by GitHub
commit 5602d3e9fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -417,8 +417,9 @@ void CSpectator::OnRender()
if(m_pClient->m_aClients[m_pClient->m_Snap.m_paInfoByDDTeamName[i]->m_ClientID].m_Friend) if(m_pClient->m_aClients[m_pClient->m_Snap.m_paInfoByDDTeamName[i]->m_ClientID].m_Friend)
{ {
TextRender()->TextColor(1.0f, 0.3f, 0.3f, 1.0f); ColorRGBA rgb = color_cast<ColorRGBA>(ColorHSLA(g_Config.m_ClMessageFriendColor));
TextRender()->Text(0, Width / 2.0f + x - TeeInfo.m_Size / 2.0f, Height / 2.0f + y + BoxMove + (LineHeight - FontSize) / 2.f, FontSize, "", 220.0f); TextRender()->TextColor(rgb.WithAlpha(1.f));
TextRender()->Text(0, Width / 2.0f + x - TeeInfo.m_Size / 2.0f, Height / 2.0f + y + BoxMove + (LineHeight - FontSize) / 2.f, FontSize, "", 220.0f);
TextRender()->TextColor(1.0f, 1.0f, 1.0f, 1.0f); TextRender()->TextColor(1.0f, 1.0f, 1.0f, 1.0f);
} }