diff --git a/data/gui/main.stkgui b/data/gui/main.stkgui index b7ac8bd52..9162a2945 100644 --- a/data/gui/main.stkgui +++ b/data/gui/main.stkgui @@ -6,12 +6,6 @@ <spacer width="2%" height="1"/> - <label text="You are playing as" height="100%"/> - - <spacer width="2%" height="1"/> - - <button id="playername" width="15%" align="center"/> - <spacer proportion="1" height="1"/> <buttonbar id="menu_bottomrow" x="0" y="0" width="30%" height="100%" align="center"> <icon-button id="options" width="64" height="64" icon="gui/main_options.png" diff --git a/data/gui/options_players.stkgui b/data/gui/options_players.stkgui index 5d3977e3e..391ff1b63 100644 --- a/data/gui/options_players.stkgui +++ b/data/gui/options_players.stkgui @@ -18,6 +18,16 @@ <spacer width="5" height="5"/> + <div layout="horizontal-row" width="75%" height="fit" align="center"> + <spacer proportion="1"/> + <label text="You are playing as" height="100%"/> + <spacer width="2%" height="1"/> + <button id="playername" width="27%" align="center"/> + <spacer proportion="1"/> + </div> + + <spacer width="5" height="10"/> + <label width="100%" I18N="In players configuration menu" text="Press enter or double-click on a player to edit him/her" diff --git a/src/states_screens/main_menu_screen.cpp b/src/states_screens/main_menu_screen.cpp index 05c84df45..904d6256d 100644 --- a/src/states_screens/main_menu_screen.cpp +++ b/src/states_screens/main_menu_screen.cpp @@ -20,10 +20,8 @@ #include "states_screens/main_menu_screen.hpp" #include <string> -#include <IGUIButton.h> #include "addons/network_http.hpp" -#include "challenges/unlock_manager.hpp" #include "graphics/irr_driver.hpp" #include "guiengine/scalable_font.hpp" #include "guiengine/widgets/label_widget.hpp" @@ -41,7 +39,6 @@ #include "states_screens/kart_selection.hpp" #include "states_screens/options_screen_video.hpp" #include "states_screens/state_manager.hpp" -#include "states_screens/story_mode_lobby.hpp" #include "states_screens/tutorial_screen.hpp" #if DEBUG_MENU_ITEM @@ -121,10 +118,6 @@ void MainMenuScreen::init() w->setText(news_text, true); w->update(0.01f); - ButtonWidget* you = getWidget<ButtonWidget>("playername"); - you->setText( unlock_manager->getCurrentSlot()->getPlayerName() ); - ((gui::IGUIButton*)you->getIrrlichtElement())->setOverrideFont( GUIEngine::getSmallFont() ); - RibbonWidget* r = getWidget<RibbonWidget>("menu_bottomrow"); // FIXME: why do I need to do this manually ((IconButtonWidget*)r->getChildren().get(0))->unfocused(PLAYER_ID_GAME_MASTER, NULL); @@ -179,12 +172,6 @@ void MainMenuScreen::onUpdate(float delta, irr::video::IVideoDriver* driver) void MainMenuScreen::eventCallback(Widget* widget, const std::string& name, const int playerID) { - if (name == "playername") - { - UserConfigParams::m_default_player = L""; - StateManager::get()->resetAndGoToScreen(StoryModeLobbyScreen::getInstance()); - } - // most interesting stuff is in the ribbons, so start there RibbonWidget* ribbon = dynamic_cast<RibbonWidget*>(widget); diff --git a/src/states_screens/options_screen_players.cpp b/src/states_screens/options_screen_players.cpp index 4b9b49f3d..b758b06dc 100644 --- a/src/states_screens/options_screen_players.cpp +++ b/src/states_screens/options_screen_players.cpp @@ -17,10 +17,12 @@ #include "states_screens/options_screen_players.hpp" +#include "challenges/unlock_manager.hpp" #include "config/player.hpp" #include "config/device_config.hpp" #include "graphics/irr_driver.hpp" #include "guiengine/engine.hpp" +#include "guiengine/scalable_font.hpp" #include "guiengine/screen.hpp" #include "guiengine/widget.hpp" #include "guiengine/widgets/list_widget.hpp" @@ -32,7 +34,9 @@ #include "states_screens/options_screen_video.hpp" #include "states_screens/options_screen_ui.hpp" #include "states_screens/state_manager.hpp" +#include "states_screens/story_mode_lobby.hpp" +#include <IGUIButton.h> #include <iostream> #include <sstream> @@ -91,6 +95,11 @@ void OptionsScreenPlayers::init() players->setActivated(); } + + ButtonWidget* you = getWidget<ButtonWidget>("playername"); + you->setText( unlock_manager->getCurrentSlot()->getPlayerName() ); + ((gui::IGUIButton*)you->getIrrlichtElement())->setOverrideFont( GUIEngine::getSmallFont() ); + } // init // ----------------------------------------------------------------------------- @@ -199,7 +208,12 @@ void OptionsScreenPlayers::eventCallback(Widget* widget, const std::string& name return; } } // end for - } // name=="players" + } + else if (name == "playername") + { + UserConfigParams::m_default_player = L""; + StateManager::get()->resetAndGoToScreen(StoryModeLobbyScreen::getInstance()); + } } // eventCallback