本文整理汇总了C++中FFormatNamedArguments::Add方法的典型用法代码示例。如果您正苦于以下问题:C++ FFormatNamedArguments::Add方法的具体用法?C++ FFormatNamedArguments::Add怎么用?C++ FFormatNamedArguments::Add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FFormatNamedArguments
的用法示例。
在下文中一共展示了FFormatNamedArguments::Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InternalLogSummary
void FCompilerResultsLog::InternalLogSummary()
{
if(CurrentEventScope.IsValid())
{
const double CompileStartTime = CurrentEventScope->StartTime;
const double CompileFinishTime = CurrentEventScope->FinishTime;
FNumberFormattingOptions TimeFormat;
TimeFormat.MaximumFractionalDigits = 2;
TimeFormat.MinimumFractionalDigits = 2;
TimeFormat.MaximumIntegralDigits = 4;
TimeFormat.MinimumIntegralDigits = 4;
TimeFormat.UseGrouping = false;
FFormatNamedArguments Args;
Args.Add(TEXT("Time"), FText::AsNumber(CompileFinishTime - GStartTime, &TimeFormat));
Args.Add(TEXT("SourceName"), FText::FromString(SourceName));
Args.Add(TEXT("NumWarnings"), NumWarnings);
Args.Add(TEXT("NumErrors"), NumErrors);
Args.Add(TEXT("TotalMilliseconds"), (int)((CompileFinishTime - CompileStartTime) * 1000));
if (NumErrors > 0)
{
FString FailMsg = FText::Format(LOCTEXT("CompileFailed", "[{Time}] Compile of {SourceName} failed. {NumErrors} Fatal Issue(s) {NumWarnings} Warning(s) [in {TotalMilliseconds} ms]"), Args).ToString();
Warning(*FailMsg);
}
else if(NumWarnings > 0)
{
FString WarningMsg = FText::Format(LOCTEXT("CompileWarning", "[{Time}] Compile of {SourceName} successful, but with {NumWarnings} Warning(s) [in {TotalMilliseconds} ms]"), Args).ToString();
Warning(*WarningMsg);
}
else
{
FString SuccessMsg = FText::Format(LOCTEXT("CompileSuccess", "[{Time}] Compile of {SourceName} successful! [in {TotalMilliseconds} ms]"), Args).ToString();
Note(*SuccessMsg);
}
if(bLogDetailedResults)
{
Note(*LOCTEXT("PerformanceSummaryHeading", "Performance summary:").ToString());
InternalLogEvent(*CurrentEventScope.Get());
}
}
}
示例2: TooltipMetaKey
FText UK2Node_VariableGet::GetPropertyTooltip(UProperty const* VariableProperty)
{
FName VarName = NAME_None;
if (VariableProperty != nullptr)
{
VarName = VariableProperty->GetFName();
UClass* SourceClass = VariableProperty->GetOwnerClass();
// discover if the variable property is a non blueprint user variable
bool const bIsNativeVariable = (SourceClass != nullptr) && (SourceClass->ClassGeneratedBy == nullptr);
FName const TooltipMetaKey(TEXT("tooltip"));
FText SubTooltip;
if (bIsNativeVariable)
{
FText const PropertyTooltip = VariableProperty->GetToolTipText();
if (!PropertyTooltip.IsEmpty())
{
// See if the native property has a tooltip
SubTooltip = PropertyTooltip;
FString TooltipName = FString::Printf(TEXT("%s.%s"), *VarName.ToString(), *TooltipMetaKey.ToString());
FText::FindText(*VariableProperty->GetFullGroupName(true), *TooltipName, SubTooltip);
}
}
else if (UBlueprint* VarBlueprint = Cast<UBlueprint>(SourceClass->ClassGeneratedBy))
{
FString UserTooltipData;
if (FBlueprintEditorUtils::GetBlueprintVariableMetaData(VarBlueprint, VarName, /*InLocalVarScope =*/nullptr, TooltipMetaKey, UserTooltipData))
{
SubTooltip = FText::FromString(UserTooltipData);
}
}
if (!SubTooltip.IsEmpty())
{
FFormatNamedArguments Args;
Args.Add(TEXT("VarName"), FText::FromName(VarName));
Args.Add(TEXT("PropertyTooltip"), SubTooltip);
return FText::Format(LOCTEXT("GetVariableProperty_Tooltip", "Read the value of variable {VarName}\n{PropertyTooltip}"), Args);
}
}
return K2Node_VariableGetImpl::GetBaseTooltip(VarName);
}
示例3: Format
FText UK2Node_ActorBoundEvent::GetNodeTitle(ENodeTitleType::Type TitleType) const
{
if (EventOwner == nullptr)
{
FFormatNamedArguments Args;
Args.Add(TEXT("DelegatePropertyName"), FText::FromName(DelegatePropertyName));
return FText::Format(LOCTEXT("ActorBoundEventTitle", "{DelegatePropertyName} (None)"), Args);
}
else if (CachedNodeTitle.IsOutOfDate())
{
FFormatNamedArguments Args;
Args.Add(TEXT("DelegatePropertyName"), FText::FromName(DelegatePropertyName));
Args.Add(TEXT("TargetName"), FText::FromString(EventOwner->GetActorLabel()));
// FText::Format() is slow, so we cache this to save on performance
CachedNodeTitle = FText::Format(LOCTEXT("ActorBoundEventTitle", "{DelegatePropertyName} ({TargetName})"), Args);
}
return CachedNodeTitle;
}
示例4: GetNodeTitle
FText UAnimGraphNode_FootPlacementIK::GetNodeTitle(ENodeTitleType::Type TitleType) const
{
FFormatNamedArguments Args;
Args.Add(TEXT("ControllerDescription"), GetControllerDescription());
Args.Add(TEXT("BoneName"), FText::FromName(Node.IKBone.BoneName));
if(TitleType == ENodeTitleType::ListView || TitleType == ENodeTitleType::MenuTitle)
{
if (Node.IKBone.BoneName == NAME_None)
{
return FText::Format(LOCTEXT("FootPlacementIK_MenuTitle", "{ControllerDescription}"), Args);
}
return FText::Format(LOCTEXT("FootPlacementIK_ListTitle", "{ControllerDescription} - Bone: {BoneName}"), Args);
}
else
{
return FText::Format(LOCTEXT("FootPlacementIK_FullTitle", "{ControllerDescription}\nBone: {BoneName}"), Args);
}
}
示例5: NSLOCTEXT
FText UK2Node_LiveEditObject::GetNodeTitle(ENodeTitleType::Type TitleType) const
{
UEdGraphPin* BaseClassPin = GetBaseClassPin();
if ((BaseClassPin == nullptr) || (BaseClassPin->DefaultObject == nullptr))
{
return NSLOCTEXT("K2Node", "LiveEditObject_NullTitle", "LiveEditObject NONE");
}
else if (CachedNodeTitle.IsOutOfDate())
{
FNumberFormattingOptions NumberOptions;
NumberOptions.UseGrouping = false;
FFormatNamedArguments Args;
Args.Add(TEXT("SpawnString"), FText::FromName(BaseClassPin->DefaultObject->GetFName()));
Args.Add(TEXT("ID"), FText::AsNumber(GetUniqueID(), &NumberOptions));
CachedNodeTitle = FText::Format(NSLOCTEXT("K2Node", "LiveEditObject", "LiveEditObject {SpawnString}_{ID}"), Args);
}
return CachedNodeTitle;
}
示例6: GetBreakLinkToSubMenuActions
void UEdGraphSchema_BehaviorTreeDecorator::GetBreakLinkToSubMenuActions( class FMenuBuilder& MenuBuilder, UEdGraphPin* InGraphPin )
{
// Make sure we have a unique name for every entry in the list
TMap< FString, uint32 > LinkTitleCount;
// Add all the links we could break from
for(TArray<class UEdGraphPin*>::TConstIterator Links(InGraphPin->LinkedTo); Links; ++Links)
{
UEdGraphPin* Pin = *Links;
FString TitleString = Pin->GetOwningNode()->GetNodeTitle(ENodeTitleType::ListView).ToString();
FText Title = FText::FromString( TitleString );
if ( Pin->PinName != TEXT("") )
{
TitleString = FString::Printf(TEXT("%s (%s)"), *TitleString, *Pin->PinName);
// Add name of connection if possible
FFormatNamedArguments Args;
Args.Add( TEXT("NodeTitle"), Title );
Args.Add( TEXT("PinName"), Pin->GetDisplayName() );
Title = FText::Format( LOCTEXT("BreakDescPin", "{NodeTitle} ({PinName})"), Args );
}
uint32 &Count = LinkTitleCount.FindOrAdd( TitleString );
FText Description;
FFormatNamedArguments Args;
Args.Add( TEXT("NodeTitle"), Title );
Args.Add( TEXT("NumberOfNodes"), Count );
if ( Count == 0 )
{
Description = FText::Format( LOCTEXT("BreakDesc", "Break link to {NodeTitle}"), Args );
}
else
{
Description = FText::Format( LOCTEXT("BreakDescMulti", "Break link to {NodeTitle} ({NumberOfNodes})"), Args );
}
++Count;
MenuBuilder.AddMenuEntry( Description, Description, FSlateIcon(), FUIAction(
FExecuteAction::CreateUObject((USoundClassGraphSchema*const)this, &USoundClassGraphSchema::BreakSinglePinLink, const_cast< UEdGraphPin* >(InGraphPin), *Links) ) );
}
}
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:43,代码来源:EdGraphSchema_BehaviorTreeDecorator.cpp
示例7: DiffR_PinDefaultValueChanged
/** Diff result when a pin default value was changed, and is in use*/
static void DiffR_PinDefaultValueChanged(FDiffResults& Results, class UEdGraphPin* Pin2, class UEdGraphPin* Pin1)
{
if(Results)
{
FDiffSingleResult Diff;
Diff.Diff = EDiffType::PIN_DEFAULT_VALUE;
Diff.Pin1 = Pin1;
Diff.Pin2 = Pin2;
FFormatNamedArguments Args;
Args.Add(TEXT("PinNameForValue1"), FText::FromString(Pin2->PinName));
Args.Add(TEXT("PinValue1"), FText::FromString(Pin1->GetDefaultAsString()));
Args.Add(TEXT("PinValue2"), FText::FromString(Pin2->GetDefaultAsString()));
Diff.ToolTip = FText::Format(LOCTEXT("DIF_PinDefaultValueToolTip", "Pin '{PinNameForValue1}' Default Value was '{PinValue1}', but is now '{PinValue2}"), Args);
Diff.DisplayColor = FLinearColor(0.665f,0.13f,0.455f);
Diff.DisplayString = FText::Format(LOCTEXT("DIF_PinDefaultValue", "Pin Default '{PinNameForValue1}' '{PinValue1}' -> '{PinValue2}']"), Args);
Results.Add(Diff);
}
}
示例8: SNew
virtual TSharedRef<SWidget> GenerateWidgetForColumn( const FName& ColumnName )
{
if ( ColumnName == DeleteAssetsView::ColumnID_Asset )
{
return SNew( SHorizontalBox )
+ SHorizontalBox::Slot()
.AutoWidth()
.Padding( 3, 0, 0, 0 )
[
SNew( STextBlock )
.Text(FText::FromString(Item->GetObject()->GetName()))
];
}
else if ( ColumnName == DeleteAssetsView::ColumnID_AssetClass )
{
return SNew( STextBlock )
.Text(FText::FromString(Item->GetObject()->GetClass()->GetName()));
}
else if ( ColumnName == DeleteAssetsView::ColumnID_DiskReferences )
{
FFormatNamedArguments Args;
Args.Add( TEXT( "AssetCount" ), FText::AsNumber( Item->RemainingDiskReferences ) );
FText OnDiskCountText = Item->RemainingDiskReferences > 1 ? FText::Format( LOCTEXT( "OnDiskReferences", "{AssetCount} References" ), Args ) : FText::Format( LOCTEXT( "OnDiskReference", "{AssetCount} Reference" ), Args );
return SNew( STextBlock )
.Text( OnDiskCountText )
.Visibility( Item->RemainingDiskReferences > 0 ? EVisibility::Visible : EVisibility::Hidden );
}
else if ( ColumnName == DeleteAssetsView::ColumnID_MemoryReferences )
{
FFormatNamedArguments Args;
Args.Add( TEXT( "ReferenceCount" ), FText::AsNumber( Item->RemainingMemoryReferences ) );
FText InMemoryCountText = Item->RemainingMemoryReferences > 1 ? FText::Format( LOCTEXT( "InMemoryReferences", "{ReferenceCount} References" ), Args ) : FText::Format( LOCTEXT( "OnDiskReference", "{ReferenceCount} Reference" ), Args );
return SNew( STextBlock )
.Text( InMemoryCountText )
.Visibility( Item->RemainingMemoryReferences > 0 ? EVisibility::Visible : EVisibility::Hidden );
}
return SNullWidget::NullWidget;
}
示例9: CheckForErrors
void UPhysicsConstraintComponent::CheckForErrors()
{
Super::CheckForErrors();
UPrimitiveComponent* PrimComp1 = GetComponentInternal(EConstraintFrame::Frame1);
UPrimitiveComponent* PrimComp2 = GetComponentInternal(EConstraintFrame::Frame2);
// Check we have something to joint
if( PrimComp1 == NULL && PrimComp2 == NULL )
{
FFormatNamedArguments Arguments;
Arguments.Add(TEXT("OwnerName"), FText::FromString(GetNameSafe(GetOwner())));
FMessageLog("MapCheck").Warning()
->AddToken(FUObjectToken::Create(this))
->AddToken(FTextToken::Create(FText::Format( LOCTEXT("NoComponentsFound","{OwnerName} : No components found to joint."), Arguments ) ));
}
// Make sure constraint components are not both static.
else if ( PrimComp1 != NULL && PrimComp2 != NULL )
{
if ( PrimComp1->Mobility != EComponentMobility::Movable && PrimComp2->Mobility != EComponentMobility::Movable )
{
FFormatNamedArguments Arguments;
Arguments.Add(TEXT("OwnerName"), FText::FromString(GetNameSafe(GetOwner())));
FMessageLog("MapCheck").Warning()
->AddToken(FUObjectToken::Create(this))
->AddToken(FTextToken::Create(FText::Format( LOCTEXT("BothComponentsStatic","{OwnerName} : Both components are static."), Arguments ) ));
}
}
else
{
// At this point, we know one constraint component is NULL and the other is non-NULL.
// Check that the non-NULL constraint component is dynamic.
if ( ( PrimComp1 == NULL && PrimComp2->Mobility != EComponentMobility::Movable ) ||
( PrimComp2 == NULL && PrimComp1->Mobility != EComponentMobility::Movable ) )
{
FFormatNamedArguments Arguments;
Arguments.Add(TEXT("OwnerName"), FText::FromString(GetNameSafe(GetOwner())));
FMessageLog("MapCheck").Warning()
->AddToken(FUObjectToken::Create(this))
->AddToken(FTextToken::Create(FText::Format( LOCTEXT("SingleStaticComponent","{OwnerName} : Connected to single static component."), Arguments ) ));
}
}
}
示例10: SetNotificationText
void FLandscapeTextureBakingNotificationImpl::SetNotificationText(const TSharedPtr<SNotificationItem>& InNotificationItem) const
{
if (ALandscapeProxy::TotalComponentsNeedingTextureBaking > 0)
{
FFormatNamedArguments Args;
Args.Add(TEXT("OutstandingTextures"), FText::AsNumber(ALandscapeProxy::TotalComponentsNeedingTextureBaking));
const FText ProgressMessage = FText::Format(NSLOCTEXT("TextureBaking", "TextureBakingFormat", "Baking Landscape Textures ({OutstandingTextures})"), Args);
InNotificationItem->SetText(ProgressMessage);
}
}
示例11: ArePinsCompatible
bool UMaterialGraphSchema::ArePinsCompatible(const UEdGraphPin* InputPin, const UEdGraphPin* OutputPin, FText& ResponseMessage) const
{
UMaterialGraphNode_Base* InputNode = CastChecked<UMaterialGraphNode_Base>(InputPin->GetOwningNode());
UMaterialGraphNode* OutputNode = CastChecked<UMaterialGraphNode>(OutputPin->GetOwningNode());
uint32 InputType = InputNode->GetInputType(InputPin);
uint32 OutputType = OutputNode->GetOutputType(OutputPin);
bool bPinsCompatible = CanConnectMaterialValueTypes(InputType, OutputType);
if (!bPinsCompatible)
{
TArray<FText> InputDescriptions;
TArray<FText> OutputDescriptions;
GetMaterialValueTypeDescriptions(InputType, InputDescriptions);
GetMaterialValueTypeDescriptions(OutputType, OutputDescriptions);
FString CombinedInputDescription;
FString CombinedOutputDescription;
for (int32 Index = 0; Index < InputDescriptions.Num(); ++Index)
{
if ( CombinedInputDescription.Len() > 0 )
{
CombinedInputDescription += TEXT(", ");
}
CombinedInputDescription += InputDescriptions[Index].ToString();
}
for (int32 Index = 0; Index < OutputDescriptions.Num(); ++Index)
{
if ( CombinedOutputDescription.Len() > 0 )
{
CombinedOutputDescription += TEXT(", ");
}
CombinedOutputDescription += OutputDescriptions[Index].ToString();
}
FFormatNamedArguments Args;
Args.Add( TEXT("InputType"), FText::FromString(CombinedInputDescription) );
Args.Add( TEXT("OutputType"), FText::FromString(CombinedOutputDescription) );
ResponseMessage = FText::Format( LOCTEXT("IncompatibleDesc", "{OutputType} is not compatible with {InputType}"), Args );
}
return bPinsCompatible;
}
示例12: GetInputText
/**
* Returns the friendly, localized string name of this key binding
* @todo Slate: Got to be a better way to do this
*/
FText FInputChord::GetInputText( ) const
{
#if PLATFORM_MAC
const FText CommandText = LOCTEXT("KeyName_Control", "Ctrl");
const FText ControlText = LOCTEXT("KeyName_Command", "Cmd");
#else
const FText ControlText = LOCTEXT("KeyName_Control", "Ctrl");
const FText CommandText = LOCTEXT("KeyName_Command", "Cmd");
#endif
const FText AltText = LOCTEXT("KeyName_Alt", "Alt");
const FText ShiftText = LOCTEXT("KeyName_Shift", "Shift");
const FText AppenderText = LOCTEXT("ModAppender", "+");
FFormatNamedArguments Args;
int32 ModCount = 0;
if (bCtrl)
{
Args.Add(FString::Printf(TEXT("Mod%d"),++ModCount), ControlText);
}
if (bCmd)
{
Args.Add(FString::Printf(TEXT("Mod%d"),++ModCount), CommandText);
}
if (bAlt)
{
Args.Add(FString::Printf(TEXT("Mod%d"),++ModCount), AltText);
}
if (bShift)
{
Args.Add(FString::Printf(TEXT("Mod%d"),++ModCount), ShiftText);
}
for (int32 i = 1; i <= 4; ++i)
{
if (i > ModCount)
{
Args.Add(FString::Printf(TEXT("Mod%d"), i), FText::GetEmpty());
Args.Add(FString::Printf(TEXT("Appender%d"), i), FText::GetEmpty());
}
else
{
Args.Add(FString::Printf(TEXT("Appender%d"), i), AppenderText);
}
}
Args.Add(TEXT("Key"), GetKeyText());
return FText::Format(LOCTEXT("FourModifiers", "{Mod1}{Appender1}{Mod2}{Appender2}{Mod3}{Appender3}{Mod4}{Appender4}{Key}"), Args);
}
示例13:
FText UK2Node_DelegateSet::GetNodeTitle(ENodeTitleType::Type TitleType) const
{
if (CachedNodeTitle.IsOutOfDate(this))
{
FFormatNamedArguments Args;
Args.Add(TEXT("DelegatePropertyName"), FText::FromName(DelegatePropertyName));
// FText::Format() is slow, so we cache this to save on performance
CachedNodeTitle.SetCachedText(FText::Format(NSLOCTEXT("K2Node", "Assign_Name", "Assign {DelegatePropertyName}"), Args), this);
}
return CachedNodeTitle;
}
示例14:
FText UK2Node_StructMemberGet::GetNodeTitle(ENodeTitleType::Type TitleType) const
{
if (CachedNodeTitle.IsOutOfDate(this))
{
FFormatNamedArguments Args;
Args.Add(TEXT("VariableName"), FText::FromString(GetVarNameString()));
// FText::Format() is slow, so we cache this to save on performance
CachedNodeTitle.SetCachedText(FText::Format(LOCTEXT("GetMembersInVariable", "Get members in {VariableName}"), Args), this);
}
return CachedNodeTitle;
}
示例15:
FText UK2Node_TemporaryVariable::GetTooltipText() const
{
if (CachedTooltip.IsOutOfDate(this))
{
FFormatNamedArguments Args;
Args.Add(TEXT("VariableType"), UEdGraphSchema_K2::TypeToText(VariableType));
// FText::Format() is slow, so we cache this to save on performance
CachedTooltip.SetCachedText(FText::Format(NSLOCTEXT("K2Node", "LocalTemporaryVariable_Tooltip", "Local temporary {VariableType} variable"), Args), this);
}
return CachedTooltip;
}