#pragma once

#include "CoreMinimal.h"
#include "LobbyTitleViewInterface.h"
#include "CoreBaseUserWidget.h"
#include "SharedPerksTooltipViewData.h"
#include "LobbyTitleViewData.h"
#include "CoreLobbyTitleWidget.generated.h"

class UCorePrestigeWidget;
class UDBDTextBlock;
class UDBDRichTextBlock;
class UCoreSharedPerksDisplayWidget;
class UCoreButtonWidget;
class UUITweenInstance;

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

protected:
	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	float _LobbyTitleFadeAnimOnPrestigeUpDuration;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	float _LobbyTitleFadeInDelay;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidgetOptional))
	UCorePrestigeWidget* Prestige;

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

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidgetOptional))
	UDBDRichTextBlock* SubtitleRTB;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidgetOptional))
	UDBDRichTextBlock* SharedPerksTitleRTB;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreSharedPerksDisplayWidget* PerksContainer;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	FSharedPerksTooltipViewData SharedPerksTooltipViewData;

public:
	UFUNCTION(BlueprintCallable)
	void SetLobbyTitleFadeOutAnimation();

	UFUNCTION(BlueprintCallable)
	void SetIsPerkSurfacingEnabled(const bool isPerkSurfacingExperimentActive);

	UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
	void SetData(const FLobbyTitleViewData& lobbyTitleViewData);

protected:
	UFUNCTION(BlueprintCallable)
	void OnPrestigeUnhovered(UCoreButtonWidget* buttonTarget);

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

private:
	UFUNCTION(BlueprintCallable)
	void OnFadeOutAnimationComplete(UUITweenInstance* tween);

	UFUNCTION(BlueprintCallable)
	void OnFadeInAnimationComplete(UUITweenInstance* tween);

public:
	UCoreLobbyTitleWidget();
};

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