2014-12-07 19:09:38 -05:00
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
2014-05-07 16:36:18 -04:00
# include "AnimGraphPrivatePCH.h"
# include "AnimGraphNode_WheelHandler.h"
2014-05-07 20:42:18 -04:00
# include "CompilerResultsLog.h"
2014-05-07 16:36:18 -04:00
/////////////////////////////////////////////////////
// UAnimGraphNode_WheelHandler
# define LOCTEXT_NAMESPACE "A3Nodes"
2014-10-14 10:29:11 -04:00
UAnimGraphNode_WheelHandler : : UAnimGraphNode_WheelHandler ( const FObjectInitializer & ObjectInitializer )
: Super ( ObjectInitializer )
2014-05-07 16:36:18 -04:00
{
}
FText UAnimGraphNode_WheelHandler : : GetControllerDescription ( ) const
{
return LOCTEXT ( " AnimGraphNode_WheelHandler " , " Wheel Handler for WheeledVehicle " ) ;
}
2014-09-03 18:14:09 -04:00
FText UAnimGraphNode_WheelHandler : : GetTooltipText ( ) const
2014-05-07 16:36:18 -04:00
{
2014-09-03 18:14:09 -04:00
return LOCTEXT ( " AnimGraphNode_WheelHandler_Tooltip " , " This alters the wheel transform based on set up in Wheeled Vehicle. This only works when the owner is WheeledVehicle. " ) ;
2014-05-07 16:36:18 -04:00
}
FText UAnimGraphNode_WheelHandler : : GetNodeTitle ( ENodeTitleType : : Type TitleType ) const
{
2014-08-21 18:50:33 -04:00
FText NodeTitle ;
2014-09-16 15:01:38 -04:00
if ( TitleType = = ENodeTitleType : : ListView | | TitleType = = ENodeTitleType : : MenuTitle )
2014-08-21 18:50:33 -04:00
{
NodeTitle = GetControllerDescription ( ) ;
}
else
{
// we don't have any run-time information, so it's limited to print
// anymore than what it is it would be nice to print more data such as
// name of bones for wheels, but it's not available in Persona
NodeTitle = FText ( LOCTEXT ( " AnimGraphNode_WheelHandler_Title " , " Wheel Handler " ) ) ;
}
return NodeTitle ;
2014-05-07 16:36:18 -04:00
}
void UAnimGraphNode_WheelHandler : : ValidateAnimNodePostCompile ( class FCompilerResultsLog & MessageLog , class UAnimBlueprintGeneratedClass * CompiledClass , int32 CompiledNodeIndex )
{
// we only support vehicle anim instance
if ( CompiledClass - > IsChildOf ( UVehicleAnimInstance : : StaticClass ( ) ) = = false )
{
MessageLog . Error ( TEXT ( " @@ is only allowwed in VehicleAnimInstance. If this is for vehicle, please change parent to be VehicleAnimInstancen (Reparent Class). " ) , this ) ;
}
}
2014-08-21 18:50:33 -04:00
bool UAnimGraphNode_WheelHandler : : IsCompatibleWithGraph ( const UEdGraph * TargetGraph ) const
{
UBlueprint * Blueprint = FBlueprintEditorUtils : : FindBlueprintForGraph ( TargetGraph ) ;
return ( Blueprint ! = nullptr ) & & Blueprint - > ParentClass - > IsChildOf < UVehicleAnimInstance > ( ) & & Super : : IsCompatibleWithGraph ( TargetGraph ) ;
}
2014-05-07 16:36:18 -04:00
# undef LOCTEXT_NAMESPACE