• 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 18: Line 18:  
|colspan="5" style="text-align:center"|%s]],
 
|colspan="5" style="text-align:center"|%s]],
 
row = [=[|-
 
row = [=[|-
|style="text-align:center;background-color:#eef2f7;font-size:20px"|[[%s]]
+
|style="text-align:center;background-color:#eef2f7;font-size:12px;line-height:12px"|%s<br>[[%s]]
 
|style="text-align:center;background-color:#eef2f7;font-size:20px"|%s
 
|style="text-align:center;background-color:#eef2f7;font-size:20px"|%s
 
|style="text-align:center;background-color:#eef2f7;font-size:20px"|%s
 
|style="text-align:center;background-color:#eef2f7;font-size:20px"|%s
Line 35: Line 35:  
local index = {}
 
local index = {}
 
local tbl = {}
 
local tbl = {}
 +
local types = {}
 +
local assetTypes = { item = 'Item Icon', equipment = 'Equipment Card', ship = 'Ship Banner' }
 
local function setData(diff)
 
local function setData(diff)
 
for _, v in ipairs(data[diff] or {}) do
 
for _, v in ipairs(data[diff] or {}) do
 
local name = v.item or v.equipment or v.ship or '??'
 
local name = v.item or v.equipment or v.ship or '??'
 
if not U.ifind(index, name) then table.insert(index, name) end
 
if not U.ifind(index, name) then table.insert(index, name) end
 +
types[name] = v.item and 'item' or v.equipment and 'equipment' or v.ship and 'ship' or '??'
 
tbl[name] = tbl[name] or {}
 
tbl[name] = tbl[name] or {}
 
tbl[name][diff] = { count = v.count or 1, level = v.level }
 
tbl[name][diff] = { count = v.count or 1, level = v.level }
Line 58: Line 61:  
setData('Casual')
 
setData('Casual')
 
for _, name in ipairs(index) do
 
for _, name in ipairs(index) do
table.insert(result, string.format(template.row, name, getCell(name, 'Casual'), getCell(name, 'Easy'), getCell(name, 'Medium'), getCell(name, 'Hard')))
+
local typ = types[name]
 +
local asset = string.format("[[File:%s %s.png|%s|link=%s]]", assetTypes[typ] or '??', name, typ == 'equipment' and '75px' or '', name)
 +
table.insert(result, string.format(template.row, asset, name, getCell(name, 'Casual'), getCell(name, 'Easy'), getCell(name, 'Medium'), getCell(name, 'Hard')))
 
end
 
end
 
table.insert(result, template.footer)
 
table.insert(result, template.footer)
cssedit, gkautomate
6,940

edits

Navigation menu