Ticket #3508: t3508_v3.patch

File t3508_v3.patch, 1.3 KB (added by Sergey Kushnirenko, 8 years ago)
  • gamesetup.js

     
    115115const g_UnassignedColor = "140 140 140";
    116116
    117117/**
     118 * Highlight observer players in the dropdownlist.
     119 */
     120const g_UnassignedPlayerColor = "30 20 20"
     121
     122/**
    118123 * Highlight ready players.
    119124 */
    120125const g_ReadyColor = "green";
     
    14121462        updatePlayerList();
    14131463}
    14141464
     1465function colorizeTextWithColor(name, color)
     1466{
     1467    return "[color=\""+ color + "\"]" + name + "[/color]";
     1468}
     1469
    14151470function updatePlayerList()
    14161471{
    14171472    g_IsInGuiUpdate = true;
     
    14271482    {
    14281483        let player = g_PlayerAssignments[guid].player;
    14291484
    1430         hostNameList.push(g_PlayerAssignments[guid].name);
     1485        if( player != -1 )
     1486            hostNameList.push( g_PlayerAssignments[guid].name );
     1487        else
     1488            hostNameList.push( colorizeTextWithColor( g_PlayerAssignments[guid].name, g_UnassignedPlayerColor ) );
     1489           
    14311490        hostGuidList.push(guid);
    14321491        assignments[player] = hostNameList.length-1;
    14331492
     
    14511510    }
    14521511
    14531512    noAssignment = hostNameList.length;
    1454     hostNameList.push("[color=\""+ g_UnassignedColor + "\"]" + translate("Unassigned"));
     1513    hostNameList.push( colorizeTextWithColor(translate("Unassigned"), g_UnassignedColor ) );
    14551514    hostGuidList.push("");
    14561515
    14571516    for (let i = 0; i < g_MaxPlayers; ++i)