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

UTGame.UTMapInfo


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
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524
00525
00526
00527
00528
00529
00530
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552
00553
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605
00606
00607
00608
00609
00610
00611
00612
00613
00614
00615
00616
00617
00618
00619
00620
00621
00622
00623
00624
00625
00626
00627
00628
00629
00630
00631
00632
00633
00634
00635
00636
00637
00638
00639
00640
00641
00642
00643
00644
00645
00646
00647
00648
00649
00650
00651
00652
00653
00654
00655
00656
00657
00658
00659
00660
00661
00662
00663
00664
00665
00666
00667
00668
00669
00670
00671
00672
00673
00674
00675
00676
00677
00678
00679
00680
00681
00682
00683
00684
00685
00686
00687
00688
00689
00690
00691
00692
00693
00694
00695
00696
00697
00698
00699
00700
00701
00702
00703
00704
00705
00706
00707
/**
 *
 * Copyright 1998-2008 Epic Games, Inc. All Rights Reserved.
 */
class UTMapInfo extends MapInfo
	dependson(UTMapMusicInfo)
	native;

/** recommended player count range - for display on the UI and the auto number of bots setting */
var() int RecommendedPlayersMin, RecommendedPlayersMax;

/** This is stored in a content package and then pointed to by the map **/
var() UTMapMusicInfo MapMusicInfo;

/** whether the path builder should build translocator/lowgrav/jumpboot paths for this level */
var() bool bBuildTranslocatorPaths;

/** modifier to visibility/range calculations for AI (0 to 1) */
var() float VisibilityModifier;

/*********************  Map Rendering ***********************/

/** reference to the texture to use for the HUD map */
var(Minimap) Texture MapTexture;

/** Allows for additional rotation on the texture to be applied */
var(Minimap) float MapTextureYaw;

/** Location which is used as center for minimap (onslaught) */
var(Minimap) vector MapCenter;

/** Radius of map (how far it extends from center) used by minimap */
var(Minimap) float MapExtent;

/** Default yaw to apply to minimap */
var(Minimap) int MapYaw;

/** range for rotating minimap */
var(Minimap) float RotatingMiniMapRange;

/** Holds the Size of the map when designed */
var(Map) float DefaultMapSize;

/** Holds a list of objectives */
var array<UTGameObjective> Objectives;

/** If true, this map and all of the associated data is up to date. */
var transient bool bMapUpToDate;

//var transient UTGameObjective CurrentNode;
var transient Actor CurrentActor;

/** Holds the node that is currently being hovered over by the mouse */
var transient actor WatchedActor;

/** Holds a reference to the material to use for rendering hud icons */
var transient Material HUDIcons;
var transient Texture2D 	HUDIconsT;

/** Current map coordinate axes */
var vector MapRotX, MapRotY;

/** Current map yaw */
var int CurrentMapRotYaw;

/** Holds the MIC that will be used to scale/rotate the map Background */
var transient MaterialInstanceConstant MapMaterialInstance;

var Material MapMaterialReference;

var	float UseableRadius;

var transient vector ActualMapCenter;
var transient float RadarWidth, RadarRange;
var transient vector CenterPos;
var transient float MapScale;
var transient float ColorPercent;

var transient MaterialInstanceConstant GreenIconMaterialInstance;

var texturecoordinates PlayerIconCoords;

// show up to 2 key vehicles on minimap
var UTVehicle KeyVehicles[2];

var array<UTGameObjective> Sensors;

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

/******************************************************
 * Map Rendering
 ******************************************************/

// -- We can probably remove these as soon as the map is 100% in the MI
simulated function VerifyMapExtent()
{
	local int NumNodes;
	local UTGameObjective O;
	local WorldInfo WI;

	if ( MapExtent == 0 )
	{
		LogInternal("NO VALID MINIMAP INFO IN UTONSLAUGHTMAPINFO!!!");
		WI = WorldInfo(Outer);
		MapCenter = vect(0,0,0);
		ForEach WI.AllActors(class'UTGameObjective', O)
		{
			MapCenter += O.Location;
			NumNodes++;
		}

		MapCenter = MapCenter/NumNodes;

		// Calculate the radar range and reset the nodes as not having been rendered
		ForEach WI.AllActors(class'UTGameObjective', O)
		{
			MapExtent = FMax(MapExtent, 2.75 * vsize2D(MapCenter - O.Location));
		}
	}
}

function FindObjectives()
{
	local UTGameObjective Obj;

    bMapUpToDate = true;
	ForEach WorldInfo(Outer).AllNavigationPoints(class'UTGameObjective', Obj)
	{
		Objectives[Objectives.length] = Obj;
	}

    if ( MapMaterialInstance == none )
    {
    	MapMaterialInstance = new(Outer) class'MaterialInstanceConstant';
    	MapMaterialInstance.SetParent(MapMaterialReference);
		MapMaterialInstance.SetTextureParameterValue('LevelMap', MapTexture);
	}
}

/**
  *  Tell all the nodes to render themselves
  */
simulated native function RenderLinks(Canvas Canvas, UTPlayerController PlayerOwner);

/**
  * Give objectives a chance to add information to minimap
  */
simulated native function RenderAdditionalInformation(Canvas Canvas, UTPlayerController PlayerOwner);

/**
  * Update Node positions and sensor array
  */
simulated native function UpdateNodes(UTPlayerController PlayerOwner);

/**
 * Draw a map on a canvas.
 *
 * @Param	Canvas			The Canvas to draw on
 * @Param	PlayerOwner	    Who is this map being shown to
 * @Param	XPos, YPos		Where on the Canvas should it be drawn
 * @Param   Width,Height	How big
 */
simulated function DrawMap(Canvas Canvas, UTPlayerController PlayerOwner, float XPos, float YPos, float Width, float Height, bool bFullDetail, float AspectRatio)
{
	local int i, j, PlayerYaw, SecondPlayerYaw, NumObjectives, TeamNum;
	local vector PlayerLocation, SecondPlayerLocation, ScreenLocation, SecondScreenLocation, WatchedLocation, CurrentObjectiveHUDLocation, NorthLocation, NorthDir;
	local float MinRadarRange, hw,hh,DotScale;
	local Pawn PawnOwner, P, SecondPawn;
	local linearcolor FinalColor, TC;
	local bool bInSensorRange, bDrawAutoObjective, bIsSplitScreen;
	local UTPawn UTP;
	local UTPlayerController PC;
	local UTVehicle V;
	local UTTeamInfo Team;
	local UTGameObjective SpawnObjective;
	local rotator MapRot;
	local UTWarfareBarricade BarricadeObjective;
	local WorldInfo WI;

	// If we aren't rendering for anyone, exit
	if ( (PlayerOwner == None) || (PlayerOwner.PlayerReplicationInfo == None) )
	{
		 return;
	}

	TC = ((PlayerOwner.PlayerReplicationInfo.Team != None) && (PlayerOwner.PlayerReplicationInfo.Team.TeamIndex == 1))
			? MakeLinearColor(0.f,0.f,0.4f,1.0f)
			: MakeLinearColor(0.2f,0.f,0.f,1.0f);

	VerifyMapExtent();


	// Make sure we have tracked all of the nodes
	if ( !bMapUpToDate )
	{
		FindObjectives();
	}

	NumObjectives = Objectives.Length;
	if ( NumObjectives == 0 )
	{
		return;
	}

	WI = WorldInfo(Outer);
	ColorPercent = 0.5f + Cos((WI.RealTimeSeconds * 4.0) * 3.14159 * 0.5f) * 0.5f;

	PawnOwner = Pawn(PlayerOwner.ViewTarget);
	SpawnObjective = UTPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo).StartObjective;

	// Refresh all Positional Data
	CenterPos.Y = YPos + (Height * 0.5);		//0.5*Canvas.ClipY;
	CenterPos.X = XPos + (Width * 0.5); 		//0.5*Canvas.ClipX;

	// MapScale is the different between the original map and this map
	MapScale = 1.5 * Height/DefaultMapSize;
	RadarWidth = Height * UseableRadius * 2;

	// determine player position on minimap
	ScreenLocation = (PawnOwner != None) ? PawnOwner.Location : PlayerOwner.Location;
	PlayerYaw = (UTRemoteRedeemer(PawnOwner) == None) ? PlayerOwner.Rotation.Yaw & 65535 : PawnOwner.Rotation.Yaw & 65535;

	RadarRange = MapExtent;
	MapRot.Yaw = (MapYaw * 182.04444444);

	ActualMapCenter = MapCenter;
	bIsSplitScreen = class'Engine'.static.IsSplitScreen();
	PlayerOwner.bRotateMinimap = PlayerOwner.bRotateMinimap && !bIsSplitScreen;

	// Look to see if we are a rotating map and not full screen
	if ( !bFullDetail && PlayerOwner.bRotateMinimap  )
	{
		// map center and rotation based on player position
		ActualMapCenter = ScreenLocation;
		MapRot.Yaw = PlayerYaw + 16384;
		MinRadarRange = RotatingMiniMapRange;

		// Setup the rotating/scaling on the map image. (Subtract off the alignment of the map)
		DrawMapImage(Canvas, XPos, YPos, Width, Height, PlayerYaw - (MapYaw * 182.0444) + 16384, (MinRadarRange/RadarRange) );
		RadarRange = MinRadarRange;
	}
	else
	{
		DrawMapImage(Canvas, XPos, YPos, Width, Height, 0, 1.0 );
		RadarWidth = Width;
	}

	// Draw the Ring
    hw = Width * 0.5;
    hh = Height * 0.5;

	// UL
    Canvas.SetPos(XPos,YPos);
    Canvas.DrawColorizedTile(class'UTHUD'.default.IconHudTexture, hw, hh, 215,579,347,347,TC);

    // UR
    Canvas.SetPos(XPos+hw,YPos);
    Canvas.DrawColorizedTile(class'UTHUD'.default.IconHudTexture, hw, hh, 562,579,-347,347,TC);

	// LL
    Canvas.SetPos(XPos,YPos+hh);
    Canvas.DrawColorizedTile(class'UTHUD'.default.IconHudTexture, hw, hh, 215,926,347,-347,TC);

    // LR
    Canvas.SetPos(XPos+hw,YPos+hh);
    Canvas.DrawColorizedTile(class'UTHUD'.default.IconHudTexture, hw, hh, 562,926,-347,-347,TC);

	// North indicator
    DotScale = hw / 347;
	if ( !bFullDetail && PlayerOwner.bRotateMinimap )
	{
		NorthDir = MapRotY;
		NorthDir.X *= -1.0;
		NorthLocation = CenterPos - 0.92 * hh * NorthDir;
		NorthLocation .X -=  29.5*DotScale;
		NorthLocation.Y -= 33.5*DotScale;
		Canvas.DrawColor = class'UTHUD'.default.RedColor;
		Canvas.DrawColor.R = 128;
		Canvas.SetPos(NorthLocation.X, NorthLocation.Y);
		NorthDir = MapRotX;
		NorthDir.Y *= -1.0;
		Canvas.DrawRotatedTile(class'UTHUD'.default.IconHudTexture, rotator(NorthDir), 59*DotScale, 67*DotScale, 725,175,59,67);
	}
	else
	{
		Canvas.SetPos(XPos + hw - (29.5 * DotScale), YPos - (5 * DotScale));    // 42-37 = 5 :)
		Canvas.DrawColorizedTile(class'UTHUD'.default.IconHudTexture, 59*DotScale, 67*DotScale, 725,175,59,67,TC);
	}

	ChangeMapRotation(MapRot);

	// draw onslaught map
	Canvas.SetPos(CenterPos.X - 0.5*RadarWidth, CenterPos.Y - 0.5*RadarWidth);

	// draw your player
	if ( (PawnOwner != None) && (PlayerOwner.Pawn == PawnOwner) )
	{
		PlayerLocation = UpdateHUDLocation(ScreenLocation);
		Canvas.DrawColor = class'UTTeamInfo'.Default.BaseTeamColor[2];
		DrawRotatedTile(Canvas, class'UTHUD'.default.IconHudTexture, PlayerLocation, PlayerYaw + 16384, 2.0, PlayerIconCoords, MakeLinearColor(0.4,1.0,0.4,1.0));
	}

	if ( bIsSplitScreen )
	{
		ForEach PlayerOwner.LocalPlayerControllers(class'UTPlayerController', PC)
		{
			if ( PC != PlayerOwner )
			{
				break;
			}
		}
		if ( (PC != None) && (PC.Pawn != None) )
		{
			SecondPawn = PC.Pawn;

			// draw second player
			SecondScreenLocation = SecondPawn.Location;
			SecondPlayerYaw = (UTRemoteRedeemer(SecondPawn) == None) ? PC.Rotation.Yaw & 65535 : SecondPawn.Rotation.Yaw & 65535;
			SecondPlayerLocation = UpdateHUDLocation(SecondScreenLocation);
			Canvas.DrawColor = class'UTTeamInfo'.Default.BaseTeamColor[2];
			DrawRotatedTile(Canvas, class'UTHUD'.default.IconHudTexture, SecondPlayerLocation, SecondPlayerYaw + 16384, 2.0, PlayerIconCoords, MakeLinearColor(1.0,1.0,0.4,1.0));
		}
	}

	FinalColor = class'UTHUD'.default.WhiteLinearColor;

	// Resolve all node positions before rendering the links
	UpdateNodes(PlayerOwner);

	if ( bFullDetail )
	{
		for (i = 0; i < NumObjectives; i++)
		{
			if (  WI.GRI.OnSameTeam(Objectives[i], PlayerOwner) )
			{
				FinalColor = Objectives[i].ControlColor[Objectives[i].DefenderTeamIndex];
				FinalColor.A = 1.0;

				// draw associated vehicle factories with vehicles
				for ( j=0; j<Objectives[i].VehicleFactories.Length; j++ )
				{
					if ( Objectives[i].VehicleFactories[j].bHasLockedVehicle )
					{
						Objectives[i].VehicleFactories[j].SetHUDLocation(UpdateHUDLocation(Objectives[i].VehicleFactories[j].Location));
						Objectives[i].VehicleFactories[j].RenderMapIcon(self, Canvas, PlayerOwner, FinalColor);
					}
				}
			}
		}

		// Handle Selection Differently
		if ( WatchedActor != none )
		{
			WatchedLocation = GetActorHudLocation(WatchedActor);

			// Draw the Watched graphic
			Canvas.SetPos(WatchedLocation.X - 15 * MapScale, WatchedLocation.Y - 15 * MapScale * Canvas.ClipY / Canvas.ClipX);
			Canvas.SetDrawColor(255,255,255,128);
			Canvas.DrawTile(class'UTHUD'.default.AltHudTexture,31*MapScale,31*MapScale,273,494,12,13);
		}

		if ( SpawnObjective != none )
		{
			// TEMP - Need a icon or background
			Canvas.SetPos(SpawnObjective.HUDLocation.X - 11 * MapScale, SpawnObjective.HUDLocation.Y - 11 * MapScale * AspectRatio); // * Canvas.ClipY / Canvas.ClipX);
			Canvas.SetDrawColor(64,255,64,128);
			Canvas.DrawTile(class'UTHUD'.default.AltHudTexture,31*MapScale,31*MapScale,273,494,12,13);
		}
	}

	RenderLinks(Canvas, PlayerOwner);

	if ( bFullDetail )
	{
		for (i = 0; i < NumObjectives; i++)
		{
			Objectives[i].RenderExtraDetails(self, Canvas, PlayerOwner, ColorPercent, Objectives[i] == CurrentActor);
		}

		// If the selected actor is a vehicle, highlight it as we would an objective
		V = UTVehicle(CurrentActor);
		if ( V != None )
		{
			Canvas.SetPos(V.HUDLocation.X - 12 * MapScale, V.HUDLocation.Y - 12 * MapScale * Canvas.ClipY / Canvas.ClipX);
			Canvas.SetDrawColor(255,255,0,255);
			Canvas.DrawTile(class'UTHUD'.default.AltHudTexture,25*MapScale,25*MapScale,273,494,12,13);
		}

		if ( bIsSplitScreen )
		{
			// draw "key vehicles" on minimap
			for ( i=0; i<2; i++ )
			{
				if ( KeyVehicles[i] == None )
				{
					continue;
				}

				if ( !KeyVehicles[i].bKeyVehicle || (KeyVehicles[i].Health <=0) || KeyVehicles[i].bDeleteMe )
				{
					KeyVehicles[i] = None;
					continue;
				}

				KeyVehicles[i].SetHUDLocation(UpdateHUDLocation(KeyVehicles[i].Location));
				class'UTHud'.static.GetTeamColor(KeyVehicles[i].Team, FinalColor);
				KeyVehicles[i].RenderMapIcon(self, Canvas, PlayerOwner, FinalColor);
			}
		}
		else
		{
		// Draw all vehicles in sensor range that aren't locked (locked vehicles handled by vehicle factory)
		ForEach WI.AllPawns(class'Pawn', P)
		{
			bInSensorRange = false;
			if ( P.bHidden || (P.Health <=0) || P.IsInvisible() || (P.DrivenVehicle != None) )
			{
				continue;
			}
			V = UTVehicle(P);
			if ( V != None )
			{
				if ( (V.bTeamLocked && !V.bKeyVehicle) || ((V == PawnOwner) && V.IsA('UTVehicle_Hoverboard')) )
		        {
			        continue;
		        }
			}
			else
			{
				UTP = UTPawn(P);
				if ( (UTP == None) || (UTP == PawnOwner) )
				{
					continue;
				}
			}

			if ( WI.GRI.OnSameTeam(PlayerOwner, P) )
			{
				bInSensorRange = true;
			}
			else
			{
			    // only draw if close to a sensor
			    for ( i=0; i<Sensors.Length; i++ )
			    {
				    if ( VSize(P.Location - Sensors[i].Location) < Sensors[i].MaxSensorRange )
				    {
					    bInSensorRange = true;
					    break;
				    }
			    }
			}

			if ( bInSensorRange )
			{
				P.SetHUDLocation(UpdateHUDLocation(P.Location));
				if ( V != None )
				{
					class'UTHud'.static.GetTeamColor(V.Team, FinalColor);
					V.RenderMapIcon(self, Canvas, PlayerOwner, FinalColor);
				}
				else
				{
					TeamNum = ((UTP.PlayerReplicationInfo != None) && (UTP.PlayerReplicationInfo.Team != None))
								? UTP.PlayerReplicationInfo.Team.TeamIndex
								: 2;
					class'UTHud'.static.GetTeamColor(TeamNum, FinalColor);
					UTP.RenderMapIcon(self, Canvas, PlayerOwner, FinalColor);
				}
			}
		}
	}
	}
	else
	{
		// draw "key vehicles" on minimap
		for ( i=0; i<2; i++ )
		{
			if ( KeyVehicles[i] == None )
			{
				continue;
			}

			if ( !KeyVehicles[i].bKeyVehicle || (KeyVehicles[i].Health <=0) || KeyVehicles[i].bDeleteMe )
			{
				KeyVehicles[i] = None;
				continue;
			}

			KeyVehicles[i].SetHUDLocation(UpdateHUDLocation(KeyVehicles[i].Location));
			class'UTHud'.static.GetTeamColor(KeyVehicles[i].Team, FinalColor);
			KeyVehicles[i].RenderMapIcon(self, Canvas, PlayerOwner, FinalColor);
		}
	}

	// draw flags after vehicles/other players
	if ( UTTeamInfo(PlayerOwner.PlayerReplicationInfo.Team) != None )
	{
		// show flag if within sensor range
		for ( j=0; j<2; j++ )
		{
			Team = UTTeamInfo(WI.GRI.Teams[j]);
			if (Team != None && Team.TeamFlag != None)
			{
				bInSensorRange = Team.TeamFlag.ShouldMinimapRenderFor(PlayerOwner);
				i = 0;
				if ( !bInSensorRange )
				{
					for ( i=0; i<Sensors.Length; i++ )
					{
						if ( VSizeSq(Team.TeamFlag.Location - Sensors[i].Location) < Square(Sensors[i].MaxSensorRange) )
						{
							bInSensorRange = true;
							break;
						}
					}
				}
				if ( bInSensorRange )
				{
					Team.TeamFlag.SetHUDLocation(UpdateHUDLocation(Team.TeamFlag.Location));
					if ( Team == PlayerOwner.PlayerReplicationInfo.Team )
					{
						Team.TeamFlag.RenderMapIcon(self, Canvas,PlayerOwner);
					}
					else
					{
						Team.TeamFlag.RenderEnemyMapIcon(self, Canvas, PlayerOwner, Sensors[i]);
					}
				}
			}
		}
	}

	RenderAdditionalInformation(Canvas, PlayerOwner);

	// highlight current objective
	if ( PlayerOwner.LastAutoObjective != None )
	{
		bDrawAutoObjective = true;
		if ( UTOnslaughtNodeObjective(PlayerOwner.LastAutoObjective) != None )
		{
			bDrawAutoObjective = UTOnslaughtNodeObjective(PlayerOwner.LastAutoObjective).IsKeyBeaconObjective(PlayerOwner);
		}
		else if ( UTOnslaughtFlag(PlayerOwner.LastAutoObjective) != None )
		{
			bDrawAutoObjective = (UTOnslaughtFlag(PlayerOwner.LastAutoObjective).HolderPRI == None);
		}
		else
		{
			BarricadeObjective = UTWarfareBarricade(PlayerOwner.LastAutoObjective);
			if ( BarricadeObjective != None )
			{
				bDrawAutoObjective = !BarricadeObjective.bDisabled && BarricadeObjective.ValidTargetFor(PlayerOwner);
			}
		}

		if ( bDrawAutoObjective )
		{
			CurrentObjectiveHUDLocation = UpdateHUDLocation(PlayerOwner.LastAutoObjective.Location);
			Canvas.SetPos(CurrentObjectiveHUDLocation.X - 12*MapScale, CurrentObjectiveHUDLocation.Y - 12*MapScale);//*AspectRatio);
			Canvas.SetDrawColor(255,255,0,255 * (1.0-ColorPercent));
			Canvas.DrawTile(class'UTHUD'.default.IconHudTexture,23*MapScale, 23*MapScale, 669,266,75,75);
		}
	}
	Canvas.SetDrawColor(255,255,255,255);
}

simulated function AddKeyVehicle(UTVehicle V)
{
	local int i;

	// make sure not already in list
	for ( i=0; i<2; i++ )
	{
		if ( KeyVehicles[i] == V )
		{
			return;
		}
	}

	// find an empty slot
	for ( i=0; i<2; i++ )
	{
		if ( (KeyVehicles[i] == None) || KeyVehicles[i].bDeleteMe || (KeyVehicles[i].Health <= 0) )
		{
			KeyVehicles[i] = V;
			return;
		}
	}
	KeyVehicles[1] = V;
}

function DrawRotatedTile(Canvas Canvas, Texture2D T, vector MapLocation, int InYaw, float IconScale, TextureCoordinates TexCoords, LinearColor DrawColor)
{
	local Rotator R;
	local float Width, Height;

	R.Yaw = InYaw - CurrentMapRotYaw;

	Width = TexCoords.UL * (MapScale/4) * IconScale;
	Height = TexCoords.VL * (MapScale/4) * IconScale;

	Canvas.SetPos(MapLocation.X - (0.5*Width), MapLocation.Y - (0.5*Height) );
	Canvas.DrawColor = MakeColor( DrawColor.R * 255, DrawColor.G * 255, DrawColor.B * 255, DrawColor.A * 255);
	Canvas.DrawRotatedTile(T, R, Width, Height, TexCoords.U, TexCoords.V, TexCoords.UL, TexCoords.VL);
}

function DrawRotatedMaterialTile(Canvas Canvas, MaterialInstanceConstant M, vector MapLocation, int InYaw, float XWidth, float YWidth, float XStart, float YStart, float XLength, float YLength)
{
	local Rotator R;

	R.Yaw = InYaw - CurrentMapRotYaw;
	M.SetScalarParameterValue('TexRotation', 0);
	Canvas.SetPos(MapLocation.X - 0.5*XWidth*MapScale, MapLocation.Y - 0.5*YWidth*MapScale);
	Canvas.DrawRotatedMaterialTile(M, R, XWidth * MapScale, YWidth * MapScale, XStart, YStart, XLength, YLength);
}

/**
 * Updates the Map Location for a given world location
 */
native function vector UpdateHUDLocation( Vector InLocation );

function ChangeMapRotation(Rotator NewMapRotation)
{
	local vector Z;

	if ( CurrentMapRotYaw == NewMapRotation.Yaw )
	{
		return;
	}

	GetAxes(NewMapRotation, MapRotX, MapRotY, Z);
	CurrentMapRotYaw = NewMapRotation.Yaw;
}

/**
 * Draws the map image for the mini map
 */
function DrawMapImage(Canvas Canvas, float X, float Y, float W, float H, float PlayerYaw, float BkgImgScaling)
{
	local Rotator MapTexRot;
	local vector Offset;

	if ( MapMaterialInstance != none && MapTexture != none )
	{
		//Zoom level of the map
		MapMaterialInstance.SetScalarParameterValue('MapScale_Parameter', BkgImgScaling);

		// Set Origin.
		// Find out where in the overall map the player is
		Offset = (MapCenter - ActualMapCenter);
		Offset.X = (Offset.X / MapExtent);
		Offset.Y = (Offset.Y / MapExtent);

		//Set the material parameters
		MapMaterialInstance.SetScalarParameterValue('U_Parameter',-Offset.Y);//N/S
		MapMaterialInstance.SetScalarParameterValue('V_Parameter',Offset.X);//E/W

		//Align the texture to the orientation specified by the MapInfo (realign the map to face 'north' always)
		//assume CW rotation (negate), material shader rotation module is speed=PI/2 so scale by 4
		MapMaterialInstance.SetScalarParameterValue('Rot_Value',(MapTextureYaw/360.0f) * -4.0f);

		//Now rotate the 'north' facing map to the player facing direction
		MapTexRot.Yaw = (PlayerYaw * -1);
		Canvas.SetPos(X,Y);
		Canvas.DrawRotatedMaterialTile(MapMaterialInstance, MapTexRot, W, H);
	}
}

function vector GetActorHudLocation(Actor CActor)
{
	if ( UTGameObjective(CActor) != none )
	{
		return UTGameObjective(CActor).HudLocation;
	}
	else if (UTVehicle(CActor) != none )
	{
		return UTVehicle(CActor).HudLocation;
	}
	else if ( UTDeployedActor(CActor) != none )
	{
		return UTDeployedActor(CActor).HudLocation;
	}

	return vect(0,0,0);
}

defaultproperties
{
   RecommendedPlayersMin=6
   RecommendedPlayersMax=10
   bBuildTranslocatorPaths=True
   VisibilityModifier=1.000000
   RotatingMiniMapRange=12000.000000
   DefaultMapSize=255.000000
   MapRotX=(X=1.000000,Y=0.000000,Z=0.000000)
   MapRotY=(X=0.000000,Y=1.000000,Z=0.000000)
   MapMaterialReference=Material'UI_HUD.Materials.MapRing_Mat'
   UseableRadius=0.392100
   PlayerIconCoords=(U=657.000000,V=129.000000,UL=68.000000,VL=106.000000)
   Name="Default__UTMapInfo"
   ObjectArchetype=MapInfo'Engine.Default__MapInfo'
}

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:22.660 - Created with UnCodeX