mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-14 03:58:18 +00:00
Fix chat refind skins
This commit is contained in:
parent
1fb2ef2dfe
commit
00e22d8d14
|
@ -877,21 +877,17 @@ void CChat::AddLine(int ClientID, int Team, const char *pLine)
|
||||||
|
|
||||||
void CChat::RefindSkins()
|
void CChat::RefindSkins()
|
||||||
{
|
{
|
||||||
for(int i = 0; i < MAX_LINES; i++)
|
for(auto &Line : m_aLines)
|
||||||
{
|
{
|
||||||
int r = ((m_CurrentLine - i) + MAX_LINES) % MAX_LINES;
|
if(Line.m_HasRenderTee)
|
||||||
if(m_aLines[r].m_TextContainerIndex == -1)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if(m_aLines[r].m_HasRenderTee)
|
|
||||||
{
|
{
|
||||||
const CSkin *pSkin = m_pClient->m_pSkins->Get(m_pClient->m_pSkins->Find(m_aLines[r].m_aSkinName));
|
const CSkin *pSkin = m_pClient->m_pSkins->Get(m_pClient->m_pSkins->Find(Line.m_aSkinName));
|
||||||
if(m_aLines[r].m_CustomColoredSkin)
|
if(Line.m_CustomColoredSkin)
|
||||||
m_aLines[r].m_RenderSkin = pSkin->m_ColorableSkin;
|
Line.m_RenderSkin = pSkin->m_ColorableSkin;
|
||||||
else
|
else
|
||||||
m_aLines[r].m_RenderSkin = pSkin->m_OriginalSkin;
|
Line.m_RenderSkin = pSkin->m_OriginalSkin;
|
||||||
|
|
||||||
m_aLines[r].m_RenderSkinMetrics = pSkin->m_Metrics;
|
Line.m_RenderSkinMetrics = pSkin->m_Metrics;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,15 +118,6 @@ struct CSkin
|
||||||
SSkinMetricVariable m_Body;
|
SSkinMetricVariable m_Body;
|
||||||
SSkinMetricVariable m_Feet;
|
SSkinMetricVariable m_Feet;
|
||||||
|
|
||||||
int m_FeetWidth;
|
|
||||||
int m_FeetHeight;
|
|
||||||
int m_FeetOffsetX;
|
|
||||||
int m_FeetOffsetY;
|
|
||||||
|
|
||||||
// these can be used to normalize the metrics
|
|
||||||
int m_FeetMaxWidth;
|
|
||||||
int m_FeetMaxHeight;
|
|
||||||
|
|
||||||
void Reset()
|
void Reset()
|
||||||
{
|
{
|
||||||
m_Body.Reset();
|
m_Body.Reset();
|
||||||
|
|
Loading…
Reference in a new issue