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.
This commit is contained in:
Kawe Mazidjatari 2022-08-31 21:49:28 +02:00
parent d9709cfb1e
commit 41fda3a8ac

View File

@ -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();
}
}
//-----------------------------------------------------------------------------