Engine
Class HUD

source: e:\games\UnrealTournament\Engine\Classes\HUD.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.HUD
Direct Known Subclasses:ChallengeHUD, CortHUD, MovieHUD, UnrealHUD

class HUD
extends Engine.Actor

//============================================================================= // HUD: Superclass of the heads-up display. //=============================================================================
Variables
 int Crosshair
 string HUDConfigWindowType
 Mutator HUDMutator
 int HudMode
 class MainMenuType
 PlayerPawn PlayerOwner
           always the actual owner
 color WhiteColor


Function Summary
 
simulated
ChangeCrosshair(int d)
 
simulated
ChangeHud(int d)
 void ClearMessage(out HUDLocalizedMessage)
 void CopyMessage(out HUDLocalizedMessage, HUDLocalizedMessage M2)
 bool DisplayMessages(Canvas Canvas)
     
// DisplayMessages is called by the Console in PostRender.
// It offers the HUD a chance to deal with messages instead of the
// Console.  Returns true if messages were dealt with.
 
simulated
DrawCrossHair(Canvas Canvas, int StartX, int StartY)
 
simulated
InputNumber(byte F)
     
//=============================================================================
// Status drawing.
 
simulated
Message(PlayerReplicationInfo PRI, string Msg, name N)
     
//=============================================================================
// Messaging.
 
simulated
PlayReceivedMessage(string S, string PName, ZoneInfo PZone)
 bool ProcessKeyEvent(int Key, int Action, FLOAT Delta)



Source Code


00001	//=============================================================================
00002	// HUD: Superclass of the heads-up display.
00003	//=============================================================================
00004	class HUD extends Actor
00005		abstract
00006		native
00007		config(user);
00008	
00009	//=============================================================================
00010	// Variables.
00011	
00012	var globalconfig int HudMode;	
00013	var globalconfig int Crosshair;
00014	var() class<menu> MainMenuType;
00015	var() string HUDConfigWindowType;
00016	var color WhiteColor;
00017	var	Menu MainMenu;
00018	var Mutator HUDMutator;
00019	var PlayerPawn PlayerOwner; // always the actual owner
00020	
00021	struct HUDLocalizedMessage
00022	{
00023		var Class<LocalMessage> Message;
00024		var int Switch;
00025		var PlayerReplicationInfo RelatedPRI;
00026		var Object OptionalObject;
00027		var float EndOfLife;
00028		var float LifeTime;
00029		var bool bDrawing;
00030		var int numLines;
00031		var string StringMessage;
00032		var color DrawColor;
00033		var font StringFont;
00034		var float XL, YL;
00035		var float YPos;
00036	};
00037	
00038	function ClearMessage(out HUDLocalizedMessage M)
00039	{
00040		M.Message = None;
00041		M.Switch = 0;
00042		M.RelatedPRI = None;
00043		M.OptionalObject = None;
00044		M.EndOfLife = 0;
00045		M.StringMessage = "";
00046		M.DrawColor = WhiteColor;
00047		M.XL = 0;
00048		M.bDrawing = false;
00049	}
00050	
00051	function CopyMessage(out HUDLocalizedMessage M1, HUDLocalizedMessage M2)
00052	{
00053		M1.Message = M2.Message;
00054		M1.Switch = M2.Switch;
00055		M1.RelatedPRI = M2.RelatedPRI;
00056		M1.OptionalObject = M2.OptionalObject;
00057		M1.EndOfLife = M2.EndOfLife;
00058		M1.StringMessage = M2.StringMessage;
00059		M1.DrawColor = M2.DrawColor;
00060		M1.XL = M2.XL;
00061		M1.YL = M2.YL;
00062		M1.YPos = M2.YPos;
00063		M1.bDrawing = M2.bDrawing;
00064		M1.LifeTime = M2.LifeTime;
00065		M1.numLines = M2.numLines;
00066	}
00067	
00068	//=============================================================================
00069	// Status drawing.
00070	
00071	simulated event PreRender( canvas Canvas );
00072	simulated event PostRender( canvas Canvas );
00073	simulated function InputNumber(byte F);
00074	simulated function ChangeHud(int d);
00075	simulated function ChangeCrosshair(int d);
00076	simulated function DrawCrossHair( canvas Canvas, int StartX, int StartY);
00077	
00078	//=============================================================================
00079	// Messaging.
00080	
00081	simulated function Message( PlayerReplicationInfo PRI, coerce string Msg, name N );
00082	simulated function LocalizedMessage( class<LocalMessage> Message, optional int Switch, optional PlayerReplicationInfo RelatedPRI_1, optional PlayerReplicationInfo RelatedPRI_2, optional Object OptionalObject, optional string CriticalString );
00083	
00084	simulated function PlayReceivedMessage( string S, string PName, ZoneInfo PZone )
00085	{
00086		PlayerPawn(Owner).ClientMessage(S);
00087		if (PlayerPawn(Owner).bMessageBeep)
00088			PlayerPawn(Owner).PlayBeepSound();
00089	}
00090	
00091	// DisplayMessages is called by the Console in PostRender.
00092	// It offers the HUD a chance to deal with messages instead of the
00093	// Console.  Returns true if messages were dealt with.
00094	simulated function bool DisplayMessages(canvas Canvas)
00095	{
00096		return false;
00097	}
00098	
00099	function bool ProcessKeyEvent( int Key, int Action, FLOAT Delta )
00100	{
00101		return false;
00102	}
00103	
00104	defaultproperties
00105	{
00106	     HUDConfigWindowType="UMenu.UMenuHUDConfigCW"
00107	     WhiteColor=(G=128,B=255)
00108	     bHidden=True
00109	     RemoteRole=ROLE_SimulatedProxy
00110	}

End Source Code