// Copyright Epic Games, Inc. All Rights Reserved.

#include "ForestImporterEdMode.h"
#include "ForestImporterEdModeToolkit.h"
#include "Toolkits/ToolkitManager.h"
#include "EditorModeManager.h"

const FEditorModeID FForestImporterEdMode::EM_ForestImporterEdModeId = TEXT("EM_ForestImporterEdMode");

FForestImporterEdMode::FForestImporterEdMode()
{

}

FForestImporterEdMode::~FForestImporterEdMode()
{

}

void FForestImporterEdMode::Enter()
{
	FEdMode::Enter();

	if (!Toolkit.IsValid() && UsesToolkits())
	{
		Toolkit = MakeShareable(new FForestImporterEdModeToolkit);
		Toolkit->Init(Owner->GetToolkitHost());
	}
}

void FForestImporterEdMode::Exit()
{
	if (Toolkit.IsValid())
	{
		FToolkitManager::Get().CloseToolkit(Toolkit.ToSharedRef());
		Toolkit.Reset();
	}

	// Call base Exit method to ensure proper cleanup
	FEdMode::Exit();
}

bool FForestImporterEdMode::UsesToolkits() const
{
	return true;
}




