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

@ -189,13 +189,6 @@ namespace cheat::feature
const auto sceneID = game::GetCurrentMapSceneID(); const auto sceneID = game::GetCurrentMapSceneID();
if (m_ScenesData.count(sceneID) == 0) if (m_ScenesData.count(sceneID) == 0)
ImGui::Text("Sorry. Current scene is not supported."); 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(); ImGui::InputText("Search", &m_SearchText); ImGui::SameLine();
HelpMarker( HelpMarker(
@ -1386,6 +1379,12 @@ namespace cheat::feature
void InteractiveMap::DrawExternal() 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) if (IsMiniMapActive() && f_Enabled)
DrawMinimapPoints(); DrawMinimapPoints();