Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation
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
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224

    //=============================================================================
    // 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.
    //
    //=============================================================================
    class LocalMessage extends Info;

    var bool	bComplexString;									// Indicates a multicolor string message class.
    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	bIsConsoleMessage;								// If true, put a GetString on the console.
    var bool	bFadeMessage;									// If true, use fade out effect on message.
    var bool	bBeep;											// If true, beep!
    var bool	bOffsetYPos;									// If the YPos indicated isn't where the message appears.
    var bool	bCenter;										// Whether or not to center the message.
    var bool	bFromBottom;									// Subtract YPos.
    var int		Lifetime;										// # of seconds to stay in HUD message queue.

    var(Message) class<LocalMessage> ChildMessage;                      // In some cases, we need to refer to a child message.

    var Color  DrawColor;
    var float XPos, YPos;
    var int FontSize;                                          // 0: Huge, 1: Big, 2: Small ...

    #if IG_TRIBES3 // david: more flexibility in LocalMessage system, uses Objects instead of PlayerReplicationInfos

    static function RenderComplexMessage(
    	Canvas Canvas,
    	out float XL,
    	out float YL,
    	optional String MessageString,
    	optional int Switch,
    	optional Core.Object Related1,
    	optional Core.Object Related2,
    	optional Core.Object OptionalObject,
    	optional String OptionalString
    	);

    static function string GetRelatedString(
        optional int Switch,
        optional Core.Object Related1,
        optional Core.Object Related2,
        optional Core.Object OptionalObject,
    	optional String OptionalString
        )
    {
        return static.GetString(Switch,Related1,Related2,OptionalObject,OptionalString);
    }

    static function string GetString(
    	optional int Switch,
    	optional Core.Object Related1,
    	optional Core.Object Related2,
    	optional Core.Object OptionalObject,
    	optional String OptionalString
    	)
    {
    	if ( class<Actor>(OptionalObject) != None )
    		return class<Actor>(OptionalObject).static.GetLocalString(Switch, Related1, Related2);
    	return "";
    }

    static function string AssembleString(
    	HUD myHUD,
    	optional int Switch,
    	optional Core.Object Related1,
    	optional String MessageString
    	)
    {
    	return "";
    }

    static function ClientReceive(
    	PlayerController P,
    	optional int Switch,
    	optional Core.Object Related1,
    	optional Core.Object Related2,
    	optional Core.Object OptionalObject,
    	optional String OptionalString
    	)
    {
    	if ( P.myHUD != None )
    	P.myHUD.LocalizedMessage( Default.Class, Switch, Related1, Related2, OptionalObject,,OptionalString );

        if ( Default.bIsConsoleMessage && (P.Player != None) && (P.Player.Console != None) )
    		P.Player.InteractionMaster.Process_Message( Static.GetString( Switch, Related1, Related2, OptionalObject, OptionalString ), 6.0, P.Player.LocalInteractions);
    }

    static function color GetConsoleColor( Core.Object Related1 )
    {
        return Default.DrawColor;
    }

    static function color GetColor(
    	optional int Switch,
    	optional Core.Object Related1,
    	optional Core.Object Related2
    	)
    {
    	return Default.DrawColor;
    }

    static function float GetOffset(int Switch, float YL, float ClipY )
    {
    	return Default.YPos;
    }

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

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

    #else
    static function RenderComplexMessage(
    	Canvas Canvas,
    	out float XL,
    	out float YL,
    	optional String MessageString,
    	optional int Switch,
    	optional Core.Object Related1,
    	optional Core.Object Related2,
    	optional Core.Object OptionalObject
    	);

    static function string GetRelatedString(
        optional int Switch,
        optional Core.Object Related1,
        optional Core.Object Related2,
        optional Core.Object OptionalObject
        )
    {
        return static.GetString(Switch,Related1,Related2,OptionalObject);
    }

    static function string GetString(
    	optional int Switch,
    	optional Core.Object Related1,
    	optional Core.Object Related2,
    	optional Core.Object OptionalObject
    	)
    {
    	if ( class<Actor>(OptionalObject) != None )
    		return class<Actor>(OptionalObject).static.GetLocalString(Switch, Related1, Related2);
    	return "";
    }

    static function string AssembleString(
    	HUD myHUD,
    	optional int Switch,
    	optional Core.Object Related1,
    	optional String MessageString
    	)
    {
    	return "";
    }

    static function ClientReceive(
    	PlayerController P,
    	optional int Switch,
    	optional Core.Object Related1,
    	optional Core.Object Related2,
    	optional Core.Object OptionalObject
    	)
    {
    	if ( P.myHUD != None )
    	P.myHUD.LocalizedMessage( Default.Class, Switch, Related1, Related2, OptionalObject );

        if ( Default.bIsConsoleMessage && (P.Player != None) && (P.Player.Console != None) )
    		P.Player.InteractionMaster.Process_Message( Static.GetString( Switch, Related1, Related2, OptionalObject ), 6.0, P.Player.LocalInteractions);
    }

    static function color GetConsoleColor( Core.Object Related1 )
    {
        return Default.DrawColor;
    }

    static function color GetColor(
    	optional int Switch,
    	optional Core.Object Related1,
    	optional Core.Object Related2
    	)
    {
    	return Default.DrawColor;
    }

    static function float GetOffset(int Switch, float YL, float ClipY )
    {
    	return Default.YPos;
    }

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

    static function float GetLifeTime(int Switch)
    {
        return default.Lifetime;
    }
    #endif

    defaultproperties
    {
        bIsSpecial=true
        bIsUnique=False
    	Lifetime=5
    	bIsConsoleMessage=True

    	DrawColor=(R=255,G=255,B=255,A=255)
        XPos=0.5
        YPos=0.7
    }

Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation
previous class next class | frames no frames

Class file time: ne 5.9.2004 16:01:26.000 - Creation time: st 23.5.2018 00:10:45.092 - Created with UnCodeX