当前位置: 首页>>代码示例>>C++>>正文


C++ FFormatNamedArguments类代码示例

本文整理汇总了C++中FFormatNamedArguments的典型用法代码示例。如果您正苦于以下问题:C++ FFormatNamedArguments类的具体用法?C++ FFormatNamedArguments怎么用?C++ FFormatNamedArguments使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了FFormatNamedArguments类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ToText

FText FEnvDirection::ToText() const
{
	if(DirMode == EEnvDirection::TwoPoints)
	{
		FFormatNamedArguments Args;
		Args.Add(TEXT("LineFrom"), UEnvQueryTypes::DescribeContext(LineFrom));
		Args.Add(TEXT("LineTo"), UEnvQueryTypes::DescribeContext(LineTo));

		return FText::Format(LOCTEXT("DescribeLineFromAndTo", "[{LineFrom} - {LineTo}]"), Args);
	}
	else
	{
		FFormatNamedArguments Args;
		Args.Add(TEXT("Rotation"), UEnvQueryTypes::DescribeContext(Rotation));

		return FText::Format(LOCTEXT("DescribeRotation", "[{Rotation} rotation]"), Args);
	}
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:18,代码来源:EnvQueryTypes.cpp

示例2: LOCTEXT

FText UAnimGraphNode_BlendListByEnum::GetNodeTitle(ENodeTitleType::Type TitleType) const
{
	if (BoundEnum == nullptr)
	{
		return LOCTEXT("AnimGraphNode_BlendListByEnum_TitleError", "ERROR: Blend Poses (by missing enum)");
	}
	// @TODO: don't know enough about this node type to comfortably assert that
	//        the BoundEnum won't change after the node has spawned... until
	//        then, we'll leave this optimization off
	else //if (CachedNodeTitle.IsOutOfDate())
	{
		FFormatNamedArguments Args;
		Args.Add(TEXT("EnumName"), FText::FromString(BoundEnum->GetName()));
		// FText::Format() is slow, so we cache this to save on performance
		CachedNodeTitle = FText::Format(LOCTEXT("AnimGraphNode_BlendListByEnum_Title", "Blend Poses ({EnumName})"), Args);
	}
	return CachedNodeTitle;
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:18,代码来源:AnimGraphNode_BlendListByEnum.cpp

示例3: DiffR_NodeCommentChanged

/** Diff result when a node comment was changed */
static void DiffR_NodeCommentChanged(FDiffResults& Results, class UEdGraphNode* Node, class UEdGraphNode* Node2)
{
	if(Results)
	{
		FDiffSingleResult Diff;
		Diff.Diff = EDiffType::NODE_COMMENT;
		Diff.Node1 = Node;
		Diff.Node2 = Node2;

		FFormatNamedArguments Args;
		Args.Add(TEXT("NodeTitle"), Node->GetNodeTitle(ENodeTitleType::ListView));
		Diff.ToolTip =  FText::Format(LOCTEXT("DIF_CommentModified", "Comment Modified Node '{NodeTitle}'"), Args);

		Diff.DisplayString = Diff.ToolTip;
		Diff.DisplayColor = FLinearColor(0.25f,0.4f,0.5f);
		Results.Add(Diff);
	}
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:19,代码来源:GraphDiffControl.cpp

示例4: GetTargetPin

FText UK2Node_VariableSetRef::GetNodeTitle(ENodeTitleType::Type TitleType) const
{
	const UEdGraphSchema_K2* Schema = GetDefault<UEdGraphSchema_K2>();

	UEdGraphPin* TargetPin = GetTargetPin();
	if ((TargetPin == nullptr) || (TargetPin->PinType.PinCategory == Schema->PC_Wildcard))
	{
		return NSLOCTEXT("K2Node", "SetRefVarNodeTitle", "Set By-Ref Var");
	}
	else if (CachedNodeTitle.IsOutOfDate())
	{
		FFormatNamedArguments Args;
		Args.Add(TEXT("PinType"), Schema->TypeToText(TargetPin->PinType));
		// FText::Format() is slow, so we cache this to save on performance
		CachedNodeTitle = FText::Format(NSLOCTEXT("K2Node", "SetRefVarNodeTitle_Typed", "Set {PinType}"), Args);
	}
	return CachedNodeTitle;
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:18,代码来源:K2Node_VariableSetRef.cpp

示例5: DiffR_NodeMoved

/** Diff result when a node was moved on the graph */
static void DiffR_NodeMoved(FDiffResults& Results, UEdGraphNode* Node, class UEdGraphNode* OtherNode)
{
	if(Results)
	{
		FDiffSingleResult Diff;
		Diff.Diff = EDiffType::NODE_MOVED;
		Diff.Node1 = Node;
		Diff.Node2 = OtherNode;

		FFormatNamedArguments Args;
		Args.Add(TEXT("NodeTitle"), Node->GetNodeTitle(ENodeTitleType::ListView));
		Diff.ToolTip = FText::Format(LOCTEXT("DIF_MoveNode", "Moved Node '{NodeTitle}'"), Args);

		Diff.DisplayString = Diff.ToolTip;
		Diff.DisplayColor = FLinearColor(0.9f, 0.84f, 0.43f);
		Results.Add(Diff);
	}
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:19,代码来源:GraphDiffControl.cpp

示例6: GetDescriptionForObject

FText FAssetEditorToolkit::GetDescriptionForObject(const UObject* InObject)
{
	const bool bDirtyState = InObject->GetOutermost()->IsDirty();
	FString NameString;
	if(const AActor* ObjectAsActor = Cast<AActor>(InObject))
	{
		NameString = ObjectAsActor->GetActorLabel();
	}
	else
	{
		NameString = InObject->GetName();
	}

	FFormatNamedArguments Args;
	Args.Add( TEXT("ObjectName"), FText::FromString( NameString ));
	Args.Add( TEXT("DirtyState"), bDirtyState ? FText::FromString( TEXT( "*" ) ) : FText::GetEmpty() );
	return FText::Format( LOCTEXT("AssetEditorAppLabel", "{ObjectName}{DirtyState}"), Args );
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:18,代码来源:AssetEditorToolkit.cpp

示例7: FName

/** UI_COMMAND takes long for the compile to optimize */
PRAGMA_DISABLE_OPTIMIZATION
void FLevelEditorModesCommands::RegisterCommands()
{
	EditorModeCommands.Empty();

	int editorMode = 0;
	FKey EdModeKeys[9] = { EKeys::One, EKeys::Two, EKeys::Three, EKeys::Four, EKeys::Five, EKeys::Six, EKeys::Seven, EKeys::Eight, EKeys::Nine };

	for ( const FEditorModeInfo& Mode : FEditorModeRegistry::Get().GetSortedModeInfo() )
	{
		// If the mode isn't visible don't create a menu option for it.
		if (!Mode.bVisible)
		{
			continue;
		}

		FName EditorModeCommandName = FName(*(FString("EditorMode.") + Mode.ID.ToString()));

		TSharedPtr<FUICommandInfo> EditorModeCommand = 
			FInputBindingManager::Get().FindCommandInContext(GetContextName(), EditorModeCommandName);

		// If a command isn't yet registered for this mode, we need to register one.
		if ( !EditorModeCommand.IsValid() )
		{
			FFormatNamedArguments Args;
			Args.Add( TEXT("Mode"), Mode.Name );
			const FText Tooltip = FText::Format( NSLOCTEXT("LevelEditor", "ModeTooltipF", "Activate {Mode} Editing Mode"), Args );

			FUICommandInfo::MakeCommandInfo(
				this->AsShared(),
				EditorModeCommand,
				EditorModeCommandName,
				Mode.Name,
				Tooltip,
				Mode.IconBrush,
				EUserInterfaceActionType::ToggleButton,
				editorMode < 9 ? FInputChord( EModifierKey::Shift, EdModeKeys[editorMode] ) : FInputChord() );

			EditorModeCommands.Add(EditorModeCommand);
		}

		editorMode++;
	}
}
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:45,代码来源:LevelEditorModesActions.cpp

示例8: CreateWorker

ECommandResult::Type FSubversionSourceControlProvider::Execute( const TSharedRef<ISourceControlOperation, ESPMode::ThreadSafe>& InOperation, const TArray<FString>& InFiles, EConcurrency::Type InConcurrency, const FSourceControlOperationComplete& InOperationCompleteDelegate )
{
	if(!IsEnabled())
	{
		return ECommandResult::Failed;
	}

	if(!SubversionSourceControlUtils::CheckFilenames(InFiles))
	{
		return ECommandResult::Failed;
	}

	TArray<FString> AbsoluteFiles = SourceControlHelpers::AbsoluteFilenames(InFiles);

	// Query to see if the we allow this operation
	TSharedPtr<ISubversionSourceControlWorker, ESPMode::ThreadSafe> Worker = CreateWorker(InOperation->GetName());
	if(!Worker.IsValid())
	{
		// this operation is unsupported by this source control provider
		FFormatNamedArguments Arguments;
		Arguments.Add( TEXT("OperationName"), FText::FromName(InOperation->GetName()) );
		Arguments.Add( TEXT("ProviderName"), FText::FromName(GetName()) );
		FMessageLog("SourceControl").Error(FText::Format(LOCTEXT("UnsupportedOperation", "Operation '{OperationName}' not supported by source control provider '{ProviderName}'"), Arguments));
		return ECommandResult::Failed;
	}

	// fire off operation
	if(InConcurrency == EConcurrency::Synchronous)
	{
		FSubversionSourceControlCommand* Command = new FSubversionSourceControlCommand(InOperation, Worker.ToSharedRef());
		Command->bAutoDelete = false;
		Command->Files = AbsoluteFiles;
		Command->OperationCompleteDelegate = InOperationCompleteDelegate;
		return ExecuteSynchronousCommand(*Command, InOperation->GetInProgressString(), true);
	}
	else
	{
		FSubversionSourceControlCommand* Command = new FSubversionSourceControlCommand(InOperation, Worker.ToSharedRef());
		Command->bAutoDelete = true;
		Command->Files = AbsoluteFiles;
		Command->OperationCompleteDelegate = InOperationCompleteDelegate;
		return IssueCommand(*Command, false);
	}
}
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:44,代码来源:SubversionSourceControlProvider.cpp

示例9: MenuBuilder

TSharedRef<SWidget> SSourceControlPicker::OnGetMenuContent() const
{
	FSourceControlModule& SourceControlModule = FSourceControlModule::Get();

	SourceControlModule.RefreshSourceControlProviders();

	FMenuBuilder MenuBuilder(true, NULL);

	// Get the provider names first so that we can sort them for the UI
	TArray< TPair<FName, int32> > SortedProviderNames;
	const int NumProviders = SourceControlModule.GetNumSourceControlProviders();
	SortedProviderNames.Reserve(NumProviders);
	for(int ProviderIndex = 0; ProviderIndex < NumProviders; ++ProviderIndex)
	{
		const FName ProviderName = SourceControlModule.GetSourceControlProviderName(ProviderIndex);
		SortedProviderNames.Add(TPairInitializer<FName, int32>(ProviderName, ProviderIndex));
	}

	// Sort based on the provider name
	SortedProviderNames.Sort([](const TPair<FName, int32>& One, const TPair<FName, int32>& Two)
	{
		return One.Key < Two.Key;
	});

	for(auto SortedProviderNameIter = SortedProviderNames.CreateConstIterator(); SortedProviderNameIter; ++SortedProviderNameIter)
	{
		const FText ProviderText = GetProviderText(SortedProviderNameIter->Key);
		const int32  ProviderIndex = SortedProviderNameIter->Value;

		FFormatNamedArguments Arguments;
		Arguments.Add( TEXT("ProviderName"), ProviderText );
		MenuBuilder.AddMenuEntry(
			ProviderText,
			FText::Format(LOCTEXT("SourceControlProvider_Tooltip", "Use {ProviderName} as source control provider"), Arguments),
			FSlateIcon(),
			FUIAction(
				FExecuteAction::CreateSP( this, &SSourceControlPicker::ChangeSourceControlProvider, ProviderIndex ),
				FCanExecuteAction()
				)
			);
	}

	return MenuBuilder.MakeWidget();
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:44,代码来源:SSourceControlPicker.cpp

示例10: 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);
}
开发者ID:PopCap,项目名称:GameIdea,代码行数:44,代码来源:K2Node_VariableGet.cpp

示例11: GetBaseClassPin

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;
}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:19,代码来源:K2Node_LiveEditObject.cpp

示例12: GetEditingObjects

FText FSimpleAssetEditor::GetToolkitName() const
{
	const auto EditingObjects = GetEditingObjects();

	check( EditingObjects.Num() > 0 );

	FFormatNamedArguments Args;
	Args.Add( TEXT("ToolkitName"), GetBaseToolkitName() );

	if( EditingObjects.Num() == 1 )
	{
		const UObject* EditingObject = EditingObjects[ 0 ];

		const bool bDirtyState = EditingObject->GetOutermost()->IsDirty();

		Args.Add( TEXT("ObjectName"), FText::FromString( EditingObject->GetName() ) );
		Args.Add( TEXT("DirtyState"), bDirtyState ? FText::FromString( TEXT( "*" ) ) : FText::GetEmpty() );
		return FText::Format( LOCTEXT("ToolkitTitle", "{ObjectName}{DirtyState} - {ToolkitName}"), Args );
	}
	else
	{
		bool bDirtyState = false;
		UClass* SharedBaseClass = NULL;
		for( int32 x = 0; x < EditingObjects.Num(); ++x )
		{
			UObject* Obj = EditingObjects[ x ];
			check( Obj );

			UClass* ObjClass = Cast<UClass>(Obj);
			if (ObjClass == NULL)
			{
				ObjClass = Obj->GetClass();
			}
			check( ObjClass );

			// Initialize with the class of the first object we encounter.
			if( SharedBaseClass == NULL )
			{
				SharedBaseClass = ObjClass;
			}

			// If we've encountered an object that's not a subclass of the current best baseclass,
			// climb up a step in the class hierarchy.
			while( !ObjClass->IsChildOf( SharedBaseClass ) )
			{
				SharedBaseClass = SharedBaseClass->GetSuperClass();
			}

			// If any of the objects are dirty, flag the label
			bDirtyState |= Obj->GetOutermost()->IsDirty();
		}

		Args.Add( TEXT("NumberOfObjects"), EditingObjects.Num() );
		Args.Add( TEXT("ClassName"), FText::FromString( SharedBaseClass->GetName() ) );
		Args.Add( TEXT("DirtyState"), bDirtyState ? FText::FromString( TEXT( "*" ) ) : FText::GetEmpty() );
		return FText::Format( LOCTEXT("ToolkitTitle_EditingMultiple", "{NumberOfObjects} {ClassName}{DirtyState} - {ToolkitName}"), Args );
	}
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:58,代码来源:SimpleAssetEditor.cpp

示例13: LOCTEXT

FText UK2Node_Composite::GetNodeTitle(ENodeTitleType::Type TitleType) const
{
	if (BoundGraph == nullptr)
	{
		return LOCTEXT("InvalidGraph", "Invalid Graph");
	}
	else if (TitleType != ENodeTitleType::FullTitle)
	{
		return FText::FromString(BoundGraph->GetName());
	}
	else if (CachedNodeTitle.IsOutOfDate(this)) // TitleType == ENodeTitleType::FullTitle
	{
		FFormatNamedArguments Args;
		Args.Add(TEXT("BoundGraphName"), (BoundGraph) ? FText::FromString(BoundGraph->GetName()) : LOCTEXT("InvalidGraph", "Invalid Graph"));
		// FText::Format() is slow, so we cache this to save on performance
		CachedNodeTitle.SetCachedText(FText::Format(LOCTEXT("Collapsed_Name", "{BoundGraphName}\nCollapsed Graph"), Args), this);
	}
	return CachedNodeTitle;
}
开发者ID:johndpope,项目名称:UE4,代码行数:19,代码来源:K2Node_Composite.cpp

示例14: check

void FWorldTileModel::FixupStreamingObjects()
{
	check(LoadedLevel != NULL);

	// Remove streaming levels that is not part of our world
	UWorld* LevelWorld = CastChecked<UWorld>(LoadedLevel->GetOuter());
	for(int32 LevelIndex = LevelWorld->StreamingLevels.Num() - 1; LevelIndex >= 0; --LevelIndex)
	{
		FName StreamingPackageName = LevelWorld->StreamingLevels[LevelIndex]->PackageName;
		TSharedPtr<FLevelModel> LevelModel = LevelCollectionModel.FindLevelModel(StreamingPackageName);
		if (!LevelModel.IsValid())
		{
			LevelWorld->StreamingLevels.RemoveAt(LevelIndex);
			FFormatNamedArguments Arguments;
			Arguments.Add(TEXT("LevelName"), FText::FromName(StreamingPackageName));
			FMessageLog("MapCheck").Warning(FText::Format( LOCTEXT("MapCheck_Message_InvalidStreamingLevel", "Streaming level '{LevelName}' is not under the current world root. Fixed by removing from streaming list."), Arguments ) );
		}
	}
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:19,代码来源:WorldTileModel.cpp

示例15: if

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;
}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:19,代码来源:K2Node_ActorBoundEvent.cpp


注:本文中的FFormatNamedArguments类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。