Editing Module:Shop
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
| Latest revision | Your text | ||
| 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 'Dough' | local currency = args.currency or 'Dough' | ||
| Line 34: | Line 34: | ||
local data = p.splitParams(raw, delim) | local data = p.splitParams(raw, delim) | ||
data.size = data.size or args.size or '35' -- first column image size | data.size = data.size or args.size or '35' -- first column image size | ||
data.currency = currency | data.currency = data.currency or currency | ||
data.cost_delim = data.cost_delim or args.cost_delim or ',' | data.cost_delim = data.cost_delim or args.cost_delim or ',' | ||
out:tag('tr'):node(p.ItemRow(data, args)) | out:tag('tr'):node(p.ItemRow(data, args)) | ||
| Line 85: | Line 85: | ||
if not data[1] and lib.isNotEmpty(data.x) and data.x ~= '1' then i.cell:wikitext('×', data.x, ' per ') end | if not data[1] and lib.isNotEmpty(data.x) and data.x ~= '1' then i.cell:wikitext('×', data.x, ' per ') end | ||
if tonumber(i.value) == nil then | if tonumber(i.value) == nil then | ||
local items = lib.split(i.value, data.cost_delim | local items = lib.split(i.value, data.cost_delim) | ||
for a, item in ipairs(items) do | for a, item in ipairs(items) do | ||
local name, amount = string.match(item, '^(.-)%*(.-)$') | local name, amount = string.match(item, '^(.-)%*(.-)$') | ||
| Line 93: | Line 93: | ||
name = name, | name = name, | ||
link = name, | link = name, | ||
count = | count = TS(amount*i.mult) .. (i.mult2>0 and (' (' .. TS(amount*i.mult2) .. ')') or ''), | ||
notext = 1, | notext = 1, | ||
size = 25 | size = 25 | ||
| Line 132: | Line 132: | ||
info.text = data.text or specific | info.text = data.text or specific | ||
info['type'] = data['type'] | info['type'] = data['type'] | ||
if (data['type'] == 'Light Cone') then | |||
info.suffix = 'Icon' | |||
end | |||
if (data['type'] == ' | |||
info. | |||
end | |||
row:tag('td'):node(Item(info)) | row:tag('td'):node(Item(info)) | ||
if (not args.nocat) then category:wikitext('[[Category:Sells ', specific, '|', specific, ']]') end | if (not args.nocat) then category:wikitext('[[Category:Sells ', specific, '|', specific, ']]') end | ||