Module:Required for completing: Difference between revisions
Created page with "--<nowiki> -- essentially the inverse of Module:Missionreq local missions = mw.loadData('Module:Missionreq/data') local p = {} local yesno = require('Module:Yesno') funct..." |
No edit summary |
||
| Line 79: | Line 79: | ||
local _nested = {} | local _nested = {} | ||
for k,v in pairs(nestedMissions) do | for k,v in pairs(nestedMissions) do | ||
if k:find('^Full:') or k:find('^Started') then | if k:find('^Full:') or k:find('^Started') then | ||
local _k = k:gsub('^Full:', ''):gsub('^Started:', '') | local _k = k:gsub('^Full:', ''):gsub('^Started:', '') | ||
| Line 111: | Line 104: | ||
local ret = {} | local ret = {} | ||
if qs == nil or #qs == 0 then | if qs == nil or #qs == 0 then | ||
table.insert(ret, string.format('%s is not currently required for any missions | table.insert(ret, string.format('%s is not currently required for any missions.', q)) | ||
else | else | ||
table.insert(ret, string.format('%s is directly required for the following missions | table.insert(ret, string.format('%s is directly required for the following missions:', q)) | ||
for i,v in ipairs(qs) do | for i,v in ipairs(qs) do | ||
local repl, str | local repl, str | ||
| Line 130: | Line 123: | ||
if indirqs and #indirqs > 0 then | if indirqs and #indirqs > 0 then | ||
table.insert(ret, '') | table.insert(ret, '') | ||
table.insert(ret, '<div class="mw-collapsible mw-collapsed" style="display:inline-block;">It is therefore an indirect requirement for the following missions | table.insert(ret, '<div class="mw-collapsible mw-collapsed" style="display:inline-block;">It is therefore an indirect requirement for the following missions: <div class="mw-collapsible-content">') | ||
for i,v in ipairs(indirqs) do | for i,v in ipairs(indirqs) do | ||
local repl, str | local repl, str | ||