// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "IDetailCustomization.h" #include "Templates/SharedPointer.h" #include "UObject/WeakObjectPtrTemplates.h" class IDetailLayoutBuilder; class IPropertyHandle; class ULightComponent; class ULocalLightComponent; class FLightComponentDetails : public IDetailCustomization { public: /** Makes a new instance of this detail layout class for a specific detail view requesting it */ static TSharedRef MakeInstance(); /** IDetailCustomization interface */ virtual void CustomizeDetails( IDetailLayoutBuilder& DetailBuilder ) override; virtual void CustomizeDetails(const TSharedPtr& DetailBuilder) override; static void SetComponentIntensity(ULightComponent* Component, float InIntensity); private: /** Helper functions which tell whether the various custom controls are enabled or not */ bool IsLightBrightnessEnabled() const; bool IsUseIESBrightnessEnabled() const; bool IsIESBrightnessScaleEnabled() const; void ResetIntensityToDefault(TSharedPtr PropertyHandle, TWeakObjectPtr Component); bool IsIntensityResetToDefaultVisible(TSharedPtr PropertyHandle, TWeakObjectPtr Component) const; private: TSharedPtr IESBrightnessTextureProperty; TSharedPtr IESBrightnessEnabledProperty; TSharedPtr IESBrightnessScaleProperty; TSharedPtr LightIntensityProperty; TSharedPtr IntensityUnitsProperty; TWeakPtr CachedDetailBuilder; void ResetIntensityUnitsToDefault(TSharedPtr PropertyHandle, ULocalLightComponent* Component); bool IsIntensityUnitsResetToDefaultVisible(TSharedPtr PropertyHandle, ULocalLightComponent* Component) const; /** Called when the intensity units are changed */ void OnIntensityUnitsPreChange(ULocalLightComponent* Component); void OnIntensityUnitsChanged(ULocalLightComponent* Component); /* Add local light intensity with unit */ void AddLocalLightIntensityWithUnit(IDetailLayoutBuilder& DetailBuilder, ULocalLightComponent* Component); float LastLightBrigtness = 0; };