Module:Infobox NPC: Difference between revisions

Jump to navigation Jump to search
480 bytes removed ,  10:17, 9 November 2022
no edit summary
(Created page with "-------------------------- -- Module for Template:Infobox NPC ------------------------ local p = {} local onmain = require('Module:Mainonly').on_main local paramtest = require('Module:Paramtest') local infobox = require('Module:Infobox') function p.main(frame) local args = frame:getParent().args local ret = infobox.new(args) ret:defineParams{ { name = 'name', func = 'name' }, { name = 'image', func = 'image' }, { name = 'image_smw', func = { name = image_...")
 
No edit summary
Line 20: Line 20:
{ name = 'aka', func = 'has_content' },
{ name = 'aka', func = 'has_content' },
{ name = 'level', func = 'has_content' },
{ name = 'level', func = 'has_content' },
{ name = 'members', func = 'has_content' },
{ name = 'race', func = 'has_content' },
{ name = 'race', func = 'has_content' },
{ name = 'quest', func = 'has_content' },
{ name = 'location', func = 'has_content' },
{ name = 'location', func = 'has_content' },
{ name = 'shop', func = 'has_content' },
{ name = 'shop', func = 'has_content' },
Line 42: Line 40:
id_smw = 'NPC ID',
id_smw = 'NPC ID',
examine = 'Examine',
examine = 'Examine',
members = 'Is members only',
location = 'NPC location',
location = 'NPC location',
usesinfobox = 'Uses infobox',
usesinfobox = 'Uses infobox',
Line 67: Line 64:
:pad(20)
:pad(20)


:addRow{
:addRow{qu
{ tag = 'argd', content = 'image', colspan = '20', class = 'infobox-full-width-content' }
{ tag = 'argd', content = 'image', colspan = '20', class = 'infobox-full-width-content' }
}
}
Line 97: Line 94:
}
}
end
end
ret:addRow{
{ tag = 'th', content = '[[Members]]', colspan = '8' },
{ tag = 'argd', content = 'members', colspan = '12' }
}
if ret:paramDefined('race') then
if ret:paramDefined('race') then
Line 119: Line 111:
{ tag = 'th', content = '[[Shop]]', colspan = '8' },
{ tag = 'th', content = '[[Shop]]', colspan = '8' },
{ tag = 'argd', content = 'shop', colspan = '12' }
{ tag = 'argd', content = 'shop', colspan = '12' }
}
end
if ret:paramDefined('quest') then
ret:addRow{
{ tag = 'th', content = '[[Quest]]', colspan = '8' },
{ tag = 'argd', content = 'quest', colspan = '12' }
}
}
end
end
Line 220: Line 205:
aka = 'Pages with AKA',
aka = 'Pages with AKA',
shop = 'Merchants',
shop = 'Merchants',
quest = 'Quest NPCs'
}
}
for n, v in pairs(defined_args) do
for n, v in pairs(defined_args) do
Line 231: Line 215:
local notdefined_args = {
local notdefined_args = {
image = 'Needs image',
image = 'Needs image',
members = 'Needs members status',
release = 'Needs release date',
release = 'Needs release date',
examine = 'Needs examine added',
examine = 'Needs examine added',

Navigation menu