Line 1: |
Line 1: |
| local U = require('Module:Core') | | local U = require('Module:Core') |
− | local loadData = require('Module:Data').load
| |
| local getArgs = require('Module:GetArgs') | | local getArgs = require('Module:GetArgs') |
| local Ship = require('Module:Ship') | | local Ship = require('Module:Ship') |
Line 67: |
Line 66: |
| | | |
| local function render(args) | | local function render(args) |
− | local data = loadData('Fleet/Friend', args.friend)
| + | local success, data = U.requireModule('Data/Fleet/Friend/' .. args.friend) |
| + | if not success then |
| + | return "''No data''" |
| + | end |
| local groups = {} | | local groups = {} |
| for _, e in pairs(data) do | | for _, e in pairs(data) do |
Line 76: |
Line 78: |
| end | | end |
| end | | end |
− | local fleetTypes = U.isort(U.keys(groups))
| |
| local result = {} | | local result = {} |
| local first = true | | local first = true |
− | for _, fleetType in ipairs(fleetTypes) do | + | for _, fleetType in ipairs(U.isort(U.keys(groups))) do |
| local fleets = groups[fleetType] | | local fleets = groups[fleetType] |
| table.sort( | | table.sort( |
Line 114: |
Line 115: |
| for i, fleet in ipairs(fleets) do | | for i, fleet in ipairs(fleets) do |
| if first then | | if first then |
− | table.insert(result, string.format(tableStart, U.ijoin(fleet.notes, ', '))) | + | table.insert(result, string.format(tableStart, '?' .. U.ijoin(fleet.notes, ', '))) |
| first = false | | first = false |
| end | | end |