Line 5:
Line 5:
!colspan="5" style="background-color:#3baef5;color:white"|Rewards]],
!colspan="5" style="background-color:#3baef5;color:white"|Rewards]],
footer = [[|}]],
footer = [[|}]],
−
all = [=[|-
+
ship = [=[|-
!style="background-color:#3baef5;color:white"|Ship
!style="background-color:#3baef5;color:white"|Ship
|colspan="4" style="background-color:#eef2f7"|%s<br>[[%s]]]=],
|colspan="4" style="background-color:#eef2f7"|%s<br>[[%s]]]=],
Line 21:
Line 21:
|style="background-color:#eef2f7;font-size:18px"|%s]=],
|style="background-color:#eef2f7;font-size:18px"|%s]=],
}
}
+
+
local assetTypes = { item = 'Item Icon', equipment = 'Equipment Card', ship = 'Ship Banner' }
+
+
local assetSizes = { item = '75px', equipment = '75px', ship = '240px' }
local function render(frame)
local function render(frame)
Line 32:
Line 36:
local tbl = {}
local tbl = {}
local types = {}
local types = {}
−
-- TODO: assuming 0-1 single ship rewards on all difficulties
+
-- TODO: assuming 0-1 single ship reward on all difficulties
local ship = false
local ship = false
−
local assetTypes = { item = 'Item Icon', equipment = 'Equipment Card', ship = 'Ship Banner' }
−
local assetSizes = { item = '75px', equipment = '75px', ship = '240px' }
local function setData(diff)
local function setData(diff)
for _, v in ipairs(data[diff] or {}) do
for _, v in ipairs(data[diff] or {}) do
Line 60:
Line 62:
end
end
local function getAsset(name)
local function getAsset(name)
−
local typ = types[name]
+
return string.format("[[File:%s %s.png|%s|link=%s]]", assetTypes[types[name]] or '??', name, assetSizes[types[name]] or '??', name)
−
return string.format("[[File:%s %s.png|%s|link=%s]]", assetTypes[typ] or '??', name, assetSizes[typ] or '??', name)
end
end
setData('Hard')
setData('Hard')
Line 69:
Line 70:
local result = { template.top_header }
local result = { template.top_header }
if ship then
if ship then
−
table.insert(result, string.format(template.all, getAsset(ship), ship))
+
table.insert(result, string.format(template.ship, getAsset(ship), ship))
end
end
table.insert(result, template.header)
table.insert(result, template.header)