diff --git a/Project/Binaries/Win64/UnrealEditor-GasaEditor.dll b/Project/Binaries/Win64/UnrealEditor-GasaEditor.dll index 0099970..b0293b3 100644 --- a/Project/Binaries/Win64/UnrealEditor-GasaEditor.dll +++ b/Project/Binaries/Win64/UnrealEditor-GasaEditor.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d0cc403c45e28f2452702441c05eb75301540ec586d0f94eabbef2445befb7f8 +oid sha256:873a05db7e7d47efe7f28c35f73a556f508724c60c6003f15139c7a183b498a1 size 79360 diff --git a/Project/Source/Gasa/AbilitySystem/GasaAbilitySystemComponent.cpp b/Project/Source/Gasa/AbilitySystem/GasaAbilitySystemComponent.cpp index 7b856b3..99d010c 100644 --- a/Project/Source/Gasa/AbilitySystem/GasaAbilitySystemComponent.cpp +++ b/Project/Source/Gasa/AbilitySystem/GasaAbilitySystemComponent.cpp @@ -1,6 +1,16 @@ #include "GasaAbilitySystemComponent.h" #include "Engine/Engine.h" +#include "Engine/GameViewportClient.h" +#include "Game/GasaGameState.h" +#include "Game/GasaPlayerController.h" +#include "GameFramework/HUD.h" +#include "Slate/SceneViewport.h" +#include "UI/GasaHUD.h" +#include "CogDebugDraw.h" + + +using namespace Gasa; void UGasaAbilitySystemComp::OnAbilityActorInfoSet() { @@ -9,7 +19,14 @@ void UGasaAbilitySystemComp::OnAbilityActorInfoSet() void UGasaAbilitySystemComp::EffectApplied(UAbilitySystemComponent* AbilitySystem, FGameplayEffectSpec const& Spec, FActiveGameplayEffectHandle ActiveEffect) { - GEngine->AddOnScreenDebugMessage(1, 8.f, FColor::Yellow, FString("Effect applied")); + FGameplayTagContainer Tags; + Spec.GetAllAssetTags(Tags); + for (FGameplayTag const& Tag : Tags) + { + // TODO(Ed): Broadcast the tag to the widget controller + FString Msg = FString::Printf(TEXT("GE Tag: %s"), * Tag.ToString()); + Log(Msg); + } } void UGasaAbilitySystemComp::InitAbilityActorInfo(AActor* InOwnerActor, AActor* InAvatarActor) diff --git a/Project/Source/Gasa/Game/GasaGameState.cpp~ b/Project/Source/Gasa/Game/GasaGameState.cpp~ deleted file mode 100644 index 772b6be..0000000 --- a/Project/Source/Gasa/Game/GasaGameState.cpp~ +++ /dev/null @@ -1,147 +0,0 @@ -#include "GasaGameState.h" - -#include "CogAll.h" -#include "CogWindowManager.h" -#include "GasaPlayerState.h" -#include "GasaGameInstance.h" -#include "Net/UnrealNetwork.h" -#include "Networking/GasaNetLibrary_Inlines.h" -using namespace Gasa; - -AGasaGameState::AGasaGameState() -{ - // Enable ticking - PrimaryActorTick.bCanEverTick = true; - PrimaryActorTick.SetTickFunctionEnable(true); - PrimaryActorTick.bStartWithTickEnabled = true; - - // Replication - bReplicates = true; - bNetLoadOnClient = false; - NetDormancy = DORM_Awake; - NetCullDistanceSquared = NetCullDist_Default; - NetUpdateFrequency = 10.0f; - MinNetUpdateFrequency = 1.0f; - NetPriority = 5.0f; -} - -#pragma region GameFramework -void AGasaGameState::OnGameFrameworkInitialized() -{ - NetLog("Received gameplay framework initialization."); - if (IsServer()) - { - if (PlayerArray.Num() > 0) - { - ListenServerHost = Cast(PlayerArray[0]); - } - else - { - NetLog("Was not able to assign HostingPlayer!", ELogV::Error); - } - } - BP_OnGameFrameworkInitialized(); -} -#pragma endregion GameFramework - -#pragma region Networking -void AGasaGameState::Client_OnRep_OnlinePlayers() -{ -} -#pragma endregion Networking - -#pragma region Seamless Travel -void AGasaGameState::Multicast_R_NotifySeamlessTravelEnd_Implementation() -{ - NetLog("Multicast_R_NotifySeamlessTravelEnd_Implementation"); - BP_Event_OnSeamlessTravelEnd.Broadcast(); - Event_OnSeamlessTravelEnd.Broadcast(); -} -#pragma endregion Seamless Travel - -#pragma region GameStateBase -void AGasaGameState::HandleBeginPlay() -{ - Super::HandleBeginPlay(); - NetLog("HandleBeginPlay: Directly called from GM"); -} - -void AGasaGameState::SeamlessTravelTransitionCheckpoint(bool bToTransitionMap) -{ - Super::SeamlessTravelTransitionCheckpoint(bToTransitionMap); - NetLog("SeamlessTravelTransitionCheckpoint"); - NetLog(FString("ToTransitionMap: ") + FString(bToTransitionMap ? "true" : "false")); - - if (bToTransitionMap) - { - Event_OnSeamlessTravelStart.Broadcast(); - } - else - { - Multicast_R_NotifySeamlessTravelEnd(); - } -} -#pragma endregion GameStateBase - -#pragma region Actor -void AGasaGameState::BeginPlay() -{ - Super::BeginPlay(); - NetLog("BeginPlay"); - - // Notified as initialized here as any possible components should also be initialized by this point. - UGasaGameInstance* - GI = GetGameInstance(); - GI->Event_OnGameFrameworkInitialized.AddDynamic(this, & ThisClass::OnGameFrameworkInitialized); - GI->NotifyGameFrameworkClassReady(EGameFrameworkClassFlag::GameState); - -#if ENABLE_COG - CogWindowManager = NewObject(this); - CogWindowManagerRef = CogWindowManager; - - // Add all the built-in windows - Cog::AddAllWindows(*CogWindowManager); -#endif //ENABLE_COG -} - -void AGasaGameState::PostInitializeComponents() -{ - NetLog("PostInitializeComponents"); - Super::PostInitializeComponents(); - - if ( ! GetWorld()->IsEditorWorld() && IsServer()) - { - OnlinePlayers.Empty(); -#if 0 - const auto GI = Cast(GetGameInstance()); - if (GI != nullptr) - { - int32 NumConnections = GI->SessionSettings.bPublicGame - ? GI->SessionSettings.PublicConnections - : GI->SessionSettings.PrivateConnections; - OnlinePlayers.Init(nullptr, NumConnections); - } -#endif - } -} - -void AGasaGameState::Tick(float DeltaSeconds) -{ - Super::Tick(DeltaSeconds); - -#if ENABLE_COG - if (CogWindowManager) - CogWindowManager->Tick(DeltaSeconds); -#endif //ENABLE_COG -} -#pragma endregion Actor - -#pragma region UObject -void AGasaGameState::GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const -{ - Super::GetLifetimeReplicatedProps(OutLifetimeProps); - - DOREPLIFETIME(AGasaGameState, ListenServerHost); - DOREPLIFETIME(AGasaGameState, OnlinePlayers); -} -#pragma endregion UObject diff --git a/Project/Source/Gasa/Game/GasaPlayerController.cpp b/Project/Source/Gasa/Game/GasaPlayerController.cpp index 6a91152..a961b00 100644 --- a/Project/Source/Gasa/Game/GasaPlayerController.cpp +++ b/Project/Source/Gasa/Game/GasaPlayerController.cpp @@ -3,6 +3,7 @@ #include "Networking/GasaNetLibrary_Inlines.h" #include "AbilitySystemComponent.h" +#include "DrawDebugHelpers.h" #include "Engine/LocalPlayer.h" #include "EnhancedInputComponent.h" #include "EnhancedInputSubsystems.h" @@ -66,14 +67,17 @@ void AGasaPlayerController::NetOwner_OnReady() if (IsClient()) ServerRPC_R_NotifyOwningClientReady(); + Cam = GetWorld()->SpawnActor(GetDevOptions()->Template_PlayerCamera.Get(), FActorSpawnParameters() ); + SetViewTarget(Cam); + AGasaPlayerState* PS = GetPlayerState(); APlayerCharacter* PlayerChar = GetPawn(); { PlayerChar->AbilitySystem = PS->AbilitySystem; PlayerChar->Attributes = PS->Attributes; PlayerChar->AbilitySystem->InitAbilityActorInfo(PS, this); - Cam->AttachToActor(PlayerChar, FAttachmentTransformRules::KeepRelativeTransform); } + Cam->AttachToActor(PlayerChar, FAttachmentTransformRules::KeepRelativeTransform); } void AGasaPlayerController::OnGameFrameworkInitialized() @@ -416,15 +420,11 @@ void AGasaPlayerController::BeginPlay() void AGasaPlayerController::PostInitializeComponents() { Super::PostInitializeComponents(); - - Cam = GetWorld()->SpawnActor(GetDevOptions()->Template_PlayerCamera.Get(), FActorSpawnParameters() ); - SetViewTarget(Cam); } void AGasaPlayerController::Tick(float DeltaSeconds) { Super::Tick(DeltaSeconds); - #if 0 switch (HighlightState) { diff --git a/Project/Source/Gasa/Gasa.Build.cs b/Project/Source/Gasa/Gasa.Build.cs index fb8db38..ffc04cd 100644 --- a/Project/Source/Gasa/Gasa.Build.cs +++ b/Project/Source/Gasa/Gasa.Build.cs @@ -84,6 +84,15 @@ public class Gasa : ModuleRules PrivateIncludePathModuleNames.AddRange( new string[] { "CogCommon", + "CogAbility", + "CogAI", + "CogAll", + "CogDebug", + "CogDebugEditor", + "CogEngine", + "CogImgui", + "CogInput", + "CogWindow", }); PrivateDependencyModuleNames.AddRange(new string[] { diff --git a/Project/Source/Gasa/GasaCommon.h b/Project/Source/Gasa/GasaCommon.h index a6577fa..8f29e2f 100644 --- a/Project/Source/Gasa/GasaCommon.h +++ b/Project/Source/Gasa/GasaCommon.h @@ -160,7 +160,8 @@ namespace Gasa // Works for Unreal 5.4, Win64 MSVC (untested in other scenarios, for now) inline - void Log( FString Message, EGasaVerbosity Verbosity = EGasaVerbosity::Log + void Log( FString Message + , EGasaVerbosity Verbosity = EGasaVerbosity::Log , FLogCategoryBase& Category = LogGasa , bool DumpStack = false , int32 Line = __builtin_LINE() diff --git a/Project/Source/Gasa/UI/GasaHUD.cpp b/Project/Source/Gasa/UI/GasaHUD.cpp index 3284826..c3997a5 100644 --- a/Project/Source/Gasa/UI/GasaHUD.cpp +++ b/Project/Source/Gasa/UI/GasaHUD.cpp @@ -20,6 +20,11 @@ void AGasaHUD::InitHostWidget(FWidgetControllerData const* WidgetControllerData) HostWidget->AddToViewport(); } +void AGasaHUD::DrawHUD() +{ + Super::DrawHUD(); +} + #pragma region HUD void AGasaHUD::ShowHUD() { @@ -32,4 +37,9 @@ void AGasaHUD::BeginPlay() { Super::BeginPlay(); } + +void AGasaHUD::Tick(float DeltaSeconds) +{ + Super::Tick(DeltaSeconds); +} #pragma endregion Actor diff --git a/Project/Source/Gasa/UI/GasaHUD.h b/Project/Source/Gasa/UI/GasaHUD.h index 2d63150..009ee81 100644 --- a/Project/Source/Gasa/UI/GasaHUD.h +++ b/Project/Source/Gasa/UI/GasaHUD.h @@ -21,11 +21,14 @@ public: void InitHostWidget(FWidgetControllerData const* WidgetControllerData); -#pragma region HUD +#pragma region HUD + void DrawHUD() override; void ShowHUD() override; #pragma endregion HUD #pragma region Actor void BeginPlay() override; + + void Tick(float DeltaSeconds) override; #pragma endregion Actor };