| Line 2: |
Line 2: |
| | | | |
| | local U = require('Module:Core') | | local U = require('Module:Core') |
| − | local JSON = require('Module:Core/JSON')
| |
| | local loadData = require('Module:Data').load | | local loadData = require('Module:Data').load |
| | local getArgs = require('Module:GetArgs') | | local getArgs = require('Module:GetArgs') |
| Line 9: |
Line 8: |
| | local EquipmentCardKai = require('Module:EquipmentCardKai') | | local EquipmentCardKai = require('Module:EquipmentCardKai') |
| | local ShipsByApiId = require('Module:Collection/ShipsByApiId') | | local ShipsByApiId = require('Module:Collection/ShipsByApiId') |
| − | local EquipmentByApiId = require('Module:Collection/EquipmentByApiId')
| |
| | | | |
| | local function getShipCard(ship, hp, maxHp) | | local function getShipCard(ship, hp, maxHp) |
| Line 28: |
Line 26: |
| | | | |
| | local function getEquipmentCard(eq, cardSize) | | local function getEquipmentCard(eq, cardSize) |
| − | local id = tonumber(eq)
| |
| − | if id then
| |
| − | eq = EquipmentByApiId[id]
| |
| − | end
| |
| | return EquipmentCardKai:Asset({ eq, size = cardSize or '100px' }) | | return EquipmentCardKai:Asset({ eq, size = cardSize or '100px' }) |
| | end | | end |
| Line 56: |
Line 50: |
| | ]=] | | ]=] |
| | | | |
| − | local fleetNames = require('Module:Fleet/Names') | + | local fleetNames = require('Module:FleetNames') |
| | | | |
| | local function getFleetName(fleet, event) | | local function getFleetName(fleet, event) |
| Line 104: |
Line 98: |
| | | | |
| | local function formatVoice(e) | | local function formatVoice(e) |
| − | if type(e.voice) == 'number' and e.voice < 10 then | + | local file = type(e.voice) == 'number' and e.voice < 10 and |
| − | return string.format('{{audio|file=Ship Voice %s Spring 2019 Event Friend Fleet %s.ogg}}', e.ship, e.voice) | + | string.format('Ship Voice %s Spring 2019 Event Friend Fleet %s.ogg', e.ship, e.voice) or |
| − | else
| + | string.format('Ship Voice %s %s.ogg', e.ship, e.voice) |
| − | return string.format('{{audio|file=Ship Voice %s %s.ogg}}', e.ship, e.voice)
| + | return string.format('<span data-voice="%s">{{audio|file=%s}}</span>', file, file) |
| − | end | |
| | end | | end |
| | | | |
| | local function renderFriend(args, frame) | | local function renderFriend(args, frame) |
| | -- local data = loadData('Fleet/Friend/' .. args.friend) | | -- local data = loadData('Fleet/Friend/' .. args.friend) |
| − | local success, data = U.requireModule('Data/Fleet/Friend/' .. args.friend) | + | local success, data = U.requireModule('Data/FriendFleet/' .. args.friend) |
| | if not success then | | if not success then |
| | return "''No data''" | | return "''No data''" |