本文整理汇总了C++中UProperty::SetFlags方法的典型用法代码示例。如果您正苦于以下问题:C++ UProperty::SetFlags方法的具体用法?C++ UProperty::SetFlags怎么用?C++ UProperty::SetFlags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UProperty
的用法示例。
在下文中一共展示了UProperty::SetFlags方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateVariables
static void CreateVariables(UUserDefinedStruct* Struct, const class UEdGraphSchema_K2* Schema, FCompilerResultsLog& MessageLog)
{
check(Struct && Schema);
//FKismetCompilerUtilities::LinkAddedProperty push property to begin, so we revert the order
for (int32 VarDescIdx = FStructureEditorUtils::GetVarDesc(Struct).Num() - 1; VarDescIdx >= 0; --VarDescIdx)
{
FStructVariableDescription& VarDesc = FStructureEditorUtils::GetVarDesc(Struct)[VarDescIdx];
VarDesc.bInvalidMember = true;
FEdGraphPinType VarType = VarDesc.ToPinType();
FString ErrorMsg;
if(!FStructureEditorUtils::CanHaveAMemberVariableOfType(Struct, VarType, &ErrorMsg))
{
LogError(Struct, MessageLog, FString::Printf(*LOCTEXT("StructureGeneric_Error", "Structure: %s Error: %s").ToString(), *Struct->GetFullName(), *ErrorMsg));
continue;
}
UProperty* NewProperty = FKismetCompilerUtilities::CreatePropertyOnScope(Struct, VarDesc.VarName, VarType, NULL, 0, Schema, MessageLog);
if (NewProperty != NULL)
{
NewProperty->SetFlags(RF_LoadCompleted);
FKismetCompilerUtilities::LinkAddedProperty(Struct, NewProperty);
}
else
{
LogError(Struct, MessageLog, FString::Printf(*LOCTEXT("VariableInvalidType_Error", "The variable %s declared in %s has an invalid type %s").ToString(),
*VarDesc.VarName.ToString(), *Struct->GetName(), *UEdGraphSchema_K2::TypeToText(VarType).ToString()));
continue;
}
NewProperty->SetPropertyFlags(CPF_Edit | CPF_BlueprintVisible);
if (VarDesc.bDontEditoOnInstance)
{
NewProperty->SetPropertyFlags(CPF_DisableEditOnInstance);
}
if (VarDesc.bEnable3dWidget)
{
NewProperty->SetMetaData(FEdMode::MD_MakeEditWidget, TEXT("true"));
}
NewProperty->SetMetaData(TEXT("DisplayName"), *VarDesc.FriendlyName);
NewProperty->SetMetaData(FBlueprintMetadata::MD_Tooltip, *VarDesc.ToolTip);
NewProperty->RepNotifyFunc = NAME_None;
if (!VarDesc.DefaultValue.IsEmpty())
{
NewProperty->SetMetaData(TEXT("MakeStructureDefaultValue"), *VarDesc.DefaultValue);
}
VarDesc.CurrentDefaultValue = VarDesc.DefaultValue;
VarDesc.bInvalidMember = false;
}
}