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)) if (UNLIKELY(!Data))
{ {
Data = &Contexts.Emplace(Utilities::STANDALONE_GAME_CONTEXT_INDEX, FContextData{ GetWorldContextName(), Utilities::STANDALONE_GAME_CONTEXT_INDEX, DrawMultiContextEvent, FontAtlas }); Data = &Contexts.Emplace(Utilities::STANDALONE_GAME_CONTEXT_INDEX, FContextData{ GetWorldContextName(), Utilities::STANDALONE_GAME_CONTEXT_INDEX, OnDrawMultiContext, FontAtlas });
ContextProxyCreatedEvent.Broadcast(Utilities::STANDALONE_GAME_CONTEXT_INDEX, *Data->ContextProxy); OnContextProxyCreated.Broadcast(Utilities::STANDALONE_GAME_CONTEXT_INDEX, *Data->ContextProxy);
} }
return *Data; return *Data;
@ -222,8 +222,8 @@ FImGuiContextManager::FContextData& FImGuiContextManager::GetWorldContextData(co
#else #else
if (UNLIKELY(!Data)) if (UNLIKELY(!Data))
{ {
Data = &Contexts.Emplace(Index, FContextData{ GetWorldContextName(World), Index, DrawMultiContextEvent, FontAtlas }); Data = &Contexts.Emplace(Index, FContextData{ GetWorldContextName(World), Index, OnDrawMultiContext, FontAtlas });
ContextProxyCreatedEvent.Broadcast(Index, *Data->ContextProxy); OnContextProxyCreated.Broadcast(Index, *Data->ContextProxy);
} }
#endif #endif

View File

@ -6,6 +6,7 @@
class FImGuiModuleSettings; class FImGuiModuleSettings;
struct FImGuiDPIScaleInfo;
// TODO: It might be useful to broadcast FContextProxyCreatedDelegate to users, to support similar cases to our ImGui // 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. // demo, but we would need to remove from that interface internal classes.

View File

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

View File

@ -7,6 +7,7 @@
class FImGuiModuleManager; class FImGuiModuleManager;
class UGameViewportClient; class UGameViewportClient;
struct FImGuiDPIScaleInfo;
// Layout preset for ImGui Widget. // Layout preset for ImGui Widget.
class SImGuiLayout : public SCompoundWidget class SImGuiLayout : public SCompoundWidget
@ -31,7 +32,7 @@ public:
private: private:
float GetDPIScale() const { return DPIScale; } float GetDPIScale() const { return DPIScale; }
void SetDPIScale(const FImGuiDPIScaleInfo& ScaleInfo) { DPIScale = ScaleInfo.GetSlateScale(); } void SetDPIScale(const FImGuiDPIScaleInfo& ScaleInfo);
FImGuiModuleManager* ModuleManager = nullptr; FImGuiModuleManager* ModuleManager = nullptr;
TWeakObjectPtr<UGameViewportClient> GameViewport; TWeakObjectPtr<UGameViewportClient> GameViewport;