1
0
forked from 0ad/0ad

Give players and bots their actual name during the game, for better experience.

Patch by elexis, fixes #3253

This was SVN commit r16838.
This commit is contained in:
Nicolas Auvray 2015-07-08 19:03:14 +00:00
parent 542061dbed
commit cf21c34e3f
2 changed files with 15 additions and 0 deletions

View File

@ -1101,6 +1101,13 @@ function launchGame()
} }
} }
// Copy playernames from initial player assignment to the settings
for (let guid of g_PlayerAssignments)
{
let player = g_PlayerAssignments[guid];
g_GameAttributes.settings.PlayerData[player.player - 1].Name = player.name;
}
if (g_IsNetworked) if (g_IsNetworked)
{ {
Engine.SetNetworkGameAttributes(g_GameAttributes); Engine.SetNetworkGameAttributes(g_GameAttributes);

View File

@ -108,6 +108,14 @@ function pollAndHandleNetworkClient()
break; break;
case "start": case "start":
// Copy playernames from initial player assignment to the settings
for (let guid of g_PlayerAssignments)
{
let player = g_PlayerAssignments[guid];
g_GameAttributes.settings.PlayerData[player.player - 1].Name = player.name;
}
Engine.SwitchGuiPage("page_loading.xml", { Engine.SwitchGuiPage("page_loading.xml", {
"attribs": g_GameAttributes, "attribs": g_GameAttributes,
"isNetworked" : true, "isNetworked" : true,