UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
GameDelegates.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6
8
13// enum class with size so it can be forward declared.
14enum class EGameDelegates_SaveGame : short
15{
16 MaxSize,
17 Icon,
18 Title,
20 Detail,
21};
22
25 TConstArrayView<const ITargetPlatform*> /* InTargetPlatforms */, TArray<FName>& /* InOutPackagesToCook */,
26 TArray<FName>& /* InOutPackagesToNeverCook */);
27
30DECLARE_DELEGATE_FourParams(FAssignLayerChunkDelegate, const FAssignLayerChunkMap* /*ChunkManifest*/, const FString& /*Platform*/, const int32 /*ChunkIndex*/, int32& /*OutChunkLayer*/);
31
33DECLARE_DELEGATE_ThreeParams(FExtendedSaveGameInfoDelegate, const TCHAR* /*SaveName*/, const EGameDelegates_SaveGame /*Key*/, FString& /*Value*/);
34
36// using a TMap in the DECLARE_DELEGATE macro caused compiler problems (in clang anyway), a typedef solves it
38DECLARE_DELEGATE_FiveParams(FWebServerActionDelegate, int32 /*UserIndex*/, const FString& /*Action*/, const FString& /*URL*/, const StringStringMap& /*Params*/, StringStringMap& /*Response*/);
39
41DECLARE_MULTICAST_DELEGATE_TwoParams(FPreCommitMapChangeDelegate, const FString& /*PreviousMapName*/, const FString& /*NextMapName*/);
42
47
50
52DECLARE_MULTICAST_DELEGATE_ThreeParams(FViewTargetChangedDelegate, class APlayerController* /*PC*/, class AActor* /*OldViewTarget*/, class AActor* /*NewViewTarget*/);
53
54// Helper defines to make defining the delegate members easy
55#define DEFINE_GAME_DELEGATE(DelegateType) \
56 public: F##DelegateType& Get##DelegateType() { return DelegateType; } \
57 private: F##DelegateType DelegateType;
58
59#define DEFINE_GAME_DELEGATE_TYPED(DelegateVariable, DelegateType) \
60 public: DelegateType& Get##DelegateVariable() { return DelegateVariable; } \
61 private: DelegateType DelegateVariable;
62
65{
66public:
67
70
71 // Called when an exit command is received
73
74 // Called when ending playing a map
76
77 // Called when a pending connection has been lost
79
80 // Called when pre/post committing a map change at runtime
83
84 // Called when a player is disconnecting due to network failure
86
87 //Called when a PlayerController view target changes.
89
90 // Implement all delegates declared above
94
95 // Called at start of CookByTheBook
97
99};
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define DECLARE_MULTICAST_DELEGATE_TwoParams(DelegateName, Param1Type, Param2Type)
Definition DelegateCombinations.h:58
#define DECLARE_DELEGATE_FiveParams(DelegateName, Param1Type, Param2Type, Param3Type, Param4Type, Param5Type)
Definition DelegateCombinations.h:84
#define DECLARE_DELEGATE_RetVal(ReturnValueType, DelegateName)
Definition DelegateCombinations.h:41
#define DECLARE_DELEGATE_ThreeParams(DelegateName, Param1Type, Param2Type, Param3Type)
Definition DelegateCombinations.h:66
#define DECLARE_MULTICAST_DELEGATE_ThreeParams(DelegateName, Param1Type, Param2Type, Param3Type)
Definition DelegateCombinations.h:67
#define DECLARE_MULTICAST_DELEGATE_OneParam(DelegateName, Param1Type)
Definition DelegateCombinations.h:49
#define DECLARE_DELEGATE_FourParams(DelegateName, Param1Type, Param2Type, Param3Type, Param4Type)
Definition DelegateCombinations.h:75
EGameDelegates_SaveGame
Definition GameDelegates.h:15
TMap< FString, FString > StringStringMap
Definition GameDelegates.h:37
const TMap< FName, FString > FAssignLayerChunkMap
Definition GameDelegates.h:29
Definition Actor.h:257
Definition PlayerController.h:261
Definition GameDelegates.h:65
DEFINE_GAME_DELEGATE_TYPED(PostCommitMapChangeDelegate, FSimpleMulticastDelegate)
DEFINE_GAME_DELEGATE_TYPED(ExitCommandDelegate, FSimpleMulticastDelegate)
DEFINE_GAME_DELEGATE(WebServerActionDelegate)
DEFINE_GAME_DELEGATE_TYPED(EndPlayMapDelegate, FSimpleMulticastDelegate)
DEFINE_GAME_DELEGATE(HandleDisconnectDelegate)
DEFINE_GAME_DELEGATE_TYPED(PendingConnectionLostDelegate, FPendingConnectionLostDelegate)
DEFINE_GAME_DELEGATE(PreCommitMapChangeDelegate)
DEFINE_GAME_DELEGATE(ExtendedSaveGameInfoDelegate)
DEFINE_GAME_DELEGATE(ModifyCookDelegate)
DEFINE_GAME_DELEGATE(CookedEditorPackageManagerFactoryDelegate)
DEFINE_GAME_DELEGATE_TYPED(ViewTargetChangedDelegate, FViewTargetChangedDelegate)
static ENGINE_API FGameDelegates & Get()
Definition GameDelegates.cpp:6
DEFINE_GAME_DELEGATE(AssignLayerChunkDelegate)
Definition Array.h:670
Definition UnrealString.h.inl:34
Definition UniquePtr.h:107
Definition NetDriver.h:799
Definition World.h:918
Definition OnlineReplStructs.h:26