// Project Lab - NHTV Igad

#pragma once

#include "GUI/Menu/SubMenu.h"
#include "EffectSelector.generated.h"

extern TSubclassOf<class UEffectSelector> defaultEffectSelectorClass;

UCLASS()
class UNREALPROJECT_API UEffectSelector : public USubMenu
{
	GENERATED_BODY()
public:
	UEffectSelector(const FObjectInitializer& init);
	virtual void NativeConstruct();

	UFUNCTION(BlueprintImplementableEvent)
	void OnSelectionConfirmed(UEffectSlot* effect);

	UFUNCTION(BlueprintCallable, Category="EffectSelector")
	void Init(class USkillWidget* widget);
	UFUNCTION(BlueprintCallable, Category = "EffectSelector")
	void Init2(TArray<class UAbilityInfo*> abilities);

	UPROPERTY(EditDefaultsOnly)
	TSubclassOf<class UEffectSlot> effectSlotClass;

	UPROPERTY(BlueprintReadOnly)
	class UBaseSkillObject* skill;
	UPROPERTY(BlueprintReadOnly)
	class USkillWidget* widget;

	DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnEffectSelected, int32, selected);
	UPROPERTY(BlueprintAssignable)
	FOnEffectSelected onEffectSelected;

private:
	UFUNCTION()
	void m_OnItemSelected(UMenuItemBase* item);
	UFUNCTION()
	void m_OnItemSelectionConfirmed(UMenuItemBase* item);

	UPROPERTY()
	UTextBlock* m_nameField;
	UPROPERTY()
	UMultiLineEditableTextBox* m_descriptionField;
	UPROPERTY()
	UPanelWidget* m_container;
	UPROPERTY()
	TArray<class UEffectSlot*> m_effectSlots;
};
