2014-03-14 14:13:41 -04:00
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
# include "BlueprintGraphPrivatePCH.h"
2014-05-29 16:42:22 -04:00
# include "K2Node_GetInputAxisValue.h"
2014-03-14 14:13:41 -04:00
# include "CompilerResultsLog.h"
UK2Node_GetInputAxisValue : : UK2Node_GetInputAxisValue ( const class FPostConstructInitializeProperties & PCIP )
: Super ( PCIP )
{
bConsumeInput = true ;
}
void UK2Node_GetInputAxisValue : : AllocateDefaultPins ( )
{
Super : : AllocateDefaultPins ( ) ;
UEdGraphPin * InputAxisNamePin = FindPinChecked ( TEXT ( " InputAxisName " ) ) ;
InputAxisNamePin - > DefaultValue = InputAxisName . ToString ( ) ;
}
void UK2Node_GetInputAxisValue : : Initialize ( const FName AxisName )
{
InputAxisName = AxisName ;
SetFromFunction ( AActor : : StaticClass ( ) - > FindFunctionByName ( TEXT ( " GetInputAxisValue " ) ) ) ;
}
2014-04-23 18:30:37 -04:00
FText UK2Node_GetInputAxisValue : : GetNodeTitle ( ENodeTitleType : : Type TitleType ) const
2014-03-14 14:13:41 -04:00
{
2014-04-23 18:30:37 -04:00
FFormatNamedArguments Args ;
Args . Add ( TEXT ( " InputAxisName " ) , FText : : FromName ( InputAxisName ) ) ;
return FText : : Format ( NSLOCTEXT ( " K2Node " , " GetInputAxis_Name " , " Get {InputAxisName} " ) , Args ) ;
}
FString UK2Node_GetInputAxisValue : : GetNodeNativeTitle ( ENodeTitleType : : Type TitleType ) const
{
// Do not setup this function for localization, intentionally left unlocalized!
return FString : : Printf ( TEXT ( " Get %s " ) , * InputAxisName . ToString ( ) ) ;
2014-03-14 14:13:41 -04:00
}
FString UK2Node_GetInputAxisValue : : GetTooltip ( ) const
{
return FString : : Printf ( * NSLOCTEXT ( " K2Node " , " GetInputAxis_Tooltip " , " Returns the current value of input axis %s. If input is disabled for the actor the value will be 0. " ) . ToString ( ) , * InputAxisName . ToString ( ) ) ;
}
void UK2Node_GetInputAxisValue : : ValidateNodeDuringCompilation ( class FCompilerResultsLog & MessageLog ) const
{
Super : : ValidateNodeDuringCompilation ( MessageLog ) ;
TArray < FName > AxisNames ;
GetDefault < UInputSettings > ( ) - > GetAxisNames ( AxisNames ) ;
if ( ! AxisNames . Contains ( InputAxisName ) )
{
MessageLog . Warning ( * FString : : Printf ( * NSLOCTEXT ( " KismetCompiler " , " MissingInputAxis_Warning " , " Get Input Axis references unknown Axis '%s' for @@ " ) . ToString ( ) , * InputAxisName . ToString ( ) ) , this ) ;
}
}
UClass * UK2Node_GetInputAxisValue : : GetDynamicBindingClass ( ) const
{
return UInputAxisDelegateBinding : : StaticClass ( ) ;
}
void UK2Node_GetInputAxisValue : : RegisterDynamicBinding ( UDynamicBlueprintBinding * BindingObject ) const
{
UInputAxisDelegateBinding * InputAxisBindingObject = CastChecked < UInputAxisDelegateBinding > ( BindingObject ) ;
FBlueprintInputAxisDelegateBinding Binding ;
Binding . InputAxisName = InputAxisName ;
Binding . bConsumeInput = bConsumeInput ;
Binding . bExecuteWhenPaused = bExecuteWhenPaused ;
InputAxisBindingObject - > InputAxisDelegateBindings . Add ( Binding ) ;
}