put the definition of the max. length of a player name in one place
This commit is contained in:
parent
be02fd2e18
commit
7ce4277fd3
3 changed files with 6 additions and 3 deletions
|
@ -1384,7 +1384,7 @@ bool game_controller::play_multiplayer()
|
|||
{
|
||||
gui::dialog d(disp(), _("Multiplayer"), "", gui::OK_CANCEL);
|
||||
d.set_menu(host_or_join);
|
||||
d.set_textbox(_("Login: "), login, 18, font::relative_size(250));
|
||||
d.set_textbox(_("Login: "), login, mp::max_login_size, font::relative_size(250));
|
||||
res = d.show();
|
||||
login = d.textbox_text();
|
||||
}
|
||||
|
|
|
@ -228,11 +228,11 @@ static server_type open_connection(game_display& disp, const std::string& origin
|
|||
if(!first_time) {
|
||||
const int res = gui::show_dialog(disp, NULL, "",
|
||||
_("You must log in to this server"), gui::OK_CANCEL,
|
||||
NULL, NULL, _("Login: "), &login, 18);
|
||||
NULL, NULL, _("Login: "), &login, mp::max_login_size);
|
||||
if(res != 0 || login.empty()) {
|
||||
return ABORT_SERVER;
|
||||
}
|
||||
if(login.size() > 18) {
|
||||
if(login.size() > mp::max_login_size) {
|
||||
gui::show_error_message(disp, _("The login name you chose is too long, please use a login with less than 18 characters"));
|
||||
return ABORT_SERVER;
|
||||
}
|
||||
|
|
|
@ -21,6 +21,9 @@ class game_data;
|
|||
|
||||
namespace mp {
|
||||
|
||||
// max. length of a player name
|
||||
const int max_login_size = 18;
|
||||
|
||||
/*
|
||||
* This is the main entry points of multiplayer mode.
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue