Ticket #3409: sort_players_in_gamesteup.patch
File sort_players_in_gamesteup.patch, 1.3 KB (added by , 8 years ago) |
---|
-
gamesetup.js
115 115 const g_UnassignedColor = "140 140 140"; 116 116 117 117 /** 118 * Highlight observer players in the dropdownlist. 119 */ 120 const g_ObserverColor = "170 170 250"; 121 122 /** 118 123 * Highlight ready players. 119 124 */ 120 125 const g_ReadyColor = "green"; … … 1423 1428 let noAssignment; 1424 1429 let assignedCount = 0; 1425 1430 1431 //add assigned players 1426 1432 for (let guid in g_PlayerAssignments) 1427 1433 { 1428 1434 let player = g_PlayerAssignments[guid].player; 1429 1435 1436 if (player == -1) 1437 continue; 1438 1430 1439 hostNameList.push(g_PlayerAssignments[guid].name); 1431 1440 hostGuidList.push(guid); 1432 1441 assignments[player] = hostNameList.length-1; 1442 assignedCount++; 1443 } 1444 1445 //add observer players 1446 for (let guid in g_PlayerAssignments) 1447 { 1448 let player = g_PlayerAssignments[guid].player; 1433 1449 1434 1450 if (player != -1) 1435 assignedCount++; 1436 } 1451 continue; 1437 1452 1453 hostNameList.push("[color=\""+ g_ObserverColor + "\"]" + g_PlayerAssignments[guid].name + "[/color]"); 1454 hostGuidList.push(guid); 1455 assignments[player] = hostNameList.length-1; 1456 } 1457 1438 1458 // Only enable start button if we have enough assigned players 1439 1459 if (g_IsController) 1440 1460 Engine.GetGUIObjectByName("startGame").enabled = assignedCount > 0;