本文整理汇总了C++中UEnum类的典型用法代码示例。如果您正苦于以下问题:C++ UEnum类的具体用法?C++ UEnum怎么用?C++ UEnum使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了UEnum类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: TEXT
TSharedRef<SWidget> FTextureLODGroupLayout::MakeMipGenSettingsComboWidget(TSharedPtr<TextureMipGenSettings> InItem)
{
UEnum* TextureGroupEnum = FindObject<UEnum>(NULL, TEXT("/Script/Engine.TextureMipGenSettings"));
const FString MipGenSettingsName = TextureGroupEnum->GetMetaData(TEXT("DisplayName"), *InItem.Get());
return SNew(STextBlock).Text(FText::FromString(MipGenSettingsName)).Font(IDetailLayoutBuilder::GetDetailFont());
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:7,代码来源:TextureLODSettingsDetails.cpp
示例2: LOCTEXT
void FIntroTutorials::AddSummonBlueprintTutorialsMenuExtension(FMenuBuilder& MenuBuilder, UObject* PrimaryObject)
{
MenuBuilder.BeginSection("Tutorials", LOCTEXT("TutorialsLabel", "Tutorials"));
MenuBuilder.AddMenuEntry(
LOCTEXT("BlueprintMenuEntryTitle", "Blueprint Overview"),
LOCTEXT("BlueprintMenuEntryToolTip", "Opens up an introductory overview of Blueprints."),
FSlateIcon(FEditorStyle::GetStyleSetName(), "LevelEditor.Tutorials"),
FUIAction(FExecuteAction::CreateRaw(this, &FIntroTutorials::SummonBlueprintTutorialHome, PrimaryObject, true)));
if(PrimaryObject != nullptr)
{
UBlueprint* BP = Cast<UBlueprint>(PrimaryObject);
if(BP != nullptr)
{
UEnum* Enum = FindObject<UEnum>(ANY_PACKAGE, TEXT("EBlueprintType"), true);
check(Enum);
MenuBuilder.AddMenuEntry(
FText::Format(LOCTEXT("BlueprintTutorialsMenuEntryTitle", "{0} Tutorial"), Enum->GetEnumText(BP->BlueprintType)),
LOCTEXT("BlueprintTutorialsMenuEntryToolTip", "Opens up an introductory tutorial covering this particular part of the Blueprint editor."),
FSlateIcon(FEditorStyle::GetStyleSetName(), "LevelEditor.Tutorials"),
FUIAction(FExecuteAction::CreateRaw(this, &FIntroTutorials::SummonBlueprintTutorialHome, PrimaryObject, false)));
}
}
MenuBuilder.EndSection();
}
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:26,代码来源:IntroTutorials.cpp
示例3: TEXT
void FAbcImportSettingsCustomization::CustomizeDetails(IDetailLayoutBuilder& LayoutBuilder)
{
TSharedRef<IPropertyHandle> ImportType = LayoutBuilder.GetProperty(GET_MEMBER_NAME_CHECKED(UAbcImportSettings, ImportType));
uint8 EnumValue;
ImportType->GetValue(EnumValue);
IDetailCategoryBuilder& CompressionBuilder = LayoutBuilder.EditCategory("Compression");
CompressionBuilder.SetCategoryVisibility(EnumValue == (uint8)EAlembicImportType::Skeletal);
IDetailCategoryBuilder& StaticMeshBuilder = LayoutBuilder.EditCategory("StaticMesh");
StaticMeshBuilder.SetCategoryVisibility(EnumValue == (uint8)EAlembicImportType::StaticMesh);
FSimpleDelegate OnImportTypeChangedDelegate = FSimpleDelegate::CreateSP(this, &FAbcImportSettingsCustomization::OnImportTypeChanged, &LayoutBuilder);
ImportType->SetOnPropertyValueChanged(OnImportTypeChangedDelegate);
if (UAbcImportSettings::Get()->bReimport)
{
UEnum* ImportTypeEnum = FindObject<UEnum>(ANY_PACKAGE, TEXT("EAlembicImportType"));
static FText RestrictReason = FText::FromString("Unable to change type while reimporting");
TSharedPtr<FPropertyRestriction> EnumRestriction = MakeShareable(new FPropertyRestriction(RestrictReason));
for (uint8 EnumIndex = 0; EnumIndex < (ImportTypeEnum->GetMaxEnumValue() + 1); ++EnumIndex)
{
if (EnumValue != EnumIndex)
{
const FString RestrictValue = ImportTypeEnum->GetDisplayNameTextByValue(EnumIndex).ToString();
EnumRestriction->AddValue(RestrictValue);
}
}
ImportType->AddRestriction(EnumRestriction.ToSharedRef());
}
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:32,代码来源:AbcImportSettingsCustomization.cpp
示例4: UE_LOG
void USoundGroups::Initialize() const
{
for (int32 ProfileIndex = 0; ProfileIndex < SoundGroupProfiles.Num(); ++ProfileIndex)
{
SoundGroupMap.Add(SoundGroupProfiles[ProfileIndex].SoundGroup, SoundGroupProfiles[ProfileIndex]);
}
if (!SoundGroupMap.Find(SOUNDGROUP_Default))
{
UE_LOG(LogAudio, Warning, TEXT("Missing default SoundGroup profile. Creating default with no decompression."));
SoundGroupMap.Add(SOUNDGROUP_Default, FSoundGroup());
}
#if WITH_EDITOR
UEnum* SoundGroupEnum = FindObjectChecked<UEnum>(NULL, TEXT("/Script/Engine.ESoundGroup"));
for (const auto& It : SoundGroupMap)
{
if (It.Value.DisplayName.Len() > 0)
{
SoundGroupEnum->SetMetaData(TEXT("DisplayName"), *It.Value.DisplayName, It.Key);
SoundGroupEnum->RemoveMetaData(TEXT("Hidden"), It.Key);
}
else
{
if (SoundGroupEnum->HasMetaData(TEXT("Hidden"), It.Key))
{
UE_LOG(LogAudio, Warning, TEXT("Custom Game SoundGroup profile for %s defined but no display name supplied."), *SoundGroupEnum->GetEnumText(It.Key).ToString());
}
SoundGroupEnum->RemoveMetaData(TEXT("Hidden"), It.Key);
}
}
#endif
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:35,代码来源:SoundGroups.cpp
示例5: TEXT
void FEnvQueryTestDetails::BuildScoreClampingTypeValues(bool bBuildMinValues, TArray<FTextIntPair>& ClampTypeValues) const
{
UEnum* ScoringNormalizationEnum = FindObject<UEnum>(ANY_PACKAGE, TEXT("EEnvQueryTestClamping"));
check(ScoringNormalizationEnum);
ClampTypeValues.Reset();
ClampTypeValues.Add(FTextIntPair(ScoringNormalizationEnum->GetEnumText(EEnvQueryTestClamping::None), EEnvQueryTestClamping::None));
ClampTypeValues.Add(FTextIntPair(ScoringNormalizationEnum->GetEnumText(EEnvQueryTestClamping::SpecifiedValue), EEnvQueryTestClamping::SpecifiedValue));
if (IsFiltering())
{
bool bSupportFilterThreshold = false;
if (bBuildMinValues)
{
if (UsesFilterMin())
{
bSupportFilterThreshold = true;
}
}
else if (UsesFilterMax())
{
bSupportFilterThreshold = true;
}
if (bSupportFilterThreshold)
{
ClampTypeValues.Add(FTextIntPair(ScoringNormalizationEnum->GetEnumText(EEnvQueryTestClamping::FilterThreshold), EEnvQueryTestClamping::FilterThreshold));
}
}
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:30,代码来源:EnvQueryTestDetails.cpp
示例6: SendToObjects
void SPropertyEditorCombo::SendToObjects( const FString& NewValue )
{
const TSharedRef< FPropertyNode > PropertyNode = PropertyEditor->GetPropertyNode();
UProperty* Property = PropertyNode->GetProperty();
FString Value;
if ( bUsesAlternateDisplayValues && !Property->IsA(UStrProperty::StaticClass()))
{
// currently only enum properties can use alternate display values; this
// might change, so assert here so that if support is expanded to other
// property types without updating this block of code, we'll catch it quickly
UEnum* Enum = CastChecked<UByteProperty>(Property)->Enum;
check(Enum != nullptr);
const int32 Index = FindEnumValueIndex(Enum, NewValue);
check( Index != INDEX_NONE );
Value = Enum->GetEnumName(Index);
FText ToolTipValue = Enum->GetToolTipText(Index);
FText ToolTipText = Property->GetToolTipText();
if (!ToolTipValue.IsEmpty())
{
ToolTipText = FText::Format(FText::FromString(TEXT("{0}\n\n{1}")), ToolTipText, ToolTipValue);
}
SetToolTipText(ToolTipText);
}
else
{
Value = NewValue;
}
const TSharedRef< IPropertyHandle > PropertyHandle = PropertyEditor->GetPropertyHandle();
PropertyHandle->SetValueFromFormattedString( Value );
}
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:35,代码来源:SPropertyEditorCombo.cpp
示例7: LhsEnumName
FORCEINLINE bool FCompareUObjectByPropertyAscending<UByteProperty>::ComparePropertyValue( const uint8& LhsValue, const uint8& RhsValue ) const
{
// Bytes are trivially sorted numerically
UEnum* PropertyEnum = Property->GetIntPropertyEnum();
if( PropertyEnum == NULL )
{
return LhsValue < RhsValue;
}
else
{
// But Enums are sorted alphabetically based on the full enum entry name - must be sure that values are within Enum bounds!
bool bLhsEnumValid = LhsValue < PropertyEnum->NumEnums();
bool bRhsEnumValid = RhsValue < PropertyEnum->NumEnums();
if(bLhsEnumValid && bRhsEnumValid)
{
FName LhsEnumName( PropertyEnum->GetEnum( LhsValue ) );
FName RhsEnumName( PropertyEnum->GetEnum( RhsValue ) );
return LhsEnumName.Compare( RhsEnumName ) < 0;
}
else if(bLhsEnumValid)
{
return true;
}
else if(bRhsEnumValid)
{
return false;
}
else
{
return LhsValue < RhsValue;
}
}
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:33,代码来源:PropertyTableColumn.cpp
示例8: Z_Construct_UEnum_UAndroidRuntimeSettings_EAndroidScreenOrientation
FString FAndroidTargetSettingsCustomization::OrientationToString(const EAndroidScreenOrientation::Type Orientation)
{
extern ANDROIDRUNTIMESETTINGS_API class UEnum* Z_Construct_UEnum_UAndroidRuntimeSettings_EAndroidScreenOrientation();
UEnum* Enum = Z_Construct_UEnum_UAndroidRuntimeSettings_EAndroidScreenOrientation();
check(Enum != nullptr);
return Enum->GetMetaData(TEXT("ManifestValue"), (int32)Orientation);
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:9,代码来源:AndroidTargetSettingsCustomization.cpp
示例9: Z_Construct_UEnum_UAndroidRuntimeSettings_EAndroidDepthBufferPreference
FString FAndroidTargetSettingsCustomization::DepthBufferPreferenceToString(const EAndroidDepthBufferPreference::Type DepthBufferPreference)
{
extern ANDROIDRUNTIMESETTINGS_API class UEnum* Z_Construct_UEnum_UAndroidRuntimeSettings_EAndroidDepthBufferPreference();
UEnum* Enum = Z_Construct_UEnum_UAndroidRuntimeSettings_EAndroidDepthBufferPreference();
check(Enum != nullptr);
return Enum->GetMetaData(TEXT("ManifestValue"), (int32)DepthBufferPreference);
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:9,代码来源:AndroidTargetSettingsCustomization.cpp
示例10: TEXT
FString UEnvQueryTest_Trace::GetDescriptionTitle() const
{
UEnum* ChannelEnum = FindObject<UEnum>(ANY_PACKAGE, TEXT("ETraceTypeQuery"), true);
FString ChannelDesc = ChannelEnum->GetEnumString(TraceChannel);
FString DirectionDesc = TraceToItem.IsNamedParam() ?
FString::Printf(TEXT("%s, direction: %s"), *UEnvQueryTypes::DescribeContext(Context), *UEnvQueryTypes::DescribeBoolParam(TraceToItem)) :
FString::Printf(TEXT("%s %s"), TraceToItem.Value ? TEXT("from") : TEXT("to"), *UEnvQueryTypes::DescribeContext(Context));
return FString::Printf(TEXT("%s: %s on %s"),
*Super::GetDescriptionTitle(), *DirectionDesc, *ChannelDesc);
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:12,代码来源:EnvQueryTest_Trace.cpp
示例11: TEXT
FText UEnvQueryTest_Trace::GetDescriptionTitle() const
{
UEnum* ChannelEnum = FindObject<UEnum>(ANY_PACKAGE, TEXT("ETraceTypeQuery"), true);
FString ChannelDesc = ChannelEnum->GetEnumText(TraceData.TraceChannel).ToString();
FString DirectionDesc = TraceFromContext.IsDynamic() ?
FString::Printf(TEXT("%s, direction: %s"), *UEnvQueryTypes::DescribeContext(Context).ToString(), *TraceFromContext.ToString()) :
FString::Printf(TEXT("%s %s"), TraceFromContext.DefaultValue ? TEXT("from") : TEXT("to"), *UEnvQueryTypes::DescribeContext(Context).ToString());
return FText::FromString(FString::Printf(TEXT("%s: %s on %s"),
*Super::GetDescriptionTitle().ToString(), *DirectionDesc, *ChannelDesc));
}
开发者ID:didixp,项目名称:Ark-Dev-Kit,代码行数:12,代码来源:EnvQueryTest_Trace.cpp
示例12: GetGraph
void UK2Node::PostReconstructNode()
{
if (!IsTemplate())
{
// Make sure we're not dealing with a menu node
UEdGraph* OuterGraph = GetGraph();
if( OuterGraph && OuterGraph->Schema )
{
const UEdGraphSchema_K2* Schema = Cast<const UEdGraphSchema_K2>(GetSchema());
// fix up any pin data if it needs to
for( auto PinIt = Pins.CreateIterator(); PinIt; ++PinIt )
{
UEdGraphPin* CurrentPin = *PinIt;
const FString& PinCategory = CurrentPin->PinType.PinCategory;
// fix up enum names if it exists in enum redirects
if (PinCategory == Schema->PC_Byte)
{
UEnum* EnumPtr = Cast<UEnum>(CurrentPin->PinType.PinSubCategoryObject.Get());
if (EnumPtr)
{
const FString& PinValue = CurrentPin->DefaultValue;
// see if this enum is in EnumRedirects
int32 EnumIndex = UEnum::FindEnumRedirects(EnumPtr, *PinValue);
if (EnumIndex != INDEX_NONE)
{
FString EnumName = EnumPtr->GetEnumName(EnumIndex);
// if the name does not match with pin value, override pin value
if (EnumName != PinValue)
{
// I'm not marking package as dirty
// as I know that's not going to work during serialize or post load
CurrentPin->DefaultValue = EnumName;
continue;
}
}
}
}
else if (PinCategory == Schema->PC_Object)
{
UClass const* PinClass = Cast<UClass const>(CurrentPin->PinType.PinSubCategoryObject.Get());
if ((PinClass != nullptr) && PinClass->IsChildOf(UInterface::StaticClass()))
{
CurrentPin->PinType.PinCategory = Schema->PC_Interface;
}
}
}
}
}
}
开发者ID:mysheng8,项目名称:UnrealEngine,代码行数:51,代码来源:K2Node.cpp
示例13: ensure
UEnum* FEnumEditorUtils::CreateUserDefinedEnum(UObject* InParent, FName EnumName, EObjectFlags Flags)
{
ensure(0 != (RF_Public & Flags));
UEnum* Enum = NewObject<UUserDefinedEnum>(InParent, EnumName, Flags);
if (NULL != Enum)
{
TArray<TPair<FName, int8>> EmptyNames;
Enum->SetEnums(EmptyNames, UEnum::ECppForm::Namespaced);
Enum->SetMetaData(TEXT("BlueprintType"), TEXT("true"));
}
return Enum;
}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:15,代码来源:EnumEditorUtils.cpp
示例14: LOCTEXT
void FFeaturePackContentSource::HandleSuperSearchTextChanged(const FString& InText, TArray< TSharedPtr<FSearchEntry> >& OutSuggestions)
{
FString FeaturePackSearchCat = LOCTEXT("FeaturePackSearchCategory", "Feature Packs").ToString();
FString CurrentLanguage = FInternationalization::Get().GetCurrentCulture()->GetTwoLetterISOLanguageName();
FLocalizedText CurrentName = ChooseLocalizedText(LocalizedNames,CurrentLanguage);
FLocalizedTextArray CurrentTagSet = ChooseLocalizedTextArray(LocalizedSearchTags,CurrentLanguage);
FText AsText = FText::FromString(InText);
TArray<FText> TagArray = CurrentTagSet.GetTags();
if (TagArray.Num() != 0)
{
UEnum* Enum = FindObjectChecked<UEnum>(ANY_PACKAGE, TEXT("EContentSourceCategory"));
// Add a feature packs category
for (int32 iTag = 0; iTag < TagArray.Num(); iTag++)
{
if (TagArray[iTag].EqualToCaseIgnored(AsText))
{
// This will add the category if one doesnt exist
TryAddFeaturePackCategory(FeaturePackSearchCat,OutSuggestions);
TSharedPtr<FSearchEntry> FeaturePackEntry = MakeShareable(new FSearchEntry());
FeaturePackEntry->Title = FText::Format( LOCTEXT("FeaturePackSearchResult", "{0} ({1})"), CurrentName.GetText(), Enum->GetDisplayNameText((int32)Category)).ToString();
FeaturePackEntry->bCategory = false;
OutSuggestions.Add(FeaturePackEntry);
return;
}
}
}
}
开发者ID:didixp,项目名称:Ark-Dev-Kit,代码行数:28,代码来源:FeaturePackContentSource.cpp
示例15: TEXT
void UPhysicsSettings::LoadSurfaceType()
{
// read "SurfaceType" defines and set meta data for the enum
// find the enum
UEnum * Enum = FindObject<UEnum>(ANY_PACKAGE, TEXT("EPhysicalSurface"), true);
// we need this Enum
check(Enum);
const FString KeyName = TEXT("DisplayName");
const FString HiddenMeta = TEXT("Hidden");
const FString UnusedDisplayName = TEXT("Unused");
// remainders, set to be unused
for(int32 EnumIndex=1; EnumIndex<Enum->NumEnums(); ++EnumIndex)
{
// if meta data isn't set yet, set name to "Unused" until we fix property window to handle this
// make sure all hide and set unused first
// if not hidden yet
if(!Enum->HasMetaData(*HiddenMeta, EnumIndex))
{
Enum->SetMetaData(*HiddenMeta, TEXT(""), EnumIndex);
Enum->SetMetaData(*KeyName, *UnusedDisplayName, EnumIndex);
}
}
for(auto Iter=PhysicalSurfaces.CreateConstIterator(); Iter; ++Iter)
{
// @todo only for editor
Enum->SetMetaData(*KeyName, *Iter->Name.ToString(), Iter->Type);
// also need to remove "Hidden"
Enum->RemoveMetaData(*HiddenMeta, Iter->Type);
}
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:33,代码来源:PhysicsSettings.cpp
示例16: CreateEnum
UEnum* UJavascriptLibrary::CreateEnum(UObject* Outer, FName Name, TArray<FName> DisplayNames)
{
UEnum* Enum = NewObject<UEnum>(Outer,Name,RF_Public);
if (NULL != Enum)
{
TArray<TPair<FName, uint8>> Names;
int32 Index = 0;
for (auto DisplayName : DisplayNames)
{
Names.Add(TPairInitializer<FName, uint8>(DisplayName, Index));
Index++;
}
Enum->SetEnums(Names, UEnum::ECppForm::Namespaced);
}
return Enum;
}
开发者ID:junhuac,项目名称:Unreal.js-core,代码行数:20,代码来源:JavascriptLibrary.cpp
示例17: GetEaseFuncPin
void UK2Node_EaseFunction::RefreshPinVisibility()
{
const auto EaseFuncPin = GetEaseFuncPin();
UEnum * Enum = FindObject<UEnum>(ANY_PACKAGE, TEXT("EEasingFunc"), true);
check(Enum != NULL);
const int32 NewEasingFunc = CanCustomizeCurve() ? Enum->GetValueByName(*EaseFuncPin->DefaultValue) : -1;
// Early exit in case no changes are required
const UEdGraphSchema_K2* K2Schema = Cast<const UEdGraphSchema_K2>(GetSchema());
UEdGraphPin* BlendExpPin = FindPinChecked(FEaseFunctionNodeHelper::GetBlendExpPinName());
if (NewEasingFunc == -1 ||
NewEasingFunc == EEasingFunc::EaseIn ||
NewEasingFunc == EEasingFunc::EaseOut ||
NewEasingFunc == EEasingFunc::EaseInOut)
{
// Show the BlendExpPin
BlendExpPin->bHidden = false;
}
else
{
// Hide the BlendExpPin:
BlendExpPin->BreakAllPinLinks();
BlendExpPin->bHidden = true;
}
UEdGraphPin* StepsPin = FindPinChecked(FEaseFunctionNodeHelper::GetStepsPinName());
if (NewEasingFunc == -1 ||
NewEasingFunc == EEasingFunc::Step)
{
// Show the Steps pin:
StepsPin->bHidden = false;
}
else
{
// Hide the Steps pin:
StepsPin->BreakAllPinLinks();
StepsPin->bHidden = true;
}
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:41,代码来源:K2Node_EaseFunction.cpp
示例18: TEXT
void UGatherTextFromMetaDataCommandlet::GatherTextFromUObject(UField* const Field)
{
const int32 MetaDataCount = 3;
const FString MetaDataKeys[MetaDataCount] =
{ TEXT("ToolTip"), TEXT("DisplayName"), TEXT("Category") };
const FString AssociatedNamespaces[MetaDataCount] =
{ TEXT("UObjectToolTips"), TEXT("UObjectDisplayNames"), TEXT("UObjectCategories") };
// Gather for object.
{
for(int32 i = 0; i < MetaDataCount; ++i)
{
const FString& MetaDataValue = Field->GetMetaData(*MetaDataKeys[i]);
if(!(MetaDataValue.IsEmpty()))
{
const FString Namespace = AssociatedNamespaces[i];
FLocItem LocItem(MetaDataValue);
FContext Context;
Context.Key = MetaDataKeys[i] == TEXT("Category")
? MetaDataValue
: Field->GetFullGroupName(true) + TEXT(".") + Field->GetName();
Context.SourceLocation = TEXT("Run-time MetaData");
ManifestInfo->AddEntry(TEXT("EntryDescription"), Namespace, LocItem, Context);
}
}
}
// For enums, also gather for enum values.
{
UEnum* Enum = Cast<UEnum>(Field);
if(Enum)
{
const int32 ValueCount = Enum->NumEnums();
for(int32 i = 0; i < ValueCount; ++i)
{
for(int32 j = 0; j < MetaDataCount; ++j)
{
const FString& MetaDataValue = Enum->GetMetaData(*MetaDataKeys[j], i);
if(!(MetaDataValue.IsEmpty()))
{
const FString Namespace = AssociatedNamespaces[j];
FLocItem LocItem(MetaDataValue);
FContext Context;
Context.Key = MetaDataKeys[j] == TEXT("Category")
? MetaDataValue
: Enum->GetFullGroupName(true) + TEXT(".") + Enum->GetName() + TEXT(".") + Enum->GetEnumName(i);
Context.SourceLocation = TEXT("Run-time MetaData");
ManifestInfo->AddEntry(TEXT("EntryDescription"), Namespace, LocItem, Context);
}
}
}
}
}
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:54,代码来源:GatherTextFromMetadataCommandlet.cpp
示例19: SendToObjects
void SPropertyEditorCombo::SendToObjects( const FString& NewValue )
{
const TSharedRef< FPropertyNode > PropertyNode = PropertyEditor->GetPropertyNode();
UProperty* Property = PropertyNode->GetProperty();
FString Value;
FString ToolTipValue;
if ( bUsesAlternateDisplayValues && !Property->IsA(UStrProperty::StaticClass()))
{
// currently only enum properties can use alternate display values; this might change, so assert here so that if support is expanded to other property types
// without updating this block of code, we'll catch it quickly
UEnum* Enum = CastChecked<UByteProperty>(Property)->Enum;
check(Enum);
int32 Index = INDEX_NONE;
for( int32 ItemIndex = 0; ItemIndex < Enum->NumEnums(); ++ItemIndex )
{
const FString EnumName = Enum->GetEnumName(ItemIndex);
const FString DisplayName = Enum->GetDisplayNameText(ItemIndex ).ToString();
if( DisplayName.Len() > 0 )
{
if ( DisplayName == NewValue )
{
Index = ItemIndex;
break;
}
}
else if (EnumName == NewValue)
{
Index = ItemIndex;
break;
}
}
check( Index != INDEX_NONE );
Value = Enum->GetEnumName(Index);
ToolTipValue = Enum->GetMetaData( TEXT("ToolTip"), Index );
FString ToolTipText = Property->GetToolTipText().ToString();
if (ToolTipValue.Len() > 0)
{
ToolTipText = FString::Printf(TEXT("%s\n\n%s"), *ToolTipText, *ToolTipValue);
}
SetToolTipText(ToolTipText);
}
else
{
Value = NewValue;
}
const TSharedRef< IPropertyHandle > PropertyHandle = PropertyEditor->GetPropertyHandle();
PropertyHandle->SetValueFromFormattedString( Value );
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:53,代码来源:SPropertyEditorCombo.cpp
示例20: Initialize
const FSoundGroup& USoundGroups::GetSoundGroup(const ESoundGroup SoundGroup) const
{
// Initialize the settings if this gets called early enough to require it
if (SoundGroupMap.Num() == 0)
{
Initialize();
}
const FSoundGroup* SG = SoundGroupMap.Find(SoundGroup);
if (SG == NULL)
{
UEnum* SoundGroupEnum = FindObjectChecked<UEnum>(NULL, TEXT("/Script/Engine.ESoundGroup"));
UE_LOG(LogAudio, Warning, TEXT("Requested SoundGroup %s does not have defined profile. Using SOUNDGROUP_Default."), *SoundGroupEnum->GetEnumText(SoundGroup).ToString());
return SoundGroupMap.FindChecked(SOUNDGROUP_Default);
}
return *SG;
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:19,代码来源:SoundGroups.cpp
注:本文中的UEnum类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论