diff --git a/Source/ImGui/Private/ImGuiModule.cpp b/Source/ImGui/Private/ImGuiModule.cpp index ea12089..3534aeb 100644 --- a/Source/ImGui/Private/ImGuiModule.cpp +++ b/Source/ImGui/Private/ImGuiModule.cpp @@ -53,6 +53,12 @@ FImGuiDelegateHandle FImGuiModule::AddWorldImGuiDelegate(const FImGuiDelegate& D return { FImGuiDelegatesContainer::Get().OnWorldDebug(ContextIndex).Add(Delegate), EDelegateCategory::Default, ContextIndex }; } +FImGuiDelegateHandle FImGuiModule::AddWorldImGuiDelegate(const UWorld* World, const FImGuiDelegate& Delegate) +{ + const int32 ContextIndex = Utilities::GetWorldContextIndex(World); + return { FImGuiDelegatesContainer::Get().OnWorldDebug(ContextIndex).Add(Delegate), EDelegateCategory::Default, ContextIndex }; +} + FImGuiDelegateHandle FImGuiModule::AddMultiContextImGuiDelegate(const FImGuiDelegate& Delegate) { return { FImGuiDelegatesContainer::Get().OnMultiContextDebug().Add(Delegate), EDelegateCategory::MultiContext }; diff --git a/Source/ImGui/Public/ImGuiModule.h b/Source/ImGui/Public/ImGuiModule.h index ec2ac4a..8e63e60 100644 --- a/Source/ImGui/Public/ImGuiModule.h +++ b/Source/ImGui/Public/ImGuiModule.h @@ -57,6 +57,16 @@ public: */ virtual FImGuiDelegateHandle AddWorldImGuiDelegate(const FImGuiDelegate& Delegate); + /** + * Add a delegate called at the end of a specific world's debug frame to draw debug controls in its ImGui context, + * creating that context on demand. + * + * @param World - A specific world to add the delegate to to + * @param Delegate - Delegate that we want to add (@see FImGuiDelegate::Create...) + * @returns Returns handle that can be used to remove delegate (@see RemoveImGuiDelegate) + */ + virtual FImGuiDelegateHandle AddWorldImGuiDelegate(const UWorld* World, const FImGuiDelegate& Delegate); + /** * Add shared delegate called for each ImGui context at the end of debug frame, after calling context specific * delegate. This delegate will be used for any ImGui context, created before or after it is registered. diff --git a/Source/ThirdParty/ImGuiLibrary/Private/imgui_internal.h b/Source/ThirdParty/ImGuiLibrary/Include/imgui_internal.h similarity index 100% rename from Source/ThirdParty/ImGuiLibrary/Private/imgui_internal.h rename to Source/ThirdParty/ImGuiLibrary/Include/imgui_internal.h diff --git a/Source/ThirdParty/ImGuiLibrary/Private/imstb_textedit.h b/Source/ThirdParty/ImGuiLibrary/Include/imstb_textedit.h similarity index 100% rename from Source/ThirdParty/ImGuiLibrary/Private/imstb_textedit.h rename to Source/ThirdParty/ImGuiLibrary/Include/imstb_textedit.h