You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
StructUtilsTestSuite has been moved to Developper StructUtilsEditor has been moved to Engine/Editor NetSerialization for FInstancedStruct not using native serialization has been moved to the engine module since FRepLayout is not available in CoreUObject module. Old plugins and modules are kept temporarily and will be remove in a different CL Temporary header files added to facilitate transition to the new include path #jira UE-216472 #rb Devin.Doucette, Francis.Hurteau [CL 34509881 by yoan stamant in ue5-main branch]
61 lines
2.2 KiB
C++
61 lines
2.2 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "StructViewerFilter.h"
|
|
#include "StructViewerModule.h"
|
|
#include "Widgets/SCompoundWidget.h"
|
|
|
|
class IPropertyHandle;
|
|
class IPropertyUtilities;
|
|
class IAssetReferenceFilter;
|
|
class SComboButton;
|
|
|
|
/**
|
|
* Filter used by the instanced struct struct picker.
|
|
*/
|
|
class STRUCTUTILSEDITOR_API FInstancedStructFilter : public IStructViewerFilter
|
|
{
|
|
public:
|
|
/** The base struct for the property that classes must be a child-of. */
|
|
TWeakObjectPtr<const UScriptStruct> BaseStruct = nullptr;
|
|
|
|
// A flag controlling whether we allow UserDefinedStructs
|
|
bool bAllowUserDefinedStructs = false;
|
|
|
|
// A flag controlling whether we allow to select the BaseStruct
|
|
bool bAllowBaseStruct = true;
|
|
|
|
virtual bool IsStructAllowed(const FStructViewerInitializationOptions& InInitOptions, const UScriptStruct* InStruct, TSharedRef<FStructViewerFilterFuncs> InFilterFuncs) override;
|
|
virtual bool IsUnloadedStructAllowed(const FStructViewerInitializationOptions& InInitOptions, const FSoftObjectPath& InStructPath, TSharedRef<FStructViewerFilterFuncs> InFilterFuncs) override;
|
|
|
|
// Optional filter to prevent selection of some structs e.g. ones in a plugin that is inaccessible from the object being edited
|
|
TSharedPtr<IAssetReferenceFilter> AssetReferenceFilter;
|
|
};
|
|
|
|
class STRUCTUTILSEDITOR_API SInstancedStructPicker : public SCompoundWidget
|
|
{
|
|
public:
|
|
SLATE_BEGIN_ARGS(SInstancedStructPicker) { }
|
|
SLATE_ARGUMENT(FOnStructPicked, OnStructPicked)
|
|
SLATE_END_ARGS()
|
|
|
|
void Construct(const FArguments& InArgs, TSharedPtr<IPropertyHandle> InStructProperty, TSharedPtr<IPropertyUtilities> InPropertyUtils);
|
|
|
|
FOnStructPicked OnStructPicked;
|
|
|
|
private:
|
|
TSharedPtr<SComboButton> ComboButton;
|
|
TSharedPtr<IPropertyHandle> StructProperty;
|
|
TSharedPtr<IPropertyUtilities> PropUtils;
|
|
|
|
/** The base struct that we're allowing to be picked (controlled by the "BaseStruct" meta-data) */
|
|
TWeakObjectPtr<UScriptStruct> BaseScriptStruct = nullptr;
|
|
|
|
FText GetDisplayValueString() const;
|
|
FText GetTooltipText() const;
|
|
const FSlateBrush* GetDisplayValueIcon() const;
|
|
TSharedRef<SWidget> GenerateStructPicker();
|
|
void StructPicked(const UScriptStruct* InStruct);
|
|
};
|