mirror of
https://github.com/Ed94/Cog.git
synced 2026-06-13 00:01:37 -07:00
CogImGui: Fix cursor hidden on startup if imgui input is enabled
This commit is contained in:
@@ -100,7 +100,6 @@ void FCogImguiContext::Initialize()
|
||||
PlatformApplication->OnDisplayMetricsChanged().AddRaw(this, &FCogImguiContext::OnDisplayMetricsChanged);
|
||||
OnDisplayMetricsChanged(DisplayMetrics);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -640,6 +639,19 @@ void FCogImguiContext::SetShareMouseWithGameplay(bool Value)
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void FCogImguiContext::RefreshMouseCursor()
|
||||
{
|
||||
//-------------------------------------------------------------------------------------------
|
||||
// Focus the main widget when enabling input otherwise the mouse can still be hidden because
|
||||
// the gameplay might have the focus and might hide the cursor.
|
||||
//-------------------------------------------------------------------------------------------
|
||||
if (bEnableInput)
|
||||
{
|
||||
FSlateApplication::Get().SetKeyboardFocus(MainWidget);
|
||||
FSlateApplication::Get().SetUserFocus(0, MainWidget);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------
|
||||
// Force to show the cursor when sharing mouse with gameplay for games that hide the cursor
|
||||
//-------------------------------------------------------------------------------------------
|
||||
if (APlayerController* PlayerController = GetLocalPlayerController(GameViewport->GetWorld()))
|
||||
{
|
||||
if (bHasSavedInitialCursorVisibility == false)
|
||||
|
||||
Reference in New Issue
Block a user