// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "CoreMinimal.h" #include "Input/Reply.h" #include "IPropertyTypeCustomization.h" #include "PropertyHandle.h" class SButton; class SComboButton; class IMenu; class FDirectoryPathStructCustomization : public IPropertyTypeCustomization { public: static TSharedRef MakeInstance(); /** IPropertyTypeCustomization interface */ virtual void CustomizeHeader( TSharedRef StructPropertyHandle, class FDetailWidgetRow& HeaderRow, IPropertyTypeCustomizationUtils& StructCustomizationUtils ) override; virtual void CustomizeChildren( TSharedRef StructPropertyHandle, class IDetailChildrenBuilder& StructBuilder, IPropertyTypeCustomizationUtils& StructCustomizationUtils ) override; private: /** Delegate for displaying text value of path */ FText GetDisplayedText(TSharedRef PropertyHandle) const; /** Delegate used to display a directory picker */ FReply OnPickContent(TSharedRef PropertyHandle) ; /** Delegate used to display a directory picker */ FReply OnPickDirectory(TSharedRef PropertyHandle, const bool bRelativeToGameContentDir, const bool bUseRelativePaths) const; /** Check whether that the chosen path is valid */ bool IsValidPath(const FString& AbsolutePath, const bool bRelativeToGameContentDir, FText* const OutReason = nullptr) const; /** Called when a path is picked from the path picker */ void OnPathPicked(const FString& Path, TSharedRef PropertyHandle); /** The browse button widget */ TSharedPtr BrowseButton; /** The pick button widget */ TSharedPtr PickerButton; /** The pick button popup menu*/ TSharedPtr PickerMenu; /** Absolute path to the game content directory */ FString AbsoluteGameContentDir; };