////////////////////////////////////////////////////////////
//
// LuprexViewportClient.h
//
// Custom game viewport client.  Implements a project-wide
// click-to-focus rule: when a left-mouse-button click is
// not handled by any widget and bubbles up to the viewport,
// we hit-test under the cursor and focus the nearest
// focusable ancestor of whatever was hit.
//
////////////////////////////////////////////////////////////

#pragma once

#include "CoreMinimal.h"
#include "Engine/GameViewportClient.h"
#include "Layout/WidgetPath.h"
#include "LuprexViewportClient.generated.h"

UCLASS()
class INTEGRATION_API UlxViewportClient : public UGameViewportClient
{
	GENERATED_BODY()

public:
	UlxViewportClient(const FObjectInitializer &ObjectInitializer);

	virtual bool InputKey(const FInputKeyEventArgs &EventArgs) override;

private:
	bool TryBringToFront(const FWidgetPath &Path);
};
