Compare commits

...

1 Commits

Author SHA1 Message Date
nillerusr
898716f600 game/client: make font size proportional 2022-06-19 15:17:06 +03:00

View File

@ -820,6 +820,8 @@ CHudCloseCaption::CHudCloseCaption( const char *pElementName )
vgui::Panel *pParent = g_pClientMode->GetViewport(); vgui::Panel *pParent = g_pClientMode->GetViewport();
SetParent( pParent ); SetParent( pParent );
SetProportional( true );
m_nGoalHeight = 0; m_nGoalHeight = 0;
m_nCurrentHeight = 0; m_nCurrentHeight = 0;
m_flGoalAlpha = 1.0f; m_flGoalAlpha = 1.0f;
@ -1575,17 +1577,17 @@ void CHudCloseCaption::CreateFonts( void )
{ {
vgui::IScheme *pScheme = vgui::scheme()->GetIScheme( GetScheme() ); vgui::IScheme *pScheme = vgui::scheme()->GetIScheme( GetScheme() );
m_hFonts[CCFONT_NORMAL] = pScheme->GetFont( "CloseCaption_Normal" ); m_hFonts[CCFONT_NORMAL] = pScheme->GetFont( "CloseCaption_Normal", true );
if ( IsPC() ) if ( IsPC() )
{ {
m_hFonts[CCFONT_BOLD] = pScheme->GetFont( "CloseCaption_Bold" ); m_hFonts[CCFONT_BOLD] = pScheme->GetFont( "CloseCaption_Bold", true );
m_hFonts[CCFONT_ITALIC] = pScheme->GetFont( "CloseCaption_Italic" ); m_hFonts[CCFONT_ITALIC] = pScheme->GetFont( "CloseCaption_Italic", true );
m_hFonts[CCFONT_ITALICBOLD] = pScheme->GetFont( "CloseCaption_BoldItalic" ); m_hFonts[CCFONT_ITALICBOLD] = pScheme->GetFont( "CloseCaption_BoldItalic", true );
} }
else else
{ {
m_hFonts[CCFONT_SMALL] = pScheme->GetFont( "CloseCaption_Small" ); m_hFonts[CCFONT_SMALL] = pScheme->GetFont( "CloseCaption_Small", true );
} }
m_nLineHeight = MAX( 6, vgui::surface()->GetFontTall( m_hFonts[ CCFONT_NORMAL ] ) ); m_nLineHeight = MAX( 6, vgui::surface()->GetFontTall( m_hFonts[ CCFONT_NORMAL ] ) );