#pragma once

#include "CoreMinimal.h"
#include "StoreSpecialPacksDetailsViewInterface.h"
#include "CoreBaseUserWidget.h"
#include "Templates/SubclassOf.h"
#include "ECurrencyType.h"
#include "UObject/SoftObjectPtr.h"
#include "SoftRemoteContentCacheObjectPtr.h"
#include "CoreStoreSpecialPackDetailsWidget.generated.h"

class URetainerBox;
class UDBDImage;
class UDBDTextBlock;
class UDBDRichTextBlock;
class UUniformGridPanel;
class UCoreCurrencyInputSwitcherWidget;
class UCoreInputSwitcherWidget;
class UCoreStoreArchivePassItemWidget;
class UCoreStoreRiftTierItemWidget;
class UDBDScrollBox;
class UCoreStoreCharacterItemWidget;
class UCoreStoreCustomizationItemWidget;
class UStoreSpecialPackViewData;
class UCorePreConstructableList;
class UTextureLoadingWrapper;
class ULocalTextureLoader;
class UStorePackContentData;
class UTexture2D;
class UCoreButtonWidget;

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

protected:
	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	URetainerBox* MaskEffect;

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

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

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

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UDBDRichTextBlock* SubTextRTB;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UUniformGridPanel* ContentPanel;

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

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreCurrencyInputSwitcherWidget* CurrencyBuyButton;

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

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreStoreArchivePassItemWidget* ArchivePassItem;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreStoreRiftTierItemWidget* RiftTierItem;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UDBDScrollBox* PackDetailsScrollBox;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UDBDRichTextBlock* DescriptionRTB;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, NoClear)
	TSubclassOf<UCoreStoreCharacterItemWidget> _characterItemWidgetClass;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	int32 _characterPoolSize;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, NoClear)
	TSubclassOf<UCoreStoreCustomizationItemWidget> _customizationItemWidgetClass;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	int32 _customizationPoolSize;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	int32 _numOfColumns;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	float _itemScale;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	int32 _itemsLayoutMask;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient)
	UStoreSpecialPackViewData* _data;

private:
	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	UCorePreConstructableList* _characterList;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	UCorePreConstructableList* _customizationList;

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

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

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

	UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
	void OnShowAnimationFinished();

private:
	UFUNCTION(BlueprintCallable)
	void OnPremiumButtonClicked();

protected:
	UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
	void OnHideAnimationFinished();

private:
	UFUNCTION(BlueprintCallable)
	void OnCustomizationClicked(UCoreButtonWidget* button);

	UFUNCTION(BlueprintCallable)
	void OnCurrencyButtonClicked(ECurrencyType currencyType);

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

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

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

public:
	UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
	void AnimateShow();

	UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
	void AnimateHide();

public:
	UCoreStoreSpecialPackDetailsWidget();
};

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