#pragma once

#include "CoreMinimal.h"
#include "StoreCharactersSelectionViewInterface.h"
#include "CoreBaseUserWidget.h"
#include "StoreCharacterSelectedDelegate.h"
#include "Templates/SubclassOf.h"
#include "ESortingOption.h"
#include "ESortingOrder.h"
#include "ERightStickMode.h"
#include "Components/SlateWrapperTypes.h"
#include "StoreCharactersFiltersData.h"
#include "CoreStoreCharactersSelectionWidget.generated.h"

class UCoreStoreCharacterItemWidget;
class UUniformGridPanel;
class UCoreStoreCharactersFilterWidget;
class UCoreIconToggleWidget;
class UCoreSearchBarWidget;
class UCoreStoreCharacterPerksToastWidget;
class UCoreInfoMessageWidget;
class UDBDScrollBox;
class UCorePreConstructableList;
class UCoreButtonWidget;
class UCoreSelectableButtonWidget;

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

protected:
	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	FStoreCharacterSelectedDelegate _characterSelectedDelegate;

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

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	int32 _numberOfColumns;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	float _itemScale;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	int32 _layoutMask;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, NoClear)
	int32 _preConstructedItemsCount;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	bool _defaultFilterAvailable;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	bool _defaultFilterOwned;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	int32 _sortingOptions;

	UPROPERTY(EditAnywhere)
	ESortingOption _defaultSortingOption;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	ESortingOrder _defaultSortingOrder;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidgetOptional))
	UUniformGridPanel* Container;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreStoreCharactersFilterWidget* FiltersWidget;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreIconToggleWidget* FiltersButton;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreSearchBarWidget* SearchBar;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreIconToggleWidget* PerksToastButton;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreStoreCharacterPerksToastWidget* PerksToast;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreInfoMessageWidget* EmptyContentWidget;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Transient, meta=(BindWidgetOptional))
	UCoreStoreCharacterItemWidget* _selectedItem;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	FText _filtersTooltipText;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	FText _closeFiltersTooltipText;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	FText _perksTooltipText;

private:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Export, meta=(AllowPrivateAccess=true))
	UDBDScrollBox* CharacterSelectionScrollBox;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	UCorePreConstructableList* _characterList;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	ERightStickMode _rightStickMode;

public:
	UFUNCTION(BlueprintCallable)
	void SetRightStickMode(ERightStickMode rightStickMode);

protected:
	UFUNCTION(BlueprintCallable)
	void OnPerkWidgetVisibilityChanged(ESlateVisibility newVisibility);

	UFUNCTION(BlueprintCallable)
	void OnPerkToastButtonClick(UCoreButtonWidget* buttonTarget);

	UFUNCTION(BlueprintCallable)
	void OnFiltersWidgetVisibilityChanged(const ESlateVisibility newVisibility);

	UFUNCTION(BlueprintCallable)
	void OnFiltersChanged(const FStoreCharactersFiltersData& storeFiltersData);

	UFUNCTION(BlueprintCallable)
	void OnFiltersButtonClicked(UCoreButtonWidget* buttonTarget);

	UFUNCTION(BlueprintCallable)
	void OnClearFiltersClicked();

	UFUNCTION(BlueprintCallable)
	void OnCharacterSelected(UCoreSelectableButtonWidget* buttonTarget, bool isSelected);

public:
	UFUNCTION(BlueprintPure)
	ERightStickMode GetRightStickMode() const;

	UFUNCTION(BlueprintPure)
	UDBDScrollBox* GetCharacterSelectionScrollBox() const;

public:
	UCoreStoreCharactersSelectionWidget();
};

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