// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "CoreMinimal.h" #include "Layout/Visibility.h" #include "IPropertyTypeCustomization.h" #include "GameplayEffect.h" #include "PropertyHandle.h" class FDetailWidgetRow; class IDetailChildrenBuilder; /** Details customization for FGameplayEffectModifierMagnitude */ class FGameplayEffectModifierMagnitudeDetails : public IPropertyTypeCustomization { public: static TSharedRef MakeInstance(); /** Overridden to provide the property name */ virtual void CustomizeHeader(TSharedRef StructPropertyHandle, FDetailWidgetRow& HeaderRow, IPropertyTypeCustomizationUtils& StructCustomizationUtils) override; /** Overridden to only show the magnitude that is currently being used based on calculation type */ virtual void CustomizeChildren(TSharedRef StructPropertyHandle, IDetailChildrenBuilder& StructBuilder, IPropertyTypeCustomizationUtils& StructCustomizationUtils) override; private: /** Called via delegate when the user changes the calculation type */ void OnCalculationTypeChanged(); /** Visibility delegate for the various methods of calculating magnitude */ EVisibility GetMagnitudeCalculationPropertyVisibility(FProperty* InProperty) const; /** Property handle of the enumeration of the magnitude calculation type */ TSharedPtr MagnitudeCalculationTypePropertyHandle; /** Currently visible magnitude calculation type */ EGameplayEffectMagnitudeCalculation VisibleCalculationType; /** Acceleration map for determining whether to show a magnitude property or not */ TMap PropertyToCalcEnumMap; };