// Copyright (c) Microsoft Corporation. 
// Licensed under the MIT license.

#include "LODRecipeFactory.h"
#include "LODRecipe.h"
#include "Telemetry.h"
#include "TelemetryManager.h"

//////////////////////////////////////////////////////////////////////////
// ULODRecipeFactory

ULODRecipeFactory::ULODRecipeFactory(const FObjectInitializer& ObjectInitializer)
	: Super(ObjectInitializer)
{
	SupportedClass = ULODRecipe::StaticClass();
	bCreateNew = true;
	bEditAfterNew = true;
}

UObject* ULODRecipeFactory::FactoryCreateNew(UClass* InClass, UObject* InParent, FName InName, EObjectFlags Flags, UObject* Context, FFeedbackContext* Warn)
{
	FTelemetryBuilder Builder;
	Builder.SetProperties({ FTelemetry::Prop(TEXT("action"), TEXT("create_new"))
		});

	FTelemetry::Record(SGTC::Factory, SGTC::LODRecipe, MoveTemp(Builder));


	return NewObject<ULODRecipe>(InParent, InClass, InName, Flags);
}

bool ULODRecipeFactory::ShouldShowInNewMenu() const
{
	return true;
}
