// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "CoreMinimal.h" #include "IDetailCustomization.h" #include "IDetailCustomNodeBuilder.h" #include "IPropertyTypeCustomization.h" class IDetailLayoutBuilder; class FInputContextDetails : public IDetailCustomization { public: /** Makes a new instance of this detail layout class for a specific detail view requesting it */ static TSharedRef MakeInstance(); /** ILayoutDetails interface */ virtual void CustomizeDetails( IDetailLayoutBuilder& DetailBuilder ) override; }; class FEnhancedActionMappingCustomization : public IPropertyTypeCustomization { public: static TSharedRef MakeInstance() { return MakeShareable(new FEnhancedActionMappingCustomization()); } /** IPropertyTypeCustomization interface */ virtual void CustomizeHeader(TSharedRef PropertyHandle, FDetailWidgetRow& HeaderRow, IPropertyTypeCustomizationUtils& CustomizationUtils) override; virtual void CustomizeChildren(TSharedRef PropertyHandle, IDetailChildrenBuilder& ChildBuilder, IPropertyTypeCustomizationUtils& CustomizationUtils) override; private: void RemoveMappingButton_OnClick() const; TSharedPtr KeyStructInstance; TSharedPtr MappingPropertyHandle; }; /** * Customization for UEnhancedInputDeveloperSettings. * * This will just make the normal details panel for UEnhancedInputDeveloperSettings, and then add all the default settings * of Input Triggers and Input Modifiers by gather all the CDO's for them. */ class FEnhancedInputDeveloperSettingsCustomization : public IDetailCustomization { public: //~ IDetailCustomization interface static TSharedRef MakeInstance() { return MakeShareable(new FEnhancedInputDeveloperSettingsCustomization()); } virtual ~FEnhancedInputDeveloperSettingsCustomization(); virtual void CustomizeDetails(IDetailLayoutBuilder& DetailBuilder) override; virtual void CustomizeDetails(const TSharedPtr& DetailBuilder) override; //~ End IDetailCustomization interface private: /** Gather all of the CDO's for the given class, Native and Blueprint. */ static TArray GatherClassDetailsCDOs(UClass* Class); /** * Called when any Asset is added, removed, or renamed. * * This will rebuild the Modifier and Trigger CDO views to make sure that * any newly added Blueprint */ void RebuildDetailsViewForAsset(const FAssetData& AssetData, const bool bIsAssetBeingRemoved); /** Callbacks that are triggered from the Asset Registry. */ void OnAssetAdded(const FAssetData& AssetData) { RebuildDetailsViewForAsset(AssetData, false); } void OnAssetRemoved(const FAssetData& AssetData) { RebuildDetailsViewForAsset(AssetData, true); } void OnAssetRenamed(const FAssetData& AssetData, const FString&) { RebuildDetailsViewForAsset(AssetData, false); } /** * Create a new category on the DetailBuilder and add each object in the given array as an external reference. * * @param DetailBuilder The details builder that can be used to add categories * @param CategoryName The name of the new category to add * @param ObjectsToCustomize Array of CDO objects to customize and add as external references */ void CustomizeCDOValues(IDetailLayoutBuilder& DetailBuilder, const FName CategoryName, const TArray& ObjectsToCustomize); // Cached details builder so that we can rebuild the details when a new BP asset is added TWeakPtr CachedDetailBuilder; /** * Populated by RebuildDetailsViewForAsset so that we can exclude any blueprint classes * that have been removed from the asset registry but are still loaded in memory. * This is reset when CustomizeCDOValues is called */ static TSet ExcludedAssetNames; };