1
0
forked from 0ad/0ad

Sorts the lobby player list, ignoring case

This was SVN commit r14927.
This commit is contained in:
scythetwirler 2014-04-13 18:29:32 +00:00
parent b08e364e81
commit 1073382e3b

View File

@ -155,6 +155,13 @@ function updatePlayerList()
var playersBox = Engine.GetGUIObjectByName("playersBox");
[playerList, presenceList, nickList, ratingList] = [[],[],[],[]];
var cleanPlayerList = Engine.GetPlayerList();
// Sort the player list, ignoring case.
cleanPlayerList.sort(function(a,b)
{
var aName = a.name.toLowerCase();
var bName = b.name.toLowerCase();
return ((aName > bName) ? 1 : (bName > aName) ? -1 : 0);
} );
for (var i = 0; i < cleanPlayerList.length; i++)
{
// Identify current user's rating.