Différences entre les versions de « Module:Villagers »

Aller à la navigation Aller à la recherche
aucun résumé de modification
Ligne 12 : Ligne 12 :
for k, v in pairs(b) do
for k, v in pairs(b) do
if v.rank == rank then
if v.rank == rank then
--amay4672: looks at lines called rank in Module:Buildings and
-- matches them to what's typed into the Template box "rank".
-- Only recognises capitalised values of ranks due to com.fUpper above
jobs[k] = true
jobs[k] = true
-- amay4672: I think [k] throughout refers to the building names from Module:Buildings
end
end
end
end
--amay4672: reasonably sure that here until :tag is all template creation
table.sort(jobs)
table.sort(jobs)
mw.log(#jobs)
mw.log(#jobs)
Ligne 33 : Ligne 28 :
local jobName = mw.html.create('li')
local jobName = mw.html.create('li')
jobName:wikitext('[[' .. com.fUpper(k) .. ']]' .. ((b[k].job and ' - ' .. b[k].job) or ''))
jobName:wikitext('[[' .. com.fUpper(k) .. ']]' .. ((b[k].job and ' - ' .. b[k].job) or ''))
-- amay4672: evidently com.fUpper(k) here is what creates the hyperlinked building name
jobList:node(jobName)
jobList:node(jobName)
end
end
825

modifications

Menu de navigation