// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "Containers/UnrealString.h" #include "IPropertyTypeCustomization.h" #include "Input/Reply.h" #include "Internationalization/Text.h" #include "Templates/SharedPointer.h" class IMenu; class IPropertyHandle; class SButton; 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 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); /** Delegate to determine whether the browse button should be enabled */ bool IsBrowseEnabled(TSharedRef PropertyHandle) const; private: /** 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; };