// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "ChaosClothAsset/ConnectableValueCustomization.h" template struct TOptional; namespace UE::Chaos::ClothAsset { /** * Customization for all property that also uses weight maps. * Works like a FMathStructCustomization with the difference that * the structure member short names are displayed in the header's row. */ class FWeightedValueCustomization : public FConnectableValueCustomization { public: static TSharedRef MakeInstance(); FWeightedValueCustomization(); virtual ~FWeightedValueCustomization() override; protected: //~ Begin IPropertyTypeCustomization implementation virtual void CustomizeChildren( TSharedRef PropertyHandle, IDetailChildrenBuilder& ChildBuilder, IPropertyTypeCustomizationUtils& CustomizationUtils) { // Skip the FConnectableValueCustomization implementation that doesn't display children FImportedValueCustomization::CustomizeChildren(PropertyHandle, ChildBuilder, CustomizationUtils); } //~ End IPropertyTypeCustomization implementation //~ Begin FMathStructCustomization implementation virtual void MakeHeaderRow(TSharedRef& StructPropertyHandle, FDetailWidgetRow& Row) override; virtual TSharedRef MakeChildWidget(TSharedRef& StructurePropertyHandle, TSharedRef& PropertyHandle) override; //~ End FMathStructCustomization implementation private: static void ExtractFloatMetadata( TSharedRef& PropertyHandle, TOptional& MinValue, TOptional& MaxValue, TOptional& SliderMinValue, TOptional& SliderMaxValue, float& SliderExponent, float& Delta, float& ShiftMultiplier, float& CtrlMultiplier, bool& SupportDynamicSliderMaxValue, bool& SupportDynamicSliderMinValue); TSharedRef MakeFloatWidget(TSharedRef& StructurePropertyHandle, TSharedRef& PropertyHandle); void OnDynamicSliderMaxValueChanged(float NewMaxSliderValue, TWeakPtr InValueChangedSourceWidget, bool IsOriginator, bool UpdateOnlyIfHigher); void OnDynamicSliderMinValueChanged(float NewMinSliderValue, TWeakPtr InValueChangedSourceWidget, bool IsOriginator, bool UpdateOnlyIfLower); }; }