## Engine
Class LocalMessage

source: C:\XIII\Engine\Classes\LocalMessage.uc

    Core.Object
       |
       +--Engine.Actor
          |
          +--Engine.Info
             |
             +--Engine.LocalMessage

Direct Known Subclasses:GameMessage, XIIILocalMessage

class LocalMessage
extends Engine.Info

    //=============================================================================
    // LocalMessage
    //
    // LocalMessages are abstract classes which contain an array of localized text.
    // The PlayerController function ReceiveLocalizedMessage() is used to send messages
    // to a specific player by specifying the LocalMessage class and index.  This allows
    // the message to be localized on the client side, and saves network bandwidth since
    // the text is not sent.  Actors (such as the GameInfo) use one or more LocalMessage
    // classes to send messages.  The BroadcastHandler function BroadcastLocalizedMessage()
    // is used to broadcast localized messages to all the players.
    //
    //=============================================================================

Variables
`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(PlayerController P, optional int, optional PlayerReplicationInfo, optional PlayerReplicationInfo, optional Object)`
`color` | `GetColor(optional int, optional PlayerReplicationInfo, optional PlayerReplicationInfo)`
`int` | `GetFontSize(int Switch)`
`float` | `GetOffset(int Switch, float YL, float ClipY)`
`string` | `GetString(optional int, 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	// LocalMessage
    00003	//
    00004	// LocalMessages are abstract classes which contain an array of localized text.
    00005	// The PlayerController function ReceiveLocalizedMessage() is used to send messages
    00006	// to a specific player by specifying the LocalMessage class and index.  This allows
    00007	// the message to be localized on the client side, and saves network bandwidth since
    00008	// the text is not sent.  Actors (such as the GameInfo) use one or more LocalMessage
    00009	// classes to send messages.  The BroadcastHandler function BroadcastLocalizedMessage()
    00010	// is used to broadcast localized messages to all the players.
    00011	//
    00012	//=============================================================================
    00013	class LocalMessage extends Info;
    00014
    00015	var bool	bComplexString;									// Indicates a multicolor string message class.
    00016	var bool	bIsSpecial;										// If true, don't add to normal queue.
    00017	var bool	bIsUnique;										// If true and special, only one can be in the HUD queue at a time.
    00018	var bool	bIsConsoleMessage;								// If true, put a GetString on the console.
    00019	var bool	bFadeMessage;									// If true, use fade out effect on message.
    00020	var bool	bBeep;											// If true, beep!
    00021	var bool	bOffsetYPos;									// If the YPos indicated isn't where the message appears.
    00022	var int		Lifetime;										// # of seconds to stay in HUD message queue.
    00023
    00024	var class<LocalMessage> ChildMessage;						// In some cases, we need to refer to a child message.
    00025
    00026	// Canvas Variables
    00027	var bool	bFromBottom;									// Subtract YPos.
    00028	var color	DrawColor;										// Color to display message with.
    00029	var float	XPos, YPos;										// Coordinates to print message at.
    00030	var bool	bCenter;										// Whether or not to center the message.
    00031
    00032	static function RenderComplexMessage(
    00033		Canvas Canvas,
    00034		out float XL,
    00035		out float YL,
    00036		optional String MessageString,
    00037		optional int Switch,
    00038		optional PlayerReplicationInfo RelatedPRI_1,
    00039		optional PlayerReplicationInfo RelatedPRI_2,
    00040		optional Object OptionalObject
    00041		);
    00042
    00043	static function string GetString(
    00044		optional int Switch,
    00045		optional PlayerReplicationInfo RelatedPRI_1,
    00046		optional PlayerReplicationInfo RelatedPRI_2,
    00047		optional Object OptionalObject
    00048		)
    00049	{
    00050		if ( class<Actor>(OptionalObject) != None )
    00051			return class<Actor>(OptionalObject).static.GetLocalString(Switch, RelatedPRI_1, RelatedPRI_2);
    00052		return "";
    00053	}
    00054
    00055	static function string AssembleString(
    00056		HUD myHUD,
    00057		optional int Switch,
    00058		optional PlayerReplicationInfo RelatedPRI_1,
    00059		optional String MessageString
    00060		)
    00061	{
    00062		return "";
    00063	}
    00064
    00065	static function ClientReceive(
    00066		PlayerController P,
    00067		optional int Switch,
    00068		optional PlayerReplicationInfo RelatedPRI_1,
    00069		optional PlayerReplicationInfo RelatedPRI_2,
    00070		optional Object OptionalObject
    00071		)
    00072	{
    00073		P.myHUD.LocalizedMessage( Default.Class, Switch, RelatedPRI_1, RelatedPRI_2, OptionalObject );
    00074
    00075		if ( Default.bIsConsoleMessage && (P.Player != None) && (P.Player.Console != None) )
    00076			P.Player.Console.Message(Static.GetString( Switch, RelatedPRI_1, RelatedPRI_2, OptionalObject ), 6.0);
    00077	}
    00078
    00079	static function color GetColor(
    00080		optional int Switch,
    00081		optional PlayerReplicationInfo RelatedPRI_1,
    00082		optional PlayerReplicationInfo RelatedPRI_2
    00083		)
    00084	{
    00085		return Default.DrawColor;
    00086	}
    00087
    00088	static function float GetOffset(int Switch, float YL, float ClipY )
    00089	{
    00090		return Default.YPos;
    00091	}
    00092
    00093	static function int GetFontSize( int Switch );
    00094
    00095	defaultproperties
    00096	{
    00097	     Lifetime=3
    00098	     DrawColor=(B=255,G=255,R=255,A=255)
    00099	}

End Source Code