Lost_Edge/Source/Lost_Edge/Private/Widgets/InputAnimatedWidgetInterface.h

65 lines
1.9 KiB
C++

// Oleg Petruny proprietary.
#pragma once
#include "UObject/Interface.h"
#include "InputAnimatedWidgetInterface.generated.h"
UENUM(BlueprintType)
enum class EInputAnimatedWidgetAnimation : uint8
{
Click,
Hold,
Unhold,
TurnOnIndication,
TurnOffIndication
};
UINTERFACE(MinimalAPI, Blueprintable)
class UInputAnimatedWidgetInterface : public UInterface
{
GENERATED_BODY()
};
class IInputAnimatedWidgetInterface
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category = "InputAnimatedWidget")
void OnClick();
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category = "InputAnimatedWidget")
void OnHold();
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category = "InputAnimatedWidget")
void OnUnhold();
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category = "InputAnimatedWidget")
void OnTurnOnIndication();
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category = "InputAnimatedWidget")
void OnTurnOffIndication();
// Unsafe C++ shortcut
void RunAnimation(const EInputAnimatedWidgetAnimation animation)
{
switch(animation)
{
case EInputAnimatedWidgetAnimation::Click:
Execute_OnClick(this->_getUObject());
break;
case EInputAnimatedWidgetAnimation::Hold:
Execute_OnHold(this->_getUObject());
break;
case EInputAnimatedWidgetAnimation::Unhold:
Execute_OnUnhold(this->_getUObject());
break;
case EInputAnimatedWidgetAnimation::TurnOnIndication:
Execute_OnTurnOnIndication(this->_getUObject());
break;
case EInputAnimatedWidgetAnimation::TurnOffIndication:
Execute_OnTurnOffIndication(this->_getUObject());
break;
default:
break;
}
}
};