UGlobalMessageSubsystem
#include <GlobalMessenger/Public/GlobalMessageSubsystem.h>class UGlobalMessageSubsystemDefined in GlobalMessageSubsystem.h:16
Inherits:
UWorldSubsystem
Inheritance diagram
Section titled “Inheritance diagram”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UGlobalMessageSubsystem["UGlobalMessageSubsystem"]
class UWorldSubsystem["UWorldSubsystem"]
UWorldSubsystem <|-- UGlobalMessageSubsystem
Class detail
Section titled “Class detail”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UGlobalMessageSubsystem {
+BroadcastMessage(const FGameplayTag FilterTag, UObject *Payl
+ListenToMessage(const UObject *WorldContextObject, const FG
+RemoveListener(const UObject *ListenerObject) bool
+Get(const UWorld &TargetWorld) UGlobalMessageSubsystem() *
+Deinitialize() override
}
Caller impact — Get
Section titled “Caller impact — Get”Documented call sites inside the plugin (3):
flowchart LR UGlobalMessageSubsystem__Get["UGlobalMessageSubsystem::Get"] UOperatingSystemBankManager__RegisterNewBankAccount["UOperatingSystemBankManager::RegisterNewBankAccount"] UOperatingSystemBankManager__RegisterNewBankAccount --> UGlobalMessageSubsystem__Get UOperatingSystemMailManager__RegisterNewMailAccount["UOperatingSystemMailManager::RegisterNewMailAccount"] UOperatingSystemMailManager__RegisterNewMailAccount --> UGlobalMessageSubsystem__Get UOperatingSystemBankManager__UnregisterBankAccount["UOperatingSystemBankManager::UnregisterBankAccount"] UOperatingSystemBankManager__UnregisterBankAccount --> UGlobalMessageSubsystem__Get
Subsystem that allows broadcasting and listening to global messages.
Public Methods
Section titled “Public Methods”| Return | Name | Description |
|---|---|---|
void | BroadcastMessage | Broadcast a message to the global message subsystem. The message is sent to all listeners that are currently registered to receive messages with the specified filter tag. The payload object can be any UObject derived class providing the necessary data for the message. |
void | ListenToMessage | Listens for global messages that match the specified filter tag and invokes the provided callback function. |
bool | RemoveListener | Removes a listener from the GlobalMessageSubsystem. |
BroadcastMessage
Section titled “BroadcastMessage”void BroadcastMessage(const FGameplayTag FilterTag, UObject * Payload)Defined in GlobalMessageSubsystem.h:43 Broadcast a message to the global message subsystem. The message is sent to all listeners that are currently registered to receive messages with the specified filter tag. The payload object can be any UObject derived class providing the necessary data for the message.
Parameters
Section titled “Parameters”-
FilterTagThe filter tag used to determine which listeners should receive the message. -
PayloadThe payload object containing the data for the message. Can be nullptr if no data is needed.
Referenced by
Section titled “Referenced by”References
Section titled “References”BroadcastMessageGMessenger
ListenToMessage
Section titled “ListenToMessage”void ListenToMessage(const UObject * WorldContextObject, const FGameplayTag FilterTag, const FGlobalMessageReceiveDelegate & Callback)Defined in GlobalMessageSubsystem.h:56 Listens for global messages that match the specified filter tag and invokes the provided callback function.
This function adds a listener to the global message subsystem, which allows you to receive global messages that match the specified filter tag. When a global message with a matching tag is received, the provided callback function is invoked.
Parameters
Section titled “Parameters”-
WorldContextObjectThe object that represents the world context. -
FilterTagThe tag used to filter the global messages. -
CallbackThe delegate function to be invoked when a global message is received.
References
Section titled “References”GMessenger
RemoveListener
Section titled “RemoveListener”bool RemoveListener(const UObject * ListenerObject)Defined in GlobalMessageSubsystem.h:68 Removes a listener from the GlobalMessageSubsystem.
This method removes a listener object from the GlobalMessageSubsystem. Once removed, the listener will no longer be notified of any global message events.
Parameters
Section titled “Parameters”ListenerObjectThe listener object to be removed.
Returns
Section titled “Returns”True if the listener was successfully removed, false otherwise.
References
Section titled “References”GMessenger
Public Static Methods
Section titled “Public Static Methods”| Return | Name | Description |
|---|---|---|
UGlobalMessageSubsystem * | Get static | Retrieves the instance of the global message subsystem for the specified world. |
static
static UGlobalMessageSubsystem * Get(const UWorld & TargetWorld)Defined in GlobalMessageSubsystem.h:32 Retrieves the instance of the global message subsystem for the specified world.
Parameters
Section titled “Parameters”TargetWorldThe world for which to retrieve the global message subsystem.
Returns
Section titled “Returns”The instance of the global message subsystem for the specified world.
Referenced by
Section titled “Referenced by”Protected Methods
Section titled “Protected Methods”| Return | Name | Description |
|---|---|---|
void | Deinitialize virtual override |
Deinitialize
Section titled “Deinitialize”virtual override
virtual void Deinitialize() overrideDefined in GlobalMessageSubsystem.h:22
References
Section titled “References”GMessenger