#pragma once

#include "CoreMinimal.h"
#include "CoreBaseUserWidget.h"
#include "ClaimedRitualDelegate.h"
#include "RemovedDailyRitualDelegate.h"
#include "OnOutOfDailyRitualsDelegate.h"
#include "Templates/SubclassOf.h"
#include "DailyRitualViewData.h"
#include "DailyRitualsContainerWidget.generated.h"

class UDailyRitualTileWidget;
class UCanvasPanel;
class UDBDTextBlock;
class UUITweenInstance;

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

protected:
	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	FClaimedRitualDelegate _claimButtonClickedDelegate;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	FRemovedDailyRitualDelegate _removeButtonClickedDelegate;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	FOnOutOfDailyRitualsDelegate _onOutOfDailyRitualsDelegate;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, NoClear)
	TSubclassOf<UDailyRitualTileWidget> DailyRitualTileWidgetClass;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, NoClear)
	TSubclassOf<UDailyRitualTileWidget> OnboardingRitualTileWidgetClass;

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

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

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	float TilePadding;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	float FadeInNoRitualsWarningTextDuration;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	float AlignmentAnimationDuration;

private:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	UUITweenInstance* _alignAssignedRitualsTween;

public:
	UFUNCTION(BlueprintCallable)
	void StartAnim();

	UFUNCTION(BlueprintCallable)
	void SetData(TArray<FDailyRitualViewData> dailyRitualsData, const bool isAfterTrial);

private:
	UFUNCTION(BlueprintCallable)
	void OnRecentlyAssignedDailyRitualFadeInComplete(UDailyRitualTileWidget* dailyRitualTile);

	UFUNCTION(BlueprintCallable)
	void OnDelayUntilFadeInSequenceComplete(UUITweenInstance* delayUntilFadeInSequenceTween);

	UFUNCTION(BlueprintCallable)
	void OnDailyRitualTileFadeOutComplete(UDailyRitualTileWidget* dailyRitualTile);

protected:
	UFUNCTION(BlueprintCallable)
	void OnDailyRitualRemoveButtonClicked(const FString& dailyRitualKey);

	UFUNCTION(BlueprintCallable)
	void OnDailyRitualClaimButtonClicked(const FString& dailyRitualKey);

public:
	UDailyRitualsContainerWidget();
};

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