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

Scripting.CutsceneManager


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
class CutsceneManager extends Core.Object;

var Script playingCutscene;

//
// Cancels the currently playing opening cutscene
//
simulated function bool CancelOpeningCutscence()
{
	if(playingCutscene.scriptType == TYPE_OpeningCutscene)
	{
		playingCutscene.exit();
		return true;
	}

	return false;
}

simulated function ScriptEnded(Script script)
{
	if(script.scriptType != TYPE_Normal && playingCutscene != None && playingCutscene == script)
	{
		playingCutscene.Level.SpeechManager.EnableChannel("Dynamic");
		playingCutscene = None;
	}
}


//
// Processes the script and return whether the passed script
// can execute. This will update the playingCutscene variable
// if necessary.
//
function bool CanExecute(Script script)
{
	// normal scripts can always execute
	if(script.scriptType == TYPE_Normal)
		return true;

	// if there is no existing cutscene, or the playing cutscene 
	// is no longer executing,  just play the new one
	if(playingCutscene == None || ! playingCutscene.bIsExecuting)
	{
		playingCutscene = script;
		playingCutscene.Level.SpeechManager.DisableChannel("Dynamic");
		return true;
	}

	// check the priority of the existing cutscene
	if(playingCutscene.cutscenePriority <= script.cutscenePriority)
	{
		playingCutscene.exit();
		playingCutscene = script;
		playingCutscene.Level.SpeechManager.DisableChannel("Dynamic");

		return true;
	}

	return false;
}


Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: ne 5.9.2004 15:53:44.000 - Creation time: st 23.5.2018 00:10:43.023 - Created with UnCodeX