#pragma once

#include "CoreMinimal.h"
#include "StoreSubPresenter.h"
#include "EquippedPlayerCustomization.h"
#include "StoreCharactersFiltersData.h"
#include "ESortingOption.h"
#include "ESortingOrder.h"
#include "EMoriPreviewVariant.h"
#include "ECurrencyType.h"
#include "AnimationPreviewRequest.h"
#include "StoreCollectionsCustomizationsSubPresenter.generated.h"

class UStoreCollectionViewData;
class UStoreCustomizationItemViewData;
class UAnimationPreviewPreloadRequest;
class UAnimationPreviewSubsystem;

UCLASS(Blueprintable)
class DBDUIPRESENTERS_API UStoreCollectionsCustomizationsSubPresenter : public UStoreSubPresenter
{
	GENERATED_BODY()

private:
	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	UStoreCollectionViewData* _currentCollection;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	UStoreCustomizationItemViewData* _currentCustomization;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	UStoreCustomizationItemViewData* _customizationBeingPurchased;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	FEquippedPlayerCustomization _selectedCustomization;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	TArray<UStoreCustomizationItemViewData*> _availableCustomizations;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	TArray<UStoreCustomizationItemViewData*> _displayingCustomizations;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	FStoreCharactersFiltersData _customizationsFilterData;

	UPROPERTY(EditInstanceOnly, Transient)
	ESortingOption _customizationsSortingOption;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	ESortingOrder _customizationsSortingOrder;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	UAnimationPreviewPreloadRequest* _moriPreviewPreloadRequest;

private:
	UFUNCTION(BlueprintCallable)
	void UpdateDisplayingCustomizations(bool scrollToSelectedItem);

	UFUNCTION(BlueprintCallable)
	void PlayMoriAnimation(const EMoriPreviewVariant moriPreviewVariant);

	UFUNCTION()
	void OnSortingChanged(const ESortingOption sortingOption, const ESortingOrder sortingOrder);

	UFUNCTION(BlueprintCallable)
	void OnSearchBarTextChanged(const FString& enteredText);

	UFUNCTION(BlueprintCallable)
	void OnPlaySecondMoriClicked();

	UFUNCTION(BlueprintCallable)
	void OnPlayMoriClicked();

	UFUNCTION(BlueprintCallable)
	void OnFiltersChanged(const FStoreCharactersFiltersData& storeFiltersData);

	UFUNCTION(BlueprintCallable)
	void OnCustomizationUnlockClicked(ECurrencyType currencyType);

	UFUNCTION(BlueprintCallable)
	void OnCustomizationSelected(const FName customizationId);

	UFUNCTION(BlueprintCallable)
	void OnCustomizationEquipClicked();

	UFUNCTION(BlueprintCallable)
	void OnClearFiltersClicked();

	UFUNCTION(BlueprintCallable)
	void OnAvailabilityBannerClicked();

	UFUNCTION(BlueprintCallable)
	void OnAnimationPreviewComplete(UAnimationPreviewSubsystem* animationPreviewSubsystem, const FAnimationPreviewRequest& request, bool completedSuccessfully);

public:
	UStoreCollectionsCustomizationsSubPresenter();
};

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