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


C++ FText::EqualTo方法代码示例

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


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

示例1: DroppedOnCategory

FReply FKismetVariableDragDropAction::DroppedOnCategory(FText Category)
{
	UE_LOG(LogTemp, Log, TEXT("Dropped %s on Category %s"), *VariableName.ToString(), *Category.ToString());

	UBlueprint* BP = NULL;
	if(VariableSource.Get()->IsA(UFunction::StaticClass()))
	{
		BP = UBlueprint::GetBlueprintFromClass(Cast<UClass>(VariableSource.Get()->GetOuter()));
	}
	else
	{
		BP = UBlueprint::GetBlueprintFromClass(Cast<UClass>(VariableSource.Get()));
	}

	if(BP != NULL)
	{
		// Check this is actually a different category
		FText CurrentCategory = FBlueprintEditorUtils::GetBlueprintVariableCategory(BP, VariableName, GetLocalVariableScope());
		if(!Category.EqualTo(CurrentCategory))
		{
			FBlueprintEditorUtils::SetBlueprintVariableCategory(BP, VariableName, GetLocalVariableScope(), Category, false);
		}
	}

	return FReply::Handled();
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:26,代码来源:BPVariableDragDropAction.cpp

示例2: DroppedOnAction

FReply FKismetVariableDragDropAction::DroppedOnAction(TSharedRef<FEdGraphSchemaAction> Action)
{
	if(Action->GetTypeId() == FEdGraphSchemaAction_K2Var::StaticGetTypeId())
	{
		FEdGraphSchemaAction_K2Var* VarAction = (FEdGraphSchemaAction_K2Var*)&Action.Get();

		// Only let you drag and drop if variables are from same BP class, and not onto itself
		UBlueprint* BP = UBlueprint::GetBlueprintFromClass(Cast<UClass>(VariableSource.Get()));
		FName TargetVarName = VarAction->GetVariableName();
		if( (BP != NULL) && 
			(VariableName != TargetVarName) && 
			(VariableSource == VarAction->GetVariableClass()) )
		{
			bool bMoved = FBlueprintEditorUtils::MoveVariableBeforeVariable(BP, VariableName, TargetVarName, true);
			// If we moved successfully
			if(bMoved)
			{
				// Change category of var to match the one we dragged on to as well
				FText MovedVarCategory = FBlueprintEditorUtils::GetBlueprintVariableCategory(BP, VariableName, GetLocalVariableScope());
				FText TargetVarCategory = FBlueprintEditorUtils::GetBlueprintVariableCategory(BP, TargetVarName, GetLocalVariableScope());
				if(!MovedVarCategory.EqualTo(TargetVarCategory))
				{
					FBlueprintEditorUtils::SetBlueprintVariableCategory(BP, VariableName, GetLocalVariableScope(), TargetVarCategory, true);
				}

				// Update Blueprint after changes so they reflect in My Blueprint tab.
				FBlueprintEditorUtils::MarkBlueprintAsStructurallyModified(BP);
			}
		}

		return FReply::Handled();
	}
	return FReply::Unhandled();
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:34,代码来源:BPVariableDragDropAction.cpp

示例3: SetDisplayName

void UMovieSceneNameableTrack::SetDisplayName(const FText& NewDisplayName)
{
	if (NewDisplayName.EqualTo(DisplayName))
	{
		return;
	}

	SetFlags(RF_Transactional);
	Modify();

	DisplayName = NewDisplayName;
}
开发者ID:WasPedro,项目名称:UnrealEngine4.11-HairWorks,代码行数:12,代码来源:MovieSceneNameableTrack.cpp

示例4: GetCurrentMatineeName

FText FCinematicOptionsCustomization::GetCurrentMatineeName() const
{
	FText SettingName;
	Matinee->GetValueAsDisplayText(SettingName);
	for (TObjectIterator<AMatineeActor> It; It; ++It)
	{
		AMatineeActor* MatineeActor = *It;
		if (SettingName.EqualTo(FText::FromString(MatineeActor->GetName())))
		{
			return SettingName;
		}
	}

	Matinee->SetValueFromFormattedString(FString("None"));
	return FText::FromString("None");
}
开发者ID:serioussam909,项目名称:UE4-DialogueSystem,代码行数:16,代码来源:ShowPhrasesCustomization.cpp

示例5: EqualEqual_TextText

bool UKismetTextLibrary::EqualEqual_TextText(const FText& A, const FText& B)
{
	return A.EqualTo( B );
}
开发者ID:WasPedro,项目名称:UnrealEngine4.11-HairWorks,代码行数:4,代码来源:KismetTextLibrary.cpp

示例6: ExecuteUnitTest


//.........这里部分代码省略.........
	// FString property writing
	{
		FString TargetResult = TEXT("Expected");
		UVMTestClassA* TestObj = NewObject<UVMTestClassA>();

		TestObj->StringProp = TEXT("NotExpected");

		bool bError = false;
		FString* Result = (FString*)(FVMReflection(TestObj)->*"StringProp", &bError);

		if (!bError && Result != NULL)
		{
			*Result = TargetResult;
		}

		TestResults.Add(TEXT("FString Writing"), (!bError && TestObj->StringProp == TargetResult));
	}



	// FText property reading
	{
		FText TargetResult = FText::FromString(TEXT("TargetResult"));
		UVMTestClassA* TestObj = NewObject<UVMTestClassA>();

		if (TestObj != NULL)
		{
			TestObj->TextProp = TargetResult;
		}

		bool bError = false;
		FText Result = (FText)(FVMReflection(TestObj)->*"TextProp", &bError);

		TestResults.Add(TEXT("FText Reading"), (!bError && Result.EqualTo(TargetResult)));
	}

	// FText property writing
	{
		FText TargetResult = FText::FromString(TEXT("Expected"));
		UVMTestClassA* TestObj = NewObject<UVMTestClassA>();

		TestObj->TextProp = FText::FromString(TEXT("NotExpected"));

		bool bError = false;
		FText* Result = (FText*)(FVMReflection(TestObj)->*"TextProp", &bError);

		if (!bError && Result != NULL)
		{
			*Result = TargetResult;
		}

		TestResults.Add(TEXT("FText Writing"), (!bError && TestObj->TextProp.EqualTo(TargetResult)));
	}



	/**
	 * Array unit tests
	 */

	// Bad static array access (no element selected)
	{
		UVMTestClassA* TestObj = NewObject<UVMTestClassA>();
		bool bError = false;

		(void)(uint8)((FVMReflection(TestObj)->*"BytePropArray")["uint8"], &bError);
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:67,代码来源:VMReflection.cpp

示例7: HoverTargetChanged


//.........这里部分代码省略.........
		FText Category;
		UBlueprint* Blueprint;
		
		// Find the Blueprint for this property
		if(Cast<UFunction>(VariableSource.Get()))
		{
			Blueprint = UBlueprint::GetBlueprintFromClass(Cast<UClass>(VariableSource->GetOuter()));
		}
		else
		{
			Blueprint = UBlueprint::GetBlueprintFromClass(Cast<UClass>(VariableSource.Get()));
		}

		if(Blueprint != NULL)
		{
			Category = FBlueprintEditorUtils::GetBlueprintVariableCategory(Blueprint, VariableProperty->GetFName(), GetLocalVariableScope() );
		}

		// See if class is native
		UClass* OuterClass = Cast<UClass>(VariableProperty->GetOuter());
		if(OuterClass || Cast<UFunction>(VariableProperty->GetOuter()))
		{
			const bool bIsNativeVar = (OuterClass && OuterClass->ClassGeneratedBy == NULL);

			FFormatNamedArguments Args;
			Args.Add(TEXT("VariableName"), FText::FromString(VariableString));
			Args.Add(TEXT("HoveredCategoryName"), HoveredCategoryName);

			if (bIsNativeVar)
			{
				StatusSymbol = FEditorStyle::GetBrush(TEXT("Graph.ConnectorFeedback.Error"));
				Message = FText::Format( LOCTEXT("ChangingCatagoryNotThisVar", "Cannot change category for variable '{VariableName}'"), Args );
			}
			else if (Category.EqualTo(HoveredCategoryName))
			{
				StatusSymbol = FEditorStyle::GetBrush(TEXT("Graph.ConnectorFeedback.Error"));
				Message = FText::Format( LOCTEXT("ChangingCatagoryAlreadyIn", "Variable '{VariableName}' is already in category '{HoveredCategoryName}'"), Args );
			}
			else
			{
				StatusSymbol = FEditorStyle::GetBrush(TEXT("Graph.ConnectorFeedback.OK"));
				Message = FText::Format( LOCTEXT("ChangingCatagoryOk", "Move variable '{VariableName}' to category '{HoveredCategoryName}'"), Args );
			}
		}
	}
	else if (HoveredAction.IsValid())
	{
		if(HoveredAction.Pin()->GetTypeId() == FEdGraphSchemaAction_K2Var::StaticGetTypeId())
		{
			FEdGraphSchemaAction_K2Var* VarAction = (FEdGraphSchemaAction_K2Var*)HoveredAction.Pin().Get();
			FName TargetVarName = VarAction->GetVariableName();

			// Needs to have a valid index to move it (this excludes variables added through other means, like timelines/components
			int32 MoveVarIndex = INDEX_NONE;
			int32 TargetVarIndex = INDEX_NONE;
			UBlueprint* Blueprint = UBlueprint::GetBlueprintFromClass(Cast<UClass>(VariableSource.Get()));
			if(Blueprint != NULL)
			{
				MoveVarIndex = FBlueprintEditorUtils::FindNewVariableIndex(Blueprint, VariableName);
				TargetVarIndex = FBlueprintEditorUtils::FindNewVariableIndex(Blueprint, TargetVarName);
			}

			FFormatNamedArguments Args;
			Args.Add(TEXT("VariableName"), FText::FromString(VariableString));
			Args.Add(TEXT("TargetVarName"), FText::FromName(TargetVarName));
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:66,代码来源:BPVariableDragDropAction.cpp


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