You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Enable renaming for 3d Transform track #jira UE-127874 #rb mike.zyracki #ROBOMERGE-AUTHOR: max.chen #ROBOMERGE-SOURCE: CL 18244156 in //UE5/Release-5.0/... via CL 18244411 #ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469) [CL 18244449 by max chen in ue5-release-engine-test branch]
103 lines
2.1 KiB
C++
103 lines
2.1 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "MovieSceneNameableTrack.h"
|
|
#include "UObject/NameTypes.h"
|
|
|
|
#define LOCTEXT_NAMESPACE "MovieSceneNameableTrack"
|
|
|
|
|
|
/* UMovieSceneNameableTrack interface
|
|
*****************************************************************************/
|
|
|
|
#if WITH_EDITORONLY_DATA
|
|
|
|
void UMovieSceneNameableTrack::SetDisplayName(const FText& NewDisplayName)
|
|
{
|
|
if (NewDisplayName.EqualTo(DisplayName))
|
|
{
|
|
return;
|
|
}
|
|
|
|
SetFlags(RF_Transactional);
|
|
Modify();
|
|
|
|
DisplayName = NewDisplayName;
|
|
}
|
|
|
|
void UMovieSceneNameableTrack::SetTrackRowDisplayName(const FText& NewDisplayName, int32 TrackRowIndex)
|
|
{
|
|
if (TrackRowIndex >= TrackRowDisplayNames.Num())
|
|
{
|
|
TrackRowDisplayNames.AddDefaulted(TrackRowIndex+1);
|
|
}
|
|
|
|
if (NewDisplayName.EqualTo(TrackRowDisplayNames[TrackRowIndex]))
|
|
{
|
|
return;
|
|
}
|
|
|
|
SetFlags(RF_Transactional);
|
|
Modify();
|
|
|
|
TrackRowDisplayNames[TrackRowIndex] = NewDisplayName;
|
|
}
|
|
|
|
bool UMovieSceneNameableTrack::ValidateDisplayName(const FText& NewDisplayName, FText& OutErrorMessage) const
|
|
{
|
|
if (NewDisplayName.IsEmpty())
|
|
{
|
|
OutErrorMessage = LOCTEXT("RenameFailed_LeftBlank", "Labels cannot be left blank");
|
|
return false;
|
|
}
|
|
else if (NewDisplayName.ToString().Len() >= NAME_SIZE)
|
|
{
|
|
OutErrorMessage = FText::Format(LOCTEXT("RenameFailed_TooLong", "Names must be less than {0} characters long"), NAME_SIZE);
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
/* UMovieSceneTrack interface
|
|
*****************************************************************************/
|
|
|
|
#if WITH_EDITORONLY_DATA
|
|
|
|
FText UMovieSceneNameableTrack::GetDisplayName() const
|
|
{
|
|
if (DisplayName.IsEmpty())
|
|
{
|
|
return GetDefaultDisplayName();
|
|
}
|
|
|
|
return DisplayName;
|
|
}
|
|
|
|
FText UMovieSceneNameableTrack::GetTrackRowDisplayName(int32 TrackRowIndex) const
|
|
{
|
|
if (TrackRowIndex < TrackRowDisplayNames.Num() && !TrackRowDisplayNames[TrackRowIndex].IsEmpty())
|
|
{
|
|
return TrackRowDisplayNames[TrackRowIndex];
|
|
}
|
|
|
|
if (DisplayName.IsEmpty())
|
|
{
|
|
return GetDefaultDisplayName();
|
|
}
|
|
|
|
return DisplayName;
|
|
}
|
|
|
|
FText UMovieSceneNameableTrack::GetDefaultDisplayName() const
|
|
|
|
{
|
|
return LOCTEXT("UnnamedTrackName", "Unnamed Track");
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
#undef LOCTEXT_NAMESPACE
|