#pragma once

#include "CoreMinimal.h"
#include "CoreBaseUserWidget.h"
#include "StoreCharmSlotSelectedDelegate.h"
#include "Templates/SubclassOf.h"
#include "Layout/Margin.h"
#include "CoreStoreCharmSlotListWidget.generated.h"

class UCoreStoreCharmSlotWidget;
class UHorizontalBox;
class UDBDTextBlock;
class UCorePreConstructableList;
class UCoreSelectableButtonWidget;

UCLASS(Blueprintable, EditInlineNew)
class DBDUIVIEWSCORE_API UCoreStoreCharmSlotListWidget : public UCoreBaseUserWidget
{
	GENERATED_BODY()

protected:
	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	FStoreCharmSlotSelectedDelegate _charmSlotSelectedDelegate;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, NoClear)
	TSubclassOf<UCoreStoreCharmSlotWidget> _charmSlotItemWidgetClass;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, NoClear)
	int32 _preConstructedCharmSlotsCount;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, NoClear)
	FMargin _charmSlotsPadding;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidgetOptional))
	UHorizontalBox* CharmSlotsContainer;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidgetOptional))
	UDBDTextBlock* TitleTB;

private:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	UCorePreConstructableList* _charmSlotList;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Transient, Export, meta=(AllowPrivateAccess=true))
	UCoreStoreCharmSlotWidget* _selectedCharmSlotItem;

protected:
	UFUNCTION(BlueprintCallable)
	void OnCharmSlotSelected(UCoreSelectableButtonWidget* buttonTarget, bool isSelected);

public:
	UCoreStoreCharmSlotListWidget();
};

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