#pragma once

#include "CoreMinimal.h"
#include "ChallengesMenuViewInterface.h"
#include "CoreBaseUserWidget.h"
#include "Templates/SubclassOf.h"
#include "BackButtonClickedDelegate.h"
#include "ChallengeSetListWidgetSelectedDelegate.h"
#include "SettingsButtonClickedDelegate.h"
#include "ChallengesMenuButtonClickedDelegate.h"
#include "InfoButtonClickedDelegate.h"
#include "ChallengesMenuTabSelectedDelegate.h"
#include "ChallengeSkinUIData.h"
#include "CoreChallengesMenuWidget.generated.h"

class UDBDTextBlock;
class UWidgetSwitcher;
class UOverlay;
class UCoreInputSwitcherWidget;
class UCoreFooterButtonWidget;
class UCoreFooterInputSwitcherWidget;
class UCoreChallengeSetListWidget;
class UChallengesMenuRiftButtonWidget;
class UChallengesMenuChallengeSetWidget;
class UDataTable;
class UCoreButtonWidget;
class UCoreSelectableButtonWidget;

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

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

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UDBDTextBlock* SubtitleTB;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UWidgetSwitcher* TabContentSwitcher;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UOverlay* ContentsOverlay;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreInputSwitcherWidget* BackInputSwitcher;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreFooterButtonWidget* SettingsButton;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreFooterButtonWidget* InfoButton;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreFooterInputSwitcherWidget* FollowChallengeInputSwitcher;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreInputSwitcherWidget* GoToRiftPassInputSwitcher;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreInputSwitcherWidget* GoToEventInputSwitcher;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreChallengeSetListWidget* ChallengeSetList;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UChallengesMenuRiftButtonWidget* ChallengesMenuRiftButton;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	TSubclassOf<UChallengesMenuChallengeSetWidget> ChallengeSetWidgetClass;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, NoClear)
	UDataTable* _eventSkinDataTable;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, BlueprintCallable)
	FBackButtonClickedDelegate _backButtonClickedDelegate;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, BlueprintCallable)
	FChallengeSetListWidgetSelectedDelegate _challengeSetSelectedDelegate;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, BlueprintCallable)
	FSettingsButtonClickedDelegate _settingsButtonClickedDelegate;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, BlueprintCallable)
	FChallengesMenuButtonClickedDelegate _goToEventButtonClickedDelegate;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, BlueprintCallable)
	FChallengesMenuButtonClickedDelegate _goToRiftPassButtonClickedDelegate;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, BlueprintCallable)
	FInfoButtonClickedDelegate _onInfoButtonClicked;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, BlueprintCallable)
	FChallengesMenuTabSelectedDelegate _tabSelectedDelegate;

protected:
	UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
	void UpdateChallengeMenuVisuals(const FChallengeSkinUIData& challengeSkinData);

	UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
	void SetUiTakeoverVisuals(bool isActive);

	UFUNCTION(BlueprintCallable)
	void OnSettingsButtonClicked(UCoreButtonWidget* button);

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

	UFUNCTION(BlueprintCallable)
	void OnMenuTabSelected(UCoreSelectableButtonWidget* selectedButton);

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

	UFUNCTION(BlueprintCallable)
	void OnGoToRiftPassButtonClicked();

	UFUNCTION(BlueprintCallable)
	void OnGoToEventButtonClicked();

	UFUNCTION(BlueprintCallable)
	void OnChallengeSetSelected(const FString& challengeSetId, const FString& eventFrameLabel);

	UFUNCTION(BlueprintCallable)
	void OnBackButtonClicked();

public:
	UCoreChallengesMenuWidget();
};

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