fix #231: infinity input blocking when Filters collapsed

This commit is contained in:
Callow 2022-07-13 11:19:38 +03:00
parent cd7cc0588b
commit 975ef516fd

View File

@ -190,13 +190,6 @@ namespace cheat::feature
if (m_ScenesData.count(sceneID) == 0)
ImGui::Text("Sorry. Current scene is not supported.");
// If any InputText is focused, the game will not respond any keyboard input.
auto ctx = ImGui::GetCurrentContext();
if (ctx->IO.WantCaptureKeyboard)
renderer::SetInputLock(this, true);
else
renderer::SetInputLock(this, false);
ImGui::InputText("Search", &m_SearchText); ImGui::SameLine();
HelpMarker(
"This page following with filters for items.\n"
@ -1386,6 +1379,12 @@ namespace cheat::feature
void InteractiveMap::DrawExternal()
{
// If any InputText is focused, the game will not respond any keyboard input.
auto ctx = ImGui::GetCurrentContext();
if (ctx->IO.WantCaptureKeyboard && !renderer::IsInputLocked())
renderer::SetInputLock(this, true);
else if (!ctx->IO.WantCaptureKeyboard && renderer::IsInputLocked())
renderer::SetInputLock(this, false);
if (IsMiniMapActive() && f_Enabled)
DrawMinimapPoints();