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

UTGame.UTUIScene_CMissionBriefing


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
/**
 * Copyright 1998-2008 Epic Games, Inc. All Rights Reserved.
 */

class UTUIScene_CMissionBriefing extends UTUIScene_Campaign
	native(UI);

/** UI Controls we adjust */
var transient UILabel MissionName;
var transient UIImage CloseInMap;
var transient UIPanel BriefBar;
var transient UIPanel ObjectiveBar;

var transient UILabel ObjectiveText;
var transient UIImage ObjectiveImage;
var transient UILabel LoadingLabel;
var transient UIImage LoadingLogo;
var transient UIImage LoadingImage;

var transient UILabelButton StartGameButton;

var transient UIImage PlayerBox;
var transient UILabel PlayerLabels[4];
var transient UIImage PlayerReady[4];


var transient EMissionInformation FinalMission;

var transient bool bFinalStage;
var transient int ObjectiveDisplayIndex;
var transient float ObjectiveTimer;

var editconst AudioComponent AudioPlayer;
var editconst AudioComponent NotificationAudioPlayer;

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

/** Setup */
event PostInitialize()
{
	local int i;

	Super.PostInitialize();

	MissionName = UILabel(FindChild('MissionName',true));
	CloseInMap = UIImage(FindChild('CloseInMap',true));

	ObjectiveBar = UIPanel(FindChild('ObjectiveBar',true));

    StartGameButton = UILabelButton(FindChild('StartButton',true));
    StartGameButton.OnClicked=StartGameClick;

    // if we're on the console, don't allow the start button to receive focus
    if ( IsConsole() )
    {
    	StartGameButton.SetPrivateBehavior(PRIVATE_NotFocusable, true);
    }

	ObjectiveText = UILabel(FindChild('ObjectiveText',true));
	ObjectiveImage = UIIMage(FindChild('Objective_Image',true));

    LoadingLabel = UILabel(FindChild('Connecting',true));
    LoadingImage = UIImage(FindChild('ConnectingImage',true));
    LoadingLogo	 = UIImage(FindChild('ConnectingImageULogo',true));


    PlayerBox = UIImage (FindChild('PlayerBox',true));
    PlayerBox.SetVisibility(true);

	for (i=0;i<4;i++)
	{
	    PlayerLabels[i] = UILabel( FindChild(name("PlayerLabel"$i),true));
	    PlayerReady[i] = UIImage (FindChild(name("ReadyU"$i),true));
	}
}

function Launch(UTMissionGRI MGRI)
{
	if ( MGRI.GetCurrentMission(FinalMission) )
	{
		// Make sure to clear the reference to the actor object that is hanging around
		// so the game doesn't crash.

		FinalMission.MapBeacon = none;
		MissionName.SetDatastoreBinding(FinalMission.Title$" -<Strings:UTGameUI.Campaign.Objectives>");

		if ( FinalMission.ObjectiveText != "" )
		{
			ObjectiveText.SetDataStoreBinding(FinalMission.ObjectiveText);
		}

		// Set the background image

		if ( CloseInMap != none && FinalMission.BriefingImage != none )
		{
			CloseInMap.Imagecomponent.SetImage( FinalMission.BriefingImage );
			if ( FinalMission.bCustomBriefingCoords )
			{
				CloseInMap.ImageComponent.SetCoordinates( FinalMission.BriefingCoords );
			}
		}

		if ( FinalMission.BriefingAudioCue != none )
		{
			PlaySound(FinalMission.BriefingAudioCue);
		}

	}

	NextObjective();
	LoadingLabel.SetVisibility(true);
	LoadingImage.SetVisibility(true);
	LoadingLogo.SetVisibility(true);
}

event SceneDeactivated()
{
	Super.SceneDeactivated();
}


/**
 * Provides a hook for unrealscript to respond to input using actual input key names (i.e. Left, Tab, etc.)
 *
 * Called when an input key event is received which this widget responds to and is in the correct state to process.  The
 * keys and states widgets receive input for is managed through the UI editor's key binding dialog (F8).
 *
 * This delegate is called BEFORE kismet is given a chance to process the input.
 *
 * @param	EventParms	information about the input event.
 *
 * @return	TRUE to indicate that this input key was processed; no further processing will occur on this input key event.
 */
function bool HandleInputKey( const out InputEventParameters EventParms )
{
	if(EventParms.EventType==IE_Released)
	{
		if(EventParms.InputKeyName=='XboxTypeS_A')
		{
			if ( StartGameButton != none && StartGameButton.IsVisible() )
			{
				StartGame();
			}
			return true;
		}
	}

	return true;
}


/**
 * Called by UTUI_SinglePlayer when on the objectives/loading screen after loading finishes and we're waiting
 * waiting for the user to press the 'Begin Mission' button to start the game.
 */
event MissionReadyToStart()
{
	PlayObjectiveSound(soundcue'A_interface.Menu.UT3MenuMatchReady01Cue');
}


function bool StartGameClick(UIScreenObject EventObject, int PlayerIndex)
{
	StartGame();
	return true;
}

function StartGame()
{
	local WorldInfo WI;
	local UTGame G;
	if ( StartGameButton != none && StartGameButton.IsVisible() )
	{
		// DB: When the user has clicks the 'Begin Mission' button, make sure
		// DB: that any mission briefing audio that's still playing gets stopped,
		// DB: so that it won't continue to play in game.
		AudioPlayer.Stop();

		SceneClient.CloseScene(self);

		WI = GetWorldInfo();

		// Have the host start the match

		if ( WI != none && WI.Role == ROLE_Authority )
		{
			G = UTGame(WI.Game);
			if (G!=none)
			{
			 	G.StartMatch();
			}
		}
	}
}

event NextObjective()
{
	local string s;
	local int i;
	local string colorcode;
	if (FinalMission.Objectives.Length > 0)
	{
		ObjectiveDisplayIndex++;
		if (ObjectiveDisplayIndex == FinalMission.Objectives.Length)
		{
			ObjectiveDisplayIndex = -1;
			return;
		}

		ObjectiveTimer = FinalMission.Objectives[ObjectiveDisplayIndex].FocusTime;

		PlayObjectiveSound(soundcue'A_interface.Menu.UT3MenuMatchFocus01Cue');

		for (i=0;i<FinalMission.Objectives.Length;i++)
		{

			// Add the carriage return

			if (s != "")
			{
				S = S $ "\n ";
			}
			else
			{
				S = " ";
			}

			ColorCode = (i == ObjectiveDisplayIndex) ? "<color:R=0.9,G=0.9,B=0.9>" : "<color:R=0.3,G=0.3,B=0.3>";

			s = S $ ColorCode $ "-" @ finalMission.Objectives[i].Text;
		}
		ObjectiveText.SetDatastoreBinding(s);

		if ( FinalMission.Objectives[ObjectiveDisplayIndex].Image != none )
		{
			ObjectiveImage.SetVisibility(true);
			ObjectiveImage.ImageComponent.SetImage(FinalMission.Objectives[ObjectiveDisplayIndex].Image);
			if ( FinalMission.Objectives[ObjectiveDisplayIndex].bCustomCoords )
			{
				ObjectiveImage.ImageComponent.SetCoordinates( FinalMission.Objectives[ObjectiveDisplayIndex].ImageCoords);
			}
			else
			{
				ObjectiveImage.ImageComponent.DisableCustomCoordinates();
			}
		}
		else
		{
			ObjectiveImage.SetVisibility(false);
		}
	}
}

function PlaySound(SoundCue SoundToPlay, optional bool bIsUISound)
{
	//`log( "!!!!!!!!!!!!!!!!!!!!!!!MISSIONBRIEFING PLAYSOUND:" @ SoundToPlay );
	AudioPlayer.SoundCue = SoundToPlay;
	// Set bIgnoreForFlushing to TRUE so that the audio won't be stopped
	// by the audio device flush issued from the seamless travel handler.
	AudioPlayer.bIgnoreForFlushing=TRUE;
	AudioPlayer.Play();
}

/**
 * This function allows you to play various objective notification sounds on top of the briefing music which is played through PlaySound().
 */
function PlayObjectiveSound(SoundCue SoundToPlay)
{
	//`log( "!!!!!!!!!!!!!!!!!!!!!!!MISSIONBRIEFING PLAY OBJECTIVE SOUND:" @ SoundToPlay );
	NotificationAudioPlayer.SoundCue = SoundToPlay;
	// Set bIgnoreForFlushing to TRUE so that the audio won't be stopped
	// by the audio device flush issued from the seamless travel handler.
	NotificationAudioPlayer.bIgnoreForFlushing=TRUE;
	NotificationAudioPlayer.Play();
}

defaultproperties
{
   Begin Object Class=AudioComponent Name=ACPlayer ObjName=ACPlayer Archetype=AudioComponent'Engine.Default__AudioComponent'
      bAllowSpatialization=False
      Name="ACPlayer"
      ObjectArchetype=AudioComponent'Engine.Default__AudioComponent'
   End Object
   AudioPlayer=ACPlayer
   Begin Object Class=AudioComponent Name=ObjectivePlayer ObjName=ObjectivePlayer Archetype=AudioComponent'Engine.Default__AudioComponent'
      bAllowSpatialization=False
      Name="ObjectivePlayer"
      ObjectArchetype=AudioComponent'Engine.Default__AudioComponent'
   End Object
   NotificationAudioPlayer=ObjectivePlayer
   bExemptFromAutoClose=True
   bCloseOnLevelChange=False
   Begin Object Class=UIComp_Event Name=SceneEventComponent ObjName=SceneEventComponent Archetype=UIComp_Event'UTGame.Default__UTUIScene_Campaign:SceneEventComponent'
      ObjectArchetype=UIComp_Event'UTGame.Default__UTUIScene_Campaign:SceneEventComponent'
   End Object
   EventProvider=SceneEventComponent
   Name="Default__UTUIScene_CMissionBriefing"
   ObjectArchetype=UTUIScene_Campaign'UTGame.Default__UTUIScene_Campaign'
}

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