Toggleable Scoreboard

From Valve Developer Community
Revision as of 03:45, 11 April 2011 by Zeta (talk | contribs) (Created page with 'To replace the default behaviour of scoreboards (where one would need to hold down a button to make the scoreboard appear), the following change would make it so the scoreboard b…')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

To replace the default behaviour of scoreboards (where one would need to hold down a button to make the scoreboard appear), the following change would make it so the scoreboard becomes Toggleable.

Open the file in_main.cpp and modify the IN_ScoreDown and IN_ScoreUp functions to the following:

void IN_ScoreDown( const CCommand &args )
{
	KeyDown( &in_score, args[1] );

	if(gViewPortInterface)
	{
		if ((gViewPortInterface->FindPanelByName( PANEL_SCOREBOARD ))->IsVisible())
		{
			gViewPortInterface->ShowPanel( PANEL_SCOREBOARD, false );
		}
		else 
		{
			gViewPortInterface->ShowPanel( PANEL_SCOREBOARD, true );
		}
	}
}

void IN_ScoreUp( const CCommand &args )
{

}