// Oleg Petruny proprietary.

#pragma once

#include "Widgets/WorldDilationResponsiveUserWidget.h"

#include "QuickTimeEventWidgetManager.generated.h"

enum class EInputAnimatedWidgetAnimation : uint8;
enum class EQuickTimeEventType : uint8;
enum class EQuickTimeEventResult : uint8;
class UQuickTimeEventWidget;

UCLASS(Blueprintable, Abstract)
class UQuickTimeEventWidgetManager : public UWorldDilationResponsiveUserWidget
{
    GENERATED_BODY()

    friend UQuickTimeEventWidget;

public:
    void ShowEvent(const int32 id, const struct FQuickTimeEventEnqueProperties& properties);
    EQuickTimeEventResult RemoveEvent(const int32 id);
    EQuickTimeEventResult AnimateEvent(const int32 id, const bool released);

protected:
    virtual void UpdateAnimation(UWidget* widget, float newSpeed) override;

    UPROPERTY(EditDefaultsOnly)
    TMap<EQuickTimeEventType, TSubclassOf<UQuickTimeEventWidget>> eventWidgetClasses;

    UPROPERTY(meta = (BindWidget))
    class UCanvasPanel* canvas;

    TMap<const int32, UQuickTimeEventWidget*> eventsMap;
    FCriticalSection mappingLock;
};
