Merge pull request #8499 from Robyt3/Client-Spectate-HUD-Cleanup

Remove `Spectate` label from HUD, show `Following {player}` instead
This commit is contained in:
heinrich5991 2024-06-18 20:07:11 +00:00 committed by GitHub
commit f5d28f155a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1384,7 +1384,18 @@ void CHud::RenderSpectatorHud()
// draw the text
char aBuf[128];
str_format(aBuf, sizeof(aBuf), "%s: %s", Localize("Spectate"), GameClient()->m_MultiViewActivated ? Localize("Multi-View") : m_pClient->m_Snap.m_SpecInfo.m_SpectatorId != SPEC_FREEVIEW ? m_pClient->m_aClients[m_pClient->m_Snap.m_SpecInfo.m_SpectatorId].m_aName : Localize("Free-View"));
if(GameClient()->m_MultiViewActivated)
{
str_copy(aBuf, Localize("Multi-View"));
}
else if(m_pClient->m_Snap.m_SpecInfo.m_SpectatorId != SPEC_FREEVIEW)
{
str_format(aBuf, sizeof(aBuf), Localize("Following %s", "Spectating"), m_pClient->m_aClients[m_pClient->m_Snap.m_SpecInfo.m_SpectatorId].m_aName);
}
else
{
str_copy(aBuf, Localize("Free-View"));
}
TextRender()->Text(m_Width - 174.0f, m_Height - 15.0f + (15.f - 8.f) / 2.f, 8.0f, aBuf, -1.0f);
}