Add 'handicapped' to player name

This commit is contained in:
Flakebi 2014-11-04 23:36:16 +01:00
parent 6d07189474
commit 5a84b471e4
2 changed files with 13 additions and 7 deletions

View File

@ -13,7 +13,7 @@
I18N="Main menu button" text="Story Mode"/>
<icon-button id="new" width="128" height="128"
icon="gui/menu_race.png" focus_icon="gui/menu_race_focus.png"
I18N="Main menu button" text="Single-player"/>
I18N="Main menu button" text="Singleplayer"/>
<icon-button id="multiplayer" width="128" height="128"
icon="gui/menu_multi.png" focus_icon="gui/menu_multi_focus.png"
I18N="Main menu button" text="Multiplayer"/>

View File

@ -351,10 +351,15 @@ void PlayerKartWidget::add()
for (int n=0; n<player_amount; n++)
{
core::stringw name = PlayerManager::get()->getPlayer(n)->getName();
m_player_ident_spinner->addLabel(translations->fribidize(name));
core::stringw label = translations->fribidize(name);
m_player_ident_spinner->addLabel(label);
if (UserConfigParams::m_per_player_difficulty)
{
// The second player is the same, but with handicap
m_player_ident_spinner->addLabel(translations->fribidize(name));
label += L" ";
label += _(L"(handicapped)");
m_player_ident_spinner->addLabel(label);
}
}
// select the right player profile in the spinner
@ -366,9 +371,6 @@ void PlayerKartWidget::add()
m_player_ident_spinner->setVisible(false);
}
// Add anchor badge if the player is handicapped
int spinner_value = m_player_ident_spinner->getValue();
assert(m_player_ident_spinner->getStringValue() == name);
} // add
@ -630,7 +632,11 @@ void PlayerKartWidget::setSize(const int x, const int y, const int w, const int
// -- sizes
player_name_h = 40;
player_name_w = std::min(400, w);
// Set it a bit higher so there's space for "(handicapped)"
if(UserConfigParams::m_per_player_difficulty)
player_name_w = std::min(500, w);
else
player_name_w = std::min(400, w);
kart_name_w = w;
kart_name_h = 25;