Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

Engine.LocalMessage


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
//=============================================================================
// 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.
//
// Copyright 1998-2008 Epic Games, Inc. All Rights Reserved.
//=============================================================================
class LocalMessage extends Object
	abstract;

var bool   bIsSpecial;                                     // If true, don't add to normal queue.
var bool   bIsUnique;                                      // If true and special, only one can be in the HUD queue at a time.
var bool   bIsPartiallyUnique;                             // If true and special, only one can be in the HUD queue with the same switch value
var bool   bIsConsoleMessage;                              // If true, put a GetString on the console.
var bool   bBeep;                                          // If true, beep!
var	bool   bCountInstances;									// if true, if sent to HUD multiple times, count up instances (only if bIsUnique)

var float    Lifetime;                                       // # of seconds to stay in HUD message queue.
var Color  DrawColor;
var float PosY;
var int		FontSize;                                      // Tiny to Huge ( see HUD::GetFontSizeIndex )

static function ClientReceive(
	PlayerController P,
	optional int Switch,
	optional PlayerReplicationInfo RelatedPRI_1,
	optional PlayerReplicationInfo RelatedPRI_2,
	optional Object OptionalObject
	)
{
	local string MessageString;

	MessageString = static.GetString(Switch, (RelatedPRI_1 == P.PlayerReplicationInfo), RelatedPRI_1, RelatedPRI_2, OptionalObject);
	if ( MessageString != "" )
	{
		if ( P.myHud != None )
			P.myHUD.LocalizedMessage(
				Default.Class,
				RelatedPRI_1,
				MessageString,
				Switch,
				static.GetPos(Switch, P.myHUD),
				static.GetLifeTime(Switch),
				static.GetFontSize(Switch, RelatedPRI_1, RelatedPRI_2, P.PlayerReplicationInfo),
				static.GetColor(Switch, RelatedPRI_1, RelatedPRI_2, OptionalObject),
				OptionalObject );

		if(IsConsoleMessage(Switch) && LocalPlayer(P.Player) != None && LocalPlayer(P.Player).ViewportClient != None)
			LocalPlayer(P.Player).ViewportClient.ViewportConsole.OutputText( MessageString );
	}
}

static function string GetString(
	optional int Switch,
	optional bool bPRI1HUD,
	optional PlayerReplicationInfo RelatedPRI_1,
	optional PlayerReplicationInfo RelatedPRI_2,
	optional Object OptionalObject
	)
{
	if ( class<Actor>(OptionalObject) != None )
		return class<Actor>(OptionalObject).static.GetLocalString(Switch, RelatedPRI_1, RelatedPRI_2);
	return "";
}

static function color GetConsoleColor( PlayerReplicationInfo RelatedPRI_1 )
{
    return Default.DrawColor;
}

static function color GetColor(
	optional int Switch,
	optional PlayerReplicationInfo RelatedPRI_1,
	optional PlayerReplicationInfo RelatedPRI_2,
	optional Object OptionalObject
	)
{
	return Default.DrawColor;
}

static function float GetPos( int Switch, HUD myHUD )
{
    return default.PosY;
}

static function int GetFontSize( int Switch, PlayerReplicationInfo RelatedPRI1, PlayerReplicationInfo RelatedPRI2, PlayerReplicationInfo LocalPlayer )
{
    return default.FontSize;
}

static function float GetLifeTime(int Switch)
{
    return default.LifeTime;
}

static function bool IsConsoleMessage(int Switch)
{
    return default.bIsConsoleMessage;
}

static function bool IsKeyObjectiveMessage( int Switch )
{
	return false;
}

/**
  * RETURNS true if messages are similar enough to trigger "partially unique" check for HUD display
  */
static function bool PartiallyDuplicates(INT Switch1, INT Switch2, object OptionalObject1, object OptionalObject2 )
{
	return (Switch1 == Switch2);
}

defaultproperties
{
   bIsSpecial=True
   bIsConsoleMessage=True
   Lifetime=3.000000
   DrawColor=(B=255,G=255,R=255,A=255)
   PosY=0.830000
   Name="Default__LocalMessage"
   ObjectArchetype=Object'Core.Default__Object'
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: tr 31-1-2018 17:18:30.000 - Creation time: sk 18-3-2018 10:01:09.786 - Created with UnCodeX