2022-06-23 17:08:58 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#include "DataLayerInstanceCustomization.h"
|
2022-08-24 22:45:13 -04:00
|
|
|
|
|
|
|
|
#include "Containers/Array.h"
|
2022-06-23 17:08:58 -04:00
|
|
|
#include "DetailLayoutBuilder.h"
|
2022-08-24 22:45:13 -04:00
|
|
|
#include "Misc/AssertionMacros.h"
|
|
|
|
|
#include "Templates/Casts.h"
|
|
|
|
|
#include "UObject/Object.h"
|
|
|
|
|
#include "UObject/WeakObjectPtr.h"
|
|
|
|
|
#include "UObject/WeakObjectPtrTemplates.h"
|
|
|
|
|
#include "WorldPartition/DataLayer/DataLayerInstance.h"
|
2022-06-23 17:08:58 -04:00
|
|
|
|
|
|
|
|
#define LOCTEXT_NAMESPACE "FDataLayerInstanceDetails"
|
|
|
|
|
|
|
|
|
|
TSharedRef<IDetailCustomization> FDataLayerInstanceDetails::MakeInstance()
|
|
|
|
|
{
|
|
|
|
|
return MakeShareable(new FDataLayerInstanceDetails);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FDataLayerInstanceDetails::CustomizeDetails(IDetailLayoutBuilder& DetailBuilder)
|
|
|
|
|
{
|
|
|
|
|
TArray<TWeakObjectPtr<UObject>> ObjectsBeingCustomized;
|
|
|
|
|
DetailBuilder.GetObjectsBeingCustomized(ObjectsBeingCustomized);
|
|
|
|
|
|
|
|
|
|
bool bHasRuntime = false;
|
|
|
|
|
for (const TWeakObjectPtr<UObject>& SelectedObject : ObjectsBeingCustomized)
|
|
|
|
|
{
|
|
|
|
|
UDataLayerInstance* DataLayerInstance = Cast<UDataLayerInstance>(SelectedObject.Get());
|
2023-08-11 11:14:31 -04:00
|
|
|
if (DataLayerInstance && DataLayerInstance->IsRuntime() && !DataLayerInstance->IsClientOnly() && !DataLayerInstance->IsServerOnly())
|
2022-06-23 17:08:58 -04:00
|
|
|
{
|
|
|
|
|
bHasRuntime = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!bHasRuntime)
|
|
|
|
|
{
|
|
|
|
|
DetailBuilder.HideProperty(GET_MEMBER_NAME_CHECKED(UDataLayerInstance, InitialRuntimeState));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#undef LOCTEXT_NAMESPACE
|