mirror of https://github.com/OpenRCT2/OpenRCT2.git
Get fallback player name from language files
This commit is contained in:
parent
a5b47a8481
commit
65f25f8340
|
@ -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,
|
||||||
|
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue