You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
19 lines
672 B
C++
19 lines
672 B
C++
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
||
|
|
|
||
|
|
#include "LandscapeEditorServices.h"
|
||
|
|
#include "SLandscapeLayerListDialog.h"
|
||
|
|
|
||
|
|
#if WITH_EDITOR
|
||
|
|
int32 FLandscapeEditorServices::GetOrCreateEditLayer(FName InEditLayerName, ALandscape* InTargetLandscape)
|
||
|
|
{
|
||
|
|
int32 ExistingLayerIndex = InTargetLandscape->GetLayerIndex(InEditLayerName);
|
||
|
|
if (ExistingLayerIndex == INDEX_NONE)
|
||
|
|
{
|
||
|
|
InTargetLandscape->CreateLayer(InEditLayerName);
|
||
|
|
TSharedPtr<SLandscapeLayerListDialog> Dialog = SNew(SLandscapeLayerListDialog, InTargetLandscape->LandscapeLayers);
|
||
|
|
Dialog->ShowModal();
|
||
|
|
ExistingLayerIndex = Dialog->InsertedLayerIndex;
|
||
|
|
}
|
||
|
|
return ExistingLayerIndex;
|
||
|
|
}
|
||
|
|
#endif // WITH_EDITOR
|