1,124
edits
Line 34: | Line 34: | ||
for k, v in pairs (dataTable) do | for k, v in pairs (dataTable) do | ||
local getPreReq = {} | local getPreReq = {} | ||
table.insert(getPreReq, v.building | table.insert(getPreReq, v.building) | ||
table.insert(getPreReq, v.population .. | table.insert(getPreReq, v.population) | ||
if v.splendor then | |||
table.insert(getPreReq, | for k, v in pairs(v.splendor) do | ||
table.insert(getPreReq, i.icon(k .. ' splendor', v, nil, nil, 'en')) | |||
end | |||
end | |||
if v.influence then | |||
for k, v in pairs(v.influence) do | |||
table.insert(getPreReq, i.icon(k .. ' influence', v, nil, nil, 'en')) | |||
end | |||
end | |||
local preReq = '' | local preReq = '' | ||
for k, v in ipairs(getPreReq) do | for k, v in ipairs(getPreReq) do | ||
preReq = preReq .. v | |||
if | if k ~= #getPreReq then | ||
preReq = preReq | preReq = preReq .. '<br />' | ||
end | |||
end | |||
local production = {} | |||
if v.requirements then | |||
local reqs = '' | |||
for k, v in pairs(v.requirements) do | |||
end | end | ||
end | end | ||
local newRow = mw.html.create('tr') | local newRow = mw.html.create('tr') | ||
newRow:tag('th') | newRow:tag('th') | ||
:wikitext(k) | :wikitext(k) | ||
:done() | |||
:tag('td') | |||
:wikitext(preReq) | |||
:done() | :done() | ||
end | end |