59. Message Widget

This commit is contained in:
Edward R. Gonzalez 2024-04-26 21:36:09 -04:00
parent 22385f63bb
commit ed6dbf89e9
7 changed files with 19 additions and 9 deletions

View File

@ -0,0 +1,6 @@
{
"ColumnWidths":
{
"TextStyle": 1099
}
}

View File

@ -14,11 +14,14 @@ using namespace Gasa;
void UGasaAbilitySystemComp::OnAbilityActorInfoSet()
{
if ( ! OnGameplayEffectAppliedDelegateToSelf.IsBoundToObject(this))
OnGameplayEffectAppliedDelegateToSelf.AddUObject(this, & ThisClass::EffectApplied);
}
void UGasaAbilitySystemComp::EffectApplied(UAbilitySystemComponent* AbilitySystem, FGameplayEffectSpec const& Spec,
FActiveGameplayEffectHandle ActiveEffect)
{
Log("EFFECT APPLIED?");
FGameplayTagContainer Tags;
Spec.GetAllAssetTags(Tags);
Event_OnEffectAppliedAssetTags.Broadcast(Tags);
@ -27,6 +30,4 @@ void UGasaAbilitySystemComp::EffectApplied(UAbilitySystemComponent* AbilitySyste
void UGasaAbilitySystemComp::InitAbilityActorInfo(AActor* InOwnerActor, AActor* InAvatarActor)
{
Super::InitAbilityActorInfo(InOwnerActor, InAvatarActor);
OnGameplayEffectAppliedDelegateToSelf.AddUObject(this, & ThisClass::EffectApplied);
}

View File

@ -17,7 +17,6 @@ public:
FEffectAssetTagsSig Event_OnEffectAppliedAssetTags;
// TODO(Ed): If hes only using this to bind the EffectApplied to a delegate, then just use the init override instead.
void OnAbilityActorInfoSet();
void EffectApplied(UAbilitySystemComponent* AbilitySystem, FGameplayEffectSpec const& Spec, FActiveGameplayEffectHandle ActiveEffect);
@ -25,4 +24,4 @@ public:
#pragma region AbilitySystemComponent
void InitAbilityActorInfo(AActor* InOwnerActor, AActor* InAvatarActor) override;
#pragma endregion AbilitySystemComponent
};
};

View File

@ -158,7 +158,9 @@ void AGasaCharacter::PossessedBy(AController* NewController)
#if 0
if (bAutoAbilitySystem)
{
AbilitySystem->InitAbilityActorInfo(this, this);
}
#endif
}
@ -181,7 +183,10 @@ void AGasaCharacter::BeginPlay()
// TODO(Ed): Find out if this is the best spot todo this
// There is also OnPossessed, PostInitializeComponents, etc...
if (bAutoAbilitySystem)
{
AbilitySystem->InitAbilityActorInfo(this, this);
Cast<UGasaAbilitySystemComp>(AbilitySystem)->OnAbilityActorInfoSet();
}
}
void AGasaCharacter::Tick(float DeltaSeconds)

View File

@ -232,8 +232,7 @@ void AGasaGameMode::HandleSeamlessTravelPlayer(AController*& Controller)
void AGasaGameMode::InitializeHUDForPlayer_Implementation(APlayerController* NewPlayer)
{
// Super::InitializeHUDForPlayer_Implementation(NewPlayer);
NewPlayer->ClientSetHUD(HUDClass);
Super::InitializeHUDForPlayer_Implementation(NewPlayer);
}
void AGasaGameMode::InitSeamlessTravelPlayer(AController* NewController)

View File

@ -19,6 +19,7 @@
#include "GasaGameInstance.h"
#include "GasaGameState.h"
#include "GasaPlayerState.h"
#include "AbilitySystem/GasaAbilitySystemComponent.h"
#include "Actors/CameraMount.h"
#include "UI/GasaHUD.h"
#include "UI/WidgetController.h"
@ -75,7 +76,8 @@ void AGasaPlayerController::NetOwner_OnReady()
{
PlayerChar->AbilitySystem = PS->AbilitySystem;
PlayerChar->Attributes = PS->Attributes;
PlayerChar->AbilitySystem->InitAbilityActorInfo(PS, this);
PS->AbilitySystem->InitAbilityActorInfo(PS, PlayerChar);
Cast<UGasaAbilitySystemComp>(PS->AbilitySystem)->OnAbilityActorInfoSet();
}
Cam->AttachToActor(PlayerChar, FAttachmentTransformRules::KeepRelativeTransform);
}

View File

@ -14,8 +14,6 @@ void AGasaHUD::InitHostWidget(FWidgetControllerData const* WidgetControllerData)
HostWidgetController = NewObject<UHostWidgetController>(this, GetDevOptions()->Template_HostWidgetController.Get());
HostWidgetController->Data = (* WidgetControllerData);
HostWidget->SetWidgetController(HostWidgetController);
HostWidgetController->BindCallbacksToDependencies();
HostWidgetController->BroadcastInitialValues();
HostWidget->AddToViewport();
}