// Message handler for text messages // displays a string, looking them up from the titles.txt file, which can be localised // parameters: // byte: message direction ( HUD_PRINTCONSOLE, HUD_PRINTNOTIFY, HUD_PRINTCENTER, HUD_PRINTTALK ) // string: message // optional parameters: // string: message parameter 1 // string: message parameter 2 // string: message parameter 3 // string: message parameter 4 // any string that starts with the character '#' is a message name, and is used to look up the real message in titles.txt // the next (optional) one to four strings are parameters for that string (which can also be message names if they begin with '#') int CHudTextMessage::MsgFunc_TextMsg( const char *pszName, int iSize, void *pbuf ) { BEGIN_READ( pbuf, iSize ); int msg_dest = READ_BYTE(); #define MSG_BUF_SIZE 128 static char szBuf[6][MSG_BUF_SIZE]; char *msg_text = LookupString( READ_STRING(), &msg_dest ); msg_text = safe_strcpy( szBuf[0], msg_text , MSG_BUF_SIZE); // keep reading strings and using C format strings for subsituting the strings into the localised text string char *sstr1 = LookupString( READ_STRING() ); sstr1 = safe_strcpy( szBuf[1], sstr1 , MSG_BUF_SIZE); StripEndNewlineFromString( sstr1 ); // these strings are meant for subsitution into the main strings, so cull the automatic end newlines char *sstr2 = LookupString( READ_STRING() ); sstr2 = safe_strcpy( szBuf[2], sstr2 , MSG_BUF_SIZE); StripEndNewlineFromString( sstr2 ); char *sstr3 = LookupString( READ_STRING() ); sstr3 = safe_strcpy( szBuf[3], sstr3 , MSG_BUF_SIZE); StripEndNewlineFromString( sstr3 ); char *sstr4 = LookupString( READ_STRING() ); sstr4 = safe_strcpy( szBuf[4], sstr4 , MSG_BUF_SIZE); StripEndNewlineFromString( sstr4 ); char *psz = szBuf[5]; if ( gViewPort && gViewPort->AllowedToPrintText() == FALSE ) return 1; switch ( msg_dest ) { case HUD_PRINTCENTER: safe_sprintf( psz, MSG_BUF_SIZE, msg_text, sstr1, sstr2, sstr3, sstr4 ); CenterPrint( ConvertCRtoNL( psz ) ); break; case HUD_PRINTNOTIFY: psz[0] = 1; // mark this message to go into the notify buffer safe_sprintf( psz+1, MSG_BUF_SIZE, msg_text, sstr1, sstr2, sstr3, sstr4 ); ConsolePrint( ConvertCRtoNL( psz ) ); break; case HUD_PRINTTALK: safe_sprintf( psz, MSG_BUF_SIZE, msg_text, sstr1, sstr2, sstr3, sstr4 ); gHUD.m_SayText.SayTextPrint( ConvertCRtoNL( psz ), 128 ); break; case HUD_PRINTCONSOLE: safe_sprintf( psz, MSG_BUF_SIZE, msg_text, sstr1, sstr2, sstr3, sstr4 ); ConsolePrint( ConvertCRtoNL( psz ) ); break; } return 1; }
//----------------------------------------------------------------------------- // Purpose: Reads in a player's Chat text from the server //----------------------------------------------------------------------------- void CHudChat::MsgFunc_SayText2( bf_read &msg ) { int client = msg.ReadByte(); bool bWantsToChat = msg.ReadByte() ? true : false; wchar_t szBuf[6][256]; char untranslated_msg_text[256]; wchar_t *msg_text = ReadLocalizedString( msg, szBuf[0], sizeof( szBuf[0] ), false, untranslated_msg_text, sizeof( untranslated_msg_text ) ); // keep reading strings and using C format strings for subsituting the strings into the localised text string ReadChatTextString ( msg, szBuf[1], sizeof( szBuf[1] ) ); // player name ReadChatTextString ( msg, szBuf[2], sizeof( szBuf[2] ) ); // chat text ReadLocalizedString( msg, szBuf[3], sizeof( szBuf[3] ), true ); ReadLocalizedString( msg, szBuf[4], sizeof( szBuf[4] ), true ); g_pVGuiLocalize->ConstructString( szBuf[5], sizeof( szBuf[5] ), msg_text, 4, szBuf[1], szBuf[2], szBuf[3], szBuf[4] ); char ansiString[512]; g_pVGuiLocalize->ConvertUnicodeToANSI( ConvertCRtoNL( szBuf[5] ), ansiString, sizeof( ansiString ) ); if ( bWantsToChat ) { // print raw chat text ChatPrintf( client, CHAT_FILTER_NONE, "%s", ansiString ); Msg( "%s\n", RemoveColorMarkup(ansiString) ); } else { // print raw chat text ChatPrintf( client, CHAT_FILTER_NONE, "%s", ansiString ); } }
// Message handler for text messages // displays a string, looking them up from the titles.txt file, which can be localised // parameters: // byte: message direction ( HUD_PRINTCONSOLE, HUD_PRINTNOTIFY, HUD_PRINTCENTER, HUD_PRINTTALK ) // string: message // optional parameters: // string: message parameter 1 // string: message parameter 2 // string: message parameter 3 // string: message parameter 4 // any string that starts with the character '#' is a message name, and is used to look up the real message in titles.txt // the next (optional) one to four strings are parameters for that string (which can also be message names if they begin with '#') int CHudTextMessage::MsgFunc_TextMsg( const char *pszName, int iSize, void *pbuf ) { int destination; StringList message; NetMsg_TextMsg( pbuf, iSize, destination, message ); if ( gViewPort && gViewPort->AllowedToPrintText() == FALSE ) return 1; while( message.size() < 5 ) { message.push_back( string("") ); } char psz[1024]; char* origin = psz; if( destination == HUD_PRINTNOTIFY ) { psz[0] = 1; origin = psz + 1; } // Ensure that message[0] does not contain exessive %'s, max 4x%s, all other %'s removed. size_t lastpos = 0; size_t pos; int count = 0; while(true) { pos = message[0].find("%", lastpos); if (pos == string::npos) break; if ((message[0].substr(pos + 1, 1) == "s") && (count < 4)) count++; else message[0].replace(pos, 1, " "); lastpos = pos + 1; } sprintf( origin, message[0].c_str(), message[1].c_str(), message[2].c_str(), message[3].c_str(), message[4].c_str() ); ConvertCRtoNL(psz); switch ( destination ) { case HUD_PRINTNOTIFY: case HUD_PRINTCONSOLE: ConsolePrint(psz); break; case HUD_PRINTCENTER: CenterPrint(psz); break; case HUD_PRINTTALK: gHUD.m_SayText.SayTextPrint(psz, 1024); break; } return 1; }
//----------------------------------------------------------------------------- // Purpose: Message handler for ShowMenu message // takes four values: // short: a bitfield of keys that are valid input // char : the duration, in seconds, the menu should stay up. -1 means is stays until something is chosen. // byte : a boolean, TRUE if there is more string yet to be received before displaying the menu, false if it's the last string // string: menu string to display // if this message is never received, then scores will simply be the combined totals of the players. //----------------------------------------------------------------------------- void CHudMenu::MsgFunc_ShowMenu( bf_read &msg) { m_bitsValidSlots = (short)msg.ReadWord(); int DisplayTime = msg.ReadChar(); int NeedMore = msg.ReadByte(); if ( DisplayTime > 0 ) { m_flShutoffTime = m_flOpenCloseTime + DisplayTime + gpGlobals->realtime; } else { m_flShutoffTime = -1; } if ( m_bitsValidSlots ) { char szString[2048]; msg.ReadString( szString, sizeof(szString) ); if ( !m_fWaitingForMore ) // this is the start of a new menu { Q_strncpy( g_szPrelocalisedMenuString, szString, sizeof( g_szPrelocalisedMenuString ) ); } else { // append to the current menu string Q_strncat( g_szPrelocalisedMenuString, szString, sizeof( g_szPrelocalisedMenuString ), COPY_ALL_CHARACTERS ); } if ( !NeedMore ) { GetClientMode()->GetViewportAnimationController()->StartAnimationSequence("MenuOpen"); m_nSelectedItem = -1; // we have the whole string, so we can localise it now char szMenuString[MAX_MENU_STRING]; Q_strncpy( szMenuString, ConvertCRtoNL( hudtextmessage->BufferedLocaliseTextString( g_szPrelocalisedMenuString ) ), sizeof( szMenuString ) ); g_pVGuiLocalize->ConvertANSIToUnicode( szMenuString, g_szMenuString, sizeof( g_szMenuString ) ); ProcessText(); } m_bMenuDisplayed = true; m_bMenuTakesInput = true; m_flSelectionTime = gpGlobals->curtime; } else { HideMenu(); } m_fWaitingForMore = NeedMore; }
void C_Camera::FireGameEvent( IGameEvent * event) { if ( !engine->IsHLTV() ) return; // not in HLTV mode const char *type = event->GetName(); if ( Q_strcmp( "game_newmap", type ) == 0 ) { //Reset(); // reset all camera settings //// show spectator UI //if ( !gViewPortInterface ) // return; //if ( engine->IsPlayingDemo() ) // { // // for demo playback show full menu // gViewPortInterface->ShowPanel( PANEL_SPECMENU, true ); // SetCamMode( CAM_MODE_ROAMING ); //} //else //{ // // during live broadcast only show black bars // gViewPortInterface->ShowPanel( PANEL_SPECGUI, true ); //} return; } if ( Q_strcmp( "hltv_message", type ) == 0 ) { wchar_t outputBuf[1024]; const char *pszText = event->GetString( "text", "" ); char *tmpStr = hudtextmessage->LookupString( pszText ); const wchar_t *pBuf = g_pVGuiLocalize->Find( tmpStr ); if ( pBuf ) { // Copy pBuf into szBuf[i]. int nMaxChars = sizeof( outputBuf ) / sizeof( wchar_t ); wcsncpy( outputBuf, pBuf, nMaxChars ); outputBuf[nMaxChars-1] = 0; } else { g_pVGuiLocalize->ConvertANSIToUnicode( tmpStr, outputBuf, sizeof(outputBuf) ); } internalCenterPrint->Print( ConvertCRtoNL( outputBuf ) ); return ; } }
//----------------------------------------------------------------------------- // Purpose: Reads in a player's Chat text from the server //----------------------------------------------------------------------------- void CBaseHudChat::MsgFunc_SayText2( bf_read &msg ) { // Got message during connection if ( !g_PR ) return; int client = msg.ReadByte(); bool bWantsToChat = msg.ReadByte(); wchar_t szBuf[6][256]; char untranslated_msg_text[256]; wchar_t *msg_text = ReadLocalizedString( msg, szBuf[0], sizeof( szBuf[0] ), false, untranslated_msg_text, sizeof( untranslated_msg_text ) ); // keep reading strings and using C format strings for subsituting the strings into the localised text string ReadChatTextString ( msg, szBuf[1], sizeof( szBuf[1] ) ); // player name ReadChatTextString ( msg, szBuf[2], sizeof( szBuf[2] ) ); // chat text ReadLocalizedString( msg, szBuf[3], sizeof( szBuf[3] ), true ); ReadLocalizedString( msg, szBuf[4], sizeof( szBuf[4] ), true ); g_pVGuiLocalize->ConstructString( szBuf[5], sizeof( szBuf[5] ), msg_text, 4, szBuf[1], szBuf[2], szBuf[3], szBuf[4] ); char ansiString[512]; g_pVGuiLocalize->ConvertUnicodeToANSI( ConvertCRtoNL( szBuf[5] ), ansiString, sizeof( ansiString ) ); if ( bWantsToChat ) { int iFilter = CHAT_FILTER_NONE; if ( client > 0 && (g_PR->GetTeam( client ) != g_PR->GetTeam( GetLocalPlayerIndex() )) ) { iFilter = CHAT_FILTER_PUBLICCHAT; } // print raw chat text ChatPrintf( client, iFilter, "%s", ansiString ); Msg( "%s\n", RemoveColorMarkup(ansiString) ); CLocalPlayerFilter filter; C_BaseEntity::EmitSound( filter, SOUND_FROM_LOCAL_PLAYER, "HudChat.Message" ); } else { // print raw chat text ChatPrintf( client, GetFilterForString( untranslated_msg_text), "%s", ansiString ); } }
//----------------------------------------------------------------------------- // Purpose: Local method to bring up a menu, mirroring code found in // MsgFunc_ShowMenu. // // takes two values: // menuName : menu name string // validSlots: a bitfield describing the valid keys //----------------------------------------------------------------------------- void CHudMenu::ShowMenu( const char * menuName, int validSlots ) { m_flShutoffTime = -1; m_bitsValidSlots = validSlots; m_fWaitingForMore = 0; Q_strncpy( g_szPrelocalisedMenuString, menuName, sizeof( g_szPrelocalisedMenuString ) ); GetClientMode()->GetViewportAnimationController()->StartAnimationSequence("MenuOpen"); m_nSelectedItem = -1; // we have the whole string, so we can localise it now char szMenuString[MAX_MENU_STRING]; Q_strncpy( szMenuString, ConvertCRtoNL( hudtextmessage->BufferedLocaliseTextString( g_szPrelocalisedMenuString ) ), sizeof( szMenuString ) ); g_pVGuiLocalize->ConvertANSIToUnicode( szMenuString, g_szMenuString, sizeof( g_szMenuString ) ); ProcessText(); m_bMenuDisplayed = true; m_bMenuTakesInput = true; m_flSelectionTime = gpGlobals->curtime; }
void C_HLTVCamera::FireGameEvent( IGameEvent * event) { if ( !g_bEngineIsHLTV ) return; // not in HLTV mode const char *type = event->GetName(); if ( Q_strcmp( "game_newmap", type ) == 0 ) { Reset(); // reset all camera settings // show spectator UI if ( !GetViewPortInterface() ) return; if ( engine->IsPlayingDemo() ) { // for demo playback show full menu GetViewPortInterface()->ShowPanel( PANEL_SPECMENU, true ); SetMode( OBS_MODE_ROAMING ); } else { // during live broadcast only show black bars GetViewPortInterface()->ShowPanel( PANEL_SPECGUI, true ); } return; } if ( Q_strcmp( "hltv_message", type ) == 0 ) { wchar_t outputBuf[1024]; const char *pszText = event->GetString( "text", "" ); char *tmpStr = hudtextmessage->LookupString( pszText ); const wchar_t *pBuf = g_pVGuiLocalize->Find( tmpStr ); if ( pBuf ) { // Copy pBuf into szBuf[i]. int nMaxChars = sizeof( outputBuf ) / sizeof( wchar_t ); wcsncpy( outputBuf, pBuf, nMaxChars ); outputBuf[nMaxChars-1] = 0; } else { g_pVGuiLocalize->ConvertANSIToUnicode( tmpStr, outputBuf, sizeof(outputBuf) ); } GetCenterPrint()->Print( ConvertCRtoNL( outputBuf ) ); return ; } if ( Q_strcmp( "hltv_title", type ) == 0 ) { Q_strncpy( m_szTitleText, event->GetString( "text", "" ), sizeof(m_szTitleText) ); return; } if ( Q_strcmp( "hltv_status", type ) == 0 ) { int nNumProxies = event->GetInt( "proxies" ); m_nNumSpectators = event->GetInt( "clients" ) - nNumProxies; return; } // after this only auto-director commands follow // don't execute them is autodirector is off and PVS is unlocked if ( !spec_autodirector.GetBool() && !IsPVSLocked() ) return; if ( Q_strcmp( "hltv_cameraman", type ) == 0 ) { Reset(); m_nCameraMode = OBS_MODE_ROAMING; m_iCameraMan = event->GetInt( "index" ); return; } if ( Q_strcmp( "hltv_fixed", type ) == 0 ) { m_iCameraMan = 0; m_vCamOrigin.x = event->GetInt( "posx" ); m_vCamOrigin.y = event->GetInt( "posy" ); m_vCamOrigin.z = event->GetInt( "posz" ); QAngle angle; angle.x = event->GetInt( "theta" ); angle.y = event->GetInt( "phi" ); angle.z = 0; // no roll yet if ( m_nCameraMode != OBS_MODE_FIXED ) { SetMode( OBS_MODE_FIXED ); SetCameraAngle( angle ); m_flFOV = event->GetFloat( "fov", 90 ); } SetPrimaryTarget( event->GetInt( "target" ) ); if ( m_iTraget1 == 0 ) { SetCameraAngle( angle ); } return; } if ( Q_strcmp( "hltv_chase", type ) == 0 ) { bool bInEye = event->GetBool( "ineye" ); // check if we are already in a player chase mode bool bIsInChaseMode = (m_nCameraMode==OBS_MODE_IN_EYE)|| (m_nCameraMode==OBS_MODE_CHASE); // if we are in auto director or not in a valid chase mode, set new mode now if ( spec_autodirector.GetBool() || !bIsInChaseMode ) { SetMode( bInEye?OBS_MODE_IN_EYE:OBS_MODE_CHASE ); } m_iCameraMan = 0; m_iTraget2 = event->GetInt( "target2" ); m_flDistance = event->GetFloat( "distance", m_flDistance ); m_flOffset = event->GetFloat( "offset", m_flOffset ); m_flTheta = event->GetFloat( "theta", m_flTheta ); m_flPhi = event->GetFloat( "phi", m_flPhi ); m_flFOV = event->GetFloat( "fov", 90 ); m_flInertia = event->GetFloat( "inertia", 30.f ) / 10.f; // if inertia is not set use standard value if ( m_flInertia <= 0 ) m_flInertia = 3.0f; SetPrimaryTarget( event->GetInt( "target1" ) ); return; } }
// Message handler for text messages // displays a string, looking them up from the titles.txt file, which can be localised // parameters: // byte: message direction ( HUD_PRINTCONSOLE, HUD_PRINTNOTIFY, HUD_PRINTCENTER, HUD_PRINTTALK ) // string: message // optional parameters: // string: message parameter 1 // string: message parameter 2 // string: message parameter 3 // string: message parameter 4 // any string that starts with the character '#' is a message name, and is used to look up the real message in titles.txt // the next (optional) one to four strings are parameters for that string (which can also be message names if they begin with '#') void CHudChat::MsgFunc_TextMsg( bf_read &msg ) { char szString[2048]; int msg_dest = msg.ReadByte(); static char szBuf[6][256]; msg.ReadString( szString, sizeof(szString) ); char *msg_text = hudtextmessage->LookupString( szString, &msg_dest ); Q_strncpy( szBuf[0], msg_text, sizeof( szBuf[0] ) ); msg_text = szBuf[0]; // keep reading strings and using C format strings for subsituting the strings into the localised text string msg.ReadString( szString, sizeof(szString) ); char *sstr1 = hudtextmessage->LookupString( szString ); Q_strncpy( szBuf[1], sstr1, sizeof( szBuf[1] ) ); sstr1 = szBuf[1]; StripEndNewlineFromString( sstr1 ); // these strings are meant for subsitution into the main strings, so cull the automatic end newlines msg.ReadString( szString, sizeof(szString) ); char *sstr2 = hudtextmessage->LookupString( szString ); Q_strncpy( szBuf[2], sstr2, sizeof( szBuf[2] ) ); sstr2 = szBuf[2]; StripEndNewlineFromString( sstr2 ); msg.ReadString( szString, sizeof(szString) ); char *sstr3 = hudtextmessage->LookupString( szString ); Q_strncpy( szBuf[3], sstr3, sizeof( szBuf[3] ) ); sstr3 = szBuf[3]; StripEndNewlineFromString( sstr3 ); msg.ReadString( szString, sizeof(szString) ); char *sstr4 = hudtextmessage->LookupString( szString ); Q_strncpy( szBuf[4], sstr4, sizeof( szBuf[4] ) ); sstr4 = szBuf[4]; StripEndNewlineFromString( sstr4 ); char *psz = szBuf[5]; if ( !cl_showtextmsg.GetInt() ) return; switch ( msg_dest ) { case HUD_PRINTCENTER: Q_snprintf( psz, sizeof( szBuf[5] ), msg_text, sstr1, sstr2, sstr3, sstr4 ); GetCenterPrint()->Print( ConvertCRtoNL( psz ) ); break; case HUD_PRINTNOTIFY: psz[0] = 1; // mark this message to go into the notify buffer Q_snprintf( psz+1, sizeof( szBuf[5] ) - 1, msg_text, sstr1, sstr2, sstr3, sstr4 ); Msg( "%s", ConvertCRtoNL( psz ) ); break; case HUD_PRINTTALK: Q_snprintf( psz, sizeof( szBuf[5] ), msg_text, sstr1, sstr2, sstr3, sstr4 ); Printf( CHAT_FILTER_NONE, "%s", ConvertCRtoNL( psz ) ); break; case HUD_PRINTCONSOLE: Q_snprintf( psz, sizeof( szBuf[5] ), msg_text, sstr1, sstr2, sstr3, sstr4 ); Msg( "%s", ConvertCRtoNL( psz ) ); break; } }
void CBaseHudChat::MsgFunc_VoiceSubtitle( bf_read &msg ) { // Got message during connection if ( !g_PR ) return; if ( !cl_showtextmsg.GetInt() ) return; char szString[2048]; char szPrefix[64]; //(Voice) wchar_t szBuf[128]; int client = msg.ReadByte(); int iMenu = msg.ReadByte(); int iItem = msg.ReadByte(); const char *pszSubtitle = ""; CGameRules *pGameRules = GameRules(); CMultiplayRules *pMultiRules = dynamic_cast< CMultiplayRules * >( pGameRules ); Assert( pMultiRules ); if ( pMultiRules ) { pszSubtitle = pMultiRules->GetVoiceCommandSubtitle( iMenu, iItem ); } SetVoiceSubtitleState( true ); const wchar_t *pBuf = g_pVGuiLocalize->Find( pszSubtitle ); if ( pBuf ) { // Copy pBuf into szBuf[i]. int nMaxChars = sizeof( szBuf ) / sizeof( wchar_t ); wcsncpy( szBuf, pBuf, nMaxChars ); szBuf[nMaxChars-1] = 0; } else { g_pVGuiLocalize->ConvertANSIToUnicode( pszSubtitle, szBuf, sizeof(szBuf) ); } int len; g_pVGuiLocalize->ConvertUnicodeToANSI( szBuf, szString, sizeof(szString) ); len = strlen( szString ); if ( len && szString[len-1] != '\n' && szString[len-1] != '\r' ) { Q_strncat( szString, "\n", sizeof(szString), 1 ); } const wchar_t *pVoicePrefix = g_pVGuiLocalize->Find( "#Voice" ); g_pVGuiLocalize->ConvertUnicodeToANSI( pVoicePrefix, szPrefix, sizeof(szPrefix) ); ChatPrintf( client, CHAT_FILTER_NONE, "%c(%s) %s%c: %s", COLOR_PLAYERNAME, szPrefix, GetDisplayedSubtitlePlayerName( client ), COLOR_NORMAL, ConvertCRtoNL( szString ) ); SetVoiceSubtitleState( false ); }
//----------------------------------------------------------------------------- // Message handler for text messages // displays a string, looking them up from the titles.txt file, which can be localised // parameters: // byte: message direction ( HUD_PRINTCONSOLE, HUD_PRINTNOTIFY, HUD_PRINTCENTER, HUD_PRINTTALK ) // string: message // optional parameters: // string: message parameter 1 // string: message parameter 2 // string: message parameter 3 // string: message parameter 4 // any string that starts with the character '#' is a message name, and is used to look up the real message in titles.txt // the next (optional) one to four strings are parameters for that string (which can also be message names if they begin with '#') //----------------------------------------------------------------------------- void CBaseHudChat::MsgFunc_TextMsg( bf_read &msg ) { char szString[2048]; int msg_dest = msg.ReadByte(); wchar_t szBuf[5][256]; wchar_t outputBuf[256]; for ( int i=0; i<5; ++i ) { msg.ReadString( szString, sizeof(szString) ); char *tmpStr = hudtextmessage->LookupString( szString, &msg_dest ); const wchar_t *pBuf = g_pVGuiLocalize->Find( tmpStr ); if ( pBuf ) { // Copy pBuf into szBuf[i]. int nMaxChars = sizeof( szBuf[i] ) / sizeof( wchar_t ); wcsncpy( szBuf[i], pBuf, nMaxChars ); szBuf[i][nMaxChars-1] = 0; } else { if ( i ) { StripEndNewlineFromString( tmpStr ); // these strings are meant for subsitution into the main strings, so cull the automatic end newlines } g_pVGuiLocalize->ConvertANSIToUnicode( tmpStr, szBuf[i], sizeof(szBuf[i]) ); } } if ( !cl_showtextmsg.GetInt() ) return; int len; switch ( msg_dest ) { case HUD_PRINTCENTER: g_pVGuiLocalize->ConstructString( outputBuf, sizeof(outputBuf), szBuf[0], 4, szBuf[1], szBuf[2], szBuf[3], szBuf[4] ); internalCenterPrint->Print( ConvertCRtoNL( outputBuf ) ); break; case HUD_PRINTNOTIFY: g_pVGuiLocalize->ConstructString( outputBuf, sizeof(outputBuf), szBuf[0], 4, szBuf[1], szBuf[2], szBuf[3], szBuf[4] ); g_pVGuiLocalize->ConvertUnicodeToANSI( outputBuf, szString, sizeof(szString) ); len = strlen( szString ); if ( len && szString[len-1] != '\n' && szString[len-1] != '\r' ) { Q_strncat( szString, "\n", sizeof(szString), 1 ); } Msg( "%s", ConvertCRtoNL( szString ) ); break; case HUD_PRINTTALK: g_pVGuiLocalize->ConstructString( outputBuf, sizeof(outputBuf), szBuf[0], 4, szBuf[1], szBuf[2], szBuf[3], szBuf[4] ); g_pVGuiLocalize->ConvertUnicodeToANSI( outputBuf, szString, sizeof(szString) ); len = strlen( szString ); if ( len && szString[len-1] != '\n' && szString[len-1] != '\r' ) { Q_strncat( szString, "\n", sizeof(szString), 1 ); } Printf( CHAT_FILTER_NONE, "%s", ConvertCRtoNL( szString ) ); Msg( "%s", ConvertCRtoNL( szString ) ); break; case HUD_PRINTCONSOLE: g_pVGuiLocalize->ConstructString( outputBuf, sizeof(outputBuf), szBuf[0], 4, szBuf[1], szBuf[2], szBuf[3], szBuf[4] ); g_pVGuiLocalize->ConvertUnicodeToANSI( outputBuf, szString, sizeof(szString) ); len = strlen( szString ); if ( len && szString[len-1] != '\n' && szString[len-1] != '\r' ) { Q_strncat( szString, "\n", sizeof(szString), 1 ); } Msg( "%s", ConvertCRtoNL( szString ) ); break; } }