From e62da22784e7c1075f8e8f65c1f3ee94d381ed38 Mon Sep 17 00:00:00 2001 From: Matei Date: Mon, 9 Jul 2007 04:07:57 +0000 Subject: [PATCH] Sort maps ignoring case. This was SVN commit r5236. --- binaries/data/mods/official/gui/test/2_mainmenu.xml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/binaries/data/mods/official/gui/test/2_mainmenu.xml b/binaries/data/mods/official/gui/test/2_mainmenu.xml index fcf9af06c1..20853c132c 100644 --- a/binaries/data/mods/official/gui/test/2_mainmenu.xml +++ b/binaries/data/mods/official/gui/test/2_mainmenu.xml @@ -573,8 +573,14 @@ // Get a list of map names. mapArray = buildDirEntList (mapPath, "*.pmp", false); - // Alphabetically sort the list. - mapArray.sort(); + // Alphabetically sort the list, ignoring case. + 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++) {