Fixed standalone compilation errors after bad refactoring @9d4eb74b.

This commit is contained in:
Sebastian 2020-06-11 01:42:18 +01:00
parent 48be56de64
commit f8d8704a67
4 changed files with 13 additions and 5 deletions

View File

@ -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

View File

@ -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.

View File

@ -6,6 +6,7 @@
#include "SImGuiWidget.h"
#include "ImGuiModuleManager.h"
#include "ImGuiModuleSettings.h"
#include <Widgets/Layout/SConstraintCanvas.h>
#include <Widgets/Layout/SDPIScaler.h>
@ -76,3 +77,8 @@ SImGuiLayout::~SImGuiLayout()
}
END_SLATE_FUNCTION_BUILD_OPTIMIZATION
void SImGuiLayout::SetDPIScale(const FImGuiDPIScaleInfo& ScaleInfo)
{
DPIScale = ScaleInfo.GetSlateScale();
}

View File

@ -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<UGameViewportClient> GameViewport;