UnrealShare
Class UnrealTeamHUD

source: e:\games\UnrealTournament\UnrealShare\Classes\UnrealTeamHUD.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.HUD
         |
         +--UnrealShare.UnrealHUD
            |
            +--UnrealShare.UnrealTeamHUD
Direct Known Subclasses:None

class UnrealTeamHUD
extends UnrealShare.UnrealHUD

//============================================================================= // UnrealTeamHUD //=============================================================================

Function Summary
 
simulated
DrawFragCount(Canvas Canvas, int X, int Y)
 
simulated
DrawIdentifyInfo(Canvas Canvas, float PosX, float PosY)
 void DrawSkull(Canvas Canvas, int X, int Y, Texture SkullTexture)



Source Code


00001	//=============================================================================
00002	// UnrealTeamHUD
00003	//=============================================================================
00004	class UnrealTeamHUD extends UnrealHUD;
00005	
00006	#exec TEXTURE IMPORT NAME=BlueSkull FILE=TEXTURES\HUD\i_skullb.PCX GROUP="Icons" MIPS=OFF
00007	#exec TEXTURE IMPORT NAME=GreenSkull FILE=TEXTURES\HUD\i_skullg.PCX GROUP="Icons" MIPS=OFF
00008	#exec TEXTURE IMPORT NAME=RedSkull FILE=TEXTURES\HUD\i_skullr.PCX GROUP="Icons" MIPS=OFF
00009	#exec TEXTURE IMPORT NAME=YellowSkull FILE=TEXTURES\HUD\i_skully.PCX GROUP="Icons" MIPS=OFF
00010	
00011	simulated function DrawFragCount(Canvas Canvas, int X, int Y)
00012	{
00013		local texture SkullTexture;
00014	
00015		SkullTexture = texture'IconSkull';
00016	
00017		if ( Pawn(Owner).PlayerReplicationInfo.TeamName ~= "red" )
00018			SkullTexture = texture'RedSkull';
00019		else if ( Pawn(Owner).PlayerReplicationInfo.TeamName ~= "blue" )
00020			SkullTexture = texture'BlueSkull';
00021		else if ( Pawn(Owner).PlayerReplicationInfo.TeamName ~= "green" )
00022			SkullTexture = texture'GreenSkull';
00023		else if ( Pawn(Owner).PlayerReplicationInfo.TeamName ~= "yellow" )
00024			SkullTexture = texture'YellowSkull';
00025	
00026		DrawSkull(Canvas, X, Y, SkullTexture);
00027	}
00028	
00029	function DrawSkull(Canvas Canvas, int X, int Y, texture SkullTexture)
00030	{ 
00031		Canvas.SetPos(X,Y);
00032		Canvas.DrawIcon(SkullTexture, 1.0);	
00033		Canvas.CurX -= 19;
00034		Canvas.CurY += 23;
00035		Canvas.Font = Font'TinyWhiteFont';	
00036		if (Pawn(Owner).PlayerReplicationInfo.Score<100) Canvas.CurX+=6;
00037		if (Pawn(Owner).PlayerReplicationInfo.Score<10) Canvas.CurX+=6;	
00038		if (Pawn(Owner).PlayerReplicationInfo.Score<0) Canvas.CurX-=6;
00039		if (Pawn(Owner).PlayerReplicationInfo.Score<-9) Canvas.CurX-=6;
00040		Canvas.DrawText(int(Pawn(Owner).PlayerReplicationInfo.Score),False);
00041					
00042	}
00043	
00044	simulated function DrawIdentifyInfo(canvas Canvas, float PosX, float PosY)
00045	{
00046		local float XL, YL, XOffset;
00047	
00048		if (!TraceIdentify(Canvas))
00049			return;
00050	
00051		if(IdentifyTarget.IsA('PlayerPawn'))
00052			if(PlayerPawn(IdentifyTarget).PlayerReplicationInfo.bFeigningDeath)
00053				return;
00054	
00055		Canvas.Font = Font'WhiteFont';
00056		Canvas.Style = 3;
00057	
00058		XOffset = 0.0;
00059		Canvas.StrLen(IdentifyName$": "$IdentifyTarget.PlayerReplicationInfo.PlayerName, XL, YL);
00060		XOffset = Canvas.ClipX/2 - XL/2;
00061		Canvas.SetPos(XOffset, Canvas.ClipY - 74);
00062	
00063		if(IdentifyTarget.PlayerReplicationInfo.PlayerName != "")
00064		{
00065			Canvas.DrawColor = AltTeamColor[IdentifyTarget.PlayerReplicationInfo.Team];
00066			Canvas.DrawColor.R = Canvas.DrawColor.R * IdentifyFadeTime / 3.0; 
00067			Canvas.DrawColor.G = Canvas.DrawColor.G * IdentifyFadeTime / 3.0; 
00068			Canvas.DrawColor.B = Canvas.DrawColor.B * IdentifyFadeTime / 3.0; 
00069			Canvas.StrLen(IdentifyName$": ", XL, YL);
00070			XOffset += XL;
00071			Canvas.DrawText(IdentifyName$": ");
00072			Canvas.SetPos(XOffset, Canvas.ClipY - 74);
00073			Canvas.DrawColor = TeamColor[IdentifyTarget.PlayerReplicationInfo.Team]; 
00074			Canvas.DrawColor.R = Canvas.DrawColor.R * IdentifyFadeTime / 3.0; 
00075			Canvas.DrawColor.G = Canvas.DrawColor.G * IdentifyFadeTime / 3.0; 
00076			Canvas.DrawColor.B = Canvas.DrawColor.B * IdentifyFadeTime / 3.0; 
00077			Canvas.StrLen(IdentifyTarget.PlayerReplicationInfo.PlayerName, XL, YL);
00078			Canvas.DrawText(IdentifyTarget.PlayerReplicationInfo.PlayerName);
00079		}
00080	
00081		XOffset = 0.0;
00082		Canvas.StrLen(IdentifyHealth$": "$IdentifyTarget.Health, XL, YL);
00083		XOffset = Canvas.ClipX/2 - XL/2;
00084		Canvas.SetPos(XOffset, Canvas.ClipY - 64);
00085	
00086		if(Pawn(Owner).PlayerReplicationInfo.Team == IdentifyTarget.PlayerReplicationInfo.Team)
00087		{
00088			Canvas.DrawColor = AltTeamColor[IdentifyTarget.PlayerReplicationInfo.Team]; 
00089			Canvas.DrawColor.R = Canvas.DrawColor.R * IdentifyFadeTime / 3.0; 
00090			Canvas.DrawColor.G = Canvas.DrawColor.G * IdentifyFadeTime / 3.0; 
00091			Canvas.DrawColor.B = Canvas.DrawColor.B * IdentifyFadeTime / 3.0; 
00092			Canvas.StrLen(IdentifyHealth$": ", XL, YL);
00093			XOffset += XL;
00094			Canvas.DrawText(IdentifyHealth$": ");
00095			Canvas.SetPos(XOffset, Canvas.ClipY - 64);
00096			Canvas.DrawColor = TeamColor[IdentifyTarget.PlayerReplicationInfo.Team]; 
00097			Canvas.DrawColor.R = Canvas.DrawColor.R * IdentifyFadeTime / 3.0; 
00098			Canvas.DrawColor.G = Canvas.DrawColor.G * IdentifyFadeTime / 3.0; 
00099			Canvas.DrawColor.B = Canvas.DrawColor.B * IdentifyFadeTime / 3.0; 
00100			Canvas.StrLen(IdentifyTarget.Health, XL, YL);
00101			Canvas.DrawText(IdentifyTarget.Health);
00102		}
00103	
00104		Canvas.Style = 1;
00105		Canvas.DrawColor.R = 255;
00106		Canvas.DrawColor.G = 255;
00107		Canvas.DrawColor.B = 255;
00108	}
00109	
00110	defaultproperties
00111	{
00112	}

End Source Code