mp/src/game/client/sdk/hud/da_instructor.cpp
void CHudLessonPanel::LocalizeAndDisplay( const char *pszHudTxtMsg, const char *szRawString )
{
	static wchar_t szBuf[128];
	static wchar_t *pszBuf;

	// init buffers & pointers
	szBuf[0] = 0;
	pszBuf = szBuf;

	// try to localize
	if ( pszHudTxtMsg )
	{
		pszBuf = g_pVGuiLocalize->Find( pszHudTxtMsg );
	}
	else
	{
		pszBuf = g_pVGuiLocalize->Find( szRawString );
	}

	if ( !pszBuf )
	{
		// use plain ASCII string 
		g_pVGuiLocalize->ConvertANSIToUnicode( szRawString, szBuf, sizeof(szBuf) );
		pszBuf = szBuf;
	}

	// make it visible
	if ( SetHintText( pszBuf ) )
	{
		SetVisible( true );
		g_pClientMode->GetViewportAnimationController()->StartAnimationSequence( "LessonShow" ); 

		C_BasePlayer *pLocalPlayer = C_BasePlayer::GetLocalPlayer();
		if ( pLocalPlayer )
		{
			pLocalPlayer->EmitSound( "Hud.Hint" );

			if ( pLocalPlayer->Hints() )
			{
				pLocalPlayer->Hints()->PlayedAHint();
			}
		}
	}
	else
	{
		g_pClientMode->GetViewportAnimationController()->StartAnimationSequence( "LessonHide" ); 
	}
}
//-----------------------------------------------------------------------------
// Purpose: Localize, display, and animate the hud element
//-----------------------------------------------------------------------------
Localize, display, and animate the hud element
Localize display and animate the hud element
void CHudLessonPanel::LocalizeAndDisplay( const char *pszHudTxtMsg, const char *szRawString )
{
	static wchar_t szBuf[128];
	static wchar_t *pszBuf;
	szBuf[0] = 0;
	pszBuf = szBuf;
	if ( pszHudTxtMsg )
	{
		pszBuf = g_pVGuiLocalize->Find( pszHudTxtMsg );
	}
	else
	{
		pszBuf = g_pVGuiLocalize->Find( szRawString );
	}
	if ( !pszBuf )
	{
		g_pVGuiLocalize->ConvertANSIToUnicode( szRawString, szBuf, sizeof(szBuf) );
		pszBuf = szBuf;
	}
	if ( SetHintText( pszBuf ) )
	{
		SetVisible( true );
		g_pClientMode->GetViewportAnimationController()->StartAnimationSequence( "LessonShow" ); 
		C_BasePlayer *pLocalPlayer = C_BasePlayer::GetLocalPlayer();
		if ( pLocalPlayer )
		{
			pLocalPlayer->EmitSound( "Hud.Hint" );
			if ( pLocalPlayer->Hints() )
			{
				pLocalPlayer->Hints()->PlayedAHint();
			}
		}
	}
	else
	{
		g_pClientMode->GetViewportAnimationController()->StartAnimationSequence( "LessonHide" ); 
	}
}
void CHudLessonPanel :: LocalizeAndDisplay ( const char * pszHudTxtMsg , const char * szRawString ) { static wchar_t szBuf [ 128 ] ; static wchar_t * pszBuf ; szBuf [ 0 ] = 0 ; pszBuf = szBuf ; if ( pszHudTxtMsg ) { pszBuf = g_pVGuiLocalize -> Find ( pszHudTxtMsg ) ; } else { pszBuf = g_pVGuiLocalize -> Find ( szRawString ) ; } if ( ! pszBuf ) { g_pVGuiLocalize -> ConvertANSIToUnicode ( szRawString , szBuf , sizeof ( szBuf ) ) ; pszBuf = szBuf ; } if ( SetHintText ( pszBuf ) ) { SetVisible ( true ) ; g_pClientMode -> GetViewportAnimationController ( ) -> StartAnimationSequence ( " " ) ; C_BasePlayer * pLocalPlayer = C_BasePlayer :: GetLocalPlayer ( ) ; if ( pLocalPlayer ) { pLocalPlayer -> EmitSound ( " " ) ; if ( pLocalPlayer -> Hints ( ) ) { pLocalPlayer -> Hints ( ) -> PlayedAHint ( ) ; } } } else { g_pClientMode -> GetViewportAnimationController ( ) -> StartAnimationSequence ( " " ) ; } }
Purpose: Localize, display, and animate the hud element
Purpose : Localize display and animate the hud element
// init buffers & pointers // try to localize // use plain ASCII string  // make it visible