Fixed warnings from Unreal 5.0 Preview 1

This commit is contained in:
benui 2022-03-01 10:46:21 -08:00
parent 7b055e4040
commit 14749e50bb
7 changed files with 12 additions and 12 deletions

View File

@ -16,7 +16,7 @@
"Modules": [ "Modules": [
{ {
"Name": "ImGui", "Name": "ImGui",
"Type": "Developer", "Type": "DeveloperTool",
"LoadingPhase": "PreDefault" "LoadingPhase": "PreDefault"
} }
] ]

View File

@ -9,7 +9,7 @@
#include <InputCoreTypes.h> #include <InputCoreTypes.h>
UImGuiInputHandler* FImGuiInputHandlerFactory::NewHandler(const FStringClassReference& HandlerClassReference, FImGuiModuleManager* ModuleManager, UGameViewportClient* GameViewport, int32 ContextIndex) UImGuiInputHandler* FImGuiInputHandlerFactory::NewHandler(const FSoftClassPath& HandlerClassReference, FImGuiModuleManager* ModuleManager, UGameViewportClient* GameViewport, int32 ContextIndex)
{ {
UClass* HandlerClass = nullptr; UClass* HandlerClass = nullptr;
if (HandlerClassReference.IsValid()) if (HandlerClassReference.IsValid())

View File

@ -13,7 +13,7 @@ class FImGuiInputHandlerFactory
{ {
public: public:
static UImGuiInputHandler* NewHandler(const FStringClassReference& HandlerClassReference, FImGuiModuleManager* ModuleManager, UGameViewportClient* GameViewport, int32 ContextIndex); static UImGuiInputHandler* NewHandler(const FSoftClassPath& HandlerClassReference, FImGuiModuleManager* ModuleManager, UGameViewportClient* GameViewport, int32 ContextIndex);
static void ReleaseHandler(UImGuiInputHandler* Handler); static void ReleaseHandler(UImGuiInputHandler* Handler);
}; };

View File

@ -128,7 +128,7 @@ void FImGuiModuleSettings::UpdateDPIScaleInfo()
} }
} }
void FImGuiModuleSettings::SetImGuiInputHandlerClass(const FStringClassReference& ClassReference) void FImGuiModuleSettings::SetImGuiInputHandlerClass(const FSoftClassPath& ClassReference)
{ {
if (ImGuiInputHandlerClass != ClassReference) if (ImGuiInputHandlerClass != ClassReference)
{ {

View File

@ -10,7 +10,7 @@
#include <Styling/SlateTypes.h> #include <Styling/SlateTypes.h>
#include <UObject/Object.h> #include <UObject/Object.h>
// We use FStringClassReference, which is supported by older and newer engine versions. Starting from 4.18, it is // We use FSoftClassPath, which is supported by older and newer engine versions. Starting from 4.18, it is
// a typedef of FSoftClassPath, which is also recognized by UHT. // a typedef of FSoftClassPath, which is also recognized by UHT.
#if ENGINE_COMPATIBILITY_LEGACY_STRING_CLASS_REF #if ENGINE_COMPATIBILITY_LEGACY_STRING_CLASS_REF
#include <StringClassReference.h> #include <StringClassReference.h>
@ -176,7 +176,7 @@ protected:
// Path to own implementation of ImGui Input Handler allowing to customize handling of keyboard and gamepad input. // Path to own implementation of ImGui Input Handler allowing to customize handling of keyboard and gamepad input.
// If not set then default handler is used. // If not set then default handler is used.
UPROPERTY(EditAnywhere, config, Category = "Extensions", meta = (MetaClass = "ImGuiInputHandler")) UPROPERTY(EditAnywhere, config, Category = "Extensions", meta = (MetaClass = "ImGuiInputHandler"))
FStringClassReference ImGuiInputHandlerClass; FSoftClassPath ImGuiInputHandlerClass;
// Whether ImGui should share keyboard input with game. // Whether ImGui should share keyboard input with game.
// This defines initial behaviour which can be later changed using 'ImGui.ToggleKeyboardInputSharing' command or // This defines initial behaviour which can be later changed using 'ImGui.ToggleKeyboardInputSharing' command or
@ -236,7 +236,7 @@ public:
// Generic delegate used to notify changes of boolean properties. // Generic delegate used to notify changes of boolean properties.
DECLARE_MULTICAST_DELEGATE_OneParam(FBoolChangeDelegate, bool); DECLARE_MULTICAST_DELEGATE_OneParam(FBoolChangeDelegate, bool);
DECLARE_MULTICAST_DELEGATE_OneParam(FStringClassReferenceChangeDelegate, const FStringClassReference&); DECLARE_MULTICAST_DELEGATE_OneParam(FStringClassReferenceChangeDelegate, const FSoftClassPath&);
DECLARE_MULTICAST_DELEGATE_OneParam(FImGuiCanvasSizeInfoChangeDelegate, const FImGuiCanvasSizeInfo&); DECLARE_MULTICAST_DELEGATE_OneParam(FImGuiCanvasSizeInfoChangeDelegate, const FImGuiCanvasSizeInfo&);
DECLARE_MULTICAST_DELEGATE_OneParam(FImGuiDPIScaleInfoChangeDelegate, const FImGuiDPIScaleInfo&); DECLARE_MULTICAST_DELEGATE_OneParam(FImGuiDPIScaleInfoChangeDelegate, const FImGuiDPIScaleInfo&);
@ -253,7 +253,7 @@ public:
// event that are defined depending on needs. // event that are defined depending on needs.
// Get the path to custom implementation of ImGui Input Handler. // Get the path to custom implementation of ImGui Input Handler.
const FStringClassReference& GetImGuiInputHandlerClass() const { return ImGuiInputHandlerClass; } const FSoftClassPath& GetImGuiInputHandlerClass() const { return ImGuiInputHandlerClass; }
// Get the software cursor configuration. // Get the software cursor configuration.
bool UseSoftwareCursor() const { return bUseSoftwareCursor; } bool UseSoftwareCursor() const { return bUseSoftwareCursor; }
@ -285,7 +285,7 @@ private:
void UpdateSettings(); void UpdateSettings();
void UpdateDPIScaleInfo(); void UpdateDPIScaleInfo();
void SetImGuiInputHandlerClass(const FStringClassReference& ClassReference); void SetImGuiInputHandlerClass(const FSoftClassPath& ClassReference);
void SetShareKeyboardInput(bool bShare); void SetShareKeyboardInput(bool bShare);
void SetShareGamepadInput(bool bShare); void SetShareGamepadInput(bool bShare);
void SetShareMouseInput(bool bShare); void SetShareMouseInput(bool bShare);
@ -301,7 +301,7 @@ private:
FImGuiModuleProperties& Properties; FImGuiModuleProperties& Properties;
FImGuiModuleCommands& Commands; FImGuiModuleCommands& Commands;
FStringClassReference ImGuiInputHandlerClass; FSoftClassPath ImGuiInputHandlerClass;
FImGuiKeyInfo ToggleInputKey; FImGuiKeyInfo ToggleInputKey;
FImGuiCanvasSizeInfo CanvasSize; FImGuiCanvasSizeInfo CanvasSize;
FImGuiDPIScaleInfo DPIScale; FImGuiDPIScaleInfo DPIScale;

View File

@ -275,7 +275,7 @@ FReply SImGuiWidget::OnTouchEnded(const FGeometry& MyGeometry, const FPointerEve
return InputHandler->OnTouchEnded(TransformScreenPointToImGui(MyGeometry, TouchEvent.GetScreenSpacePosition()), TouchEvent); return InputHandler->OnTouchEnded(TransformScreenPointToImGui(MyGeometry, TouchEvent.GetScreenSpacePosition()), TouchEvent);
} }
void SImGuiWidget::CreateInputHandler(const FStringClassReference& HandlerClassReference) void SImGuiWidget::CreateInputHandler(const FSoftClassPath& HandlerClassReference)
{ {
ReleaseInputHandler(); ReleaseInputHandler();

View File

@ -84,7 +84,7 @@ public:
private: private:
void CreateInputHandler(const FStringClassReference& HandlerClassReference); void CreateInputHandler(const FSoftClassPath& HandlerClassReference);
void ReleaseInputHandler(); void ReleaseInputHandler();
void RegisterImGuiSettingsDelegates(); void RegisterImGuiSettingsDelegates();