Fix 0.7 client team colors (Closed #8977)

This commit is contained in:
ChillerDragon 2024-09-18 16:43:18 +08:00
parent 60624d5599
commit 46c5344d71
3 changed files with 12 additions and 11 deletions

View file

@ -1565,7 +1565,7 @@ void CGameClient::OnNewSnapshot()
pClient->m_SkinInfo.m_ColorFeet = ColorRGBA(1, 1, 1); pClient->m_SkinInfo.m_ColorFeet = ColorRGBA(1, 1, 1);
} }
pClient->UpdateRenderInfo(IsTeamPlay(), g_Config.m_ClDummy); pClient->UpdateRenderInfo(IsTeamPlay());
} }
} }
else if(Item.m_Type == NETOBJTYPE_PLAYERINFO) else if(Item.m_Type == NETOBJTYPE_PLAYERINFO)
@ -2388,7 +2388,7 @@ void CGameClient::CClientStats::Reset()
m_FlagCaptures = 0; m_FlagCaptures = 0;
} }
void CGameClient::CClientData::UpdateRenderInfo(bool IsTeamPlay, int Conn) void CGameClient::CClientData::UpdateRenderInfo(bool IsTeamPlay)
{ {
m_RenderInfo = m_SkinInfo; m_RenderInfo = m_SkinInfo;
@ -2403,6 +2403,7 @@ void CGameClient::CClientData::UpdateRenderInfo(bool IsTeamPlay, int Conn)
m_RenderInfo.m_ColorFeet = color_cast<ColorRGBA>(ColorHSLA(aTeamColors[m_Team])); m_RenderInfo.m_ColorFeet = color_cast<ColorRGBA>(ColorHSLA(aTeamColors[m_Team]));
// 0.7 // 0.7
for(auto &Sixup : m_RenderInfo.m_aSixup)
{ {
const ColorRGBA aTeamColorsSixup[2] = { const ColorRGBA aTeamColorsSixup[2] = {
ColorRGBA(0.753f, 0.318f, 0.318f, 1.0f), ColorRGBA(0.753f, 0.318f, 0.318f, 1.0f),
@ -2410,18 +2411,19 @@ void CGameClient::CClientData::UpdateRenderInfo(bool IsTeamPlay, int Conn)
const ColorRGBA aMarkingColorsSixup[2] = { const ColorRGBA aMarkingColorsSixup[2] = {
ColorRGBA(0.824f, 0.345f, 0.345f, 1.0f), ColorRGBA(0.824f, 0.345f, 0.345f, 1.0f),
ColorRGBA(0.345f, 0.514f, 0.824f, 1.0f)}; ColorRGBA(0.345f, 0.514f, 0.824f, 1.0f)};
float MarkingAlpha = m_RenderInfo.m_aSixup[Conn].m_aColors[protocol7::SKINPART_MARKING].a; float MarkingAlpha = Sixup.m_aColors[protocol7::SKINPART_MARKING].a;
for(auto &Color : m_RenderInfo.m_aSixup[Conn].m_aColors) for(auto &Color : Sixup.m_aColors)
Color = aTeamColorsSixup[m_Team]; Color = aTeamColorsSixup[m_Team];
if(MarkingAlpha > 0.1f) if(MarkingAlpha > 0.1f)
m_RenderInfo.m_aSixup[Conn].m_aColors[protocol7::SKINPART_MARKING] = aMarkingColorsSixup[m_Team]; Sixup.m_aColors[protocol7::SKINPART_MARKING] = aMarkingColorsSixup[m_Team];
} }
} }
else else
{ {
m_RenderInfo.m_ColorBody = color_cast<ColorRGBA>(ColorHSLA(12829350)); m_RenderInfo.m_ColorBody = color_cast<ColorRGBA>(ColorHSLA(12829350));
m_RenderInfo.m_ColorFeet = color_cast<ColorRGBA>(ColorHSLA(12829350)); m_RenderInfo.m_ColorFeet = color_cast<ColorRGBA>(ColorHSLA(12829350));
for(auto &Color : m_RenderInfo.m_aSixup[Conn].m_aColors) for(auto &Sixup : m_RenderInfo.m_aSixup)
for(auto &Color : Sixup.m_aColors)
Color = color_cast<ColorRGBA>(ColorHSLA(12829350)); Color = color_cast<ColorRGBA>(ColorHSLA(12829350));
} }
} }
@ -3757,8 +3759,7 @@ void CGameClient::RefreshSkins()
Client.m_SkinInfo.m_OriginalRenderSkin.Reset(); Client.m_SkinInfo.m_OriginalRenderSkin.Reset();
Client.m_SkinInfo.m_ColorableRenderSkin.Reset(); Client.m_SkinInfo.m_ColorableRenderSkin.Reset();
} }
for(int Dummy = 0; Dummy < NUM_DUMMIES; Dummy++) Client.UpdateRenderInfo(IsTeamPlay());
Client.UpdateRenderInfo(IsTeamPlay(), Dummy);
} }
for(auto &pComponent : m_vpAll) for(auto &pComponent : m_vpAll)

View file

@ -438,7 +438,7 @@ public:
bool m_SpecCharPresent; bool m_SpecCharPresent;
vec2 m_SpecChar; vec2 m_SpecChar;
void UpdateRenderInfo(bool IsTeamPlay, int Conn); void UpdateRenderInfo(bool IsTeamPlay);
void Reset(); void Reset();
class CSixup class CSixup

View file

@ -196,7 +196,7 @@ void *CGameClient::TranslateGameMsg(int *pMsgId, CUnpacker *pUnpacker, int Conn)
{ {
m_aClients[pMsg7->m_ClientId].m_Team = pMsg7->m_Team; m_aClients[pMsg7->m_ClientId].m_Team = pMsg7->m_Team;
m_pClient->m_TranslationContext.m_aClients[pMsg7->m_ClientId].m_Team = pMsg7->m_Team; m_pClient->m_TranslationContext.m_aClients[pMsg7->m_ClientId].m_Team = pMsg7->m_Team;
m_aClients[pMsg7->m_ClientId].UpdateRenderInfo(IsTeamPlay(), Conn); m_aClients[pMsg7->m_ClientId].UpdateRenderInfo(IsTeamPlay());
// if(pMsg7->m_ClientId == m_LocalClientId) // if(pMsg7->m_ClientId == m_LocalClientId)
// { // {