#pragma once

#include "CoreMinimal.h"
#include "AlertsViewInterface.h"
#include "CoreBaseUserWidget.h"
#include "Templates/SubclassOf.h"
#include "ETooltipHorizontalAlignment.h"
#include "ETooltipVerticalAlignment.h"
#include "ERewardSequencePlaying.h"
#include "AlertsViewData.h"
#include "RiftTierUpViewData.h"
#include "RewardWrapperViewData.h"
#include "CompletedChallengeViewData.h"
#include "ChallengeViewData.h"
#include "UObject/SoftObjectPtr.h"
#include "CoreAlertsWidget.generated.h"

class UCoreRewardWrapperWidget;
class UHorizontalBox;
class UDBDImage;
class UCoreInputSwitcherWidget;
class UDBDTextBlock;
class UAkAudioEvent;
class UDataTable;
class UCoreRewardWidget;
class UCoreButtonWidget;
class UTexture2D;

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

public:
	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	TSubclassOf<UCoreRewardWrapperWidget> RewardWidgetClass;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UHorizontalBox* Container;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UDBDImage* BackgroundImage;

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

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

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

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	ETooltipHorizontalAlignment HorizontalAlignment;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	ETooltipVerticalAlignment VerticalAlignment;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	UAkAudioEvent* SoundEffectCurrency;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	UAkAudioEvent* SoundEffectCommon;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	UAkAudioEvent* SoundEffectUncommon;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	UAkAudioEvent* SoundEffectRare;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	UAkAudioEvent* SoundEffectVeryRare;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	UAkAudioEvent* SoundEffectUltraRare;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	UAkAudioEvent* SoundEffectAscended;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	UAkAudioEvent* SoundEffectLegendary;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	UAkAudioEvent* SoundEffectVisceral;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	UAkAudioEvent* SoundEffectCharacter;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	UAkAudioEvent* SoundEffectSpecialEvent;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	UAkAudioEvent* SoundEffectProgression;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	UAkAudioEvent* SoundEffectDisappear;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	UAkAudioEvent* SoundEffectProgressBarStart;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	UAkAudioEvent* SoundEffectProgressBarEnd;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	FString InputBlockerId;

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

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	ERewardSequencePlaying _sequencePlaying;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	float _showRewardsPauseDuration;

private:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	FAlertsViewData _alertsViewData;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Instanced, meta=(AllowPrivateAccess=true))
	TArray<UCoreRewardWrapperWidget*> _alertRewardWidgets;

public:
	UFUNCTION(BlueprintCallable)
	void StartAlertRewards();

	UFUNCTION(BlueprintCallable)
	void SkipSequenceCompleted();

	UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
	void SkipSequence();

	UFUNCTION(BlueprintCallable)
	void SetCanSkipSequence(const bool canSkipSequence);

private:
	UFUNCTION(BlueprintCallable)
	void RiftTierUpSequenceCompleted();

public:
	UFUNCTION(BlueprintCallable)
	void RiftRewardsSequenceCompleted();

	UFUNCTION(BlueprintCallable)
	void RegisterRewardEvents(UCoreRewardWidget* rewardWidget);

	UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
	void PlaySoundEffect(UAkAudioEvent* soundFx);

	UFUNCTION(BlueprintCallable)
	void PlayRewardsDelaySequenceAnimation();

	UFUNCTION(BlueprintCallable)
	void PlayProgressBarSoundEffect(const float duration);

	UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
	void PlayNextRiftTierUpSequenceAnimation(const TArray<FRiftTierUpViewData>& riftTierUpData, const FString& eventFrameLabel, const FText& riftTierUpText);

	UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
	void PlayNextRewardsSequenceAnimation(const TArray<FRewardWrapperViewData>& rewards, const FString& eventFrameLabel);

	UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
	void PlayNextChallengesCompletedSequenceAnimation(const TArray<FCompletedChallengeViewData>& challengesCompleted);

	UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
	void PlayInterSequenceAnimation();

	UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
	void PlayFadeOutRewardsSequenceAnimation();

	UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
	void PlayEndSequenceAnimation();

	UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
	void PlayDisplayRewardSound(const FRewardWrapperViewData& rewardData);

	UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
	void PlayDisappearRewardSound();

	UFUNCTION(BlueprintCallable)
	void OnSkipTriggered();

private:
	UFUNCTION(BlueprintCallable)
	void OnRewardUnhovered(UCoreButtonWidget* buttonTarget);

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

public:
	UFUNCTION(BlueprintPure)
	bool IsChallengeCompleted(FChallengeViewData challenge) const;

	UFUNCTION(BlueprintPure)
	UAkAudioEvent* GetDisplayRewardSound(const FRewardWrapperViewData& rewardData) const;

	UFUNCTION(BlueprintPure)
	TSoftObjectPtr<UTexture2D> GetChallengeSetIcon(const FString& eventFrameLabel) const;

	UFUNCTION(BlueprintCallable)
	void EndRiftTierUpSequenceAnimation();

	UFUNCTION(BlueprintCallable)
	void EndInterSequenceAnimation();

	UFUNCTION(BlueprintCallable)
	void EndFadeOutRewardsSequenceAnimation();

	UFUNCTION(BlueprintPure=false, BlueprintCallable)
	void EndEndSequenceAnimation() const;

	UFUNCTION(BlueprintCallable)
	void EndChallengesCompletedSequenceAnimation();

private:
	UFUNCTION(BlueprintCallable)
	void DisplayNextRiftTierUpSequence();

	UFUNCTION(BlueprintCallable)
	void DisplayNextRiftRewardsSequence();

	UFUNCTION(BlueprintCallable)
	void DisplayNextCompletedChallengesSequence();

	UFUNCTION(BlueprintCallable)
	void DisplayNextChallengesRewardsSequence();

	UFUNCTION(BlueprintCallable)
	void DisplayNextBaseRewardsSequence();

public:
	UFUNCTION(BlueprintCallable)
	void ChallengesRewardsSequenceCompleted();

private:
	UFUNCTION(BlueprintCallable)
	void ChallengesCompletedSequenceCompleted();

public:
	UFUNCTION(BlueprintCallable)
	void BaseRewardsSequenceCompleted();

	UFUNCTION(BlueprintCallable)
	void AddElementsToSequence(const FAlertsViewData& alertsViewData);

public:
	UCoreAlertsWidget();
};

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