From b0af2b40b3bfc6a6316b26a8e981c608edf35ea3 Mon Sep 17 00:00:00 2001 From: "auria.mg" Date: Sun, 3 Apr 2016 18:42:46 -0400 Subject: [PATCH 1/2] Multiplayer : don't lock tracks --- src/states_screens/tracks_screen.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/states_screens/tracks_screen.cpp b/src/states_screens/tracks_screen.cpp index 834c46ab1..3ce9fa6da 100644 --- a/src/states_screens/tracks_screen.cpp +++ b/src/states_screens/tracks_screen.cpp @@ -216,12 +216,13 @@ void TracksScreen::buildTrackList() tracks.push_back(curr); } // for nisLocked(curr->getIdent()) && - race_manager->getNumLocalPlayers() == 1) + race_manager->getNumLocalPlayers() == 1 && !is_network) { tracks_widget->addItem( _("Locked: solve active challenges to gain access to more!"), From 53b8b90ae69dbc38cadeaac7233bcba299633993 Mon Sep 17 00:00:00 2001 From: "auria.mg" Date: Sun, 3 Apr 2016 18:56:35 -0400 Subject: [PATCH 2/2] Update servers list as they are found --- src/states_screens/server_selection.cpp | 29 ++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/src/states_screens/server_selection.cpp b/src/states_screens/server_selection.cpp index 330ede457..c0922542a 100644 --- a/src/states_screens/server_selection.cpp +++ b/src/states_screens/server_selection.cpp @@ -127,7 +127,7 @@ void ServerSelection::init() */ void ServerSelection::loadList() { - m_server_list_widget->clear(); + m_server_list_widget->clear(); ServersManager *manager = ServersManager::get(); manager->sort(m_sort_desc); for(int i=0; i < manager->getNumServers(); i++) @@ -215,7 +215,14 @@ void ServerSelection::onUpdate(float dt) { if (m_refresh_request->isSuccess()) { + int selection = m_server_list_widget->getSelectionID(); + std::string selection_str = m_server_list_widget->getSelectionInternalName(); + loadList(); + + // restore previous selection + if (selection != -1 && selection_str != "spacer" && selection_str != "loading") + m_server_list_widget->setSelectionID(selection); } else { @@ -227,9 +234,21 @@ void ServerSelection::onUpdate(float dt) m_refresh_request = NULL; m_reload_widget->setActive(true); } - else - { - m_server_list_widget->renameItem("loading", - StringUtils::loadingDots(_("Fetching servers"))); + else + { + int selection = m_server_list_widget->getSelectionID(); + std::string selection_str = m_server_list_widget->getSelectionInternalName(); + + m_server_list_widget->clear(); + + ServersManager *manager = ServersManager::get(); + loadList(); + m_server_list_widget->addItem("spacer", L""); + m_server_list_widget->addItem("loading", + StringUtils::loadingDots(_("Fetching servers"))); + + // restore previous selection + if (selection != -1 && selection_str != "spacer" && selection_str != "loading") + m_server_list_widget->setSelectionID(selection); } } // onUpdate