GSCUserWidget #
Base user widget class to inherit from for UMG that needs to interact with an Ability System Component.
For typical use case of Player HUD, use UGSCUWHud subclass instead.
This class provides an event based API to react to Ability System related events:
- Attribute value change
- Gameplay Tag change
- Gameplay Effect added / removed
- Cooldown start / expiration
Properties #
OwnerActor #
Type AActor*
Owner Actor
OwnerCoreComponent #
Type UGSCCoreComponent*
Owner Core Component
Events #
OnGameplayTagChange #
Event triggered by Companion Core Component whenever a tag is added or removed (but not if just count is increased. Only for 'new' and 'removed' events)
Parameters
Name | Type | Description |
---|---|---|
GameplayTag | FGameplayTag | |
NewTagCount | int32 |
OnGameplayEffectTimeChange #
Event triggered by Companion Core Component whenever a gameplay effect time is changed (for instance when duration is refreshed)
Parameters
Name | Type | Description |
---|---|---|
AssetTags | FGameplayTagContainer | |
GrantedTags | FGameplayTagContainer | |
ActiveHandle | FActiveGameplayEffectHandle | |
NewStartTime | float | |
NewDuration | float |
OnGameplayEffectStackChange #
Event triggered by Companion Core Component whenever a gameplay effect is added / removed
Parameters
Name | Type | Description |
---|---|---|
AssetTags | FGameplayTagContainer | |
GrantedTags | FGameplayTagContainer | |
ActiveHandle | FActiveGameplayEffectHandle | |
NewStackCount | int32 | |
OldStackCount | int32 |
OnGameplayEffectRemoved #
Event triggered by Companion Core Component whenever a gameplay effect is removed
Parameters
Name | Type | Description |
---|---|---|
AssetTags | FGameplayTagContainer | |
GrantedTags | FGameplayTagContainer | |
ActiveHandle | FActiveGameplayEffectHandle | |
EffectData | FGSCGameplayEffectUIData |
OnGameplayEffectAdded #
Event triggered by Companion Core Component whenever a gameplay effect is added
Parameters
Name | Type | Description |
---|---|---|
AssetTags | FGameplayTagContainer | |
GrantedTags | FGameplayTagContainer | |
ActiveHandle | FActiveGameplayEffectHandle | |
EffectData | FGSCGameplayEffectUIData |
OnCooldownStart #
Event triggered by Companion Core component when an ability with a valid cooldown is committed and cooldown is applied
Parameters
Name | Type | Description |
---|---|---|
Ability | UGameplayAbility* | |
CooldownTags | FGameplayTagContainer | |
TimeRemaining | float | |
Duration | float |
OnCooldownEnd #
Event triggered by Companion Core Component when a cooldown gameplay tag is removed, meaning cooldown expired
Parameters
Name | Type | Description |
---|---|---|
Ability | UGameplayAbility* | |
CooldownTag | FGameplayTag | |
Duration | float |
OnAttributeChange #
Event triggered whenever an attribute value is changed on Owner Actor's ASC
Parameters
Name | Type | Description |
---|---|---|
Attribute | FGameplayAttribute | |
NewValue | float | |
OldValue | float |
OnAbilitySystemInitialized #
Event triggered when this widget has been initialized with a valid ASC.
Run initialization logic that depends on Ability System here. (like setting initial state for user widgets based on attributes value)
Functions #
SetOwnerActor #
Initialize or update references to owner actor and additional actor components (such as AbilitySystemComponent) and cache them for this instance of user widget.
Parameters
Name | Type | Description |
---|---|---|
Actor | AActor* |
InitializeWithAbilitySystem #
Runs initialization logic for this UserWidget related to interactions with Ability System Component.
Setup AbilitySystemComponent delegates to react to various events.
Usually called from NativeConstruct, but exposed there if other classes needs to run initialization logic again to update references.
Parameters
Name | Type | Description |
---|---|---|
AbilitySystemComponent | UAbilitySystemComponent* |
GetPercentForAttributes #
Helper function to return percentage from Attribute / MaxAttribute
Parameters
Name | Type | Description |
---|---|---|
Attribute | FGameplayAttribute | |
MaxAttribute | FGameplayAttribute |
Returns float
GetOwningCoreComponent #
Returns reference to OwnerCoreComponent for this user widget, if it has been initialized.
Returns UGSCCoreComponent*
GetOwningActor #
Returns reference to OwnerActor for this user widget, if it has been initialized.
Returns AActor*
GetOwningAbilitySystemComponent #
Returns reference to AbilitySystemComponent for this user widget, if it has been initialized.
Returns UAbilitySystemComponent*
GetAttributeValue #
Returns the current value of an attribute (base value) from owning actor Ability System (if it has any). That is, the value of the attribute with no stateful modifiers
Parameters
Name | Type | Description |
---|---|---|
Attribute | FGameplayAttribute |
Returns float
Generated on Tue, 16 Jul 2024 16:16:37 GMT