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

#pragma once

#include "CoreMinimal.h"
#include "UObject/GCObject.h"
#include "Toolkits/IToolkitHost.h"
#include "Toolkits/AssetEditorToolkit.h"

class ULODRecipe;

class FLODRecipeEditor : public FAssetEditorToolkit, public FGCObject
{
public:
	FLODRecipeEditor();

	// IToolkit interface
	virtual void RegisterTabSpawners(const TSharedRef<class FTabManager>& TabManager) override;
	//virtual void UnregisterTabSpawners(const TSharedRef<class FTabManager>& TabManager) override;
	// End of IToolkit interface

	// FAssetEditorToolkit
	virtual FName GetToolkitFName() const override;
	virtual FText GetBaseToolkitName() const override;
	virtual FText GetToolkitName() const override;
	virtual FText GetToolkitToolTipText() const override;
	virtual FLinearColor GetWorldCentricTabColorScale() const override;
	virtual FString GetWorldCentricTabPrefix() const override;
	virtual FString GetDocumentationLink() const override;
	virtual void OnToolkitHostingStarted(const TSharedRef<class IToolkit>& Toolkit) override;
	virtual void OnToolkitHostingFinished(const TSharedRef<class IToolkit>& Toolkit) override;
	// End of FAssetEditorToolkit

	// FSerializableObject interface
	virtual void AddReferencedObjects(FReferenceCollector& Collector) override;
	// End of FSerializableObject interface

	void InitLODRecipeEditor(const EToolkitMode::Type Mode, const TSharedPtr< class IToolkitHost >& InitToolkitHost, class ULODRecipe* InitLODRecipe);

	ULODRecipe* GetLODRecipeBeingEdited() const { return RecipeBeingEdited; }

protected:
	TSharedRef<SDockTab> SpawnTabDetails(const FSpawnTabArgs& Args);
	TSharedRef<SDockTab> SpawnTabMorphTargets(const FSpawnTabArgs& Args);

protected:
	ULODRecipe* RecipeBeingEdited;
	TSharedPtr<class SLODRecipePropertiesTab> DetailsTab;
	TSharedPtr<class SAllowMorphTargetsWidget> MorphTargetsTab;
};
