//=======================================================================
//			Copyright XashXT Group 2007 
//			hud_single.txt - hud program
//=======================================================================

void Hud_Setup( void )
{
	SetStatAlias( health_icon, 0 ); 
	SetStatAlias( health, 1 ); 
	SetStatAlias( ammo, 3 ); 
	SetStatAlias( armor, 5 ); 
	SetStatAlias( timer, 10 ); 

	SetCvarAlias( loading_bar, "scr_loading" );
	SetCvarAlias( cl_paused, "paused" );
	SetCvarAlias( show_pause, "scr_showpause" );
	SetCvarAlias( draw_crosshair, "crosshair" );
	SetCvarAlias( levelshot, "cl_levelshot_name" );
}

void Hud_Precache( void )
{
	// precache pics
	LoadPic("hud/num0");
	LoadPic("hud/num1");
	LoadPic("hud/num2");
	LoadPic("hud/num3");
	LoadPic("hud/num4");
	LoadPic("hud/num5");
	LoadPic("hud/num6");
	LoadPic("hud/num7");
	LoadPic("hud/num8");
	LoadPic("hud/num9");
	LoadPic("hud/num-");

	LoadPic("hud/ch1");
	LoadPic("hud/ch2");
	LoadPic("hud/ch3");
}

void Hud_MenuBackground( void )
{
	DrawPic( "background/splash", 0, 0, 640, 480 );
}

void Hud_DrawPlaque( void )
{
	// logo that shows up while upload next level
	DrawPic( levelshot, 0, 0, 640, 480 );
	DrawCenterBarImage( loading_bar, "menu/m_loading", 128, 32 );
}

void Hud_HelpComputer( void )
{
	DrawCenterPic( "hud/help", 256, 192 );
}

void Hud_Single( void )
{
	DrawPic( "hud/i_health", 10, 430, 48, 48 );
	DrawField( health, 60, 430, 3 );

	if( timer )
	{
		// test timer
		DrawBarGeneric( timer, 200, 400, 240, 16 );
	}
	if( armor )
	{
		DrawPic( "hud/i_combatarmor", 180, 430, 48, 48 );
		DrawField( armor, 240, 430, 1 );
	}

	if( draw_crosshair == 1)
	{
		SetColor( 1.0, 0.5, 0.0, 1.0 );
		DrawCenterPic( "hud/ch1", 32, 32 );
	}
	if( draw_crosshair == 2)
	{
		SetColor( 0.25, 0.5, 0.5, 1.0 );
		DrawCenterPic( "hud/ch2", 64, 64 );
	}
	if( draw_crosshair == 3)
	{
		SetColor( 0.25, 0.5, 0.5, 1.0 );
		DrawCenterPic( "hud/ch3", 32, 32 );
	}

	if( cl_paused && show_pause)
	{
		ResetColor();
		DrawCenterPic( "menu/m_pause", 128, 32 );
	}

}