#pragma once

#include "CoreMinimal.h"
#include "CoreButtonSelector.h"
#include "Templates/SubclassOf.h"
#include "Layout/Margin.h"
#include "ChallengeSetMenuViewData.h"
#include "CoreChallengeSetListWidget.generated.h"

class UCoreChallengeSetItemWidget;
class UDBDScrollBox;
class UVerticalBox;
class UCorePreConstructableList;
class UDataTable;
class UCoreSelectableButtonWidget;

UCLASS(Blueprintable, EditInlineNew)
class DBDUIVIEWSCORE_API UCoreChallengeSetListWidget : public UCoreButtonSelector
{
	GENERATED_BODY()

protected:
	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	int32 _preConstructedItemsCount;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, NoClear)
	TSubclassOf<UCoreChallengeSetItemWidget> _itemWidgetClass;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	FMargin _itemMargin;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UDBDScrollBox* ItemsScrollBox;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UVerticalBox* ItemsContainer;

private:
	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	UCorePreConstructableList* _itemList;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient, Instanced, meta=(AllowPrivateAccess=true))
	UCoreChallengeSetItemWidget* _selectedItemWidget;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient, Instanced, meta=(AllowPrivateAccess=true))
	TArray<UCoreChallengeSetItemWidget*> _challengeSetButtons;

public:
	UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
	void SetChallengeSetData(const TArray<FChallengeSetMenuViewData>& challengeSetArray, UDataTable* eventSkinDataTable);

private:
	UFUNCTION(BlueprintCallable)
	void OnItemSelected(UCoreSelectableButtonWidget* button, bool isSelected);

public:
	UCoreChallengeSetListWidget();
};

FORCEINLINE uint32 GetTypeHash(const UCoreChallengeSetListWidget) { return 0; }
