diff --git a/Source/ImGui/Private/ImGuiContextManager.cpp b/Source/ImGui/Private/ImGuiContextManager.cpp index 075fff9a..4bf74f5e 100644 --- a/Source/ImGui/Private/ImGuiContextManager.cpp +++ b/Source/ImGui/Private/ImGuiContextManager.cpp @@ -146,12 +146,12 @@ FImGuiContextManager::FContextData& FImGuiContextManager::GetWorldContextData(co const int32 Index = GetWorldContextIndex(*WorldContext); checkf(Index != Utilities::INVALID_CONTEXT_INDEX, TEXT("Couldn't find context index for world %s: WorldType = %d"), - *World.GetName(), World.WorldType); + *World.GetName(), static_cast(World.WorldType)); #if WITH_EDITOR checkf(!GEngine->IsEditor() || Index != Utilities::EDITOR_CONTEXT_INDEX, TEXT("Context index %d is reserved for editor and cannot be used for world %s: WorldType = %d, NetMode = %d"), - Index, *World.GetName(), World.WorldType, World.GetNetMode()); + Index, *World.GetName(), static_cast(World.WorldType), static_cast(World.GetNetMode())); #endif FContextData* Data = Contexts.Find(Index); diff --git a/Source/ImGui/Private/ImGuiContextProxy.cpp b/Source/ImGui/Private/ImGuiContextProxy.cpp index 3fc61aae..61279209 100644 --- a/Source/ImGui/Private/ImGuiContextProxy.cpp +++ b/Source/ImGui/Private/ImGuiContextProxy.cpp @@ -7,6 +7,8 @@ #include "ImGuiImplementation.h" #include "ImGuiInteroperability.h" +#include + static constexpr float DEFAULT_CANVAS_WIDTH = 3840.f; static constexpr float DEFAULT_CANVAS_HEIGHT = 2160.f; @@ -16,7 +18,13 @@ namespace { FString GetSaveDirectory() { - FString Directory = FPaths::Combine(*FPaths::GameSavedDir(), TEXT("ImGui")); +#if (ENGINE_MAJOR_VERSION > 4 || (ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION >= 18)) + const FString SavedDir = FPaths::ProjectSavedDir(); +#else + const FString SavedDir = FPaths::GameSavedDir(); +#endif + + FString Directory = FPaths::Combine(*SavedDir, TEXT("ImGui")); // Make sure that directory is created. IPlatformFile::GetPlatformPhysical().CreateDirectory(*Directory); @@ -87,7 +95,7 @@ FImGuiContextProxy::FImGuiContextProxy(FImGuiContextProxy&& Other) FImGuiContextProxy& FImGuiContextProxy::operator=(FImGuiContextProxy&& Other) { // Swapping context so it can be destroyed with the other object. - using std::swap; + using std::swap; swap(Context, Other.Context); // Just moving remaining data that doesn't affect cleanup.