//=============================================================================
// CHSpectatorHud.
//=============================================================================
class CHSpectatorHud expands ChallengeHUD;

#exec OBJ LOAD FILE=..\unrealshare\textures\menugr.utx PACKAGE=UNREALSHARE.MenuGfx

var texture SkullColors[4];

simulated function PostRender( canvas Canvas )
{
	local float StartX;

	HUDSetup(canvas);

	if ( PlayerPawn(Owner) != None )
	{
		if ( PlayerPawn(Owner).bShowMenu  )
		{
			DisplayMenu(Canvas);
			return;
		}
		if ( PlayerPawn(Owner).bShowScores )
		{
			if ( (PlayerPawn(Owner).Scoring == None) && (PlayerPawn(Owner).ScoringType != None) )
				PlayerPawn(Owner).Scoring = Spawn(PlayerPawn(Owner).ScoringType, PlayerPawn(Owner));
			if ( PlayerPawn(Owner).Scoring != None )
			{ 
				PlayerPawn(Owner).Scoring.ShowScores(Canvas);
				return;
			}
		}

		if ( bStartUpMessage && (Level.TimeSeconds < 5) )
		{
			bStartUpMessage = false;
			PlayerPawn(Owner).SetProgressTime(7);
		}

		if ( PlayerPawn(Owner).ProgressTimeOut > Level.TimeSeconds )
			DisplayProgressMessage(Canvas);
	}
	if (Canvas.ClipY<290) Return;

	Canvas.Style = 2;
	StartX = 0.5 * Canvas.ClipX - 128;	
	Canvas.SetPos(StartX,Canvas.ClipY-58);
	Canvas.DrawTile( Texture'MenuBarrier', 256, 64, 0, 0, 256, 64 );
	StartX = 0.5 * Canvas.ClipX - 128;
	Canvas.Style = 2;	
	Canvas.SetPos(StartX,Canvas.ClipY-52);
	Canvas.DrawIcon(texture'Logo2', 1.0);	
	Canvas.Style = 1;

	// Display Frag count
	if ( (Level.Game == None) || Level.Game.IsA('TeamGamePlus') ) 
		DrawFragCount(Canvas, Canvas.ClipX-32,Canvas.ClipY-32);
}

function DrawSkull(Canvas Canvas, int X, int Y, texture SkullTexture)
{ 
	Canvas.SetPos(X,Y);
	Canvas.DrawIcon(SkullTexture, 1.0);	
	Canvas.CurX -= 19;
	Canvas.CurY += 23;
	Canvas.Font = Font'TinyWhiteFont';	
	if (Pawn(Owner).PlayerReplicationInfo.Score<100) Canvas.CurX+=6;
	if (Pawn(Owner).PlayerReplicationInfo.Score<10) Canvas.CurX+=6;	
	if (Pawn(Owner).PlayerReplicationInfo.Score<0) Canvas.CurX-=6;
	Canvas.DrawText(int(Pawn(Owner).PlayerReplicationInfo.Score),False);
				
}

defaultproperties
{
     SkullColors(0)=Texture'BotPack.Icons.RedSkull'
     SkullColors(1)=Texture'BotPack.Icons.BlueSkull'
     SkullColors(2)=Texture'BotPack.Icons.GreenSkull'
     SkullColors(3)=Texture'BotPack.Icons.YellowSkull'
}
