fix chat not closing properly

This commit is contained in:
2023-11-28 11:11:14 +01:00
parent 54cbfc2c33
commit c39340f4de
2 changed files with 3 additions and 2 deletions

View File

@@ -9,8 +9,8 @@ namespace gui {
BlitzGui::BlitzGui(Client* client) : GuiWidget(nullptr, client) {
Enable();
AddWidget(std::make_unique<MainMenu>(client));
AddWidget(std::make_unique<GameChatGui>(this, client));
AddWidget(std::make_unique<MainMenu>(client));
SetCustomTheme();
}

View File

@@ -82,8 +82,9 @@ void GameChatGui::Render() {
if (ImGui::IsKeyPressed(ImGuiKey_Enter)) {
showCHAT = true;
m_FocusRequested = true;
} else if (ImGui::IsKeyPressed(ImGuiKey_Escape)) {
} else if (ImGui::IsKeyPressed(ImGuiKey_Escape) && showCHAT) {
showCHAT = false;
ImGui::GetIO().ClearInputKeys();
}
if (showCHAT) {