UTIL_HudMessageAll

From Valve Developer Community
Jump to: navigation, search

UTIL_HudMessageAll is a UTIL provided to send a message to all player's HUDs. It is only used for debugging purposes.


See Also: UTIL_HudMessage

Usage

//-----------------------------------------------------------------------------
// Purpose: Calls UTIL_HudMessage for every player
// Input  : hudtextparmas_t - Text Parameters, size, location, color, etc. 
// Input  : pMessage - Message to send
// Output : 
//-----------------------------------------------------------------------------
void UTIL_HudMessageAll( const hudtextparms_t &textparms, const char *pMessage )

Examples

// ----------------------------------------------------------
// Skip AI if its been disabled or networks haven't been
// loaded, and put a warning message on the screen
//
// Don't do this if the convar wants it hidden
// ----------------------------------------------------------
if ( (CAI_BaseNPC::m_nDebugBits & bits_debugDisableAI || !g_pAINetworkManager->NetworksLoaded()) )
{
	if ( gpGlobals->curtime >= g_AINextDisabledMessageTime && !IsInCommentaryMode() )
	{
		g_AINextDisabledMessageTime = gpGlobals->curtime + 0.5f;

		hudtextparms_s tTextParam;
		tTextParam.x			= 0.7;
		tTextParam.y			= 0.65;
		tTextParam.effect		= 0;
		tTextParam.r1			= 255;
		tTextParam.g1			= 255;
		tTextParam.b1			= 255;
		tTextParam.a1			= 255;
		tTextParam.r2			= 255;
		tTextParam.g2			= 255;
		tTextParam.b2			= 255;
		tTextParam.a2			= 255;
		tTextParam.fadeinTime	= 0;
		tTextParam.fadeoutTime	= 0;
		tTextParam.holdTime		= 0.6;
		tTextParam.fxTime		= 0;
		tTextParam.channel		= 1;
		UTIL_HudMessageAll( tTextParam, "A.I. Disabled...\n" );
	}
	SetActivity( ACT_IDLE );
	return false;
}