Skip to content

Commit 74483dc

Browse files
authored
Fix guiSetInputMode cursor bug (#4015) (#4439)
Enhance GUI input handling
1 parent 4b4c4c1 commit 74483dc

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

Client/core/CGUI.cpp

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -700,9 +700,21 @@ bool CLocalGUI::InputGoesToGUI()
700700
if (!pGUI)
701701
return false;
702702

703-
// Here we're supposed to check if things like menues are up, console is up or the chatbox is expecting input
704-
// If the console is visible OR the chat is expecting input OR the mainmenu is visible
705-
return (IsConsoleVisible() || IsMainMenuVisible() || IsChatBoxInputEnabled() || m_bForceCursorVisible || pGUI->GetGUIInputEnabled() ||
703+
bool shouldShowCursorForGUI = false;
704+
if (pGUI->GetGUIInputEnabled())
705+
{
706+
eInputMode inputMode = pGUI->GetGUIInputMode();
707+
if (inputMode == INPUTMODE_NO_BINDS_ON_EDIT)
708+
{
709+
shouldShowCursorForGUI = true;
710+
}
711+
else if (inputMode == INPUTMODE_NO_BINDS)
712+
{
713+
shouldShowCursorForGUI = false;
714+
}
715+
}
716+
717+
return (IsConsoleVisible() || IsMainMenuVisible() || IsChatBoxInputEnabled() || m_bForceCursorVisible || shouldShowCursorForGUI ||
706718
!CCore::GetSingleton().IsFocused() || IsWebRequestGUIVisible());
707719
}
708720

0 commit comments

Comments
 (0)