> For the complete documentation index, see [llms.txt](https://dante-3.gitbook.io/dante-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dante-3.gitbook.io/dante-docs/indicator-system-plugin/indicator-subsystem/delegates.md).

# Delegates

```cpp
DECLARE_MULTICAST_DELEGATE_TwoParams(FOnIndicatorManagerRegistered,   AActor*, UIndicatorManagerComponent*);
DECLARE_MULTICAST_DELEGATE_TwoParams(FOnIndicatorManagerUnregistered, AActor*, UIndicatorManagerComponent*);

FOnIndicatorManagerRegistered   OnIndicatorManagerRegistered;
FOnIndicatorManagerUnregistered OnIndicatorManagerUnregistered;
```

C++-only multicast delegates. Subscribe to observe when a `UIndicatorManagerComponent` is added or removed from the global system.

{% hint style="info" %}
These delegates are declared but are **not broadcast** by the current `AddIndicatorForActor` / `RemoveIndicatorForActor` implementations — the subsystem only manages `UIndicatorDescriptor*` entries. Binding these delegates has no effect until broadcast calls are added. This is a known extension point.
{% endhint %}

**Example subscription:**

```cpp
IndicatorSub->OnIndicatorManagerRegistered.AddLambda(
    [](AActor* Actor, UIndicatorManagerComponent* IMC)
    {
        UE_LOG(LogGame, Log, TEXT("Indicator registered for: %s"), *Actor->GetName());
    });
```

***

## Internal Storage

```cpp
UPROPERTY()
TMap<AActor*, UIndicatorDescriptor*> ActiveIndicators;
```

The map is `UPROPERTY()` so it participates in UObject memory management — entries holding object pointers are tracked by the garbage collector. Descriptors remain alive as long as they are referenced here or by a `UIndicatorManagerComponent`.

***

## Lifecycle

| Event            | Behavior                                                                          |
| ---------------- | --------------------------------------------------------------------------------- |
| Created          | Automatically by the engine when `UGameInstance` initializes                      |
| `Deinitialize()` | Calls `Super::Deinitialize()` — `ActiveIndicators` is implicitly cleaned up by GC |
| Destroyed        | When `UGameInstance` is torn down (level streaming does **not** destroy it)       |

***
