From 41fda3a8ac53b40f8500a2285a099c20fac7797d Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Wed, 31 Aug 2022 21:49:28 +0200 Subject: [PATCH] Clear message when modal is closed with the 'Close' or 'X' button This does not happen when you connect, because then you can retrieve the name of the server you connected to the next time you open the modal. --- r5dev/gameui/IBrowser.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/r5dev/gameui/IBrowser.cpp b/r5dev/gameui/IBrowser.cpp index 0078084d..ef17f4a7 100644 --- a/r5dev/gameui/IBrowser.cpp +++ b/r5dev/gameui/IBrowser.cpp @@ -314,8 +314,8 @@ void CBrowser::RefreshServerList(void) //----------------------------------------------------------------------------- void CBrowser::HiddenServersModal(void) { - bool modalOpen = true; - if (ImGui::BeginPopupModal("Private Server", &modalOpen, ImGuiWindowFlags_NoResize)) + bool bModalOpen = true; + if (ImGui::BeginPopupModal("Private Server", &bModalOpen, ImGuiWindowFlags_NoResize)) { ImGui::SetWindowSize(ImVec2(408.f, 204.f), ImGuiCond_Always); @@ -375,11 +375,16 @@ void CBrowser::HiddenServersModal(void) } if (ImGui::Button("Close", ImVec2(ImGui::GetWindowContentRegionWidth(), 24))) { + m_svHiddenServerRequestMessage.clear(); ImGui::CloseCurrentPopup(); } ImGui::EndPopup(); } + else if (!bModalOpen) + { + m_svHiddenServerRequestMessage.clear(); + } } //-----------------------------------------------------------------------------