case insensitive sorting

develop
Myk Taylor 2023-04-22 15:09:54 -07:00
parent 2b2d03b9b1
commit 8ab9739cd6
No known key found for this signature in database
1 changed files with 2 additions and 2 deletions

@ -16,10 +16,10 @@ function getStockpileData()
local data = {} local data = {}
for _,bld in ipairs(df.global.world.buildings.other.STOCKPILE) do for _,bld in ipairs(df.global.world.buildings.other.STOCKPILE) do
local stockpile_number, name = bld.stockpile_number, bld.name local stockpile_number, name = bld.stockpile_number, bld.name
local sort_key = name local sort_key = tostring(name):lower()
if #name == 0 then if #name == 0 then
name = ('Stockpile #%d'):format(bld.stockpile_number) name = ('Stockpile #%d'):format(bld.stockpile_number)
sort_key = ('Stockpile #%09d'):format(bld.stockpile_number) sort_key = ('stockpile #%09d'):format(bld.stockpile_number)
end end
table.insert(data, { table.insert(data, {
stockpile_number=stockpile_number, stockpile_number=stockpile_number,