Merge branch 'fixes' of https://github.com/Flakebi/stk-code into Flakebi-fixes

This commit is contained in:
hiker 2015-01-12 22:29:08 +11:00
commit 47026e614c

View File

@ -125,13 +125,7 @@ void BaseUserScreen::init()
// Select the current player. That can only be done after // Select the current player. That can only be done after
// updateItemDisplay is called. // updateItemDisplay is called.
if (current_player_index != -1) if (current_player_index != -1)
{ selectUser(current_player_index);
// Only set focus in case of non-tabbed version (so that keyboard
// or gamepad navigation with tabs works as expected, i.e. you can
// select the next tab without having to go up to the tab list first.
if(!getWidget<RibbonWidget>("options_choice"))
selectUser(current_player_index);
}
// no current player found // no current player found
// The first player is the most frequently used, so select it // The first player is the most frequently used, so select it
else if (PlayerManager::get()->getNumPlayers() > 0) else if (PlayerManager::get()->getNumPlayers() > 0)
@ -174,15 +168,19 @@ void BaseUserScreen::tearDown()
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
/** Called when a user is selected. It updates the online checkbox and /** Called when a user is selected. It updates the online checkbox and
* entrye fields. * entry fields.
*/ */
void BaseUserScreen::selectUser(int index) void BaseUserScreen::selectUser(int index)
{ {
PlayerProfile *profile = PlayerManager::get()->getPlayer(index); PlayerProfile *profile = PlayerManager::get()->getPlayer(index);
assert(profile); assert(profile);
m_players->setSelection(StringUtils::toString(index), PLAYER_ID_GAME_MASTER, // Only set focus in case of non-tabbed version (so that keyboard
/*focusIt*/ true); // or gamepad navigation with tabs works as expected, i.e. you can
// select the next tab without having to go up to the tab list first.
if(!getWidget<RibbonWidget>("options_choice"))
m_players->setSelection(StringUtils::toString(index), PLAYER_ID_GAME_MASTER,
/*focusIt*/ true);
if (!m_new_registered_data) if (!m_new_registered_data)
m_username_tb->setText(profile->getLastOnlineName()); m_username_tb->setText(profile->getLastOnlineName());
@ -618,7 +616,7 @@ void TabbedUserScreen::init()
if (tab_bar) tab_bar->select("tab_players", PLAYER_ID_GAME_MASTER); if (tab_bar) tab_bar->select("tab_players", PLAYER_ID_GAME_MASTER);
tab_bar->getRibbonChildren()[0].setTooltip( _("Graphics") ); tab_bar->getRibbonChildren()[0].setTooltip( _("Graphics") );
tab_bar->getRibbonChildren()[1].setTooltip( _("Audio") ); tab_bar->getRibbonChildren()[1].setTooltip( _("Audio") );
tab_bar->getRibbonChildren()[2].setTooltip(_("User Interface")); tab_bar->getRibbonChildren()[2].setTooltip( _("User Interface") );
tab_bar->getRibbonChildren()[4].setTooltip( _("Controls") ); tab_bar->getRibbonChildren()[4].setTooltip( _("Controls") );
BaseUserScreen::init(); BaseUserScreen::init();
} // init } // init