Ticket #3508: t3508_v1.patch

File t3508_v1.patch, 1.2 KB (added by Sergey Kushnirenko, 8 years ago)
  • binaries/data/mods/public/gui/gamesetup/gamesetup.js

     
    14121457        updatePlayerList();
    14131458}
    14141459
     1460function colorizeTextWithUnassignedColor(text)
     1461{
     1462    return "[color=\""+ g_UnassignedColor + "\"]" + text + "[/color]";
     1463}
     1464
    14151465function updatePlayerList()
    14161466{
    14171467    g_IsInGuiUpdate = true;
     
    14271477    {
    14281478        let player = g_PlayerAssignments[guid].player;
    14291479
    1430         hostNameList.push(g_PlayerAssignments[guid].name);
     1480        if( player != -1 ) 
     1481            hostNameList.push( g_PlayerAssignments[guid].name );
     1482        else   
     1483            hostNameList.push( colorizeTextWithUnassignedColor( g_PlayerAssignments[guid].name ) );
     1484           
    14311485        hostGuidList.push(guid);
    14321486        assignments[player] = hostNameList.length-1;
    14331487
     
    14511505    }
    14521506
    14531507    noAssignment = hostNameList.length;
    1454     hostNameList.push("[color=\""+ g_UnassignedColor + "\"]" + translate("Unassigned"));
     1508    hostNameList.push( colorizeTextWithUnassignedColor( translate("Unassigned") ) );
    14551509    hostGuidList.push("");
    14561510
    14571511    for (let i = 0; i < g_MaxPlayers; ++i)