diff --git a/Source/ImGui/Private/ImGuiContextManager.cpp b/Source/ImGui/Private/ImGuiContextManager.cpp index fded091..3194c58 100644 --- a/Source/ImGui/Private/ImGuiContextManager.cpp +++ b/Source/ImGui/Private/ImGuiContextManager.cpp @@ -169,8 +169,8 @@ FImGuiContextManager::FContextData& FImGuiContextManager::GetStandaloneWorldCont if (UNLIKELY(!Data)) { - Data = &Contexts.Emplace(Utilities::STANDALONE_GAME_CONTEXT_INDEX, FContextData{ GetWorldContextName(), Utilities::STANDALONE_GAME_CONTEXT_INDEX, DrawMultiContextEvent, FontAtlas }); - ContextProxyCreatedEvent.Broadcast(Utilities::STANDALONE_GAME_CONTEXT_INDEX, *Data->ContextProxy); + Data = &Contexts.Emplace(Utilities::STANDALONE_GAME_CONTEXT_INDEX, FContextData{ GetWorldContextName(), Utilities::STANDALONE_GAME_CONTEXT_INDEX, OnDrawMultiContext, FontAtlas }); + OnContextProxyCreated.Broadcast(Utilities::STANDALONE_GAME_CONTEXT_INDEX, *Data->ContextProxy); } return *Data; @@ -222,8 +222,8 @@ FImGuiContextManager::FContextData& FImGuiContextManager::GetWorldContextData(co #else if (UNLIKELY(!Data)) { - Data = &Contexts.Emplace(Index, FContextData{ GetWorldContextName(World), Index, DrawMultiContextEvent, FontAtlas }); - ContextProxyCreatedEvent.Broadcast(Index, *Data->ContextProxy); + Data = &Contexts.Emplace(Index, FContextData{ GetWorldContextName(World), Index, OnDrawMultiContext, FontAtlas }); + OnContextProxyCreated.Broadcast(Index, *Data->ContextProxy); } #endif diff --git a/Source/ImGui/Private/ImGuiContextManager.h b/Source/ImGui/Private/ImGuiContextManager.h index e08c324..7211d53 100644 --- a/Source/ImGui/Private/ImGuiContextManager.h +++ b/Source/ImGui/Private/ImGuiContextManager.h @@ -6,6 +6,7 @@ class FImGuiModuleSettings; +struct FImGuiDPIScaleInfo; // TODO: It might be useful to broadcast FContextProxyCreatedDelegate to users, to support similar cases to our ImGui // demo, but we would need to remove from that interface internal classes. diff --git a/Source/ImGui/Private/Widgets/SImGuiLayout.cpp b/Source/ImGui/Private/Widgets/SImGuiLayout.cpp index 6f02730..cfa55a9 100644 --- a/Source/ImGui/Private/Widgets/SImGuiLayout.cpp +++ b/Source/ImGui/Private/Widgets/SImGuiLayout.cpp @@ -6,6 +6,7 @@ #include "SImGuiWidget.h" #include "ImGuiModuleManager.h" +#include "ImGuiModuleSettings.h" #include #include @@ -76,3 +77,8 @@ SImGuiLayout::~SImGuiLayout() } END_SLATE_FUNCTION_BUILD_OPTIMIZATION + +void SImGuiLayout::SetDPIScale(const FImGuiDPIScaleInfo& ScaleInfo) +{ + DPIScale = ScaleInfo.GetSlateScale(); +} diff --git a/Source/ImGui/Private/Widgets/SImGuiLayout.h b/Source/ImGui/Private/Widgets/SImGuiLayout.h index 1edcd3e..4633094 100644 --- a/Source/ImGui/Private/Widgets/SImGuiLayout.h +++ b/Source/ImGui/Private/Widgets/SImGuiLayout.h @@ -7,6 +7,7 @@ class FImGuiModuleManager; class UGameViewportClient; +struct FImGuiDPIScaleInfo; // Layout preset for ImGui Widget. class SImGuiLayout : public SCompoundWidget @@ -31,7 +32,7 @@ public: private: float GetDPIScale() const { return DPIScale; } - void SetDPIScale(const FImGuiDPIScaleInfo& ScaleInfo) { DPIScale = ScaleInfo.GetSlateScale(); } + void SetDPIScale(const FImGuiDPIScaleInfo& ScaleInfo); FImGuiModuleManager* ModuleManager = nullptr; TWeakObjectPtr GameViewport;