Show name of current player

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10373 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria
2011-12-08 00:34:48 +00:00
parent 8b50b30ecc
commit cd5e26c223
2 changed files with 16 additions and 0 deletions

View File

@@ -3,6 +3,15 @@
<div x="0" y="0" width="100%" height="100%" layout="vertical-row" >
<topbar width="100%" height="9%" layout="horizontal-row">
<spacer width="2%" height="1"/>
<label text="You are playing as" height="100%"/>
<spacer width="2%" height="1"/>
<button id="playername" width="10%" 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"

View File

@@ -22,6 +22,7 @@
#include <string>
#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"
@@ -118,6 +119,12 @@ void MainMenuScreen::init()
const core::stringw &news_text = news_manager->getNextNewsMessage();
w->setText(news_text, true);
w->update(0.01f);
ButtonWidget* you = getWidget<ButtonWidget>("playername");
you->setText( unlock_manager->getCurrentSlot()->getPlayerName() );
RibbonWidget* r = getWidget<RibbonWidget>("menu_toprow");
r->setFocusForPlayer(PLAYER_ID_GAME_MASTER);
} // init
// ----------------------------------------------------------------------------