forked from 0ad/0ad
Sort maps ignoring case.
This was SVN commit r5236.
This commit is contained in:
parent
3f90bae87a
commit
e62da22784
@ -573,8 +573,14 @@
|
|||||||
// Get a list of map names.
|
// Get a list of map names.
|
||||||
mapArray = buildDirEntList (mapPath, "*.pmp", false);
|
mapArray = buildDirEntList (mapPath, "*.pmp", false);
|
||||||
|
|
||||||
// Alphabetically sort the list.
|
// Alphabetically sort the list, ignoring case.
|
||||||
mapArray.sort();
|
mapArray.sort(function (x, y) {
|
||||||
|
var lowerX = x.toLowerCase();
|
||||||
|
var lowerY = y.toLowerCase();
|
||||||
|
if(lowerX < lowerY) return -1;
|
||||||
|
else if(lowerX > lowerY) return 1;
|
||||||
|
else return 0;
|
||||||
|
});
|
||||||
|
|
||||||
for (mapIndex = 0; mapIndex < mapArray.length; mapIndex++)
|
for (mapIndex = 0; mapIndex < mapArray.length; mapIndex++)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user