Engine
Class LocalMessage

source: c:\runehov\Engine\Classes\LocalMessage.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Info
         |
         +--Engine.LocalMessage
Direct Known Subclasses:MatchResultMessage, GenericMessage, PickupMessage, SayMessage, SubtitleMessage

class LocalMessage
extends Engine.Info

// // Represents a schematic for a client localized message. //
Variables
 RedColor, BlueColor
           # of seconds to stay in HUD message queue.
 class ChildMessage
           In some cases, we need to refer to a child message.
 color DrawColor
           Color to display message with.
 int Lifetime
           # of seconds to stay in HUD message queue.
 XPos, YPos
           Coordinates to print message at.
 bool bBeep
           If true, beep!
 bool bCenter
           Whether or not to center the message.
 bool bComplexString
           Indicates a multicolor string message class.
 bool bFadeMessage
           If true, use fade out effect on message.
 bool bFromBottom
           Subtract YPos.
 bool bIsConsoleMessage
           If true, put a GetString on the console.
 bool bIsSpecial
           If true, don't add to normal queue.
 bool bIsUnique
           If true and special, only one can be in the HUD queue at a time.
 bool bOffsetYPos
           If the YPos indicated isn't where the message appears.


Function Summary
 string AssembleString(HUD myHUD, optional int, optional PlayerReplicationInfo, optional String)
 void ClientReceive(PlayerPawn P, optional int, optional PlayerReplicationInfo, optional PlayerReplicationInfo, optional Object)
 void ClientReceiveMessage(PlayerPawn P, String Msg, optional PlayerReplicationInfo)
     
// Handle beeps and console entry for normal text message types
 color GetColor(optional int, optional PlayerReplicationInfo, optional PlayerReplicationInfo)
 int GetFontSize(int Switch)
 float GetLifeTime(String MessageString)
 float GetOffset(int Switch, float YL, float ClipY)
 string GetString(optional int, optional PlayerReplicationInfo, optional PlayerReplicationInfo, optional Object)
 color GetTeamColor(int team)
 bool KillMessage()
 void MangleString(out string, optional PlayerReplicationInfo, optional PlayerReplicationInfo, optional Object)
 void RenderComplexMessage(Canvas Canvas, out float, out float, optional String, optional int, optional PlayerReplicationInfo, optional PlayerReplicationInfo, optional Object)



Source Code


00001	//
00002	// Represents a schematic for a client localized message.
00003	//
00004	class LocalMessage expands Info;
00005	
00006	var bool	bComplexString;									// Indicates a multicolor string message class.
00007	var bool	bIsSpecial;										// If true, don't add to normal queue.
00008	var bool	bIsUnique;										// If true and special, only one can be in the HUD queue at a time.
00009	var bool	bIsConsoleMessage;								// If true, put a GetString on the console.
00010	var bool	bFadeMessage;									// If true, use fade out effect on message.
00011	var bool	bBeep;											// If true, beep!
00012	var bool	bOffsetYPos;									// If the YPos indicated isn't where the message appears.
00013	var int		Lifetime;										// # of seconds to stay in HUD message queue.
00014	var color	GreenColor, WhiteColor, GoldColor, RedColor, BlueColor;
00015	
00016	var class<LocalMessage> ChildMessage;						// In some cases, we need to refer to a child message.
00017	
00018	// Canvas Variables
00019	var bool	bFromBottom;									// Subtract YPos.
00020	var color	DrawColor;										// Color to display message with.
00021	var float	XPos, YPos;										// Coordinates to print message at.
00022	var bool	bCenter;										// Whether or not to center the message.
00023	
00024	static function RenderComplexMessage( 
00025		Canvas Canvas, 
00026		out float XL,
00027		out float YL,
00028		optional String MessageString,
00029		optional int Switch,
00030		optional PlayerReplicationInfo RelatedPRI_1, 
00031		optional PlayerReplicationInfo RelatedPRI_2,
00032		optional Object OptionalObject
00033		);
00034	
00035	static function string GetString(
00036		optional int Switch,
00037		optional PlayerReplicationInfo RelatedPRI_1, 
00038		optional PlayerReplicationInfo RelatedPRI_2,
00039		optional Object OptionalObject
00040		)
00041	{
00042		return "";
00043	}
00044	
00045	static function MangleString(out string MessageText,
00046		optional PlayerReplicationInfo PRI1,
00047		optional PlayerReplicationInfo PRI2,
00048		optional Object obj)
00049	{
00050	}
00051	
00052	static function string AssembleString(
00053		HUD myHUD,
00054		optional int Switch,
00055		optional PlayerReplicationInfo RelatedPRI_1, 
00056		optional String MessageString
00057		)
00058	{
00059		return "";
00060	}
00061	
00062	static function ClientReceive( 
00063		PlayerPawn P,
00064		optional int Switch,
00065		optional PlayerReplicationInfo RelatedPRI_1, 
00066		optional PlayerReplicationInfo RelatedPRI_2,
00067		optional Object OptionalObject
00068		)
00069	{
00070		if ( P.myHUD != None )
00071			P.myHUD.LocalizedMessage( Default.Class, Switch, RelatedPRI_1, RelatedPRI_2, OptionalObject );
00072	
00073		if ( Default.bBeep && P.bMessageBeep )
00074			P.PlayBeepSound();
00075	
00076		if ( Default.bIsConsoleMessage )
00077		{
00078			if ((P.Player != None) && (P.Player.Console != None))
00079				P.Player.Console.AddString(Static.GetString( Switch, RelatedPRI_1, RelatedPRI_2, OptionalObject ));
00080		}
00081	}
00082	
00083	// Handle beeps and console entry for normal text message types
00084	static function ClientReceiveMessage(
00085		PlayerPawn P,
00086		String Msg,
00087		optional PlayerReplicationInfo PRI
00088		)
00089	{
00090		if ( Default.bBeep && P.bMessageBeep )
00091			P.PlayBeepSound();
00092	
00093		if ( Default.bIsConsoleMessage )
00094		{
00095			if ((P.Player != None) && (P.Player.Console != None))
00096				P.Player.Console.AddString(Msg);
00097		}
00098	
00099		if ( P.myHUD != None )
00100			P.myHUD.LocalizedMessage( Default.Class, 0, PRI, None, None, Msg );
00101	}
00102	
00103	static function color GetColor(
00104		optional int Switch,
00105		optional PlayerReplicationInfo RelatedPRI_1, 
00106		optional PlayerReplicationInfo RelatedPRI_2
00107		)
00108	{
00109		return Default.DrawColor;
00110	}
00111	
00112	static function float GetLifeTime(String MessageString)
00113	{
00114		return Default.LifeTime;
00115	}
00116	
00117	static function bool KillMessage()
00118	{
00119		return false;
00120	}
00121	
00122	static function float GetOffset(int Switch, float YL, float ClipY )
00123	{
00124		return Default.YPos;
00125	}
00126	
00127	static function int GetFontSize( int Switch );
00128	
00129	static function color GetTeamColor(int team)
00130	{
00131		switch(team)
00132		{
00133			case 0:
00134				return Default.RedColor;
00135			case 1:
00136				return Default.BlueColor;
00137			case 2:
00138				return Default.GreenColor;
00139			case 3:
00140				return Default.GoldColor;
00141		}
00142		return Default.WhiteColor;
00143	}
00144	
00145	defaultproperties
00146	{
00147	     LifeTime=3
00148	     GreenColor=(G=255)
00149	     WhiteColor=(R=255,G=255,B=255)
00150	     GoldColor=(R=255,G=255)
00151	     RedColor=(R=255)
00152	     BlueColor=(B=255)
00153	     DrawColor=(R=255,G=255,B=255)
00154	}

End Source Code