Browse Source

game/client: make font size proportional

64bits
nillerusr 2 years ago
parent
commit
898716f600
  1. 12
      game/client/hud_closecaption.cpp

12
game/client/hud_closecaption.cpp

@ -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 ] ) );

Loading…
Cancel
Save