2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Customizes a string class reference to look like a UClass property
|
|
|
|
|
*/
|
2014-06-04 10:16:14 -04:00
|
|
|
class FStringClassReferenceCustomization : public IPropertyTypeCustomization
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
public:
|
2014-06-04 10:16:14 -04:00
|
|
|
static TSharedRef<IPropertyTypeCustomization> MakeInstance()
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
return MakeShareable(new FStringClassReferenceCustomization);
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-04 10:16:14 -04:00
|
|
|
/** IPropertyTypeCustomization interface */
|
2014-12-11 02:58:57 -05:00
|
|
|
virtual void CustomizeHeader(TSharedRef<class IPropertyHandle> InPropertyHandle, class FDetailWidgetRow& HeaderRow, IPropertyTypeCustomizationUtils& StructCustomizationUtils) override;
|
|
|
|
|
virtual void CustomizeChildren(TSharedRef<class IPropertyHandle> InPropertyHandle, class IDetailChildrenBuilder& StructBuilder, IPropertyTypeCustomizationUtils& StructCustomizationUtils) override;
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
/** @return The class currently set on this reference */
|
|
|
|
|
const UClass* OnGetClass() const;
|
|
|
|
|
/** Set the class used by this reference */
|
|
|
|
|
void OnSetClass(const UClass* NewClass);
|
|
|
|
|
|
|
|
|
|
/** Find or load the class associated with the given string */
|
|
|
|
|
static const UClass* StringToClass(const FString& ClassName);
|
|
|
|
|
|
2014-12-11 02:58:57 -05:00
|
|
|
/** Handle to the property being customized */
|
|
|
|
|
TSharedPtr<IPropertyHandle> PropertyHandle;
|
2014-03-14 14:13:41 -04:00
|
|
|
/** A cache of the currently resolved value for the class name */
|
|
|
|
|
mutable TWeakObjectPtr<UClass> CachedClassPtr;
|
|
|
|
|
};
|