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
-- remove duplicate 'Full completion of X/Started X' if X is already listed
-- usually applies to early missions that are required a lot
-- e.g. Desert Treasure is required for Children of Mah in several ways, some of which are direct requirements
-- (Desert Treasure -> The Temple at Senntisten -> The Light Within -> Children of Mah)
-- and some are through 'Full completion' requirements
-- (Desert Treasure -> The Temple at Senntisten -> Ritual of the Mahjarrat -> Koschei's Troubles -> Full:Children of Mah)
-- listing both is confusing so remove full/started requirements if the quest is just normally listed
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 or minimissions.', q))
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/minimissions:', q))
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 and minimissions: <div class="mw-collapsible-content">')
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