[SA] Fix issue with command window input

This commit is contained in:
Grinch_ 2021-11-01 08:59:45 +06:00
parent e2979432f9
commit bdcae6e9f7
2 changed files with 6 additions and 4 deletions

View File

@ -214,8 +214,7 @@ void Menu::DrawShortcutsWindow()
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(ImGui::GetStyle().FramePadding.x, resY / 130));
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(3, 3));
ImGui::SetNextItemWidth(resX);
ImGui::SetKeyboardFocusHere(-1);
ImGui::SetNextItemWidth(ImGui::GetContentRegionMax().x);
if (ImGui::InputTextWithHint("##TEXTFIELD", "Enter command", m_Commands::m_nInputBuffer, INPUT_BUFFER_SIZE,
ImGuiInputTextFlags_EnterReturnsTrue))
@ -224,7 +223,10 @@ void Menu::DrawShortcutsWindow()
m_Commands::m_bShowMenu = false;
strcpy(m_Commands::m_nInputBuffer, "");
}
if (!ImGui::IsAnyItemActive())
{
ImGui::SetKeyboardFocusHere(-1);
}
ImGui::PopStyleVar(2);
ImGui::End();
}

View File

@ -2,5 +2,5 @@
#define MENU_NAME "Cheat Menu"
#define MENU_VERSION_NUMBER "3.0"
#define MENU_VERSION MENU_VERSION_NUMBER"-beta"
#define BUILD_NUMBER "20211026"
#define BUILD_NUMBER "20211101"
#define MENU_TITLE MENU_NAME " v" MENU_VERSION "(" BUILD_NUMBER ")"