Select player identity by default for players > 0, so they can choose their identity
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@4613 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
4a04398267
commit
b6b47c37b6
@ -762,8 +762,8 @@ bool KartSelectionScreen::playerJoin(InputDevice* device, bool firstPlayer)
|
|||||||
kartsArea.x = irr_driver->getFrameSize().Width; // start at the rightmost of the screen
|
kartsArea.x = irr_driver->getFrameSize().Width; // start at the rightmost of the screen
|
||||||
|
|
||||||
// ---- Create new active player
|
// ---- Create new active player
|
||||||
const int id = StateManager::get()->createActivePlayer( UserConfigParams::m_all_players.get(0), device );
|
const int new_player_id = StateManager::get()->createActivePlayer( UserConfigParams::m_all_players.get(0), device );
|
||||||
ActivePlayer *aplayer = StateManager::get()->getActivePlayer(id);
|
ActivePlayer* aplayer = StateManager::get()->getActivePlayer(new_player_id);
|
||||||
|
|
||||||
// ---- Create focus dispatcher
|
// ---- Create focus dispatcher
|
||||||
if (firstPlayer)
|
if (firstPlayer)
|
||||||
@ -778,22 +778,12 @@ bool KartSelectionScreen::playerJoin(InputDevice* device, bool firstPlayer)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ---- Create player/kart widget
|
// ---- Create player/kart widget
|
||||||
PlayerKartWidget* newPlayer;
|
PlayerKartWidget* newPlayerWidget = new PlayerKartWidget(this, aplayer, &kartsArea, m_kart_widgets.size());
|
||||||
/*
|
|
||||||
if (firstPlayer)
|
this->manualAddWidget(newPlayerWidget);
|
||||||
{
|
newPlayerWidget->add();
|
||||||
newPlayer = new PlayerKartWidget(this, aplayer, &kartsArea, m_kart_widgets.size(), kartsArea.m_reserved_id);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{*/
|
|
||||||
newPlayer = new PlayerKartWidget(this, aplayer, &kartsArea, m_kart_widgets.size());
|
|
||||||
/*
|
|
||||||
}*/
|
|
||||||
|
|
||||||
this->manualAddWidget(newPlayer);
|
m_kart_widgets.push_back(newPlayerWidget);
|
||||||
newPlayer->add();
|
|
||||||
|
|
||||||
m_kart_widgets.push_back(newPlayer);
|
|
||||||
|
|
||||||
// ---- Divide screen space among all karts
|
// ---- Divide screen space among all karts
|
||||||
const int amount = m_kart_widgets.size();
|
const int amount = m_kart_widgets.size();
|
||||||
@ -805,12 +795,23 @@ bool KartSelectionScreen::playerJoin(InputDevice* device, bool firstPlayer)
|
|||||||
m_kart_widgets[n].move( fullarea->x + splitWidth*n, fullarea->y, splitWidth, fullarea->h );
|
m_kart_widgets[n].move( fullarea->x + splitWidth*n, fullarea->y, splitWidth, fullarea->h );
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---- Focus a kart for this player
|
if (firstPlayer)
|
||||||
const int playerID = amount-1;
|
|
||||||
if (!firstPlayer)
|
|
||||||
{
|
{
|
||||||
w->setSelection(playerID, playerID, true);
|
// Focus a kart for this player
|
||||||
|
const int playerID = amount-1;
|
||||||
|
if (!firstPlayer)
|
||||||
|
{
|
||||||
|
w->setSelection(playerID, playerID, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//const int playerID = amount-1;
|
||||||
|
w->setSelection(new_player_id, new_player_id, true);
|
||||||
|
|
||||||
|
newPlayerWidget->playerName->setFocusForPlayer(new_player_id);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user