From 40bdb4d777870c5cf12c67cd61a521fb57f51486 Mon Sep 17 00:00:00 2001 From: hiker Date: Tue, 21 Nov 2017 18:15:03 +1100 Subject: [PATCH] Added #define to disable the online login for now. Makes it easier to start and debug LAN play. --- src/states_screens/main_menu_screen.cpp | 8 +++++++- src/states_screens/online_profile_servers.cpp | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/states_screens/main_menu_screen.cpp b/src/states_screens/main_menu_screen.cpp index 35523b85d..42e518dc3 100644 --- a/src/states_screens/main_menu_screen.cpp +++ b/src/states_screens/main_menu_screen.cpp @@ -513,16 +513,22 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name, "\"Connect to the Internet\".")); return; } - + // Define this to require a login to the stk server (default behaviour) + // Undefine for testing LAN only. +#undef REQUIRE_LOGIN +#ifdef REQUIRE_LOGIN if (PlayerManager::getCurrentOnlineId()) +#endif { ProfileManager::get()->setVisiting(PlayerManager::getCurrentOnlineId()); OnlineProfileServers::getInstance()->push(); } +#ifdef REQUIRE_LOGIN else { UserScreen::getInstance()->push(); } +#endif } else if (selection == "addons") { diff --git a/src/states_screens/online_profile_servers.cpp b/src/states_screens/online_profile_servers.cpp index 7d3400b0f..7759bb9e8 100644 --- a/src/states_screens/online_profile_servers.cpp +++ b/src/states_screens/online_profile_servers.cpp @@ -57,6 +57,12 @@ OnlineProfileServers::OnlineProfileServers() : OnlineProfileBase("online/profile void OnlineProfileServers::loadedFromFile() { OnlineProfileBase::loadedFromFile(); + if (!PlayerManager::getCurrentOnlineId()) + { + getWidget("find_wan_server")->setActive(false); + getWidget("create_wan_server")->setActive(false); + getWidget("quick_wan_play")->setActive(false); + } } // loadedFromFile // -----------------------------------------------------------------------------