#pragma once

#include "CoreMinimal.h"
#include "CoreSelectableButtonWidget.h"
#include "StoreContentViewData.h"
#include "TimerFlagViewData.h"
#include "UObject/SoftObjectPtr.h"
#include "SoftRemoteContentCacheObjectPtr.h"
#include "PriceTagViewData.h"
#include "StoreHeritagePackViewData.h"
#include "CrossPromoCampaignViewData.h"
#include "CoreStoreContentWidget.generated.h"

class UCoreOnHoverBorderWidget;
class UDBDTextBlock;
class UCoreOwnedTagWidget;
class UCoreTimerFlagWidget;
class UDBDImage;
class UCorePriceTagWidget;
class UPanelWidget;
class UUserWidget;
class UTextureLoadingWrapper;
class ULocalTextureLoader;
class UStorePackContentData;
class UTexture2D;
class UStoreSpecialPackViewData;
class UStoreCollectionViewData;
class UStoreChapterPackViewData;
class UCoreButtonWidget;

UCLASS(Blueprintable, EditInlineNew)
class DBDUIVIEWSCORE_API UCoreStoreContentWidget : public UCoreSelectableButtonWidget
{
	GENERATED_BODY()

protected:
	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreOnHoverBorderWidget* OnHoverBorder;

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

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreOwnedTagWidget* OwnedTag;

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

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

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreTimerFlagWidget* LimitedAvailabilityTimerFlag;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreTimerFlagWidget* SaleTimerFlag;

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

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UCorePriceTagWidget* PriceTag;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UPanelWidget* RiftIconsContainer;

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

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

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UUserWidget* NotificationIcon;

private:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	FStoreContentViewData _cachedData;

	UPROPERTY(BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	UTextureLoadingWrapper* _imageLoader;

	UPROPERTY(BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	ULocalTextureLoader* _localTextureLoader;

protected:
	UFUNCTION(BlueprintCallable)
	void SetTimerFlagVisibility(UCoreTimerFlagWidget* timer, const bool isVisible);

	UFUNCTION(BlueprintCallable)
	void SetTimerFlagDataAndVisibility(UCoreTimerFlagWidget* timer, const FTimerFlagViewData& timerData, const bool isItemOwned);

	UFUNCTION(BlueprintCallable)
	void SetTextBlockVisibility(UDBDTextBlock* textBlock, const bool isVisible);

	UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
	void SetSpecialPackImageUsingComposition(const int32 numberOfItems, const TArray<UStorePackContentData*>& data, const TMap<FName, UTexture2D*>& icons);

public:
	UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
	void SetSpecialPackData(UStoreSpecialPackViewData* data, const bool appendDataToAnalyticsName);

protected:
	UFUNCTION(BlueprintCallable)
	void SetSimplifiedVisuals();

public:
	UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
	void SetSimplifiedData(const FString& packId, const FText& displayTitle, const TSoftObjectPtr<UTexture2D>& imagePtr, FSoftRemoteContentCacheObjectPtr imageRemotePtr);

protected:
	UFUNCTION(BlueprintCallable)
	void SetRiftIconsVisibility(const bool showRiftIconsContainer, const bool showRiftFragmentIcon);

	UFUNCTION(BlueprintCallable)
	void SetPriceTagVisibility(const bool isVisible);

	UFUNCTION(BlueprintCallable)
	void SetPriceTagDataAndVisibility(const FPriceTagViewData& priceTagData, const bool isVisible);

	UFUNCTION(BlueprintCallable)
	void SetOwnedTagVisibility(const bool isVisible);

	UFUNCTION(BlueprintCallable)
	void SetNewIcon(const bool isNew);

public:
	UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
	void SetImageCompositionData(const FString& packId, const FText& displayTitle, const int32 packImageCompositionNumberOfItems, const TArray<UStorePackContentData*>& packContentData);

	UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
	void SetHeritagePackData(const FStoreHeritagePackViewData& data, const bool appendDataToAnalyticsName);

	UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
	void SetCrossPromotionData(const FCrossPromoCampaignViewData& data, const bool appendDataToAnalyticsName);

	UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
	void SetCollectionData(UStoreCollectionViewData* data, const bool appendDataToAnalyticsName);

	UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
	void SetChapterPackData(UStoreChapterPackViewData* data, const bool appendDataToAnalyticsName);

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

protected:
	UFUNCTION(BlueprintPure)
	void LoadBannerImage(TSoftObjectPtr<UTexture2D> localPtr, FSoftRemoteContentCacheObjectPtr& remotePtr) const;

public:
	UCoreStoreContentWidget();
};

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