2019-04-10 19:19:11 +00:00
|
|
|
// Distributed under the MIT License (MIT) (see accompanying LICENSE file)
|
|
|
|
|
|
|
|
#include "ImGuiDelegatesContainer.h"
|
|
|
|
|
|
|
|
#include "Utilities/WorldContextIndex.h"
|
|
|
|
|
|
|
|
|
|
|
|
FImGuiDelegatesContainer FImGuiDelegatesContainer::DefaultInstance;
|
|
|
|
|
|
|
|
FImGuiDelegatesContainer* FImGuiDelegatesContainer::InstancePtr = &FImGuiDelegatesContainer::DefaultInstance;
|
|
|
|
|
|
|
|
void FImGuiDelegatesContainer::MoveContainer(FImGuiDelegatesContainer& Dst)
|
|
|
|
{
|
|
|
|
// Only move data if pointer points to default instance, otherwise our data has already been moved and we only
|
|
|
|
// keep pointer to a more recent version.
|
|
|
|
if (InstancePtr == &DefaultInstance)
|
|
|
|
{
|
|
|
|
Dst = MoveTemp(DefaultInstance);
|
|
|
|
DefaultInstance.Clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Update pointer to the most recent version.
|
|
|
|
InstancePtr = &Dst;
|
|
|
|
}
|
|
|
|
|
2019-04-14 11:16:15 +00:00
|
|
|
int32 FImGuiDelegatesContainer::GetContextIndex(UWorld* World)
|
2019-04-10 19:19:11 +00:00
|
|
|
{
|
2019-04-14 11:16:15 +00:00
|
|
|
return Utilities::GetWorldContextIndex(*World);
|
2019-04-10 19:19:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void FImGuiDelegatesContainer::Clear()
|
|
|
|
{
|
2019-04-14 11:16:15 +00:00
|
|
|
WorldEarlyDebugDelegates.Empty();
|
|
|
|
WorldDebugDelegates.Empty();
|
|
|
|
MultiContextEarlyDebugDelegate.Clear();
|
|
|
|
MultiContextDebugDelegate.Clear();
|
2019-04-10 19:19:11 +00:00
|
|
|
}
|