Files
UnrealEngineUWP/Engine/Source/Editor/DetailCustomizations/Private/PointLightComponentDetails.cpp
Daniel Wright f8a13b59d7 From NickA - Added ability to set per-property instance metadata.
[CL 2601290 by Daniel Wright in Main branch]
2015-06-25 17:00:49 -04:00

25 lines
1021 B
C++

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#include "DetailCustomizationsPrivatePCH.h"
#include "PointLightComponentDetails.h"
#include "Components/LightComponentBase.h"
#define LOCTEXT_NAMESPACE "PointLightComponentDetails"
TSharedRef<IDetailCustomization> FPointLightComponentDetails::MakeInstance()
{
return MakeShareable( new FPointLightComponentDetails );
}
void FPointLightComponentDetails::CustomizeDetails( IDetailLayoutBuilder& DetailBuilder )
{
TSharedPtr<IPropertyHandle> LightIntensityProperty = DetailBuilder.GetProperty(GET_MEMBER_NAME_CHECKED(ULightComponentBase, Intensity), ULightComponentBase::StaticClass());
// Inverse squared falloff point lights (the default) are in units of lumens, instead of just being a brightness scale
LightIntensityProperty->SetInstanceMetaData("UIMin",TEXT("0.0f"));
LightIntensityProperty->SetInstanceMetaData("UIMax", TEXT("100000.0f"));
LightIntensityProperty->SetInstanceMetaData("SliderExponent", TEXT("2.0f"));
}
#undef LOCTEXT_NAMESPACE