Module:LevelTables: Difference between revisions

Added support for new weapon data structure
write_power_increase_table broken trying to reuse some code
Line 40: Line 40:
--]]
--]]
p.write_power_increase_table = function(frame)
p.write_power_increase_table = function(frame)
    -- Use the same smart sorting for this list.
local function hero_sort(h1, h2)
return get_sortable_name(h1.Name) < get_sortable_name(h2.Name)
end
-- Read and validate the arguments passed from the #invoke call.
-- Read and validate the arguments passed from the #invoke call.
local property = frame.args[1]
local property = frame.args[1]
Line 75: Line 79:
-- Sort the hero list alphabetically, ignoring "The " for proper sorting.
-- Sort the hero list alphabetically, ignoring "The " for proper sorting.
table.sort(filtered_heroes, function(a, b)
table.sort(filtered_heroes, hero_sort)
return get_sortable_name(a.Name) < get_sortable_name(b.Name)
end)
-- Begin building the main data table.
-- Begin building the main data table.