#pragma once

#include "CoreMinimal.h"
#include "LobbyPlayerListViewInterface.h"
#include "CoreBaseUserWidget.h"
#include "Templates/SubclassOf.h"
#include "LobbyPlayerStatusClicked.h"
#include "LobbyPlayerSocialOptionClicked.h"
#include "PlayerSocialOptionViewData.h"
#include "LobbyPlayerListWidget.generated.h"

class ULobbyPlayerListItemWidget;
class UVerticalBox;
class UDBDTextBlock;
class UCorePlayerSocialOptionsMenuWidget;
class UOverlay;
class UCoreButtonWidget;

UCLASS(Blueprintable, EditInlineNew)
class DBDUIVIEWSCORE_API ULobbyPlayerListWidget : public UCoreBaseUserWidget, public ILobbyPlayerListViewInterface
{
	GENERATED_BODY()

protected:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, NoClear)
	TSubclassOf<ULobbyPlayerListItemWidget> PlayerListItemClass;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UVerticalBox* KillersSectionVerticalBox;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UVerticalBox* SurvivorsSectionVerticalBox;

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

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

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Instanced)
	TArray<ULobbyPlayerListItemWidget*> ListItems;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, BlueprintCallable)
	FLobbyPlayerStatusClicked _onPlayerStatusClicked;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, BlueprintCallable)
	FLobbyPlayerSocialOptionClicked _onPlayerSocialOptionClicked;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UCorePlayerSocialOptionsMenuWidget* PlayerSocialOptionsMenu;

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

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

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UOverlay* KillersSectionFogOverlay;

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

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UOverlay* SurvivorsSectionFogOverlay;

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

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

	UFUNCTION(BlueprintCallable)
	void OnPlayerSocialOptionClicked(const FPlayerSocialOptionViewData& playerSocialOptionData);

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

public:
	ULobbyPlayerListWidget();
};

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