Fix CHudMessage::MessageDrawScan ignoring custom font size

This commit is contained in:
samisalreadytaken 2022-12-02 22:31:24 +03:00
parent f8591316fa
commit 7011b893af

View File

@ -447,6 +447,8 @@ void CHudMessage::MessageScanStart( void )
break; break;
} }
// Font was just set in MessageDrawScan()
#ifndef MAPBASE
m_parms.font = g_hFontTrebuchet24; m_parms.font = g_hFontTrebuchet24;
if ( m_parms.vguiFontName != NULL && if ( m_parms.vguiFontName != NULL &&
@ -455,6 +457,7 @@ void CHudMessage::MessageScanStart( void )
SetFont( vgui::scheme()->GetDefaultScheme(), m_parms.vguiFontName ); SetFont( vgui::scheme()->GetDefaultScheme(), m_parms.vguiFontName );
} }
#endif
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -497,7 +500,19 @@ void CHudMessage::MessageDrawScan( client_textmessage_t *pMessage, float time )
m_parms.totalWidth = 0; m_parms.totalWidth = 0;
m_parms.vguiFontName = pMessage->pVGuiSchemeFontName; m_parms.vguiFontName = pMessage->pVGuiSchemeFontName;
#ifdef MAPBASE
if ( m_parms.vguiFontName != NULL &&
m_parms.vguiFontName[ 0 ] )
{
SetFont( vgui::scheme()->GetDefaultScheme(), m_parms.vguiFontName );
}
else
{
m_parms.font = g_hFontTrebuchet24; m_parms.font = g_hFontTrebuchet24;
}
#else
m_parms.font = g_hFontTrebuchet24;
#endif
while ( *pText ) while ( *pText )
{ {