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

#pragma once

#include "CoreMinimal.h"
#include "Widgets/DeclarativeSyntaxSupport.h"
#include "Widgets/SCompoundWidget.h"
#include "Widgets/Views/STableViewBase.h"
#include "Widgets/Views/STableRow.h"

class SAllowMorphTargetsPerLOD : public SCompoundWidget
{
	SLATE_BEGIN_ARGS(SAllowMorphTargetsPerLOD)
	{
	}

	SLATE_END_ARGS()

	/** Widget constructor */
	void Construct(const FArguments& Args, const TSharedRef<class SAllowMorphTargetsWidget> Owner);
	~SAllowMorphTargetsPerLOD();

	void RefreshPerLODCheckBoxes();
private:
	ECheckBoxState IsAllowMorphTargetChecked(const int32 LODIndex) const;
	void OnAllowMorphTargetChanged(ECheckBoxState NewCheckedState, int32 LODIndex);

	// Called when a property on the specified object is modified
	void OnPropertyChanged(UObject* ObjectBeingModified, FPropertyChangedEvent& PropertyChangedEvent);
private:

	TWeakPtr<class SAllowMorphTargetsWidget> OwnerWidget;

	TSharedPtr<SHorizontalBox> PerLODCheckBoxes;

	// Delegate to keep an eye on LOD Recipe changes
	FDelegateHandle OnPropertyChangedDelegateHandle;
};