Get fallback player name from language files

This commit is contained in:
Alexander Overvoorde 2016-02-10 22:43:17 +01:00
parent a5b47a8481
commit 65f25f8340
3 changed files with 5 additions and 2 deletions

View File

@ -475,6 +475,7 @@ enum {
STR_WATER_RIDES_TIP = 1227, STR_WATER_RIDES_TIP = 1227,
STR_SHOPS_STALLS_TIP = 1228, STR_SHOPS_STALLS_TIP = 1228,
STR_PLAYER_DEFAULT_NAME = 1315,
STR_X_PLAYER = 1317, STR_X_PLAYER = 1317,
STR_X_PLAYERS = 1318, STR_X_PLAYERS = 1318,

View File

@ -33,6 +33,7 @@
#include "../addresses.h" #include "../addresses.h"
#include "../config.h" #include "../config.h"
#include "../localisation/language.h" #include "../localisation/language.h"
#include "../localisation/string_ids.h"
#include "../openrct2.h" #include "../openrct2.h"
#include "../util/util.h" #include "../util/util.h"
#include "platform.h" #include "platform.h"
@ -882,7 +883,7 @@ utf8* platform_get_username() {
if (pw) { if (pw) {
return pw->pw_name; return pw->pw_name;
} else { } else {
return "Player"; return language_get_string(STR_PLAYER_DEFAULT_NAME);
} }
} }

View File

@ -31,6 +31,7 @@
#include "../addresses.h" #include "../addresses.h"
#include "../openrct2.h" #include "../openrct2.h"
#include "../localisation/language.h" #include "../localisation/language.h"
#include "../localisation/string_ids.h"
#include "../util/util.h" #include "../util/util.h"
#include "../config.h" #include "../config.h"
#include "platform.h" #include "platform.h"
@ -981,7 +982,7 @@ utf8* platform_get_username() {
DWORD usernameLength = UNLEN + 1; DWORD usernameLength = UNLEN + 1;
if (!GetUserName(username, &usernameLength)) { if (!GetUserName(username, &usernameLength)) {
strcpy(username, "Player"); strcpy(username, language_get_string(STR_PLAYER_DEFAULT_NAME));
} }
return username; return username;