77 lines
2.0 KiB
C
77 lines
2.0 KiB
C
|
|
// Copyright Echo Devgroup
|
||
|
|
|
||
|
|
#pragma once
|
||
|
|
|
||
|
|
#include "CoreMinimal.h"
|
||
|
|
#include "UI/WidgetController/AuraWidgetController.h"
|
||
|
|
#include "OverlayWidgetController.generated.h"
|
||
|
|
|
||
|
|
USTRUCT(BlueprintType)
|
||
|
|
struct FUIWidgetRow : public FTableRowBase
|
||
|
|
{
|
||
|
|
GENERATED_BODY()
|
||
|
|
|
||
|
|
UPROPERTY(EditAnywhere, BlueprintReadOnly)
|
||
|
|
FGameplayTag MessageTag = FGameplayTag();
|
||
|
|
|
||
|
|
UPROPERTY(EditAnywhere, BlueprintReadOnly)
|
||
|
|
FText Message = FText();
|
||
|
|
|
||
|
|
UPROPERTY(EditAnywhere, BlueprintReadOnly)
|
||
|
|
TSubclassOf<class UAuraUserWidget> MessageWidget;
|
||
|
|
|
||
|
|
UPROPERTY(EditAnywhere,BlueprintReadOnly)
|
||
|
|
UTexture2D* Image = nullptr;
|
||
|
|
};
|
||
|
|
|
||
|
|
class UAuraUserWidget;
|
||
|
|
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnAttributeChangedSignature, float, NewValue);
|
||
|
|
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FMessageWidgetRowSignature, FUIWidgetRow, Row);
|
||
|
|
|
||
|
|
/**
|
||
|
|
*
|
||
|
|
*/
|
||
|
|
|
||
|
|
|
||
|
|
UCLASS(BlueprintType, Blueprintable)
|
||
|
|
class AURA_API UOverlayWidgetController : public UAuraWidgetController
|
||
|
|
{
|
||
|
|
GENERATED_BODY()
|
||
|
|
|
||
|
|
public:
|
||
|
|
virtual void BroadcastInitialValues() override;
|
||
|
|
virtual void BindCallbacksToDependencies() override;
|
||
|
|
|
||
|
|
UPROPERTY(BlueprintAssignable, Category = "GAS|Attributes")
|
||
|
|
FOnAttributeChangedSignature OnHealthChanged;
|
||
|
|
|
||
|
|
UPROPERTY(BlueprintAssignable, Category = "GAS|Attributes")
|
||
|
|
FOnAttributeChangedSignature OnMaxHealthChanged;
|
||
|
|
|
||
|
|
UPROPERTY(BlueprintAssignable, Category = "GAS|Attributes")
|
||
|
|
FOnAttributeChangedSignature OnManaChanged;
|
||
|
|
|
||
|
|
UPROPERTY(BlueprintAssignable, Category = "GAS|Attributes")
|
||
|
|
FOnAttributeChangedSignature OnMaxManaChanged;
|
||
|
|
|
||
|
|
UPROPERTY(BlueprintAssignable, Category = "GAS|Messages")
|
||
|
|
FMessageWidgetRowSignature MessageWidgetRowDelegate;
|
||
|
|
protected:
|
||
|
|
|
||
|
|
UPROPERTY(EditDefaultsOnly,BlueprintReadOnly, Category="Widget Data")
|
||
|
|
TObjectPtr<UDataTable> MessageWidgetDataTable;
|
||
|
|
|
||
|
|
template<typename T>
|
||
|
|
T* GetDataTableRowByTag(UDataTable* DataTable, const FGameplayTag Tag);
|
||
|
|
|
||
|
|
|
||
|
|
private:
|
||
|
|
|
||
|
|
};
|
||
|
|
|
||
|
|
template <typename T>
|
||
|
|
T* UOverlayWidgetController::GetDataTableRowByTag(UDataTable* DataTable, const FGameplayTag Tag)
|
||
|
|
{
|
||
|
|
return DataTable->FindRow<T>(Tag.GetTagName(), TEXT(""));
|
||
|
|
}
|