mirror of
https://github.com/kevinporetti/UnrealImGui.git
synced 2025-01-18 00:10:32 +00:00
Cleaned up unused input processor
This commit is contained in:
parent
cb89223375
commit
9496087f9c
@ -1 +0,0 @@
|
||||
#include "ImGuiInputPreprocessor.h"
|
@ -1,79 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "ImGuiModuleManager.h"
|
||||
#include "Framework/Application/IInputProcessor.h"
|
||||
|
||||
class FImGuiModuleManager;
|
||||
|
||||
class FImGuiInputPreprocessor : public IInputProcessor
|
||||
{
|
||||
public:
|
||||
FImGuiInputPreprocessor(FImGuiModuleManager& InModuleManager)
|
||||
: ModuleManager(InModuleManager)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void Tick(const float DeltaTime, FSlateApplication& SlateApp, TSharedRef<ICursor> Cursor) override
|
||||
{
|
||||
}
|
||||
|
||||
virtual bool HandleKeyDownEvent(FSlateApplication& SlateApp, const FKeyEvent& InKeyEvent) override
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool
|
||||
HandleAnalogInputEvent(FSlateApplication& SlateApp, const FAnalogInputEvent& InAnalogInputEvent) override
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool HandleMouseMoveEvent(FSlateApplication& SlateApp, const FPointerEvent& InPointerEvent) override
|
||||
{
|
||||
/*
|
||||
const bool bIsWindowHovered = ImGui::IsWindowHovered();
|
||||
FImGuiContextProxy* Proxy = ModuleManager.GetContextManager().GetContextProxy(0);
|
||||
if (Proxy)
|
||||
{
|
||||
GEngine->AddOnScreenDebugMessage(10, 0, Proxy->WantsMouseCapture() ? FColor::Green : FColor::Red, TEXT("Move Capture"));
|
||||
}
|
||||
else
|
||||
{
|
||||
GEngine->AddOnScreenDebugMessage(10, 0, FColor::Red, TEXT("No proxy"));
|
||||
}
|
||||
|
||||
GEngine->AddOnScreenDebugMessage(1, 0, bIsWindowHovered ? FColor::Green : FColor::Red, TEXT("Move Hover"));
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool HandleMouseButtonDownEvent(FSlateApplication& SlateApp, const FPointerEvent& InPointerEvent) override
|
||||
{
|
||||
//if (ModuleManager.GetProperties().IsMouseInputShared())
|
||||
if (false) {
|
||||
FImGuiContextProxy* Proxy = ModuleManager.GetContextManager().GetContextProxy(0);
|
||||
const bool bWantsCapture = Proxy ? Proxy->WantsMouseCapture() : false;
|
||||
const bool bIsWindowHovered = ImGui::IsWindowHovered();
|
||||
GEngine->AddOnScreenDebugMessage(2, 10, bIsWindowHovered ? FColor::Green : FColor::Red, TEXT("InputPreproc: Click Hover"));
|
||||
GEngine->AddOnScreenDebugMessage(3, 10, bWantsCapture ? FColor::Green : FColor::Red, TEXT("InputPreproc: Wants capture"));
|
||||
return bWantsCapture;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool
|
||||
HandleMouseButtonDoubleClickEvent(FSlateApplication& SlateApp, const FPointerEvent& InPointerEvent) override
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual const TCHAR* GetDebugName() const override { return TEXT("CommonInput"); }
|
||||
|
||||
private:
|
||||
bool IsRelevantInput(FSlateApplication& SlateApp, const FInputEvent& InputEvent)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
FImGuiModuleManager& ModuleManager;
|
||||
};
|
@ -4,7 +4,6 @@
|
||||
|
||||
#include "ImGuiDelegatesContainer.h"
|
||||
#include "ImGuiModuleManager.h"
|
||||
#include "ImGuiInputPreprocessor.h"
|
||||
#include "TextureManager.h"
|
||||
#include "Utilities/WorldContext.h"
|
||||
#include "Utilities/WorldContextIndex.h"
|
||||
@ -132,9 +131,6 @@ void FImGuiModule::StartupModule()
|
||||
checkf(!ImGuiModuleManager, TEXT("Instance of the ImGui Module Manager already exists. Instance should be created only during module startup."));
|
||||
ImGuiModuleManager = new FImGuiModuleManager();
|
||||
|
||||
ImGuiInputPreprocessor = MakeShared<FImGuiInputPreprocessor>(*ImGuiModuleManager);
|
||||
FSlateApplication::Get().RegisterInputPreProcessor(ImGuiInputPreprocessor, 0);
|
||||
|
||||
#if WITH_EDITOR
|
||||
checkf(!ImGuiEditor, TEXT("Instance of the ImGui Editor already exists. Instance should be created only during module startup."));
|
||||
ImGuiEditor = new FImGuiEditor();
|
||||
|
@ -177,8 +177,6 @@ public:
|
||||
virtual void ShutdownModule() override;
|
||||
|
||||
private:
|
||||
TSharedPtr<class FImGuiInputPreprocessor> ImGuiInputPreprocessor;
|
||||
|
||||
#if WITH_EDITOR
|
||||
virtual void SetProperties(const FImGuiModuleProperties& Properties);
|
||||
struct FImGuiContextHandle* ImGuiContextHandle = nullptr;
|
||||
|
Loading…
Reference in New Issue
Block a user