2014-12-07 19:09:38 -05:00
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
2014-03-14 14:13:41 -04:00
# include "AnimGraphPrivatePCH.h"
2014-04-24 08:49:31 -04:00
# include "AnimGraphNode_SpringBone.h"
2014-03-14 14:13:41 -04:00
/////////////////////////////////////////////////////
// UAnimGraphNode_SpringBone
2014-04-23 18:30:37 -04:00
# define LOCTEXT_NAMESPACE "A3Nodes"
2014-10-14 10:29:11 -04:00
UAnimGraphNode_SpringBone : : UAnimGraphNode_SpringBone ( const FObjectInitializer & ObjectInitializer )
: Super ( ObjectInitializer )
2014-03-14 14:13:41 -04:00
{
}
2014-04-23 18:30:37 -04:00
FText UAnimGraphNode_SpringBone : : GetControllerDescription ( ) const
2014-03-14 14:13:41 -04:00
{
2014-04-23 18:30:37 -04:00
return LOCTEXT ( " SpringController " , " Spring controller " ) ;
2014-03-14 14:13:41 -04:00
}
2014-09-03 18:14:09 -04:00
FText UAnimGraphNode_SpringBone : : GetTooltipText ( ) const
2014-03-14 14:13:41 -04:00
{
2014-09-03 18:14:09 -04:00
return LOCTEXT ( " AnimGraphNode_SpringBone_Tooltip " , " The Spring Controller applies a spring solver that can be used to limit how far a bone can stretch from its reference pose position and apply a force in the opposite direction. " ) ;
2014-03-14 14:13:41 -04:00
}
2014-04-23 18:30:37 -04:00
FText UAnimGraphNode_SpringBone : : GetNodeTitle ( ENodeTitleType : : Type TitleType ) const
2014-03-14 14:13:41 -04:00
{
2014-09-16 15:01:38 -04:00
if ( ( TitleType = = ENodeTitleType : : ListView | | TitleType = = ENodeTitleType : : MenuTitle ) & & ( Node . SpringBone . BoneName = = NAME_None ) )
2014-09-04 11:25:05 -04:00
{
return GetControllerDescription ( ) ;
}
2014-09-24 14:15:13 -04:00
// @TODO: the bone can be altered in the property editor, so we have to
// choose to mark this dirty when that happens for this to properly work
else //if(!CachedNodeTitles.IsTitleCached(TitleType))
2014-09-04 11:25:05 -04:00
{
FFormatNamedArguments Args ;
Args . Add ( TEXT ( " ControllerDescription " ) , GetControllerDescription ( ) ) ;
Args . Add ( TEXT ( " BoneName " ) , FText : : FromName ( Node . SpringBone . BoneName ) ) ;
2014-04-23 18:30:37 -04:00
2014-09-04 11:25:05 -04:00
// FText::Format() is slow, so we cache this to save on performance
2014-09-16 15:01:38 -04:00
if ( TitleType = = ENodeTitleType : : ListView | | TitleType = = ENodeTitleType : : MenuTitle )
2014-08-21 18:50:33 -04:00
{
2014-09-04 11:25:05 -04:00
CachedNodeTitles . SetCachedTitle ( TitleType , FText : : Format ( LOCTEXT ( " AnimGraphNode_SpringBone_ListTitle " , " {ControllerDescription} - Bone: {BoneName} " ) , Args ) ) ;
}
else
{
CachedNodeTitles . SetCachedTitle ( TitleType , FText : : Format ( LOCTEXT ( " AnimGraphNode_SpringBone_Title " , " {ControllerDescription} \n Bone: {BoneName} " ) , Args ) ) ;
2014-08-21 18:50:33 -04:00
}
2014-04-23 18:30:37 -04:00
}
2014-09-04 11:25:05 -04:00
return CachedNodeTitles [ TitleType ] ;
2014-04-23 18:30:37 -04:00
}
# undef LOCTEXT_NAMESPACE