Merge pull request #2271 from konstin/network_cmake

Allow enabeling Network Multiplayer through CMake flags
This commit is contained in:
Deve
2015-09-06 20:33:10 +02:00
2 changed files with 13 additions and 4 deletions

View File

@@ -19,6 +19,7 @@ option(USE_WIIUSE "Support for wiimote input devices" ON)
option(USE_FRIBIDI "Support for right-to-left languages" ON)
option(CHECK_ASSETS "Check if assets are installed in ../stk-assets" ON)
option(USE_SYSTEM_ANGELSCRIPT "Use system angelscript instead of built-in angelscript. If you enable this option, make sure to use a compatible version." OFF)
option(ENABLE_NETWORK_MULTIPLAYER "Enable network multiplayer. This will replace the online profile GUI in the main menu with the network multiplayer GUI" OFF)
if(MSVC AND (MSVC_VERSION LESS 1900))
# Normally hide the option to build wiiuse on VS, since it depends
@@ -195,6 +196,11 @@ if(UNIX AND NOT APPLE)
endif()
endif()
# Netwowk Multiplayer
if(ENABLE_NETWORK_MULTIPLAYER)
add_definitions(-DENABLE_NETWORK_MULTIPLAYER_SCREEN)
endif()
# Set some compiler options
if(UNIX OR MINGW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")

View File

@@ -175,7 +175,7 @@ void MainMenuScreen::onUpdate(float delta)
m_online->setLabel( _("Login" ));
m_user_id->setText(player->getName());
}
else
else
{
// now must be either logging in or logging out
m_online->setActive(false);
@@ -297,7 +297,7 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name,
StoryModeStatus* sms = PlayerManager::getCurrentPlayer()->getStoryModeStatus();
sms->unlockFeature(const_cast<ChallengeStatus*>(sms->getChallengeStatus("gp1")),
RaceManager::DIFFICULTY_HARD);
StateManager::get()->enterGameState();
race_manager->setMinorMode(RaceManager::MINOR_MODE_CUTSCENE);
race_manager->setNumKarts(0);
@@ -307,7 +307,7 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name,
FeatureUnlockedCutScene* scene =
FeatureUnlockedCutScene::getInstance();
std::vector<std::string> parts;
parts.push_back("featunlocked");
((CutsceneWorld*)World::getWorld())->setParts(parts);
@@ -494,9 +494,12 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name,
if (PlayerManager::getCurrentOnlineId())
{
// For 0.8.2 disable the server menu, instead go to online profile
//OnlineScreen::getInstance()->push();
#ifdef ENABLE_NETWORK_MULTIPLAYER_SCREEN
OnlineScreen::getInstance()->push();
#else
ProfileManager::get()->setVisiting(PlayerManager::getCurrentOnlineId());
TabOnlineProfileAchievements::getInstance()->push();
#endif
}
else
{