From c06ae32391a757382f4304d3088986a74e1afb79 Mon Sep 17 00:00:00 2001 From: "Nicholas St. Germain" Date: Wed, 24 Jul 2024 10:49:36 -0500 Subject: [PATCH] "Fix Metadata Capitalization" - Ryan --- MDMetaDataEditor.uplugin | 2 +- README.md | 26 +++--- .../Private/Config/MDMetaDataEditorConfig.cpp | 2 +- .../Private/Config/MDMetaDataEditorConfig.h | 22 ++--- .../Config/MDMetaDataEditorUserConfig.cpp | 2 +- .../Config/MDMetaDataEditorUserConfig.h | 6 +- .../MDMetaDataEditorCustomizationBase.cpp | 46 +++++----- .../Types/MDMetaDataEditorPropertyType.h | 12 +-- .../Private/Types/MDMetaDataKey.cpp | 2 +- .../Private/Types/MDMetaDataKey.h | 88 +++++++++---------- ...taDataEditorBlueprintCompilerExtension.cpp | 4 +- ...MetaDataEditorBlueprintCompilerExtension.h | 2 +- 12 files changed, 107 insertions(+), 107 deletions(-) diff --git a/MDMetaDataEditor.uplugin b/MDMetaDataEditor.uplugin index 413242c..cc64e92 100644 --- a/MDMetaDataEditor.uplugin +++ b/MDMetaDataEditor.uplugin @@ -3,7 +3,7 @@ "Version": 1, "VersionName": "1.0", "FriendlyName": "MDMetaDataEditor", - "Description": "Unreal Engine 5.1+ plugin to enable editing meta data of Blueprint Properties and Functions", + "Description": "Unreal Engine 5.1+ plugin to enable editing metadata of Blueprint Properties and Functions", "Category": "Editor", "CreatedBy": "Dylan Dumesnil", "CreatedByURL": "https://github.com/DoubleDeez", diff --git a/README.md b/README.md index b180f61..373e028 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,34 @@ # MDMetaDataEditor -MDMetaDataEditor enables editing the meta data of Blueprint-created variables, function parameters, functions, events, macros, and collapsed graphs. +MDMetaDataEditor enables editing the metadata of Blueprint-created variables, function parameters, functions, events, macros, and collapsed graphs. Supports Unreal Engine 5.1 and later. ![](./Resources/readme_GameplayTagFilter.gif) -## Editing Meta Data +## Editing Metadata -The plugin adds a new `Meta Data` section to the details panel of Blueprint Variables, Functions, Events, and Function Parameters. Here, any exposed meta data values can be set. +The plugin adds a new `Metadata` section to the details panel of Blueprint Variables, Functions, Events, and Function Parameters. Here, any exposed metadata values can be set. ### Advanced -An advanced raw meta data editor can be enabled via Editor Preferences -> General -> Meta Data Editor (Local Only). This will enabling the raw strings of key-value meta data pairs. +An advanced raw metadata editor can be enabled via Editor Preferences -> General -> Metadata Editor (Local Only). This will enabling the raw strings of key-value metadata pairs. ![](./Resources/readme_ForceInlineRow.gif) ![](./Resources/readme_EditCondition.gif) -## Configuring Meta Data Keys -By default, the plugin comes with some common meta data keys pre-configured. -The list of available Meta Data Keys that are exposed to Blueprint can be configured in **Project Settings -> Editor -> Meta Data Editor**. +## Configuring Metadata Keys +By default, the plugin comes with some common metadata keys pre-configured. +The list of available Metadata Keys that are exposed to Blueprint can be configured in **Project Settings -> Editor -> Metadata Editor**. -Here, Meta Data Keys can be added, removed, and modified. By default, new keys are set up to work for any variable type in any blueprint. +Here, Metadata Keys can be added, removed, and modified. By default, new keys are set up to work for any variable type in any blueprint. -The **Key Type** should match the expected type of the meta data key, that will also determine which widget is displayed for setting the value of the meta data. +The **Key Type** should match the expected type of the metadata key, that will also determine which widget is displayed for setting the value of the metadata. -For Meta Data Keys meant only for functions, the **Supported Property Types** list should be empty and have **Can be Used by Functions** checked. +For Metadata Keys meant only for functions, the **Supported Property Types** list should be empty and have **Can be Used by Functions** checked. -See these pages for documentation on various meta data options: +See these pages for documentation on various metadata options: - [benui's all UPROPERTY specifiers](https://benui.ca/unreal/uproperty/) - [benui's all UFUNCTION specifiers](https://benui.ca/unreal/ufunction/) - [benui's all UPARAM specifiers](https://benui.ca/unreal/uparam/) @@ -43,6 +43,6 @@ See these pages for documentation on various meta data options: ## FYI -* If a meta data key is removed from the Project Settings, or the specific meta data type is disabled, that meta data key will continue to exist on variables, functions, events, and parameters. +* If a metadata key is removed from the Project Settings, or the specific metadata type is disabled, that metadata key will continue to exist on variables, functions, events, and parameters. -* I couldn't find any useful Meta Data Keys for collapsed graphs/macros so I disabled it by default. It can be re-enabled in the Project Settings. +* I couldn't find any useful Metadata Keys for collapsed graphs/macros so I disabled it by default. It can be re-enabled in the Project Settings. diff --git a/Source/MDMetaDataEditor/Private/Config/MDMetaDataEditorConfig.cpp b/Source/MDMetaDataEditor/Private/Config/MDMetaDataEditorConfig.cpp index c0ea259..afb6b03 100644 --- a/Source/MDMetaDataEditor/Private/Config/MDMetaDataEditorConfig.cpp +++ b/Source/MDMetaDataEditor/Private/Config/MDMetaDataEditorConfig.cpp @@ -235,7 +235,7 @@ void UMDMetaDataEditorConfig::PostInitProperties() FText UMDMetaDataEditorConfig::GetSectionText() const { - return INVTEXT("Meta Data Editor"); + return INVTEXT("Metadata Editor"); } void UMDMetaDataEditorConfig::ForEachVariableMetaDataKey(const UBlueprint* Blueprint, const FProperty* Property, const TFunction& Func) const diff --git a/Source/MDMetaDataEditor/Private/Config/MDMetaDataEditorConfig.h b/Source/MDMetaDataEditor/Private/Config/MDMetaDataEditorConfig.h index e46014c..be6423e 100644 --- a/Source/MDMetaDataEditor/Private/Config/MDMetaDataEditorConfig.h +++ b/Source/MDMetaDataEditor/Private/Config/MDMetaDataEditorConfig.h @@ -9,7 +9,7 @@ #include "MDMetaDataEditorConfig.generated.h" /** - * Configure which meta data keys will display on blueprint Properties and Functions. + * Configure which metadata keys will display on blueprint Properties and Functions. * Can be setup per Blueprint type and Property type. */ UCLASS(DefaultConfig, Config = Editor, MinimalAPI) @@ -30,27 +30,27 @@ class UMDMetaDataEditorConfig : public UDeveloperSettings void ForEachPropertyMetaDataKey(const UBlueprint* Blueprint, const FProperty* Property, const TFunction& Func) const; void ForEachFunctionMetaDataKey(const UBlueprint* Blueprint, const TFunction& Func) const; - // If true, the meta data keys will automatically be sorted alphabetically - UPROPERTY(EditDefaultsOnly, Config, Category = "Meta Data Editor") + // If true, the metadata keys will automatically be sorted alphabetically + UPROPERTY(EditDefaultsOnly, Config, Category = "Metadata Editor") bool bSortMetaDataAlphabetically = true; - UPROPERTY(EditDefaultsOnly, Config, Category = "Meta Data Editor") + UPROPERTY(EditDefaultsOnly, Config, Category = "Metadata Editor") bool bEnableMetaDataEditorForVariables = true; - UPROPERTY(EditDefaultsOnly, Config, Category = "Meta Data Editor") + UPROPERTY(EditDefaultsOnly, Config, Category = "Metadata Editor") bool bEnableMetaDataEditorForLocalVariables = true; - UPROPERTY(EditDefaultsOnly, Config, Category = "Meta Data Editor") + UPROPERTY(EditDefaultsOnly, Config, Category = "Metadata Editor") bool bEnableMetaDataEditorForFunctions = true; - UPROPERTY(EditDefaultsOnly, Config, Category = "Meta Data Editor") + UPROPERTY(EditDefaultsOnly, Config, Category = "Metadata Editor") bool bEnableMetaDataEditorForCustomEvents = true; - UPROPERTY(EditDefaultsOnly, Config, Category = "Meta Data Editor", DisplayName = "Enable Meta Data Editor for Collapsed Graphs and Macros") + UPROPERTY(EditDefaultsOnly, Config, Category = "Metadata Editor", DisplayName = "Enable Metadata Editor for Collapsed Graphs and Macros") bool bEnableMetaDataEditorForTunnels = false; - // Param meta data only works for Function/Event parameters - UPROPERTY(EditDefaultsOnly, Config, Category = "Meta Data Editor") + // Param metadata only works for Function/Event parameters + UPROPERTY(EditDefaultsOnly, Config, Category = "Metadata Editor") bool bEnableMetaDataEditorForFunctionParameters = true; #if WITH_EDITOR @@ -61,6 +61,6 @@ class UMDMetaDataEditorConfig : public UDeveloperSettings UFUNCTION() TArray GetMetaDataKeyNames() const; - UPROPERTY(EditAnywhere, Config, Category = "Meta Data Keys", meta = (TitleProperty = "{Key} ({KeyType})")) + UPROPERTY(EditAnywhere, Config, Category = "Metadata Keys", meta = (TitleProperty = "{Key} ({KeyType})")) TArray MetaDataKeys; }; diff --git a/Source/MDMetaDataEditor/Private/Config/MDMetaDataEditorUserConfig.cpp b/Source/MDMetaDataEditor/Private/Config/MDMetaDataEditorUserConfig.cpp index cf4c63e..0e11390 100644 --- a/Source/MDMetaDataEditor/Private/Config/MDMetaDataEditorUserConfig.cpp +++ b/Source/MDMetaDataEditor/Private/Config/MDMetaDataEditorUserConfig.cpp @@ -5,5 +5,5 @@ FText UMDMetaDataEditorUserConfig::GetSectionText() const { - return INVTEXT("Meta Data Editor (Local Only)"); + return INVTEXT("Metadata Editor (Local Only)"); } diff --git a/Source/MDMetaDataEditor/Private/Config/MDMetaDataEditorUserConfig.h b/Source/MDMetaDataEditor/Private/Config/MDMetaDataEditorUserConfig.h index c3866b7..0d5a8cf 100644 --- a/Source/MDMetaDataEditor/Private/Config/MDMetaDataEditorUserConfig.h +++ b/Source/MDMetaDataEditor/Private/Config/MDMetaDataEditorUserConfig.h @@ -6,7 +6,7 @@ #include "MDMetaDataEditorUserConfig.generated.h" /** - * Configure meta data editor behaviours. + * Configure metadata editor behaviours. * Settings are specific to the local user. */ UCLASS(Config = EditorPerProjectUserSettings, MinimalAPI) @@ -17,8 +17,8 @@ class UMDMetaDataEditorUserConfig : public UDeveloperSettings public: virtual FText GetSectionText() const override; - // If true, a raw key-value editor will be displayed on variables/functions that can have meta data - // This viewing/editing of all meta data, even if not exposed by the Meta Data Editor config. + // If true, a raw key-value editor will be displayed on variables/functions that can have metadata + // This viewing/editing of all metadata, even if not exposed by the Metadata Editor config. UPROPERTY(EditDefaultsOnly, Config, Category = "Editor Config") bool bEnableRawMetaDataEditor = false; }; diff --git a/Source/MDMetaDataEditor/Private/Customizations/MDMetaDataEditorCustomizationBase.cpp b/Source/MDMetaDataEditor/Private/Customizations/MDMetaDataEditorCustomizationBase.cpp index 68795c1..2f06742 100644 --- a/Source/MDMetaDataEditor/Private/Customizations/MDMetaDataEditorCustomizationBase.cpp +++ b/Source/MDMetaDataEditor/Private/Customizations/MDMetaDataEditorCustomizationBase.cpp @@ -78,7 +78,7 @@ namespace MDMDECB_Private FProperty* FindNodeProperty(const UK2Node_EditablePinBase* Node, const TSharedPtr& PinInfo) { - // Specifically grab the generated class, not the skeleton class so that UMDMetaDataEditorBlueprintCompilerExtension can grab the meta data after the BP is compiled + // Specifically grab the generated class, not the skeleton class so that UMDMetaDataEditorBlueprintCompilerExtension can grab the metadata after the BP is compiled const UBlueprint* Blueprint = IsValid(Node) ? Node->GetBlueprint() : nullptr; const UClass* Class = IsValid(Blueprint) ? Blueprint->GeneratedClass : nullptr; @@ -196,16 +196,16 @@ void FMDMetaDataEditorCustomizationBase::CustomizeDetails(IDetailLayoutBuilder& if (bIsProperty) { - // Put Meta Data above Default Value for Variables + // Put Metadata above Default Value for Variables int32 MetaDataSortOrder = DetailLayout.EditCategory("Variable").GetSortOrder(); - DetailLayout.EditCategory("MetaData").SetSortOrder(++MetaDataSortOrder); + DetailLayout.EditCategory("Metadata").SetSortOrder(++MetaDataSortOrder); DetailLayout.EditCategory("DefaultValue").SetSortOrder(++MetaDataSortOrder); } else if (bIsFunction) { - // Put Meta Data above Inputs for Functions + // Put Metadata above Inputs for Functions int32 MetaDataSortOrder = DetailLayout.EditCategory("Graph").GetSortOrder(); - DetailLayout.EditCategory("MetaData").SetSortOrder(++MetaDataSortOrder); + DetailLayout.EditCategory("Metadata").SetSortOrder(++MetaDataSortOrder); DetailLayout.EditCategory("Inputs").SetSortOrder(++MetaDataSortOrder); DetailLayout.EditCategory("Outputs").SetSortOrder(++MetaDataSortOrder); } @@ -227,7 +227,7 @@ void FMDMetaDataEditorCustomizationBase::CustomizeDetails(IDetailLayoutBuilder& } } - IDetailCategoryBuilder& Category = DetailLayout.EditCategory("MetaData"); + IDetailCategoryBuilder& Category = DetailLayout.EditCategory("Metadata"); IDetailGroup* Group = nullptr; FName GroupName = NAME_None; @@ -292,7 +292,7 @@ void FMDMetaDataEditorCustomizationBase::CustomizeDetails(IDetailLayoutBuilder& [ SNew(SButton) .IsFocusable(false) - .ToolTipText(INVTEXT("Remove this meta data from this property")) + .ToolTipText(INVTEXT("Remove this metadata from this property")) .ButtonStyle(FAppStyle::Get(), "SimpleButton") .ContentPadding(0) .Visibility(this, &FMDMetaDataEditorCustomizationBase::GetRemoveMetaDataButtonVisibility, Key.Key, TWeakFieldPtr()) @@ -341,7 +341,7 @@ void FMDMetaDataEditorCustomizationBase::CustomizeDetails(IDetailLayoutBuilder& Config->ForEachFunctionMetaDataKey(Blueprint, AddMetaDataKey); } - // TODO - Refactor - Adding the param meta data logic made this file/class a mess. Consider pulling that logic out. + // TODO - Refactor - Adding the param metadata logic made this file/class a mess. Consider pulling that logic out. if (Config->bEnableMetaDataEditorForFunctionParameters) { TMap ParamGroupMap; @@ -352,7 +352,7 @@ void FMDMetaDataEditorCustomizationBase::CustomizeDetails(IDetailLayoutBuilder& { if (InputsGroupPtr == nullptr) { - InputsGroupPtr = &DetailLayout.EditCategory("Inputs").AddGroup(TEXT("ParamMetaData"), INVTEXT("Param Meta Data")); + InputsGroupPtr = &DetailLayout.EditCategory("Inputs").AddGroup(TEXT("ParamMetadata"), INVTEXT("Param Metadata")); } return *InputsGroupPtr; @@ -363,7 +363,7 @@ void FMDMetaDataEditorCustomizationBase::CustomizeDetails(IDetailLayoutBuilder& { if (OutputsGroupPtr == nullptr) { - OutputsGroupPtr = &DetailLayout.EditCategory("Outputs").AddGroup(TEXT("ParamMetaData"), INVTEXT("Param Meta Data")); + OutputsGroupPtr = &DetailLayout.EditCategory("Outputs").AddGroup(TEXT("ParamMetadata"), INVTEXT("Param Metadata")); } return *OutputsGroupPtr; @@ -456,7 +456,7 @@ void FMDMetaDataEditorCustomizationBase::CustomizeDetails(IDetailLayoutBuilder& [ SNew(SButton) .IsFocusable(false) - .ToolTipText(INVTEXT("Remove this meta data from this parameter")) + .ToolTipText(INVTEXT("Remove this metadata from this parameter")) .ButtonStyle(FAppStyle::Get(), "SimpleButton") .ContentPadding(0) .Visibility(this, &FMDMetaDataEditorCustomizationBase::GetRemoveMetaDataButtonVisibility, Key.Key, MakeWeakFieldPtr(ParamProperty)) @@ -481,7 +481,7 @@ void FMDMetaDataEditorCustomizationBase::CustomizeDetails(IDetailLayoutBuilder& ? ParamGroupMap.FindRef(GroupName) : ParamGroupMap.Add(GroupName, &RootGroup.AddGroup(GroupName, ParamProperty->GetDisplayNameText())); - IDetailGroup& RawMetaDataGroup = Group->AddGroup(TEXT("RawMetaData"), INVTEXT("Raw Meta Data"), true); + IDetailGroup& RawMetaDataGroup = Group->AddGroup(TEXT("RawMetadata"), INVTEXT("Raw Metadata"), true); AddRawMetaDataEditor(ParamMetaDataMap, RawMetaDataGroup, bIsReadOnly, ParamProperty); } } @@ -491,8 +491,8 @@ void FMDMetaDataEditorCustomizationBase::CustomizeDetails(IDetailLayoutBuilder& if (UserConfig->bEnableRawMetaDataEditor && (!bIsReadOnly || (MetaDataMap != nullptr && !MetaDataMap->IsEmpty()))) { IDetailGroup& RawMetaDataGroup = DetailLayout - .EditCategory("MetaData") - .AddGroup(TEXT("RawMetaData"), INVTEXT("Raw Meta Data"), true); + .EditCategory("Metadata") + .AddGroup(TEXT("RawMetadata"), INVTEXT("Raw Metadata"), true); AddRawMetaDataEditor(MetaDataMap, RawMetaDataGroup, bIsReadOnly, nullptr); } } @@ -656,7 +656,7 @@ void FMDMetaDataEditorCustomizationBase::AddRawMetaDataEditor(const TMap Value = GetMetaDataValue(OldKey, PropertyPtr); if (!Value.IsSet()) { - // Not set means we don't have meta data with OldKey + // Not set means we don't have metadata with OldKey return; } - FScopedTransaction Transaction(FText::Format(INVTEXT("Changed Meta Data Key [{0} -> {1}]"), FText::FromName(OldKey), FText::FromName(NewKey))); + FScopedTransaction Transaction(FText::Format(INVTEXT("Changed Metadata Key [{0} -> {1}]"), FText::FromName(OldKey), FText::FromName(NewKey))); RemoveMetaDataKey(OldKey, PropertyPtr); SetMetaDataValue(NewKey, Value.GetValue(), PropertyPtr); } @@ -875,7 +875,7 @@ void FMDMetaDataEditorCustomizationBase::RemoveMetaDataKey(const FName& Key, TWe return; } - FScopedTransaction Transaction(FText::Format(INVTEXT("Removed Meta Data [{0}]"), FText::FromName(Key))); + FScopedTransaction Transaction(FText::Format(INVTEXT("Removed Metadata [{0}]"), FText::FromName(Key))); if (FProperty* ParamProperty = PropertyPtr.Get()) { @@ -1111,7 +1111,7 @@ ECheckBoxState FMDMetaDataEditorCustomizationBase::IsChecked(FName Key, TWeakFie if constexpr (bIsBoolean) { - // Don't assume unset == false, a meta data key could have different behaviour between the 2. + // Don't assume unset == false, a metadata key could have different behaviour between the 2. if (!Value.IsSet()) { return ECheckBoxState::Undetermined; diff --git a/Source/MDMetaDataEditor/Private/Types/MDMetaDataEditorPropertyType.h b/Source/MDMetaDataEditor/Private/Types/MDMetaDataEditorPropertyType.h index 953f2c1..13ebd48 100644 --- a/Source/MDMetaDataEditor/Private/Types/MDMetaDataEditorPropertyType.h +++ b/Source/MDMetaDataEditor/Private/Types/MDMetaDataEditorPropertyType.h @@ -55,23 +55,23 @@ struct FMDMetaDataEditorPropertyType void FixUp(); - UPROPERTY(EditAnywhere, Config, Category = "Meta Data Editor") + UPROPERTY(EditAnywhere, Config, Category = "Metadata Editor") FName PropertyType = NAME_None; - UPROPERTY(EditAnywhere, Config, Category = "Meta Data Editor") + UPROPERTY(EditAnywhere, Config, Category = "Metadata Editor") FName PropertySubType = NAME_None; - UPROPERTY(EditAnywhere, Config, Category = "Meta Data Editor") + UPROPERTY(EditAnywhere, Config, Category = "Metadata Editor") TSoftObjectPtr PropertySubTypeObject; - UPROPERTY(EditAnywhere, Config, Category = "Meta Data Editor") + UPROPERTY(EditAnywhere, Config, Category = "Metadata Editor") FSimpleMemberReference PropertySubTypeMemberReference; - UPROPERTY(EditAnywhere, Config, Category = "Meta Data Editor") + UPROPERTY(EditAnywhere, Config, Category = "Metadata Editor") FInstancedStruct ValueType; FMDMetaDataEditorPropertyType& SetValueType(FMDMetaDataEditorPropertyType&& InValueType) { ValueType.InitializeAs(InValueType); return *this; } - UPROPERTY(EditAnywhere, Config, Category = "Meta Data Editor") + UPROPERTY(EditAnywhere, Config, Category = "Metadata Editor") EMDMetaDataPropertyContainerType ContainerType = EMDMetaDataPropertyContainerType::None; FMDMetaDataEditorPropertyType& SetContainerType(EMDMetaDataPropertyContainerType InContainerType) { ContainerType = InContainerType; return *this; } diff --git a/Source/MDMetaDataEditor/Private/Types/MDMetaDataKey.cpp b/Source/MDMetaDataEditor/Private/Types/MDMetaDataKey.cpp index f91635b..6c64900 100644 --- a/Source/MDMetaDataEditor/Private/Types/MDMetaDataKey.cpp +++ b/Source/MDMetaDataEditor/Private/Types/MDMetaDataKey.cpp @@ -55,7 +55,7 @@ FText FMDMetaDataKey::GetToolTipText() const FString ToolTip = Description; if (bUseDisplayNameOverride) { - ToolTip += "\r\n\r\nMeta Data Key: \"" + Key.ToString() + "\""; + ToolTip += "\r\n\r\nMetadata Key: \"" + Key.ToString() + "\""; } return FText::FromString(ToolTip); } diff --git a/Source/MDMetaDataEditor/Private/Types/MDMetaDataKey.h b/Source/MDMetaDataEditor/Private/Types/MDMetaDataKey.h index 5720328..ca3b416 100644 --- a/Source/MDMetaDataEditor/Private/Types/MDMetaDataKey.h +++ b/Source/MDMetaDataEditor/Private/Types/MDMetaDataKey.h @@ -12,35 +12,35 @@ UENUM() enum class EMDMetaDataEditorKeyType : uint8 { - // The meta data key is added or removed with a checkbox but doesn't have a value + // The metadata key is added or removed with a checkbox but doesn't have a value Flag, - // The meta data value is set to true or false with a checkbox, + // The metadata value is set to true or false with a checkbox, Boolean, - // The meta data value is a user-specified string + // The metadata value is a user-specified string String, - // The meta data value is a user-specified integer + // The metadata value is a user-specified integer Integer, - // The meta data value is a user-specified floating point + // The metadata value is a user-specified floating point Float, - // The meta data value is a user-specified Gameplay Tag + // The metadata value is a user-specified Gameplay Tag GameplayTag, - // The meta data value is one or more user-specified Gameplay Tags + // The metadata value is one or more user-specified Gameplay Tags GameplayTagContainer, - // The meta data value is selected from the list of specified values + // The metadata value is selected from the list of specified values ValueList - // TODO - The meta data value is a UStruct path + // TODO - The metadata value is a UStruct path // Struct, - // TODO - The meta data value is a UClass path + // TODO - The metadata value is a UClass path // Class, - // TODO - The meta data value is a UInterface path + // TODO - The metadata value is a UInterface path // Interface, - // TODO - The meta data value is a UEnum path + // TODO - The metadata value is a UEnum path // Enum, - // TODO - The meta data value is a value of a specific enum (maybe always of the property? Let user select UEnum if property isn't an enum?) + // TODO - The metadata value is a value of a specific enum (maybe always of the property? Let user select UEnum if property isn't an enum?) // EnumValue, - // TODO - The meta data value is the name of a param on this function + // TODO - The metadata value is the name of a param on this function // Param, - // TODO - Provide a custom Struct that creates the editor widget and sets the value of the meta data + // TODO - Provide a custom Struct that creates the editor widget and sets the value of the metadata // Custom, }; @@ -50,39 +50,39 @@ struct FMDMetaDataKey GENERATED_BODY() public: - UPROPERTY(EditAnywhere, Config, Category = "Meta Data Editor") + UPROPERTY(EditAnywhere, Config, Category = "Metadata Editor") FName Key = NAME_None; - UPROPERTY(EditAnywhere, Config, Category = "Meta Data Editor") + UPROPERTY(EditAnywhere, Config, Category = "Metadata Editor") EMDMetaDataEditorKeyType KeyType = EMDMetaDataEditorKeyType::Flag; - UPROPERTY(EditAnywhere, Config, Category = "Meta Data Editor", meta = (MultiLine)) + UPROPERTY(EditAnywhere, Config, Category = "Metadata Editor", meta = (MultiLine)) FString Description; - // Group meta data in sub-categories by setting this value, nested categories delineated with pipe characters `|` - UPROPERTY(EditAnywhere, Config, Category = "Meta Data Editor") + // Group metadata in sub-categories by setting this value, nested categories delineated with pipe characters `|` + UPROPERTY(EditAnywhere, Config, Category = "Metadata Editor") FString Category; // This metadata value will be hidden unless the property/function also has the specified `RequiredMetaData` - UPROPERTY(EditAnywhere, Config, Category = "Meta Data Editor", meta = (GetOptions = "GetMetaDataKeyNames")) + UPROPERTY(EditAnywhere, Config, Category = "Metadata Editor", meta = (GetOptions = "GetMetaDataKeyNames")) FName RequiredMetaData = NAME_None; FMDMetaDataKey& SetRequiredMetaData(const FName& InRequiredMetaData) { RequiredMetaData = InRequiredMetaData; return *this; } // This metadata value will be hidden if the property/function also has any of the specified `IncompatibleMetaData` - UPROPERTY(EditAnywhere, Config, Category = "Meta Data Editor", meta = (GetOptions = "GetMetaDataKeyNames")) + UPROPERTY(EditAnywhere, Config, Category = "Metadata Editor", meta = (GetOptions = "GetMetaDataKeyNames")) TSet IncompatibleMetaData; FMDMetaDataKey& AddIncompatibleMetaData(const FName& InIncompatibleMetaData) { IncompatibleMetaData.Add(InIncompatibleMetaData); return *this; } FMDMetaDataKey& SetIncompatibleMetaData(const FName& InIncompatibleMetaData) { IncompatibleMetaData = { InIncompatibleMetaData}; return *this; } FMDMetaDataKey& SetIncompatibleMetaData(TSet&& InIncompatibleMetaData) { IncompatibleMetaData = MoveTemp(InIncompatibleMetaData); return *this; } - UPROPERTY(EditAnywhere, Config, Category = "Meta Data Editor") + UPROPERTY(EditAnywhere, Config, Category = "Metadata Editor") TSet> SupportedBlueprints = { UBlueprint::StaticClass() }; FMDMetaDataKey& ClearSupportedBlueprints() { SupportedBlueprints.Reset(); return *this; } FMDMetaDataKey& AddSupportedBlueprint(TSoftClassPtr&& InSupportedBlueprint) { SupportedBlueprints.Emplace(MoveTemp(InSupportedBlueprint)); return *this; } FMDMetaDataKey& SetSupportedBlueprint(TSoftClassPtr&& InSupportedBlueprint) { ClearSupportedBlueprints().AddSupportedBlueprint(MoveTemp(InSupportedBlueprint)); return *this; } FMDMetaDataKey& SetSupportedBlueprints(const TSet>& InSupportedBlueprints) { SupportedBlueprints = InSupportedBlueprints; return *this; } - UPROPERTY(EditAnywhere, Config, Category = "Meta Data Editor") + UPROPERTY(EditAnywhere, Config, Category = "Metadata Editor") TSet SupportedPropertyTypes = { { UEdGraphSchema_K2::PC_Wildcard } }; FMDMetaDataKey& ClearSupportedProperties() { SupportedPropertyTypes.Reset(); return *this; } FMDMetaDataKey& AddSupportedProperty(FMDMetaDataEditorPropertyType&& InSupportedProperty) { SupportedPropertyTypes.Emplace(MoveTemp(InSupportedProperty)); return *this; } @@ -111,75 +111,75 @@ struct FMDMetaDataKey } FMDMetaDataKey& SetSupportedClassProperty(UClass* ObjectClass, bool bIncludeSoft = false) { return ClearSupportedProperties().AddSupportedClassProperty(ObjectClass, bIncludeSoft); } - UPROPERTY(EditAnywhere, Config, Category = "Meta Data Editor") + UPROPERTY(EditAnywhere, Config, Category = "Metadata Editor") bool bCanBeUsedByFunctions = false; FMDMetaDataKey& CanBeUsedByFunctions(bool InCanBeUsedByFunctions) { bCanBeUsedByFunctions = InCanBeUsedByFunctions; return *this; } FMDMetaDataKey& SetFunctionsOnly() { bCanBeUsedByFunctions = true; bCanBeUsedOnFunctionParameters = false; bCanBeUsedOnVariables = false; bCanBeUsedOnLocalVariables = false; ClearSupportedProperties(); return *this; } - // Whether or not this meta data can be used on Blueprint Variables - UPROPERTY(EditAnywhere, Config, Category = "Meta Data Editor") + // Whether or not this metadata can be used on Blueprint Variables + UPROPERTY(EditAnywhere, Config, Category = "Metadata Editor") bool bCanBeUsedOnVariables = true; FMDMetaDataKey& CanBeUsedOnVariables(bool InCanBeUsedOnVariables) { bCanBeUsedOnVariables = InCanBeUsedOnVariables; return *this; } - // Whether or not this meta data can be used on Blueprint Function's Local Variables - UPROPERTY(EditAnywhere, Config, Category = "Meta Data Editor") + // Whether or not this metadata can be used on Blueprint Function's Local Variables + UPROPERTY(EditAnywhere, Config, Category = "Metadata Editor") bool bCanBeUsedOnLocalVariables = true; FMDMetaDataKey& CanBeUsedOnLocalVariables(bool InCanBeUsedOnLocalVariables) { bCanBeUsedOnLocalVariables = InCanBeUsedOnLocalVariables; return *this; } - // Whether or not this meta data can be used on Blueprint Function Parameters - UPROPERTY(EditAnywhere, Config, Category = "Meta Data Editor") + // Whether or not this metadata can be used on Blueprint Function Parameters + UPROPERTY(EditAnywhere, Config, Category = "Metadata Editor") bool bCanBeUsedOnFunctionParameters = true; FMDMetaDataKey& CanBeUsedOnFunctionParameters(bool InCanBeUsedOnFunctionParameters) { bCanBeUsedOnFunctionParameters = InCanBeUsedOnFunctionParameters; return *this; } - UPROPERTY(EditAnywhere, Config, Category = "Meta Data Editor", meta = (EditConditionHides, EditCondition = "KeyType == EMDMetaDataEditorKeyType::Integer || KeyType == EMDMetaDataEditorKeyType::Float")) + UPROPERTY(EditAnywhere, Config, Category = "Metadata Editor", meta = (EditConditionHides, EditCondition = "KeyType == EMDMetaDataEditorKeyType::Integer || KeyType == EMDMetaDataEditorKeyType::Float")) bool bAllowSlider = true; FMDMetaDataKey& AllowSlider(bool InAllowSlider) { bAllowSlider = InAllowSlider; return *this; } - UPROPERTY(EditAnywhere, Config, Category = "Meta Data Editor", meta = (EditConditionHides, EditCondition = "KeyType == EMDMetaDataEditorKeyType::Integer")) + UPROPERTY(EditAnywhere, Config, Category = "Metadata Editor", meta = (EditConditionHides, EditCondition = "KeyType == EMDMetaDataEditorKeyType::Integer")) int32 MinInt = TNumericLimits::Lowest(); FMDMetaDataKey& SetMinInt(int32 InMinInt) { MinInt = InMinInt; return *this; } - UPROPERTY(EditAnywhere, Config, Category = "Meta Data Editor", meta = (EditConditionHides, EditCondition = "KeyType == EMDMetaDataEditorKeyType::Integer")) + UPROPERTY(EditAnywhere, Config, Category = "Metadata Editor", meta = (EditConditionHides, EditCondition = "KeyType == EMDMetaDataEditorKeyType::Integer")) int32 MaxInt = TNumericLimits::Max(); FMDMetaDataKey& SetMaxInt(int32 InMaxInt) { MaxInt = InMaxInt; return *this; } - UPROPERTY(EditAnywhere, Config, Category = "Meta Data Editor", meta = (EditConditionHides, EditCondition = "bAllowSlider && KeyType == EMDMetaDataEditorKeyType::Integer")) + UPROPERTY(EditAnywhere, Config, Category = "Metadata Editor", meta = (EditConditionHides, EditCondition = "bAllowSlider && KeyType == EMDMetaDataEditorKeyType::Integer")) int32 MinSliderInt = 0; FMDMetaDataKey& SetMinSliderInt(int32 InMinSliderInt) { MinSliderInt = InMinSliderInt; return *this; } - UPROPERTY(EditAnywhere, Config, Category = "Meta Data Editor", meta = (EditConditionHides, EditCondition = "bAllowSlider && KeyType == EMDMetaDataEditorKeyType::Integer")) + UPROPERTY(EditAnywhere, Config, Category = "Metadata Editor", meta = (EditConditionHides, EditCondition = "bAllowSlider && KeyType == EMDMetaDataEditorKeyType::Integer")) int32 MaxSliderInt = 100; FMDMetaDataKey& SetMaxSliderInt(int32 InMaxSliderInt) { MaxSliderInt = InMaxSliderInt; return *this; } - UPROPERTY(EditAnywhere, Config, Category = "Meta Data Editor", meta = (EditConditionHides, EditCondition = "KeyType == EMDMetaDataEditorKeyType::Float")) + UPROPERTY(EditAnywhere, Config, Category = "Metadata Editor", meta = (EditConditionHides, EditCondition = "KeyType == EMDMetaDataEditorKeyType::Float")) float MinFloat = TNumericLimits::Lowest(); FMDMetaDataKey& SetMinFloat(float InMinFloat) { MinFloat = InMinFloat; return *this; } - UPROPERTY(EditAnywhere, Config, Category = "Meta Data Editor", meta = (EditConditionHides, EditCondition = "KeyType == EMDMetaDataEditorKeyType::Float")) + UPROPERTY(EditAnywhere, Config, Category = "Metadata Editor", meta = (EditConditionHides, EditCondition = "KeyType == EMDMetaDataEditorKeyType::Float")) float MaxFloat = TNumericLimits::Max(); FMDMetaDataKey& SetMaxFloat(float InMaxFloat) { MaxFloat = InMaxFloat; return *this; } - UPROPERTY(EditAnywhere, Config, Category = "Meta Data Editor", meta = (EditConditionHides, EditCondition = "bAllowSlider && KeyType == EMDMetaDataEditorKeyType::Float")) + UPROPERTY(EditAnywhere, Config, Category = "Metadata Editor", meta = (EditConditionHides, EditCondition = "bAllowSlider && KeyType == EMDMetaDataEditorKeyType::Float")) float MinSliderFloat = 0.f; FMDMetaDataKey& SetMinSliderFloat(float InMinSliderFloat) { MinSliderFloat = InMinSliderFloat; return *this; } - UPROPERTY(EditAnywhere, Config, Category = "Meta Data Editor", meta = (EditConditionHides, EditCondition = "bAllowSlider && KeyType == EMDMetaDataEditorKeyType::Float")) + UPROPERTY(EditAnywhere, Config, Category = "Metadata Editor", meta = (EditConditionHides, EditCondition = "bAllowSlider && KeyType == EMDMetaDataEditorKeyType::Float")) float MaxSliderFloat = 100.f; FMDMetaDataKey& SetMaxSliderFloat(float InMaxSliderFloat) { MaxSliderFloat = InMaxSliderFloat; return *this; } - // The list of values the user can select from when setting the value of this meta data key - UPROPERTY(EditAnywhere, Config, Category = "Meta Data Editor", meta = (EditConditionHides, EditCondition = "KeyType == EMDMetaDataEditorKeyType::ValueList")) + // The list of values the user can select from when setting the value of this metadata key + UPROPERTY(EditAnywhere, Config, Category = "Metadata Editor", meta = (EditConditionHides, EditCondition = "KeyType == EMDMetaDataEditorKeyType::ValueList")) TArray ValueList; bool DoesSupportBlueprint(const UBlueprint* Blueprint) const; bool DoesSupportProperty(const FProperty* Property) const; // Overrides the User friendly name to show for this key if not empty. - UPROPERTY(EditAnywhere, Config, Category = "Meta Data Editor", meta = (InlineEditConditionToggle)) + UPROPERTY(EditAnywhere, Config, Category = "Metadata Editor", meta = (InlineEditConditionToggle)) bool bUseDisplayNameOverride = false; // Overrides the User friendly name to show for this key if not empty. - UPROPERTY(EditAnywhere, Config, Category = "Meta Data Editor", meta = (DisplayAfter = "KeyType", EditCondition = "bUseDisplayNameOverride")) + UPROPERTY(EditAnywhere, Config, Category = "Metadata Editor", meta = (DisplayAfter = "KeyType", EditCondition = "bUseDisplayNameOverride")) FText DisplayNameOverride; FMDMetaDataKey& SetDisplayNameOverride(FText&& InDisplayNameOverride) { bUseDisplayNameOverride = true; DisplayNameOverride = MoveTemp(InDisplayNameOverride); return *this; } diff --git a/Source/MDMetaDataEditorGraph/Private/Extensions/MDMetaDataEditorBlueprintCompilerExtension.cpp b/Source/MDMetaDataEditorGraph/Private/Extensions/MDMetaDataEditorBlueprintCompilerExtension.cpp index 85ede0b..308c914 100644 --- a/Source/MDMetaDataEditorGraph/Private/Extensions/MDMetaDataEditorBlueprintCompilerExtension.cpp +++ b/Source/MDMetaDataEditorGraph/Private/Extensions/MDMetaDataEditorBlueprintCompilerExtension.cpp @@ -30,7 +30,7 @@ namespace MDMDEBCE_Private return nullptr; } - // Inits meta data on function-related properties (params & variables) that the engine doesn't already support + // Inits metadata on function-related properties (params & variables) that the engine doesn't already support void InitFunctionNodeMetaData(const UK2Node_FunctionEntry& FunctionNode, const UClass* OldClass, const UBlueprint* Blueprint) { auto InitFunctionMetaData = [&FunctionNode, &OldClass](const UFunction* Function) @@ -40,7 +40,7 @@ namespace MDMDEBCE_Private return; } - // Only functions created in the blueprint can have meta data set + // Only functions created in the blueprint can have metadata set const UFunction* SuperFunc = Function->GetSuperFunction(); while (IsValid(SuperFunc)) { diff --git a/Source/MDMetaDataEditorGraph/Private/Extensions/MDMetaDataEditorBlueprintCompilerExtension.h b/Source/MDMetaDataEditorGraph/Private/Extensions/MDMetaDataEditorBlueprintCompilerExtension.h index af948c6..ceabacf 100644 --- a/Source/MDMetaDataEditorGraph/Private/Extensions/MDMetaDataEditorBlueprintCompilerExtension.h +++ b/Source/MDMetaDataEditorGraph/Private/Extensions/MDMetaDataEditorBlueprintCompilerExtension.h @@ -7,7 +7,7 @@ /** - * Compiler extension to copy meta data into function local variable properties + * Compiler extension to copy metadata into function local variable properties */ UCLASS() class UMDMetaDataEditorBlueprintCompilerExtension : public UBlueprintCompilerExtension