Aura User Widget and Widget Controller

This commit is contained in:
ghostie 2025-08-31 20:20:21 -05:00
parent 794db4920a
commit b097171f8f
5 changed files with 71 additions and 1 deletions

View File

@ -10,7 +10,9 @@
"LoadingPhase": "Default",
"AdditionalDependencies": [
"Engine",
"GameplayAbilities"
"GameplayAbilities",
"UMG",
"CoreUObject"
]
}
],

View File

@ -0,0 +1,5 @@
// Copyright; GhostPacket Games
#include "UI/WidgetController/AuraWidgetController.h"

View File

@ -0,0 +1,10 @@
// Copyright; GhostPacket Games
#include "UI/Widgets/AuraUserWidget.h"
void UAuraUserWidget::SetWidgetController(UObject* InWidgetController)
{
WidgetController = InWidgetController;
WidgetControllerSet();
}

View File

@ -0,0 +1,29 @@
// Copyright; GhostPacket Games
#pragma once
#include "CoreMinimal.h"
#include "UObject/NoExportTypes.h"
#include "AuraWidgetController.generated.h"
class UAbilitySystemComponent;
class UAttributeSet;
UCLASS()
class AURA_API UAuraWidgetController : public UObject
{
GENERATED_BODY()
protected:
UPROPERTY(BlueprintReadOnly, Category = "WidgetController")
TObjectPtr<APlayerController> PlayerController;
UPROPERTY(BlueprintReadOnly, Category = "WidgetController")
TObjectPtr<APlayerState> PlayerState;
UPROPERTY(BlueprintReadOnly, Category = "WidgetController")
TObjectPtr<UAbilitySystemComponent> AbilitySystemComponent;
UPROPERTY(BlueprintReadOnly, Category = "WidgetController")
TObjectPtr<UAttributeSet> AttributeSet;
};

View File

@ -0,0 +1,24 @@
// Copyright; GhostPacket Games
#pragma once
#include "CoreMinimal.h"
#include "Blueprint/UserWidget.h"
#include "AuraUserWidget.generated.h"
UCLASS()
class AURA_API UAuraUserWidget : public UUserWidget
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable)
void SetWidgetController(UObject *InWidgetController);
UPROPERTY(BlueprintReadOnly)
TObjectPtr<UObject> WidgetController;
protected:
UFUNCTION(BlueprintImplementableEvent)
void WidgetControllerSet();
};