Added #define to disable the online login for now. Makes it easier

to start and debug LAN play.
This commit is contained in:
hiker 2017-11-21 18:15:03 +11:00
parent afac848bb9
commit 40bdb4d777
2 changed files with 13 additions and 1 deletions

View File

@ -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")
{

View File

@ -57,6 +57,12 @@ OnlineProfileServers::OnlineProfileServers() : OnlineProfileBase("online/profile
void OnlineProfileServers::loadedFromFile()
{
OnlineProfileBase::loadedFromFile();
if (!PlayerManager::getCurrentOnlineId())
{
getWidget<IconButtonWidget>("find_wan_server")->setActive(false);
getWidget<IconButtonWidget>("create_wan_server")->setActive(false);
getWidget<IconButtonWidget>("quick_wan_play")->setActive(false);
}
} // loadedFromFile
// -----------------------------------------------------------------------------