mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge pull request #8980 from ChillerDragon/pr_fix_team_colors_sixup
Fix 0.7 client team colors (Closed #8977)
This commit is contained in:
commit
2c77e79061
|
@ -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,19 +2411,20 @@ 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)
|
||||||
Color = color_cast<ColorRGBA>(ColorHSLA(12829350));
|
for(auto &Color : Sixup.m_aColors)
|
||||||
|
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)
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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)
|
||||||
// {
|
// {
|
||||||
|
|
Loading…
Reference in a new issue