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

UTGame.UTUIScene_SaveProfile


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

class UTUIScene_SaveProfile extends UTUIScene
	native(UI);

var transient float OnScreenTime;
var transient int PlayerIndexToSave;
var transient bool bProfileSaved;
var transient bool bShutdown;

var transient float MinOnScreenTime;

/** If true, then use the elapsed time to close the save message */
var transient bool bUseTimedClose;

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

delegate OnSaveFinished();

event PostInitialize()
{
	OnRawInputKey = KillInput;
}

function bool KillInput( const out InputEventParameters EventParms )
{
	return true;
}

event PerformSave()
{
	local OnlineSubsystem OnlineSub;

	if (!bProfileSaved)
	{
		// Don't use the timed close on consoles as they are event driven
		bUseTimedClose = !IsConsole(CONSOLE_PS3);
		if (!bUseTimedClose)
		{
			OnlineSub = class'GameEngine'.static.GetOnlineSubsystem();
			if (OnlineSub != None && OnlineSub.PlayerInterface != None)
			{
				// Register the call back so we can shut down the scene upon completion
				OnlineSub.PlayerInterface.AddWriteProfileSettingsCompleteDelegate(PlayerIndexToSave,OnSaveProfileComplete);
			}
			else
			{
				// Use the timed method
				bUseTimedClose = true;
			}
		}
		SavePlayerProfile(PlayerIndexToSave);
		bProfileSaved = true;
	}
}

/**
 * Called when the save has completed the async operation
 *
 * @param bWasSuccessful whether the save worked ok or not
 */
function OnSaveProfileComplete(bool bWasSuccessful)
{
	local OnlineSubsystem OnlineSub;

	OnlineSub = class'GameEngine'.static.GetOnlineSubsystem();
	if (OnlineSub != None && OnlineSub.PlayerInterface != None)
	{
		// Register the call back so we can shut down the scene upon completion
		OnlineSub.PlayerInterface.ClearWriteProfileSettingsCompleteDelegate(PlayerIndexToSave,OnSaveProfileComplete);
	}
//@todo Amitt/JoeW -- show an error when failing to save
	ShutDown();
}

event ShutDown()
{
	CloseScene(Self);
	OnSaveFinished();
	OnSaveFinished = None;
}

defaultproperties
{
   SceneInputMode=INPUTMODE_Simultaneous
   SceneRenderMode=SPLITRENDER_Fullscreen
   Begin Object Class=UIComp_Event Name=SceneEventComponent ObjName=SceneEventComponent Archetype=UIComp_Event'UTGame.Default__UTUIScene:SceneEventComponent'
      ObjectArchetype=UIComp_Event'UTGame.Default__UTUIScene:SceneEventComponent'
   End Object
   EventProvider=SceneEventComponent
   Name="Default__UTUIScene_SaveProfile"
   ObjectArchetype=UTUIScene'UTGame.Default__UTUIScene'
}

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.423 - Created with UnCodeX