#pragma once

#include "CoreMinimal.h"
#include "CommonActivatableWidget.h"
#include "InventoryScreenWidget.generated.h"

class UButton;
class UEquipmentPanelWidget;
class UEquipmentSlotMenuWidget;
class UEquipmentSlotWidget;

UCLASS(Abstract)
class NAKEDDESIRE_API UInventoryScreenWidget : public UCommonActivatableWidget
{
	GENERATED_BODY()

	UPROPERTY(EditDefaultsOnly, Category = "UI")
	TSubclassOf<UEquipmentSlotMenuWidget> EquipmentSlotMenuWidgetClass;

	UPROPERTY()
	TObjectPtr<UEquipmentSlotMenuWidget> EquipmentSlotMenuWidget;

	UPROPERTY(meta = (BindWidget))
	TObjectPtr<UEquipmentPanelWidget> EquipmentPanelWidget;

	UPROPERTY(meta = (BindWidget))
	TObjectPtr<UButton> MenuBlocker;

protected:
	virtual void NativeOnActivated() override;
	virtual void NativeOnDeactivated() override;

private:
	void HandleSlotClicked(UEquipmentSlotWidget* SlotWidget);

	UFUNCTION()
	void CloseMenu();
};