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

UTGame.UTGameViewportClient


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
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
/**
 * Copyright 1998-2008 Epic Games, Inc. All Rights Reserved.
 */
class UTGameViewportClient extends GameViewportClient
	native
	config(Game);

var localized string LevelActionMessages[6];

/** This is the remap name for UTFrontEnd so we can display a more friendly name **/
var localized string UTFrontEndString;

/** This is the remap name for UTM-MissionSelection so we can display a more friendly name **/
var localized string UTMMissionSelectionString;

/** Font used to display map name on loading screen */
var font LoadingScreenMapNameFont;

/** Font used to display game type name on loading screen */
var font LoadingScreenGameTypeNameFont;

/** Font used to display map hint message on loading screen */
var font LoadingScreenHintMessageFont;


// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)

event PostRender(Canvas Canvas)
{
	local int i;
	local UTPlayerController PC;
	local ETransitionType OldTransitionType;
	local AudioDevice AD;

	OldTransitionType = Outer.TransitionType;
	if (Outer.TransitionType == TT_None)
	{
		for (i = 0; i < Outer.GamePlayers.length; i++)
		{
			if (Outer.GamePlayers[i].Actor != None)
			{
				// count as loading if still using temp locally spawned PC on client while waiting for connection
				if (Outer.GamePlayers[i].Actor.WorldInfo.NetMode == NM_Client && Outer.GamePlayers[i].Actor.Role == ROLE_Authority)
				{
					Outer.TransitionType = TT_Loading;
					break;
				}
				else
				{
					// use 'Precaching' when loading custom characters and such
					PC = UTPlayerController(Outer.GamePlayers[i].Actor);
					if (PC != None && !PC.bInitialProcessingComplete)
					{
						Outer.TransitionType = TT_Precaching;
						break;
					}
				}
			}
		}

		AD = class'Engine'.static.GetAudioDevice();
		if (AD != None)
		{
			if (Outer.TransitionType != TT_None)
			{
				AD.TransientMasterVolume = 0.0;
			}
			else if (AD.TransientMasterVolume == 0.0)
			{
				AD.TransientMasterVolume = 1.0;
			}
		}
	}

	Super.PostRender(Canvas);

	Outer.TransitionType = OldTransitionType;
}


/**
 * Locates a random localized hint message string for the specified two game types.  Usually the first game type
 * should always be "UTDeathmatch", since you always want those strings included regardless of game type
 *
 * @param GameType1Name Name of the first game type we're interested in
 * @param GameType2Name Name of the second game type we're interested in
 *
 * @return Returns random hint string for the specified game types
 */
native final function string LoadRandomLocalizedHintMessage( string GameType1Name, string GameType2Name );


function DrawTransition(Canvas Canvas)
{
	local int Pos;
	local string MapName, Desc;
	local string ParseStr;
	local class<UTGame> GameClass;
	local string HintMessage;
	local bool bAllowHints;
	local string GameClassName;

	// if we are doing a loading transition, set up the text overlays forthe loading movie
	if (Outer.TransitionType == TT_Loading)
	{
		bAllowHints = true;

		// we want to show the name of the map except for a number of maps were we want to remap their name
		if( "UTFrontEnd" == Outer.TransitionDescription )
		{
			MapName = UTFrontEndString; //"Main Menu"

			// Don't bother displaying hints while transitioning to the main menu (since it should load pretty quickly!)
			bAllowHints = false;
		}
		else if( "UTM-MissionSelection" == Outer.TransitionDescription )
		{
			MapName = UTMMissionSelectionString; //"Mission Selection"

			// No hints while loading mission selection (since it should load fast!)
			bAllowHints = false;
		}
		else
		{
			MapName = Outer.TransitionDescription;
		}

		class'Engine'.static.RemoveAllOverlays();

		// pull the map prefix off the name
		Pos = InStr(MapName,"-");
		if (Pos != -1)
		{
			MapName = right(MapName, (Len(MapName) - Pos) - 1);
		}

		// pull off anything after | (gametype)
		Pos = InStr(MapName,"|");
		if (Pos != -1)
		{
			MapName = left(MapName, Pos);
		}

		// get the class represented by the GameType string
		GameClass = class<UTGame>(FindObject(Outer.TransitionGameType, class'Class'));
		Desc = "";

		if (GameClass == none)
		{
			// Some of the game types are in UTGameContent instead of UTGame. Unfortunately UTGameContent has not been loaded yet so we have to get its base class in UTGame
			// to get the proper description string.
			Pos = InStr(Outer.TransitionGameType, ".");

			if(Pos != -1)
			{
				ParseStr = Right(Outer.TransitionGameType, Len(Outer.TransitionGameType) - Pos - 1);

				Pos = InStr(ParseStr, "_Content");

				if(Pos != -1)
				{
					ParseStr = Left(ParseStr, Pos);

					ParseStr = "UTGame." $ ParseStr;

					GameClass = class<UTGame>(FindObject(ParseStr, class'Class'));

					if(GameClass != none)
					{
						Desc = GameClass.default.GameName;
					}
				}
			}
		}
		else
		{
			Desc = GameClass.default.GameName;
		}

		LogInternal("Desc:" @ Desc);


		// NOTE: The position and scale values are in resolution-independent coordinates (between 0 and 1).

		// NOTE: The position and scale values will be automatically corrected for aspect ratio (to match the movie image)

		// Game type name
		class'Engine'.static.AddOverlay(LoadingScreenGameTypeNameFont, Desc, 0.1822, 0.435, 1.0, 1.0, false);

		// Map name
		class'Engine'.static.AddOverlay(LoadingScreenMapNameFont, MapName, 0.1822, 0.46, 2.0, 2.0, false);

		// We don't want to draw hints for the Main Menu or FrontEnd maps, so we'll make sure we have a valid game class
		if( bAllowHints )
		{
			// Grab game class name if we have one
			GameClassName = "";
			if( GameClass != none )
			{
				GameClassName = string( GameClass.Name );
			}

			// Draw a random hint!
			// NOTE: We always include deathmatch hints, since they're generally appropriate for all game types
			HintMessage = LoadRandomLocalizedHintMessage( string( class'UTDeathmatch'.Name ), GameClassName);
			if( Len( HintMessage ) > 0 )
			{
				class'Engine'.static.AddOverlayWrapped( LoadingScreenHintMessageFont, HintMessage, 0.1822, 0.585, 1.0, 1.0, 0.7 );
			}
		}
	}
	else if (Outer.TransitionType == TT_Precaching)
	{
		Canvas.Font = class'UTHUD'.static.GetFontSizeIndex(3);
		Canvas.SetPos(0, 0);
		Canvas.SetDrawColor(0, 0, 0, 255);
		Canvas.DrawRect(Canvas.SizeX, Canvas.SizeY);
		Canvas.SetDrawColor(255, 0, 0, 255);
		Canvas.SetPos(100,200);
		Canvas.DrawText("Precaching...");
	}
}

function RenderHeader(Canvas Canvas)
{
	Canvas.Font = class'UTHUD'.static.GetFontSizeIndex(3);
	Canvas.SetDrawColor(255,255,255,255);
	Canvas.SetPos(100,100);
	Canvas.DrawText("Tell Josh Adams if you see this");
}

/** This version prevents splitting in the main menu. */
function SetSplitscreenConfiguration( ESplitScreenType SplitType )
{
	local int Idx;

	if (GamePlayers[0].Actor != None && GamePlayers[0].Actor.IsA('UTEntryPlayerController'))
	{
		// when in the menus, remove split and just use top player's viewport
		GamePlayers[0].Size.X = 1.0;
		GamePlayers[0].Size.Y = 1.0;
		GamePlayers[0].Origin.X = 0.0;
		GamePlayers[0].Origin.Y = 0.0;
		for (Idx = 1; Idx < GamePlayers.length; Idx++)
		{
			GamePlayers[Idx].Size.X = 0.0;
			GamePlayers[Idx].Size.Y = 0.0;
		}
	}
	else
	{
		Super.SetSplitscreenConfiguration(SplitType);
	}
}

defaultproperties
{
   LevelActionMessages(1)="Paused..."
   LevelActionMessages(2)="Loading..."
   LevelActionMessages(3)="Saving..."
   LevelActionMessages(4)="Connecting to..."
   LevelActionMessages(5)="Precaching..."
   UTFrontEndString="Main Menu"
   UTMMissionSelectionString="Mission Selection"
   LoadingScreenMapNameFont=MultiFont'UI_Fonts_Final.Menus.Fonts_AmbexHeavyOblique'
   LoadingScreenGameTypeNameFont=MultiFont'UI_Fonts_Final.Menus.Fonts_AmbexHeavyOblique'
   LoadingScreenHintMessageFont=MultiFont'UI_Fonts_Final.HUD.MF_Medium'
   UIControllerClass=Class'UTGame.UTGameInteraction'
   Name="Default__UTGameViewportClient"
   ObjectArchetype=GameViewportClient'Engine.Default__GameViewportClient'
}

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