// Copyright Echo Devgroup #include "AbilitySystem/AuraAbilitySystemLibrary.h" #include "Kismet/GameplayStatics.h" #include "Player/AuraPlayerState.h" #include "UI/WidgetController/AuraWidgetController.h" #include "UI/HUD/AuraHUD.h" UOverlayWidgetController* UAuraAbilitySystemLibrary::GetOverlayWidgetController(const UObject* WorldContextObject) { if (APlayerController* PC = UGameplayStatics::GetPlayerController(WorldContextObject, 0)) { if (AAuraHUD* AuraHUD = Cast(PC->GetHUD())) { AAuraPlayerState* PS = PC->GetPlayerState(); UAbilitySystemComponent* ASC = PS->GetAbilitySystemComponent(); UAttributeSet* AS = PS->GetAttributeSet(); const FWidgetControllerParams WidgetControllerParams(PC, PS, ASC, AS); return AuraHUD->GetOverlayWidgetController(WidgetControllerParams); } } return nullptr; } UAttributeMenuWidgetController* UAuraAbilitySystemLibrary::GetAttributeMenuWidgetController( const UObject* WorldContextObject) { if (APlayerController* PC = UGameplayStatics::GetPlayerController(WorldContextObject, 0)) { if (AAuraHUD* AuraHUD = Cast(PC->GetHUD())) { AAuraPlayerState* PS = PC->GetPlayerState(); UAbilitySystemComponent* ASC = PS->GetAbilitySystemComponent(); UAttributeSet* AS = PS->GetAttributeSet(); const FWidgetControllerParams WidgetControllerParams(PC, PS, ASC, AS); return AuraHUD->GetAttributeMenuWidgetController(WidgetControllerParams); } } return nullptr; }