From 848e7294c87f10373f750e0c2459c9af326f5b02 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 27 Jan 2020 21:51:42 +0000 Subject: [PATCH] Updated to engine version 4.24. --- CHANGES.md | 3 +++ ImGui.uplugin | 4 ++-- LICENSE | 2 +- README.md | 8 +++++++- Source/ImGui/Private/ImGuiContextManager.cpp | 13 ++++++++++--- Source/ImGui/Private/ImGuiContextManager.h | 3 +++ Source/ImGui/Private/VersionCompatibility.h | 13 ++++++++----- 7 files changed, 34 insertions(+), 12 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 7f73f10..65ec170 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,9 @@ Versions marked as 'unofficial' are labelled only for the needs of this changelo Change History -------------- +Version: 1.18 (2020/01) +- Updated to engine version 4.24. + Version: 1.17 (2019/04) - Added experimental support for touch input. - Integrated fixes allowing to build this as an engine plugin: diff --git a/ImGui.uplugin b/ImGui.uplugin index 6b05519..f3718bb 100644 --- a/ImGui.uplugin +++ b/ImGui.uplugin @@ -1,7 +1,7 @@ { "FileVersion": 3, "Version": 1, - "VersionName": "1.16", + "VersionName": "1.18", "FriendlyName": "ImGui", "Description": "", "Category": "Debug", @@ -10,7 +10,7 @@ "DocsURL": "", "MarketplaceURL": "", "SupportURL": "", - "CanContainContent": true, + "CanContainContent": false, "IsBetaVersion": false, "Installed": false, "Modules": [ diff --git a/LICENSE b/LICENSE index b4bd637..a9bbbe2 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2017-2019 Sebastian Gross +Copyright (c) 2017-2020 Sebastian Gross Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index a9034ba..f3b9be5 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Version: 1.17 ImGui version: 1.65 -Supported engine version: 4.22* +Supported engine version: 4.24* \* *Plugin has been tested and if necessary updated to compile and work with this engine version. As long as possible I will try to maintain backward compatibility of existing features and possibly but not necessarily when adding new features. Right now it should be at least backward compatible with the engine version 4.15.* @@ -41,6 +41,12 @@ Content of this repository needs to be placed in the *Plugins* directory under t Note that plugins can be also placed in the engine directory *[UE4 Root]/Engine/Plugins/* but I didn't try it with this project. +### Setting module type + +The *ImGui* module type is set to **Developer**, what means that if it is not referenced by other runtime modules, it can be automatically excluded from shipping builds. This is convenient when using this plugging for debugging but if you want to change it to other type, you can do it in module description section in `ImGui.uplugin` file. + +**Developer** type was depreciated in UE 4.24. I keep it for backward compatibility while I can, but if you get a UBT warning about module type, simply change it to **DeveloperTool** or **Runtime**. + ### Setting up module dependencies To use ImGui in other modules you need to add it as a private or public dependency in their Build.cs files: diff --git a/Source/ImGui/Private/ImGuiContextManager.cpp b/Source/ImGui/Private/ImGuiContextManager.cpp index b3aba70..dbb5a22 100644 --- a/Source/ImGui/Private/ImGuiContextManager.cpp +++ b/Source/ImGui/Private/ImGuiContextManager.cpp @@ -98,11 +98,18 @@ void FImGuiContextManager::Tick(float DeltaSeconds) } } +#if ENGINE_COMPATIBILITY_LEGACY_WORLD_ACTOR_TICK void FImGuiContextManager::OnWorldTickStart(ELevelTick TickType, float DeltaSeconds) { - if (GWorld) + OnWorldTickStart(GWorld, TickType, DeltaSeconds); +} +#endif + +void FImGuiContextManager::OnWorldTickStart(UWorld* World, ELevelTick TickType, float DeltaSeconds) +{ + if (World) { - FImGuiContextProxy& ContextProxy = GetWorldContextProxy(*GWorld); + FImGuiContextProxy& ContextProxy = GetWorldContextProxy(*World); // Set as current, so we have right context ready when updating world objects. ContextProxy.SetAsCurrent(); @@ -117,7 +124,7 @@ void FImGuiContextManager::OnWorldTickStart(ELevelTick TickType, float DeltaSeco #if ENGINE_COMPATIBILITY_WITH_WORLD_POST_ACTOR_TICK void FImGuiContextManager::OnWorldPostActorTick(UWorld* World, ELevelTick TickType, float DeltaSeconds) { - GetWorldContextProxy(*GWorld).DrawDebug(); + GetWorldContextProxy(*World).DrawDebug(); } #endif // ENGINE_COMPATIBILITY_WITH_WORLD_POST_ACTOR_TICK diff --git a/Source/ImGui/Private/ImGuiContextManager.h b/Source/ImGui/Private/ImGuiContextManager.h index 99f1b6e..e9627d4 100644 --- a/Source/ImGui/Private/ImGuiContextManager.h +++ b/Source/ImGui/Private/ImGuiContextManager.h @@ -80,7 +80,10 @@ private: TUniquePtr ContextProxy; }; +#if ENGINE_COMPATIBILITY_LEGACY_WORLD_ACTOR_TICK void OnWorldTickStart(ELevelTick TickType, float DeltaSeconds); +#endif + void OnWorldTickStart(UWorld* World, ELevelTick TickType, float DeltaSeconds); #if ENGINE_COMPATIBILITY_WITH_WORLD_POST_ACTOR_TICK void OnWorldPostActorTick(UWorld* World, ELevelTick TickType, float DeltaSeconds); diff --git a/Source/ImGui/Private/VersionCompatibility.h b/Source/ImGui/Private/VersionCompatibility.h index 339cf57..e67c85d 100644 --- a/Source/ImGui/Private/VersionCompatibility.h +++ b/Source/ImGui/Private/VersionCompatibility.h @@ -9,22 +9,25 @@ // One place to define compatibility with older engine versions. -// Starting from version 4.17 Slate has an improved clipping API. Old version required to specify per-vertex clipping +// Starting from version 4.17, Slate has an improved clipping API. Old version required to specify per-vertex clipping // rectangle and unofficial GSlateScissorRect to correctly clip custom vertices made with FSlateDrawElement. #define ENGINE_COMPATIBILITY_LEGACY_CLIPPING_API BELOW_ENGINE_VERSION(4, 17) -// Starting from version 4.18 FPaths::GameSavedDir() has been superseded by FPaths::ProjectSavedDir(). +// Starting from version 4.18, FPaths::GameSavedDir() has been superseded by FPaths::ProjectSavedDir(). #define ENGINE_COMPATIBILITY_LEGACY_SAVED_DIR BELOW_ENGINE_VERSION(4, 18) -// Starting from version 4.18 we have support for dual key bindings. +// Starting from version 4.18, we have support for dual key bindings. #define ENGINE_COMPATIBILITY_SINGLE_KEY_BINDING BELOW_ENGINE_VERSION(4, 18) -// Starting from version 4.18 FStringClassReference is replaced by FSoftClassPath. The new header contains a typedef +// Starting from version 4.18, FStringClassReference is replaced by FSoftClassPath. The new header contains a typedef // that renames FStringClassReference to FSoftClassPath, so it is still possible tu use the old type name in code. // The old header forwards to the new one but if used it outputs a warning, so we want to avoid it. #define ENGINE_COMPATIBILITY_LEGACY_STRING_CLASS_REF BELOW_ENGINE_VERSION(4, 18) -// Starting from version 4.18 engine has a world post actor tick event which if available, provides a good opportunity +// Starting from version 4.18, engine has a world post actor tick event which if available, provides a good opportunity // to call debug delegates after world actors are already updated. #define ENGINE_COMPATIBILITY_WITH_WORLD_POST_ACTOR_TICK FROM_ENGINE_VERSION(4, 18) +// Starting from version 4.24, world actor tick event has additional world parameter. +#define ENGINE_COMPATIBILITY_LEGACY_WORLD_ACTOR_TICK BELOW_ENGINE_VERSION(4, 24) +