Skip to content

Commit 46efb3e

Browse files
committed
refactor(basechat): remove trailing whitespace
1 parent c7b3b11 commit 46efb3e

2 files changed

Lines changed: 47 additions & 47 deletions

File tree

src/game/client/hud_basechat.cpp

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ Color g_ColorGrey( 204, 204, 204, 255 );
5555
Color g_ColorPurple( 160, 115, 205, 255 );
5656

5757
static const char *gBugPriorityTable[] = {
58-
"TODAY",
59-
"ASAP",
58+
"TODAY",
59+
"ASAP",
6060
"NONE",
6161
NULL
6262
};
@@ -65,7 +65,7 @@ static const char *gBugTokenTable[] = {
6565
"re", "regression",
6666
"today", "showstopper",
6767
"asap", "showstopper",
68-
"ss", "showstopper",
68+
"ss", "showstopper",
6969
"show", "showstopper",
7070
// "high", "high",
7171
"med", "medium",
@@ -210,15 +210,15 @@ static CUtlLinkedList<const char *> *ParseTokens(char *szString)
210210
CUtlLinkedList<const char *> *tokens = new CUtlLinkedList<const char *>();
211211
// ensure that the defaults are reset
212212
// later tokens should override these values
213-
tokens->AddToHead("NONE");
214-
tokens->AddToHead("High");
215-
tokens->AddToHead("triage");
213+
tokens->AddToHead("NONE");
214+
tokens->AddToHead("High");
215+
tokens->AddToHead("triage");
216216

217217
char *pEnd = szString + V_strlen(szString) - 1;
218218
while ( pEnd >= szString && (*pEnd == ')' || *pEnd == ' ') )
219219
{
220220
if (*pEnd == ')')
221-
{
221+
{
222222
char *pToken = NULL;
223223

224224
// skip any spaces
@@ -233,7 +233,7 @@ static CUtlLinkedList<const char *> *ParseTokens(char *szString)
233233
// skip back to the open paren (if there is one)
234234
char *pStart = pEnd;
235235
while (pStart > szString && *pStart != '(') pStart--;
236-
if (pStart >= szString)
236+
if (pStart >= szString)
237237
{
238238
*pStart = '\0';
239239
pToken = pStart+1;
@@ -292,7 +292,7 @@ wchar_t* ReadChatTextString( bf_read &msg, wchar_t *pOut, int outSize, bool stri
292292
// Input : *parent -
293293
// *panelName -
294294
//-----------------------------------------------------------------------------
295-
CBaseHudChatLine::CBaseHudChatLine( vgui::Panel *parent, const char *panelName ) :
295+
CBaseHudChatLine::CBaseHudChatLine( vgui::Panel *parent, const char *panelName ) :
296296
vgui::MultiFontRichText( parent, panelName )
297297
{
298298
m_hFont = m_hFontMarlett = 0;
@@ -358,7 +358,7 @@ void CBaseHudChatLine::PerformFadeout( void )
358358
r = r + ( 255 - r ) * frac;
359359
g = g + ( 255 - g ) * frac;
360360
b = b + ( 255 - b ) * frac;
361-
361+
362362
// Draw a right facing triangle in red, faded out over time
363363
int alpha = 63 + 192 * (1.0f - frac1 );
364364
alpha = clamp( alpha, 0, 255 );
@@ -460,11 +460,11 @@ void CBaseHudChatLine::Expire( void )
460460
//-----------------------------------------------------------------------------
461461
// Purpose: The prompt and text entry area for chat messages
462462
//-----------------------------------------------------------------------------
463-
CBaseHudChatInputLine::CBaseHudChatInputLine( CBaseHudChat *parent, char const *panelName ) :
463+
CBaseHudChatInputLine::CBaseHudChatInputLine( CBaseHudChat *parent, char const *panelName ) :
464464
vgui::Panel( parent, panelName )
465465
{
466466
m_pPrompt = new vgui::Label( this, "ChatInputPrompt", L"Enter text:" );
467-
m_pInput = new CBaseHudChatEntry( this, "ChatInput", parent );
467+
m_pInput = new CBaseHudChatEntry( this, "ChatInput", parent );
468468
m_pInput->SetMaximumCharCount( 127 );
469469
// Send converts text to utf-8
470470
m_pInput->m_iMaxByteCount = 127;
@@ -473,7 +473,7 @@ CBaseHudChatInputLine::CBaseHudChatInputLine( CBaseHudChat *parent, char const *
473473
void CBaseHudChatInputLine::ApplySchemeSettings(vgui::IScheme *pScheme)
474474
{
475475
BaseClass::ApplySchemeSettings(pScheme);
476-
476+
477477
// FIXME: Outline
478478
vgui::HFont hFont = pScheme->GetFont( "ChatFont" );
479479

@@ -527,7 +527,7 @@ void CBaseHudChatInputLine::PerformLayout()
527527
GetSize( wide, tall );
528528

529529
int w,h;
530-
m_pPrompt->GetContentSize( w, h);
530+
m_pPrompt->GetContentSize( w, h);
531531
m_pPrompt->SetBounds( 0, 0, w, tall );
532532

533533
m_pInput->SetBounds( w + 2, 0, wide - w - 2 , tall );
@@ -538,12 +538,12 @@ vgui::Panel *CBaseHudChatInputLine::GetInputPanel( void )
538538
return m_pInput;
539539
}
540540

541-
CHudChatFilterButton::CHudChatFilterButton( vgui::Panel *pParent, const char *pName, const char *pText ) :
541+
CHudChatFilterButton::CHudChatFilterButton( vgui::Panel *pParent, const char *pName, const char *pText ) :
542542
BaseClass( pParent, pName, pText )
543543
{
544544
}
545545

546-
CHudChatFilterCheckButton::CHudChatFilterCheckButton( vgui::Panel *pParent, const char *pName, const char *pText, int iFlag ) :
546+
CHudChatFilterCheckButton::CHudChatFilterCheckButton( vgui::Panel *pParent, const char *pName, const char *pText, int iFlag ) :
547547
BaseClass( pParent, pName, pText )
548548
{
549549
m_iFlag = iFlag;
@@ -793,7 +793,7 @@ void CBaseHudChat::CreateChatInputLine( void )
793793
void CBaseHudChat::CreateChatLines( void )
794794
{
795795
m_ChatLine = new CBaseHudChatLine( this, "ChatLine1" );
796-
m_ChatLine->SetVisible( false );
796+
m_ChatLine->SetVisible( false );
797797
}
798798

799799

@@ -902,7 +902,7 @@ void CBaseHudChat::MsgFunc_SayText( bf_read &msg )
902902

903903
int CBaseHudChat::GetFilterForString( const char *pString )
904904
{
905-
if ( !Q_stricmp( pString, "#HL_Name_Change" ) )
905+
if ( !Q_stricmp( pString, "#HL_Name_Change" ) )
906906
{
907907
return CHAT_FILTER_NAMECHANGE;
908908
}
@@ -1109,7 +1109,7 @@ void CBaseHudChat::MsgFunc_VoiceSubtitle( bf_read &msg )
11091109

11101110
const wchar_t *pVoicePrefix = g_pVGuiLocalize->Find( "#Voice" );
11111111
g_pVGuiLocalize->ConvertUnicodeToANSI( pVoicePrefix, szPrefix, sizeof(szPrefix) );
1112-
1112+
11131113
ChatPrintf( client, CHAT_FILTER_NONE, "%c(%s) %s%c: %s", COLOR_PLAYERNAME, szPrefix, GetDisplayedSubtitlePlayerName( client ), COLOR_NORMAL, ConvertCRtoNL( szString ) );
11141114

11151115
SetVoiceSubtitleState( false );
@@ -1274,15 +1274,15 @@ void CBaseHudChat::Printf( int iFilter, const char *fmt, ... )
12741274
//-----------------------------------------------------------------------------
12751275
void CBaseHudChat::StartMessageMode( int iMessageModeType )
12761276
{
1277-
// reactivedrop: #iss-nohud-hanging if asw_draw_hud is 0 we don't
1278-
// show chat input box, because this leads to input being stuck and
1277+
// reactivedrop: #iss-nohud-hanging if asw_draw_hud is 0 we don't
1278+
// show chat input box, because this leads to input being stuck and
12791279
// inability of client to open Esc menu or console
12801280
#ifdef INFESTED_DLL
12811281
extern ConVar asw_draw_hud;
12821282
if (!asw_draw_hud.GetBool())
12831283
return;
12841284
#endif // INFESTED_DLL
1285-
1285+
12861286
m_nMessageMode = iMessageModeType;
12871287
cl_chat_active.SetValue( m_nMessageMode );
12881288

@@ -1292,7 +1292,7 @@ void CBaseHudChat::StartMessageMode( int iMessageModeType )
12921292

12931293
m_pChatInput->ClearEntry();
12941294
SetChatPrompt( iMessageModeType );
1295-
1295+
12961296
if ( GetChatHistory() )
12971297
{
12981298
// TERROR: hack to get ChatFont back
@@ -1312,7 +1312,7 @@ void CBaseHudChat::StartMessageMode( int iMessageModeType )
13121312
SetMouseInputEnabled( true );
13131313
m_pChatInput->SetVisible( true );
13141314
vgui::surface()->CalculateMouseVisible();
1315-
m_pChatInput->SetPaintBorderEnabled( true );
1315+
m_pChatInput->SetPaintBorderEnabled( true );
13161316
m_pChatInput->RequestFocus();
13171317

13181318
#ifndef INFESTED_DLL
@@ -1354,7 +1354,7 @@ void CBaseHudChat::StopMessageMode( bool bFade )
13541354
{
13551355
SetKeyBoardInputEnabled( false );
13561356
SetMouseInputEnabled( false );
1357-
1357+
13581358
if ( GetChatHistory() )
13591359
{
13601360
GetChatHistory()->SetPaintBorderEnabled( false );
@@ -1394,7 +1394,7 @@ void CBaseHudChat::FadeChatHistory( void )
13941394
{
13951395
return;
13961396
}
1397-
1397+
13981398
float frac = ( m_flHistoryFadeTime - gpGlobals->curtime ) * CHAT_HISTORY_ONE_OVER_FADE_TIME;
13991399
int alpha = frac * CHAT_HISTORY_ALPHA;
14001400
alpha = clamp( alpha, 0, CHAT_HISTORY_ALPHA );
@@ -1451,7 +1451,7 @@ Color CBaseHudChat::GetTextColorForClient( TextColor colorNum, int clientIndex )
14511451

14521452
case COLOR_ACHIEVEMENT:
14531453
{
1454-
vgui::IScheme *pSourceScheme = vgui::scheme()->GetIScheme( vgui::scheme()->GetScheme( "SourceScheme" ) );
1454+
vgui::IScheme *pSourceScheme = vgui::scheme()->GetIScheme( vgui::scheme()->GetScheme( "SourceScheme" ) );
14551455
if ( pSourceScheme )
14561456
{
14571457
c = pSourceScheme->GetColor( "SteamLightGreen", GetBgColor() );
@@ -1512,7 +1512,7 @@ int CBaseHudChatLine::TranslateChannelRange(byte inputval)
15121512

15131513
//pass float modifier into range 0 - 255
15141514
outputMod *= 255.0f;
1515-
1515+
15161516
return outputMod;
15171517
}
15181518

@@ -1584,9 +1584,9 @@ void CBaseHudChatLine::InsertAndColorizeText( wchar_t *buf, int clientIndex )
15841584
endIndexPos = diffResult;
15851585
}
15861586

1587-
15881587

1589-
1588+
1589+
15901590
if (endIndexPos > 0)
15911591
{
15921592
// save this start
@@ -2192,7 +2192,7 @@ void CBaseHudChatLine::Colorize( int alpha )
21922192
CBaseHudChat *pChat = dynamic_cast<CBaseHudChat*>(GetParent() );
21932193

21942194
if ( pChat && pChat->GetChatHistory() )
2195-
{
2195+
{
21962196
pChat->GetChatHistory()->InsertString( "\n" );
21972197
}
21982198

@@ -2218,7 +2218,7 @@ void CBaseHudChatLine::Colorize( int alpha )
22182218
ConColorMsg( color, "%s", szText );
22192219

22202220
if ( pChat && pChat->GetChatHistory() )
2221-
{
2221+
{
22222222
pChat->GetChatHistory()->InsertColorChange( color );
22232223
pChat->GetChatHistory()->InsertFontChange( m_hFont );
22242224
pChat->GetChatHistory()->InsertString( wText );
@@ -2257,7 +2257,7 @@ void CBaseHudChat::Send( void )
22572257

22582258
wchar_t szTextbuf[1024];
22592259
m_pChatInput->GetMessageText( szTextbuf, sizeof( szTextbuf ) );
2260-
2260+
22612261
char ansi[1024];
22622262
g_pVGuiLocalize->ConvertUnicodeToANSI( szTextbuf, ansi, sizeof( ansi ) );
22632263
int len = Q_strlen(ansi);
@@ -2276,7 +2276,7 @@ void CBaseHudChat::Send( void )
22762276

22772277
engine->ClientCmd_Unrestricted(szbuf);
22782278
}
2279-
2279+
22802280
m_pChatInput->ClearEntry();
22812281
m_nMessageMode = MM_NONE; // TERROR
22822282
cl_chat_active.SetValue( m_nMessageMode );
@@ -2461,12 +2461,12 @@ void CBaseHudChat::ChatPrintf( int iPlayerIndex, int iFilter, const char *fmt, .
24612461
if ( iPlayerIndex == 0 )
24622462
{
24632463
Q_memset( &sPlayerInfo, 0, sizeof(player_info_t) );
2464-
Q_strncpy( sPlayerInfo.name, "Console", sizeof(sPlayerInfo.name) );
2464+
Q_strncpy( sPlayerInfo.name, "Console", sizeof(sPlayerInfo.name) );
24652465
}
24662466
else
24672467
{
24682468
engine->GetPlayerInfo( iPlayerIndex, &sPlayerInfo );
2469-
}
2469+
}
24702470

24712471
int bufSize = (strlen( pmsg ) + 1 ) * sizeof(wchar_t);
24722472
wchar_t *wbuf = static_cast<wchar_t *>( _alloca( bufSize ) );
@@ -2517,7 +2517,7 @@ void CBaseHudChat::FireGameEvent( IGameEvent *event )
25172517

25182518
if ( !player )
25192519
return;
2520-
2520+
25212521
ChatPrintf( player->entindex(), CHAT_FILTER_NONE, "(SourceTV) %s", event->GetString( "text" ) );
25222522
}
25232523
}

src/game/client/hud_basechat.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class CBaseHudChatLine : public vgui::MultiFontRichText
117117
Color GetTextColor( void ) { return m_clrText; }
118118
void SetNameLength( int iLength ) { m_iNameLength = iLength; }
119119
void SetNameColor( Color cColor ){ m_clrNameColor = cColor; }
120-
120+
121121
virtual void PerformFadeout( void );
122122
static int TranslateChannelRange(byte inputval);
123123
virtual void InsertAndColorizeText( wchar_t *buf, int clientIndex );
@@ -140,7 +140,7 @@ class CBaseHudChatLine : public vgui::MultiFontRichText
140140
friend class CRD_HoIAF_System;
141141

142142
int m_iNameStart;
143-
143+
144144
private:
145145
float m_flStartTime;
146146
int m_nCount;
@@ -214,17 +214,17 @@ class CBaseHudChat : public CHudElement, public vgui::EditablePanel
214214

215215
virtual void CreateChatInputLine( void );
216216
virtual void CreateChatLines( void );
217-
217+
218218
virtual void Init( void );
219219

220220
void LevelInit( const char *newmap );
221221
void LevelShutdown( void );
222222

223223
void MsgFunc_TextMsg(const char *pszName, int iSize, void *pbuf);
224-
224+
225225
virtual void Printf( int iFilter, const char *fmt, ... );
226226
virtual void ChatPrintf( int iPlayerIndex, int iFilter, const char *fmt, ... );
227-
227+
228228
virtual void StartMessageMode( int iMessageModeType );
229229
virtual void StopMessageMode( bool bFade = true );
230230
int GetMessageMode() { return m_nMessageMode; }
@@ -255,7 +255,7 @@ class CBaseHudChat : public CHudElement, public vgui::EditablePanel
255255
virtual void MsgFunc_TextMsg( bf_read &msg );
256256
virtual void MsgFunc_VoiceSubtitle( bf_read &msg );
257257

258-
258+
259259
CBaseHudChatInputLine *GetChatInput( void ) { return m_pChatInput; }
260260
CHudChatFilterPanel *GetChatFilterPanel( void );
261261

@@ -275,7 +275,7 @@ class CBaseHudChat : public CHudElement, public vgui::EditablePanel
275275

276276
bool IsVoiceSubtitle( void ) { return m_bEnteringVoice; }
277277
void SetVoiceSubtitleState( bool bState ) { m_bEnteringVoice = bState; }
278-
278+
279279
virtual void OnKeyCodeTyped(vgui::KeyCode code);
280280

281281
protected:
@@ -291,7 +291,7 @@ class CBaseHudChat : public CHudElement, public vgui::EditablePanel
291291
CHudChatFilterButton *m_pFiltersButton;
292292
CHudChatFilterPanel *m_pFilterPanel;
293293

294-
private:
294+
private:
295295
void Clear( void );
296296

297297
int ComputeBreakChar( int width, const char *text, int textlen );
@@ -328,7 +328,7 @@ class CBaseHudChatEntry : public vgui::TextEntry
328328
class CBaseHudChatInputLine : public vgui::Panel
329329
{
330330
typedef vgui::Panel BaseClass;
331-
331+
332332
public:
333333
CBaseHudChatInputLine( CBaseHudChat *parent, char const *panelName );
334334

@@ -341,7 +341,7 @@ class CBaseHudChatInputLine : public vgui::Panel
341341
virtual void ApplySchemeSettings(vgui::IScheme *pScheme);
342342

343343
vgui::Panel *GetInputPanel( void );
344-
virtual vgui::VPANEL GetCurrentKeyFocus() { return m_pInput->GetVPanel(); }
344+
virtual vgui::VPANEL GetCurrentKeyFocus() { return m_pInput->GetVPanel(); }
345345

346346
virtual void Paint()
347347
{

0 commit comments

Comments
 (0)