本文整理汇总了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();
}
示例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();
}
示例3: SetDisplayName
void UMovieSceneNameableTrack::SetDisplayName(const FText& NewDisplayName)
{
if (NewDisplayName.EqualTo(DisplayName))
{
return;
}
SetFlags(RF_Transactional);
Modify();
DisplayName = NewDisplayName;
}
示例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");
}
示例5: EqualEqual_TextText
bool UKismetTextLibrary::EqualEqual_TextText(const FText& A, const FText& B)
{
return A.EqualTo( B );
}
示例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);
示例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));