Skip to content

Commit d2db0c6

Browse files
chore: add onready getter
1 parent 7b813c1 commit d2db0c6

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

Source/Immutable/Private/Immutable/ImmutableSubsystem.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,17 @@ void UImmutableSubsystem::ManageBridgeDelegateQueue()
7272
#if USING_BLUI_CEF
7373
OnReady.Broadcast(ImtblBlui->GetJSConnector());
7474
#else
75-
OnReady.Broadcast(BrowserWidget->GetJSConnector());
75+
MulticastDelegate_OnReady.Broadcast(BrowserWidget->GetJSConnector());
7676
#endif
77-
OnReady.Clear();
77+
MulticastDelegate_OnReady.Clear();
7878
}
7979
}
8080

81+
FImmutableSubsystemReadyDelegate* UImmutableSubsystem::OnReady()
82+
{
83+
return &MulticastDelegate_OnReady;
84+
}
85+
8186
void UImmutableSubsystem::SetupGameBridge()
8287
{
8388
if (bHasSetupGameBridge)

Source/Immutable/Public/Immutable/ImmutableSubsystem.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class IMMUTABLE_API UImmutableSubsystem : public UGameInstanceSubsystem
3131
}
3232

3333
bool IsReady() const { return bIsReady; }
34+
FImmutableSubsystemReadyDelegate* OnReady();
3435

3536
// Execute a delegate when the subsystem is ready (i.e.: when the browser is
3637
// running and the Immutable SDK game bridge has loaded).
@@ -41,7 +42,7 @@ class IMMUTABLE_API UImmutableSubsystem : public UGameInstanceSubsystem
4142
void WhenReady(UserClass* Object, typename FImmutableSubsystemReadyDelegate::FDelegate::TUObjectMethodDelegate<UserClass>::FMethodPtr Func)
4243
#endif
4344
{
44-
OnReady.AddUObject(Object, Func);
45+
MulticastDelegate_OnReady.AddUObject(Object, Func);
4546
}
4647

4748
private:
@@ -63,7 +64,7 @@ class IMMUTABLE_API UImmutableSubsystem : public UGameInstanceSubsystem
6364

6465
bool bHasSetupGameBridge = false;
6566
bool bIsReady = false;
66-
FImmutableSubsystemReadyDelegate OnReady;
67+
FImmutableSubsystemReadyDelegate MulticastDelegate_OnReady;
6768

6869
FDelegateHandle WorldTickHandle;
6970
FDelegateHandle ViewportCreatedHandle;

0 commit comments

Comments
 (0)