diff --git a/Source/ImGui/Private/ImGuiImplementation.cpp b/Source/ImGui/Private/ImGuiImplementation.cpp index f4550ef..7bac665 100644 --- a/Source/ImGui/Private/ImGuiImplementation.cpp +++ b/Source/ImGui/Private/ImGuiImplementation.cpp @@ -9,6 +9,12 @@ // // We don't need to define IMGUI_API manually because it is already done for this module. +#if PLATFORM_XBOXONE +// Disable Win32 functions used in ImGui and not supported on XBox. +#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS +#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS +#endif // PLATFORM_XBOXONE + #if PLATFORM_WINDOWS #include #endif // PLATFORM_WINDOWS diff --git a/Source/ImGui/Private/ImGuiModuleManager.cpp b/Source/ImGui/Private/ImGuiModuleManager.cpp index af579c5..bea90de 100644 --- a/Source/ImGui/Private/ImGuiModuleManager.cpp +++ b/Source/ImGui/Private/ImGuiModuleManager.cpp @@ -151,17 +151,17 @@ void FImGuiModuleManager::AddWidgetToViewport(UGameViewportClient* GameViewport) // This makes sure that context for this world is created. auto& Proxy = ContextManager.GetWorldContextProxy(*GameViewport->GetWorld()); - TSharedPtr Widget; - SAssignNew(Widget, SImGuiWidget).ModuleManager(this).GameViewport(GameViewport) + TSharedPtr SharedWidget; + SAssignNew(SharedWidget, SImGuiWidget).ModuleManager(this).GameViewport(GameViewport) .ContextIndex(Utilities::GetWorldContextIndex(GameViewport)); if (TWeakPtr* Slot = Widgets.FindByPredicate([](auto& Widget) { return !Widget.IsValid(); })) { - *Slot = Widget; + *Slot = SharedWidget; } else { - Widgets.Emplace(Widget); + Widgets.Emplace(SharedWidget); } } diff --git a/Source/ImGui/Private/Utilities/WorldContext.h b/Source/ImGui/Private/Utilities/WorldContext.h index d63a317..6a75e2c 100644 --- a/Source/ImGui/Private/Utilities/WorldContext.h +++ b/Source/ImGui/Private/Utilities/WorldContext.h @@ -10,6 +10,11 @@ namespace Utilities { + FORCEINLINE const FWorldContext* GetWorldContext(const UGameInstance& GameInstance) + { + return GameInstance.GetWorldContext(); + } + template FORCEINLINE const FWorldContext* GetWorldContext(const TWeakObjectPtr& Obj) { @@ -22,11 +27,6 @@ namespace Utilities return Obj ? GetWorldContext(*Obj) : nullptr; } - FORCEINLINE const FWorldContext* GetWorldContext(const UGameInstance& GameInstance) - { - return GameInstance.GetWorldContext(); - } - FORCEINLINE const FWorldContext* GetWorldContext(const UGameViewportClient& GameViewportClient) { return GetWorldContext(GameViewportClient.GetGameInstance());