#pragma once

#include "CoreMinimal.h"
#include "ChallengesMenuRitualsViewInterface.h"
#include "CoreTabContentWidget.h"
#include "Templates/SubclassOf.h"
#include "Layout/Margin.h"
#include "ChallengeSetMenuViewData.h"
#include "UObject/ScriptInterface.h"
#include "ChallengesMenuRitualsWidget.generated.h"

class UCoreChallengeMenuSubListWidget;
class UCoreChallengeCardWidget;
class UDBDScrollBox;
class UVerticalBox;
class UCoreSearchBarWidget;
class UCoreIconToggleWidget;
class UCoreChallengeFilterWidget;
class UCoreInfoMessageWidget;
class ISearchBarViewInterface;
class UCorePreConstructableList;
class UCoreFooterInputSwitcherWidget;
class UCoreButtonWidget;

UCLASS(Blueprintable, EditInlineNew)
class DBDUIVIEWSCORE_API UChallengesMenuRitualsWidget : public UCoreTabContentWidget, public IChallengesMenuRitualsViewInterface
{
	GENERATED_BODY()

protected:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, NoClear)
	TSubclassOf<UCoreChallengeMenuSubListWidget> ChallengeListWidgetClass;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, NoClear)
	TSubclassOf<UCoreChallengeCardWidget> ChallengeCardWidgetClass;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	int32 _sortingOptions;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	int32 _preConstructedChallengeSubListCount;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	FMargin _challengeCardSubListPadding;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	float _lastChallengeCardSubListBottomPadding;

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

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

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

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

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreChallengeFilterWidget* FiltersWidget;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreInfoMessageWidget* MessageWidget;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	FChallengeSetMenuViewData _challengeSetData;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	TScriptInterface<ISearchBarViewInterface> _searchBar;

	UPROPERTY(BlueprintReadWrite, Transient)
	UCorePreConstructableList* _challengeSubListPreConstructableList;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Instanced)
	TArray<UCoreChallengeCardWidget*> _activeChallengeCards;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Instanced)
	TMap<FString, UCoreChallengeMenuSubListWidget*> _challengeSubLists;

	UPROPERTY(BlueprintReadWrite, Transient, Instanced)
	UCoreFooterInputSwitcherWidget* _followChallengeInputSwitcher;

	UPROPERTY(BlueprintReadWrite, Transient, Instanced)
	UCoreChallengeCardWidget* _hoveredChallengeCardWidget;

	UPROPERTY(BlueprintReadWrite, Transient, Instanced)
	TArray<UCoreChallengeCardWidget*> _challengeCardPool;

protected:
	UFUNCTION(BlueprintCallable)
	void ScrollToSelectedItem(const FName& selectedItemId);

	UFUNCTION(BlueprintCallable)
	void OnSortingChanged();

	UFUNCTION(BlueprintCallable)
	void OnFollowChallengeInputSwitcherTriggered();

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

	UFUNCTION(BlueprintCallable)
	void OnChallengeCardUnhovered(UCoreButtonWidget* targetButton);

	UFUNCTION(BlueprintCallable)
	void OnChallengeCardHovered(UCoreButtonWidget* targetButton);

	UFUNCTION(BlueprintCallable)
	void OnChallengeCardClicked(UCoreButtonWidget* targetButton);

public:
	UChallengesMenuRitualsWidget();
};

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