diff --git a/data/gui/online/create_server.stkgui b/data/gui/online/create_server.stkgui
index 5187f73e2..007498a92 100644
--- a/data/gui/online/create_server.stkgui
+++ b/data/gui/online/create_server.stkgui
@@ -17,6 +17,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/states_screens/create_server_screen.cpp b/src/states_screens/create_server_screen.cpp
index 39a2d6159..3db20bc9f 100644
--- a/src/states_screens/create_server_screen.cpp
+++ b/src/states_screens/create_server_screen.cpp
@@ -22,6 +22,7 @@
#include "audio/sfx_manager.hpp"
#include "challenges/unlock_manager.hpp"
#include "config/player_manager.hpp"
+#include "config/user_config.hpp"
#include "modes/demo_world.hpp"
#include "network/network_config.hpp"
#include "network/servers_manager.hpp"
@@ -68,7 +69,6 @@ void CreateServerScreen::loadedFromFile()
assert(m_create_widget != NULL);
m_cancel_widget = getWidget("cancel");
assert(m_cancel_widget != NULL);
-
} // loadedFromFile
// ----------------------------------------------------------------------------
@@ -90,6 +90,17 @@ void CreateServerScreen::init()
: PlayerManager::getCurrentOnlineUserName()
)
);
+
+
+ // -- Difficulty
+ RibbonWidget* difficulty = getWidget("difficulty");
+ assert(difficulty != NULL);
+ difficulty->setSelection(UserConfigParams::m_difficulty, PLAYER_ID_GAME_MASTER);
+
+ // -- Game modes
+ RibbonWidget* gamemode = getWidget("gamemode");
+ assert(gamemode != NULL);
+ gamemode->setSelection(0, PLAYER_ID_GAME_MASTER);
} // init
// ----------------------------------------------------------------------------
@@ -160,6 +171,10 @@ void CreateServerScreen::createServer()
const irr::core::stringw name = m_name_widget->getText().trim();
const int max_players = m_max_players_widget->getValue();
m_info_widget->setErrorColor();
+
+ RibbonWidget* difficulty_widget = getWidget("difficulty");
+ RibbonWidget* gamemode_widget = getWidget("gamemode");
+
if (name.size() < 4 || name.size() > 30)
{
m_info_widget->setText(
@@ -195,9 +210,16 @@ void CreateServerScreen::createServer()
// FIXME: Add the following fields to the create server screen
// FIXME: Long term we might add a 'vote' option (e.g. GP vs single race,
// and normal vs FTL vs time trial could be voted about).
- race_manager->setDifficulty(RaceManager::convertDifficulty("hard"));
+ std::string difficulty = difficulty_widget->getSelectionIDString(PLAYER_ID_GAME_MASTER);
+ race_manager->setDifficulty(RaceManager::convertDifficulty(difficulty));
race_manager->setMajorMode(RaceManager::MAJOR_MODE_SINGLE);
- race_manager->setMinorMode(RaceManager::MINOR_MODE_NORMAL_RACE);
+
+ std::string game_mode = gamemode_widget->getSelectionIDString(PLAYER_ID_GAME_MASTER);
+ if (game_mode == "timetrial")
+ race_manager->setMinorMode(RaceManager::MINOR_MODE_TIME_TRIAL);
+ else
+ race_manager->setMinorMode(RaceManager::MINOR_MODE_NORMAL_RACE);
+
race_manager->setReverseTrack(false);
STKHost::create();