// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "BaseGadgetTutorial.h"
#include "EndlessVendetta/EndlessVendettaCharacter.h"
#include "EndlessVendetta/GadgetSystem/GadgetBase.h"
#include "EndlessVendetta/InteractionInterface.h"
#include "EndlessVendetta/UserWidgets/GadgetMenu.h"
#include "GameFramework/Actor.h"
#include "GadgetTutorialStation.generated.h"

UCLASS()
class ENDLESSVENDETTA_API AGadgetTutorialStation : public AActor, public IInteractionInterface
{
	GENERATED_BODY()

	AEndlessVendettaCharacter* EndlessVendettaCharacter;

	UPROPERTY(EditDefaultsOnly, Category = "Gadgets")
	TArray<TSubclassOf<AGadgetBase>> GadgetsArray;

	UPROPERTY(EditDefaultsOnly, Category = "Gadgets")
	TSubclassOf<UGadgetMenu> PickGadgetWidgetClass;

	UPROPERTY(EditDefaultsOnly, Category = "Gadgets")
	FTransform GadgetTutorialSpawnTransform;

	int GadgetIndex = 0;

	UUserWidget* PickGadgetWidget;

	UGadgetMenu* GadgetMenu;

	ABaseGadgetTutorial* CurrentGadgetTutorial;

protected:
	// Called when the game starts or when spawned
	virtual void BeginPlay() override;

	void Interact() override;\

	void InteractPrompt() override;

	UFUNCTION(BlueprintCallable)
	void NextGadget();

	UFUNCTION(BlueprintCallable)
	void PreviousGadget();

	UFUNCTION(BlueprintCallable)
	void SelectGadget();

	UFUNCTION(BlueprintCallable)
	void CloseWidget();

public:
	// Sets default values for this actor's properties
	AGadgetTutorialStation();
	
	// Called every frame
	virtual void Tick(float DeltaTime) override;

};
