From 07c5420bc2f90600dafbe470b3db516ad6f58580 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Fri, 26 Apr 2024 21:36:09 -0400 Subject: [PATCH] 59. Message Widget --- Project/Content/Core/AbilitySystem/GE_PotionHealth.uasset | 2 +- .../Content/Core/Pickups/BP_HealthPotion_RawEffect.uasset | 4 ++-- Project/Content/Core/Pickups/BP_ManaPotion_RawEffect.uasset | 4 ++-- Project/Content/Core/Tables/DT_TaggedMessages.uasset | 4 ++-- Project/Content/UI/BP_HostWidgetController.uasset | 4 ++-- Project/Content/UI/DT_StyleText_EffectMessage.uasset | 3 +++ Project/Content/UI/RTD_Default.uasset | 3 +++ Project/Content/UI/UI_EffectMessage.uasset | 3 +++ Project/Content/UI/UI_Host.uasset | 4 ++-- .../DataTableEditorLayout/DT_StyleText_Defaults.json | 6 ++++++ .../Gasa/AbilitySystem/GasaAbilitySystemComponent.cpp | 5 +++-- .../Source/Gasa/AbilitySystem/GasaAbilitySystemComponent.h | 3 +-- Project/Source/Gasa/Characters/GasaCharacter.cpp | 5 +++++ Project/Source/Gasa/Game/GasaGameMode.cpp | 3 +-- Project/Source/Gasa/Game/GasaPlayerController.cpp | 4 +++- Project/Source/Gasa/UI/GasaHUD.cpp | 2 -- 16 files changed, 39 insertions(+), 20 deletions(-) create mode 100644 Project/Content/UI/DT_StyleText_EffectMessage.uasset create mode 100644 Project/Content/UI/RTD_Default.uasset create mode 100644 Project/Content/UI/UI_EffectMessage.uasset create mode 100644 Project/Saved/AssetData/DataTableEditorLayout/DT_StyleText_Defaults.json diff --git a/Project/Content/Core/AbilitySystem/GE_PotionHealth.uasset b/Project/Content/Core/AbilitySystem/GE_PotionHealth.uasset index 5acc4be..11f84ee 100644 --- a/Project/Content/Core/AbilitySystem/GE_PotionHealth.uasset +++ b/Project/Content/Core/AbilitySystem/GE_PotionHealth.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:01a8166ba9987fe32990e12f3cd0e06fa434241c881d7425cebdad01b84025e8 +oid sha256:ad743e0ffff01b8789a97fcdcc31b749b7b46d57f2c3de67c9b9dd4f221020ef size 14321 diff --git a/Project/Content/Core/Pickups/BP_HealthPotion_RawEffect.uasset b/Project/Content/Core/Pickups/BP_HealthPotion_RawEffect.uasset index 076be4f..d76f602 100644 --- a/Project/Content/Core/Pickups/BP_HealthPotion_RawEffect.uasset +++ b/Project/Content/Core/Pickups/BP_HealthPotion_RawEffect.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:44b3285008cf6a0a72c6c57f18c7ed3c380da31b0f2d833993fb3fa829de02a9 -size 40761 +oid sha256:ee7caf0ea24a176d708b346f6143176fa84114981605a457dee9dfd433f0339c +size 43479 diff --git a/Project/Content/Core/Pickups/BP_ManaPotion_RawEffect.uasset b/Project/Content/Core/Pickups/BP_ManaPotion_RawEffect.uasset index 7e56302..b51fe2a 100644 --- a/Project/Content/Core/Pickups/BP_ManaPotion_RawEffect.uasset +++ b/Project/Content/Core/Pickups/BP_ManaPotion_RawEffect.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:63d1d0ae623f7841e744a409baf9611c4764f57297c429ed8d15866038f41dad -size 40996 +oid sha256:cefd63f821fb254a12a6b177161e0f527cf0add886aca87d7fc72eb119916e84 +size 41415 diff --git a/Project/Content/Core/Tables/DT_TaggedMessages.uasset b/Project/Content/Core/Tables/DT_TaggedMessages.uasset index 0c69130..6806e73 100644 --- a/Project/Content/Core/Tables/DT_TaggedMessages.uasset +++ b/Project/Content/Core/Tables/DT_TaggedMessages.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:740bc6ded88cd0b8f38bb7ddf99dcada505374635fcdfdf4833c371f2f8bdd41 -size 4940 +oid sha256:e1cd58c36a28e857d49c12980724a4728a9798c541db9773ce09c9e34ece6411 +size 5139 diff --git a/Project/Content/UI/BP_HostWidgetController.uasset b/Project/Content/UI/BP_HostWidgetController.uasset index 2ba503b..113dc6e 100644 --- a/Project/Content/UI/BP_HostWidgetController.uasset +++ b/Project/Content/UI/BP_HostWidgetController.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0da990da446d5f58c18bddec3b46216d9f3ec307b43eb809a04c744cff49d944 -size 5825 +oid sha256:51eb0803c9df366b9b8e32c528fd309a03c9ec2710b39e160992ec8dcb41d620 +size 5986 diff --git a/Project/Content/UI/DT_StyleText_EffectMessage.uasset b/Project/Content/UI/DT_StyleText_EffectMessage.uasset new file mode 100644 index 0000000..ebff857 --- /dev/null +++ b/Project/Content/UI/DT_StyleText_EffectMessage.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33ff554ea4121b483979dfa22939c7f0839a76c564f9b4f1effb3776545dfc17 +size 9608 diff --git a/Project/Content/UI/RTD_Default.uasset b/Project/Content/UI/RTD_Default.uasset new file mode 100644 index 0000000..2e1716b --- /dev/null +++ b/Project/Content/UI/RTD_Default.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae1056fd9239769b1574932e0d4fc87b5f390892ba475ff23f909ebf906b10a8 +size 5674 diff --git a/Project/Content/UI/UI_EffectMessage.uasset b/Project/Content/UI/UI_EffectMessage.uasset new file mode 100644 index 0000000..2677e71 --- /dev/null +++ b/Project/Content/UI/UI_EffectMessage.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8e8f5b2b6cb633761834f897f27e007e86bb54de20ab47a308e4da9bb3547a08 +size 68983 diff --git a/Project/Content/UI/UI_Host.uasset b/Project/Content/UI/UI_Host.uasset index 7f7384e..c54ebb9 100644 --- a/Project/Content/UI/UI_Host.uasset +++ b/Project/Content/UI/UI_Host.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:249977d9b0ffc5fa13c9c65d2cdea54a8d35981645b7b1545f4fefb4aac5d113 -size 59609 +oid sha256:a40c6489dc7e072559de85d9a919aa1d6f9eb753c024acd8021752f4af426a11 +size 84353 diff --git a/Project/Saved/AssetData/DataTableEditorLayout/DT_StyleText_Defaults.json b/Project/Saved/AssetData/DataTableEditorLayout/DT_StyleText_Defaults.json new file mode 100644 index 0000000..bce1518 --- /dev/null +++ b/Project/Saved/AssetData/DataTableEditorLayout/DT_StyleText_Defaults.json @@ -0,0 +1,6 @@ +{ + "ColumnWidths": + { + "TextStyle": 1099 + } +} \ No newline at end of file diff --git a/Project/Source/Gasa/AbilitySystem/GasaAbilitySystemComponent.cpp b/Project/Source/Gasa/AbilitySystem/GasaAbilitySystemComponent.cpp index 5390b4e..e9b9165 100644 --- a/Project/Source/Gasa/AbilitySystem/GasaAbilitySystemComponent.cpp +++ b/Project/Source/Gasa/AbilitySystem/GasaAbilitySystemComponent.cpp @@ -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); } diff --git a/Project/Source/Gasa/AbilitySystem/GasaAbilitySystemComponent.h b/Project/Source/Gasa/AbilitySystem/GasaAbilitySystemComponent.h index a258758..b6cf1ae 100644 --- a/Project/Source/Gasa/AbilitySystem/GasaAbilitySystemComponent.h +++ b/Project/Source/Gasa/AbilitySystem/GasaAbilitySystemComponent.h @@ -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 -}; +}; \ No newline at end of file diff --git a/Project/Source/Gasa/Characters/GasaCharacter.cpp b/Project/Source/Gasa/Characters/GasaCharacter.cpp index 05c1ef2..d0cd676 100644 --- a/Project/Source/Gasa/Characters/GasaCharacter.cpp +++ b/Project/Source/Gasa/Characters/GasaCharacter.cpp @@ -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(AbilitySystem)->OnAbilityActorInfoSet(); + } } void AGasaCharacter::Tick(float DeltaSeconds) diff --git a/Project/Source/Gasa/Game/GasaGameMode.cpp b/Project/Source/Gasa/Game/GasaGameMode.cpp index 26f5c75..0f516cd 100644 --- a/Project/Source/Gasa/Game/GasaGameMode.cpp +++ b/Project/Source/Gasa/Game/GasaGameMode.cpp @@ -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) diff --git a/Project/Source/Gasa/Game/GasaPlayerController.cpp b/Project/Source/Gasa/Game/GasaPlayerController.cpp index a961b00..f82e224 100644 --- a/Project/Source/Gasa/Game/GasaPlayerController.cpp +++ b/Project/Source/Gasa/Game/GasaPlayerController.cpp @@ -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(PS->AbilitySystem)->OnAbilityActorInfoSet(); } Cam->AttachToActor(PlayerChar, FAttachmentTransformRules::KeepRelativeTransform); } diff --git a/Project/Source/Gasa/UI/GasaHUD.cpp b/Project/Source/Gasa/UI/GasaHUD.cpp index c3997a5..c47b5c7 100644 --- a/Project/Source/Gasa/UI/GasaHUD.cpp +++ b/Project/Source/Gasa/UI/GasaHUD.cpp @@ -14,8 +14,6 @@ void AGasaHUD::InitHostWidget(FWidgetControllerData const* WidgetControllerData) HostWidgetController = NewObject(this, GetDevOptions()->Template_HostWidgetController.Get()); HostWidgetController->Data = (* WidgetControllerData); HostWidget->SetWidgetController(HostWidgetController); - HostWidgetController->BindCallbacksToDependencies(); - HostWidgetController->BroadcastInitialValues(); HostWidget->AddToViewport(); }