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

UTGame.UTSeqAct_TimedTutorialMsg


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

class UTSeqAct_TimedTutorialMsg extends SequenceAction
	native;


/** Markup tutorial message to display */
var() string TutorialMessage;

/** Number of seconds to display the tutorial message */
var() float Duration;

/** True if the sequence should complete instantly; otherwise it finishes after the number of seconds specified in Duration */
var() bool bFireAndForget;


var transient UTUIScene_TimedTutorialMessage Scene;
var transient bool bFinished;

/** Transient: Number of seconds we've been alive. */
var transient float TimeSinceCreated;


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

/** Set the local player value on the scene. */
native final function LocalPlayer GetFirstLocalPlayer();

event Activated()
{
 	local GameUISceneClient SC;
 	local UIScene S;
	local UIScene ExistingScene;
	local String DisplayMessage;
	local LocalPlayer LP;
	local bool bHasScene;
	local int CurSceneIndex;

	bHasScene = false;

	LP = GetFirstLocalPlayer();

	// Reset our state
	bFinished = false;
	TimeSinceCreated = 0.0f;

	SC = class'UIRoot'.static.GetSceneClient();
	if (SC != none )
	{
		// Delete any existing timed tutorial message scenes
		for( CurSceneIndex = 0; CurSceneIndex < SC.ActiveScenes.length; ++CurSceneIndex )
		{
			ExistingScene = SC.ActiveScenes[ CurSceneIndex ];
			if( ExistingScene.IsA( 'UTUIScene_TimedTutorialMessage' ) )
			{
				// Kill it!
				SC.CloseScene( ExistingScene );

				// Restart iteration, in case our list was modified
				CurSceneIndex = 0;
			}
		}

		// Spawn our scene!
		SC.OpenScene(class'UTGameUISceneClient'.Default.TimedTutorialTemplate,LP,S);
		Scene = UTUIScene_TimedTutorialMessage(S);
		if ( Scene != none )
		{
			DisplayMessage = "<Strings:UTGameUI.Tutorials." $ TutorialMessage $ ">";
			Scene.SetValue(DisplayMessage);
			Scene.OnSceneDeactivated = OnSceneDeactivated;
			bHasScene = true;
		}
	}

	// If we were created as 'fire and forget', then we complete instantly.
	if( bFireAndForget )
	{
		OutputLinks[0].bHasImpulse = true;

		// Also, we complete instantly unless we have a tutorial message UI scene to display.
		if( !bHasScene )
		{
			bFinished = true;
		}
	}
}



function OnSceneDeactivated( UIScene DeactivatedScene )
{
	if ( DeactivatedScene == Scene )
	{
		Scene = none;

		if( !bFinished )
		{
			// We only need to fire out output if we haven't already asked for that
			if( !bFireAndForget )
			{
				OutputLinks[0].bHasImpulse = true;
			}

			bFinished = true;
		}
	}
}


event CloseSceneAndDie()
{
	local UISafeRegionPanel SP;

	if( !bFinished )
	{
		// We only need to fire out output if we haven't already asked for that
		if( !bFireAndForget )
		{
			OutputLinks[0].bHasImpulse = true;
		}

		bFinished = true;
	}

	if( Scene != none )
	{
		// Start closing the scene (it will fade out, then call back into OnSceneDeactivated)
		SP = UISafeRegionPanel(Scene.FindChild('SafeRegionPanel',true));
		if ( SP != none )
		{
			SP.PlayUIAnimation('FadeOut',,4.0);
			Scene.Findchild('Background',true).PlayUIAnimation('FadeOut',,4.0);
		}
	}
}


/**
 * Determines whether this class should be displayed in the list of available ops in the level kismet editor.
 *
 * @return	TRUE if this sequence object should be available for use in the level kismet editor
 */
event bool IsValidLevelSequenceObject()
{
	return true;
}

defaultproperties
{
   Duration=5.000000
   bFireAndForget=True
   bCallHandler=False
   bLatentExecution=True
   bAutoActivateOutputLinks=False
   OutputLinks(0)=(LinkDesc="Success")
   ObjName="Timed Tutorial Message"
   ObjCategory="Tutorials"
   Name="Default__UTSeqAct_TimedTutorialMsg"
   ObjectArchetype=SequenceAction'Engine.Default__SequenceAction'
}

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