Alphabetical sorting of texture packs in menu (fixes #3487)
authorjeanpatrick.guerrero@gmail.com <jeanpatrick.guerrero@gmail.com>
Fri, 25 Dec 2015 21:10:29 +0000 (22:10 +0100)
committerest31 <MTest31@outlook.com>
Sat, 26 Dec 2015 20:53:12 +0000 (21:53 +0100)
builtin/mainmenu/tab_texturepacks.lua

index 5514d31f90ce55430066ae94bf41a268d659f021..d8b9ba35f2f28004c18dcf3585b26e4cb8fdc799 100644 (file)
 
 --------------------------------------------------------------------------------
 local function filter_texture_pack_list(list)
-       local retval = {fgettext("None")}
+       local retval = {}
        for _, item in ipairs(list) do
                if item ~= "base" then
                        table.insert(retval, item)
                end
        end
+
+       table.sort(retval)
+       table.insert(retval, 1, fgettext("None"))
+
        return retval
 end