mirror of
https://github.com/kevinporetti/UnrealImGui.git
synced 2025-01-18 08:20:32 +00:00
Fixed a few errors and warnings on PS4 and XBox platforms.
This commit is contained in:
parent
b2f4f43d7e
commit
2e994ac124
@ -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 <AllowWindowsPlatformTypes.h>
|
||||
#endif // PLATFORM_WINDOWS
|
||||
|
@ -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<SImGuiWidget> Widget;
|
||||
SAssignNew(Widget, SImGuiWidget).ModuleManager(this).GameViewport(GameViewport)
|
||||
TSharedPtr<SImGuiWidget> SharedWidget;
|
||||
SAssignNew(SharedWidget, SImGuiWidget).ModuleManager(this).GameViewport(GameViewport)
|
||||
.ContextIndex(Utilities::GetWorldContextIndex(GameViewport));
|
||||
|
||||
if (TWeakPtr<SImGuiWidget>* Slot = Widgets.FindByPredicate([](auto& Widget) { return !Widget.IsValid(); }))
|
||||
{
|
||||
*Slot = Widget;
|
||||
*Slot = SharedWidget;
|
||||
}
|
||||
else
|
||||
{
|
||||
Widgets.Emplace(Widget);
|
||||
Widgets.Emplace(SharedWidget);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,11 @@
|
||||
|
||||
namespace Utilities
|
||||
{
|
||||
FORCEINLINE const FWorldContext* GetWorldContext(const UGameInstance& GameInstance)
|
||||
{
|
||||
return GameInstance.GetWorldContext();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
FORCEINLINE const FWorldContext* GetWorldContext(const TWeakObjectPtr<T>& 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());
|
||||
|
Loading…
Reference in New Issue
Block a user