Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Source/UHLGAS/Private/UHLAbilitySystemComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,22 @@
#include "Core/UHLGameplayTags.h"
#include "Development/UHLGASSettings.h"
#include "Utils/UnrealHelperLibraryBPL.h"
#include "GameplayAbilitySpec.h"

#include UE_INLINE_GENERATED_CPP_BY_NAME(UHLAbilitySystemComponent)

FGameplayAbilitySpecHandle UUHLAbilitySystemComponent::GiveAbilityWithSource(TSubclassOf<UGameplayAbility> AbilityClass, int32 AbilityLevel, int32 InputID, UObject* SourceObject)
{
if (!AbilityClass)
{
return FGameplayAbilitySpecHandle();
}

FGameplayAbilitySpec AbilitySpec(AbilityClass, AbilityLevel, InputID, SourceObject);

return GiveAbility(AbilitySpec);
}

void UUHLAbilitySystemComponent::BeginPlay()
{
Super::BeginPlay();
Expand Down
4 changes: 4 additions & 0 deletions Source/UHLGAS/Public/UHLAbilitySystemComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ class UHLGAS_API UUHLAbilitySystemComponent : public UAbilitySystemComponent
// UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="UHL AbilitySystemComponent", meta=(ShowOnlyInnerProperties))
// FUHLAbilitySystemSettings Settings = {};

// Grant Ability with exposed Source object
UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category = "Gameplay Abilities", meta = (DisplayName = "Give Ability With Source", ScriptName = "GiveAbilityWithSource"))
FGameplayAbilitySpecHandle GiveAbilityWithSource(TSubclassOf<UGameplayAbility> AbilityClass, int32 AbilityLevel = 1, int32 InputID = -1, UObject* SourceObject = nullptr);

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="UHL AbilitySystemComponent", meta=(InlineEditConditionToggle))
bool bInitializeGameplayAttributes = true;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="UHL AbilitySystemComponent", meta=(ForceInlineRow, EditCondition="bInitializeGameplayAttributes"))
Expand Down