• Welcome to the Kancolle Wiki!
  • If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord

Changes

Jump to navigation Jump to search
no edit summary
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 101: Line 95:  
     return string.format('{{tooltip|~/%s|%s}}', maxHp, U.ijoin(hps, ', '))
 
     return string.format('{{tooltip|~/%s|%s}}', maxHp, U.ijoin(hps, ', '))
 
   end
 
   end
 +
end
 +
 +
local function formatVoice(e)
 +
  local file = type(e.voice) == 'number' and e.voice < 10 and
 +
    string.format('Ship Voice %s Spring 2019 Event Friend Fleet %s.ogg', e.ship, e.voice) or
 +
    string.format('Ship Voice %s %s.ogg', e.ship, e.voice)
 +
  return string.format('<span data-voice="%s">{{audio|file=%s}}</span>', file, file)
 
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''"
Line 149: Line 150:  
             if fleet.p2w and fleet.p2w > 0 then
 
             if fleet.p2w and fleet.p2w > 0 then
 
                 fleetNote = fleetNote .. ", '''{{color|red|{{tooltip|Powerful|"  .. fleet.p2w ..  " samples}}}}'''"
 
                 fleetNote = fleetNote .. ", '''{{color|red|{{tooltip|Powerful|"  .. fleet.p2w ..  " samples}}}}'''"
 +
            end
 +
            if table.getn(fleet.voices or {}) > 0 then
 +
                fleetNote = fleetNote .. ' ' .. U.ijoin(U.imap(fleet.voices[1], formatVoice), ' ')
 
             end
 
             end
 
             table.insert(result, fleetNote)
 
             table.insert(result, fleetNote)
cssedit, gkautomate
6,996

edits

Navigation menu