Files
guillaume guay b59eecf4c5 - Moved GameplayDebugger from Developer/ into Runtime/ and Editor source folder to be able to use it in shipping build.
- Moved the code originally in a Editor/ folder into its own GameplayDebuggerEditor module and added it so it get dynamically loaded in the editor
- Added some delegates so GameplayDebugger code can communicate to GameplayDebuggerEditor without referencing it. As only GameplayDebuggerEditor should reference GameplayDebugger, not the opposite.

#preflight https://horde.devtools.epicgames.com/job/637808462a05dabce95c5b9e
[REVIEW] https://p4-swarm.epicgames.net/reviews/23207203
[FYI] guillaume.morreel, andrew.ladenberger

[CL 23258875 by guillaume guay in ue5-main branch]
2022-11-24 09:49:23 -05:00

42 lines
1.7 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Modules/ModuleManager.h"
#include "Engine/World.h"
#include "GameplayDebugger.h"
#include "GameplayDebuggerAddonManager.h"
class AGameplayDebuggerPlayerManager;
DECLARE_MULTICAST_DELEGATE(FOnLocalControllerInitialized)
DECLARE_MULTICAST_DELEGATE(FOnLocalControllerUninitialized)
DECLARE_MULTICAST_DELEGATE(FOnDebuggerEdMode)
class FGameplayDebuggerModule : public IGameplayDebugger
{
public:
virtual void StartupModule() override;
virtual void ShutdownModule() override;
virtual void RegisterCategory(FName CategoryName, IGameplayDebugger::FOnGetCategory MakeInstanceDelegate, EGameplayDebuggerCategoryState CategoryState, int32 SlotIdx) override;
virtual void UnregisterCategory(FName CategoryName) override;
virtual void NotifyCategoriesChanged() override;
virtual void RegisterExtension(FName ExtensionName, IGameplayDebugger::FOnGetExtension MakeInstanceDelegate) override;
virtual void UnregisterExtension(FName ExtensionName) override;
virtual void NotifyExtensionsChanged() override;
AGameplayDebuggerPlayerManager& GetPlayerManager(UWorld* World);
void OnWorldInitialized(UWorld* World, const UWorld::InitializationValues IVS);
FGameplayDebuggerAddonManager AddonManager;
TMap<TWeakObjectPtr<UWorld>, TWeakObjectPtr<AGameplayDebuggerPlayerManager>> PlayerManagers;
static GAMEPLAYDEBUGGER_API FOnLocalControllerInitialized OnLocalControllerInitialized;
static GAMEPLAYDEBUGGER_API FOnLocalControllerUninitialized OnLocalControllerUninitialized;
#if WITH_EDITOR
static GAMEPLAYDEBUGGER_API FOnDebuggerEdMode OnDebuggerEdModeActivation;
#endif // WITH_EDITOR
};