Skip to content

UGlobalMessageSubsystem

#include <GlobalMessenger/Public/GlobalMessageSubsystem.h>
class UGlobalMessageSubsystem

Defined in GlobalMessageSubsystem.h:16

Inherits: UWorldSubsystem

---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class UGlobalMessageSubsystem["UGlobalMessageSubsystem"]
  class UWorldSubsystem["UWorldSubsystem"]
  UWorldSubsystem <|-- UGlobalMessageSubsystem
---
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
  }

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.

ReturnNameDescription
voidBroadcastMessageBroadcast 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.
voidListenToMessageListens for global messages that match the specified filter tag and invokes the provided callback function.
boolRemoveListenerRemoves a listener from the GlobalMessageSubsystem.

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.

  • FilterTag The filter tag used to determine which listeners should receive the message.

  • Payload The payload object containing the data for the message. Can be nullptr if no data is needed.


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.

  • WorldContextObject The object that represents the world context.

  • FilterTag The tag used to filter the global messages.

  • Callback The delegate function to be invoked when a global message is received.

  • GMessenger

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.

  • ListenerObject The listener object to be removed.

True if the listener was successfully removed, false otherwise.

  • GMessenger
ReturnNameDescription
UGlobalMessageSubsystem *Get staticRetrieves 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.

  • TargetWorld The world for which to retrieve the global message subsystem.

The instance of the global message subsystem for the specified world.

ReturnNameDescription
voidDeinitialize virtual override

virtual override

virtual void Deinitialize() override

Defined in GlobalMessageSubsystem.h:22

  • GMessenger