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

UTGame.UTConsole


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
/**
 * Copyright 1998-2008 Epic Games, Inc. All Rights Reserved.
 *
 * Extended version of console that only allows the quick console to be open if there are no UI scenes open, this is to allow UI scenes to process the TAB key.
 */
class UTConsole extends Console;

var int TextCount;

/**
 * Process an input key event routed through unrealscript from another object. This method is assigned as the value for the
 * OnRecievedNativeInputKey delegate so that native input events are routed to this unrealscript function.
 *
 * @param	ControllerId	the controller that generated this input key event
 * @param	Key				the name of the key which an event occured for (KEY_Up, KEY_Down, etc.)
 * @param	EventType		the type of event which occured (pressed, released, etc.)
 * @param	AmountDepressed	for analog keys, the depression percent.
 *
 * @return	true to consume the key event, false to pass it on.
 */
function bool InputKey( int ControllerId, name Key, EInputEvent Event, float AmountDepressed = 1.f, bool bGamepad = FALSE )
{
	local UTGameUISceneClient UTSceneClient;

	// Don't allow console commands when in seamless travel.

    UTSceneClient = UTGameUISceneClient(class'UIRoot'.static.GetSceneClient());
	if ( UTSceneClient != none && UTSceneClient.IsInSeamlessTravel() )
	{
		return false;
	}

	if ( Event == IE_Pressed )
	{
		bCaptureKeyInput = false;

		if ( Key == ConsoleKey )
		{
			GotoState('Open');

			// this already gets set in Open.BeginState, but no harm in being explicit
			bCaptureKeyInput = true;
		}
		else if ( Key == TypeKey )
		{
			// Only show the quick console if there are no UI scenes open that are accepting input.
			if( UTSceneClient==None || UTSceneClient.IsUIAcceptingInput() ==false )
			{
				GotoState('Typing');
				// this already gets set in Typing.BeginState, but no harm in being explicit
				bCaptureKeyInput = true;
			}
		}
	}

	return bCaptureKeyInput;
}

state Typing
{
	function bool InputKey( int ControllerId, name Key, EInputEvent Event, float AmountDepressed = 1.f, bool bGamepad = FALSE )
	{
		if( Key == 'Escape' && Event == IE_Released )
		{
			GotoState( '' );
			return true;
		}

		return Super.InputKey( ControllerId, Key, Event, AmountDepressed, bGamepad);
	}
}

function OutputTextLine(coerce string Text)
{
	TextCount++;
	Super.OutputTextLine(text);
}

defaultproperties
{
   Name="Default__UTConsole"
   ObjectArchetype=Console'Engine.Default__Console'
}

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