From c79c51e6c78dab233b649a7650c8d9392ec4bf07 Mon Sep 17 00:00:00 2001 From: konstin Date: Sat, 8 Aug 2015 14:26:12 +0200 Subject: [PATCH] allow enabeling Network Multiplayer through CMake flags --- CMakeLists.txt | 6 ++++++ src/states_screens/main_menu_screen.cpp | 11 +++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d936dbbe..9797081fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 "Option description" 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") diff --git a/src/states_screens/main_menu_screen.cpp b/src/states_screens/main_menu_screen.cpp index 4d27f3be1..865f64346 100644 --- a/src/states_screens/main_menu_screen.cpp +++ b/src/states_screens/main_menu_screen.cpp @@ -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(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 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 {