Module:Shop: Difference between revisions
From The Petit Planet Wiki
More actions
ReisuDesign (talk | contribs) Created page with "local p = {} local lib = require('Module:Feature') local Item = require('Module:Item')._main local category = mw.html.create():wikitext('Category:Shops') local TS = lib.thousandsSeparator local total = {} function p.main(frame) local args = require('Module:Arguments').getArgs(frame) if tonumber(frame:callParserFunction('#var:transclude', '') or '0') == 1 then args.nocat = 1 end return p._main(args) end function p._main(args) local out = mw.html.create('tab..." |
Removed gsub() |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 16: | Line 16: | ||
function p._main(args) | function p._main(args) | ||
local out = mw.html.create('table'):addClass(' | local out = mw.html.create('table'):addClass('wikitable sortable ' .. (args.class or '')) | ||
local delim = args.delim or ';;' | local delim = args.delim or ';;' | ||
local currency = args.currency or ' | local currency = args.currency or 'Dough' | ||
local stock = args.stock or 'Stock' | local stock = args.stock or 'Stock' | ||
| Line 78: | Line 78: | ||
local cost = data[2] | local cost = data[2] | ||
local stock = data[3] or data.stock | local stock = data[3] or data.stock | ||
local currency = data.currency or args.currency or ' | local currency = data.currency or args.currency or 'Dough' | ||
function getCost(i) | function getCost(i) | ||
| Line 136: | Line 136: | ||
end | end | ||
row:tag('td'):node(Item(info)) | row:tag('td'):node(Item(info)) | ||
if (not args.nocat) then category:wikitext('[[Category:Sells ', specific | if (not args.nocat) then category:wikitext('[[Category:Sells ', specific, '|', specific, ']]') end | ||
end | end | ||
if cost then | if cost then | ||