From 1e1d51cc04dc4ff9089759414dd477203b6605b7 Mon Sep 17 00:00:00 2001 From: Guillaume Meunier Date: Fri, 16 Feb 2024 22:54:38 +0100 Subject: [PATCH] Don't try to autoconnect to incompatible servers, show when a server is incompatible or unavailable --- client/scenes/lobby.cpp | 2 +- client/scenes/lobby_gui.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/client/scenes/lobby.cpp b/client/scenes/lobby.cpp index d8d0b804..5365fe05 100644 --- a/client/scenes/lobby.cpp +++ b/client/scenes/lobby.cpp @@ -537,7 +537,7 @@ void scenes::lobby::render(XrTime predicted_display_time, bool should_render) { for(auto&& [cookie, data]: servers) { - if (data.visible && (data.autoconnect || force_autoconnect)) + if (data.visible && (data.autoconnect || force_autoconnect) && data.compatible) { connect(data); } diff --git a/client/scenes/lobby_gui.cpp b/client/scenes/lobby_gui.cpp index f985464e..3866fcb1 100644 --- a/client/scenes/lobby_gui.cpp +++ b/client/scenes/lobby_gui.cpp @@ -272,10 +272,12 @@ void scenes::lobby::gui_server_list() } vibrate_on_hover(); - if (ImGui::IsItemHovered()) + if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { if (!data.compatible) ImGui::SetTooltip("Incompatible server version"); + else if (!data.visible && !data.manual) + ImGui::SetTooltip("Server not available"); } ImGui::PopStyleColor(3);