#pragma once

#include "CoreMinimal.h"
#include "LobbySidePanelInterface.h"
#include "CoreBaseUserWidget.h"
#include "LobbySidePanelViewData.h"
#include "LobbySidePanelWidget.generated.h"

class UCoreLobbySidePanelButton;
class UCoreSelectableButtonWidget;
class UCoreButtonWidget;

UCLASS(Blueprintable, EditInlineNew)
class DBDUIVIEWSCORE_API ULobbySidePanelWidget : public UCoreBaseUserWidget, public ILobbySidePanelInterface
{
	GENERATED_BODY()

protected:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Export)
	TArray<UCoreLobbySidePanelButton*> _lobbySidePanelButtons;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreLobbySidePanelButton* CharactersButton;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreLobbySidePanelButton* LoadoutButton;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreLobbySidePanelButton* BloodWebButton;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreLobbySidePanelButton* ChallengesButton;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreLobbySidePanelButton* EventButton;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreLobbySidePanelButton* ShrineButton;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreLobbySidePanelButton* StoreButton;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreLobbySidePanelButton* SurvivorRoleButton;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreLobbySidePanelButton* KillerRoleButton;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreLobbySidePanelButton* SpectatorRoleButton;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Transient, meta=(BindWidgetOptional))
	UCoreSelectableButtonWidget* _selectedSidePanelButton;

protected:
	UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
	void SetUiTakeoverVisuals(bool isActive) const;

	UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
	void SetRoleButtonVisibility(bool isVisible) const;

	UFUNCTION(BlueprintCallable)
	void OnTabButtonSelectedChanged(UCoreSelectableButtonWidget* targetButton, bool isSelected);

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

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

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

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

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

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

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

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

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

	UFUNCTION(BlueprintCallable)
	void OnButtonSelectedAgain(UCoreSelectableButtonWidget* buttonTarget);

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

public:
	UFUNCTION(BlueprintCallable)
	void InitializeSidePanel(const FLobbySidePanelViewData& sidePanelViewData);

public:
	ULobbySidePanelWidget();
};

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