Started to indicate the name of the logged in user ... still work in

progress (black writing on dark grey).
This commit is contained in:
hiker 2014-10-23 22:26:11 +11:00
parent f70687a00b
commit b4f95d672a
2 changed files with 15 additions and 0 deletions

View File

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<label id="user-id" x="90%" y="0" width="10%" height="8%" align="right"/>
<div x="0" y="0" width="100%" height="100%" layout="vertical-row" >
<icon id="logo" align="center" proportion="5" width="100%" icon="gui/logo.png"/>

View File

@ -97,6 +97,19 @@ void MainMenuScreen::init()
{
Screen::init();
LabelWidget *user_id = getWidget<LabelWidget>("user-id");
assert(user_id);
PlayerProfile *player = PlayerManager::getCurrentPlayer();
if(player)
{
if(player->isLoggedIn())
user_id->setText(player->getLastOnlineName()+"@stk", true);
else
user_id->setText(player->getName(), true);
}
else
user_id->setText("", true);
// reset in case we're coming back from a race
StateManager::get()->resetActivePlayers();
input_manager->getDeviceList()->setAssignMode(NO_ASSIGN);