Editing Module:Item Usage
Appearance
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 127: | Line 127: | ||
end | end | ||
-- Multiple kitchenware: | -- Multiple kitchenware, in case you later use: | ||
-- |kitchenware_1 = | -- |kitchenware_1 = | ||
-- |kitchenware_2 = | -- |kitchenware_2 = | ||
| Line 267: | Line 267: | ||
return nil | return nil | ||
end | |||
local function renderCookingKitchenware(recipe) | |||
local kitchenwareArg = getKitchenwareArg() | |||
local kitchenware = {} | |||
if isNotEmpty(recipe[kitchenwareArg]) then | |||
table.insert(kitchenware, renderIconLink(recipe[kitchenwareArg])) | |||
end | |||
local index = 1 | |||
while isNotEmpty(recipe[kitchenwareArg .. '_' .. index]) do | |||
table.insert(kitchenware, renderIconLink(recipe[kitchenwareArg .. '_' .. index])) | |||
index = index + 1 | |||
end | |||
if #kitchenware == 0 then | |||
return nil | |||
end | |||
return '<b>Kitchenware:</b> ' .. table.concat(kitchenware, ' / ') | |||
end | end | ||
| Line 281: | Line 303: | ||
end | end | ||
local kitchenware = renderCookingKitchenware(recipe) | |||
local | |||
if isNotEmpty( | if isNotEmpty(kitchenware) then | ||
table.insert(kitchenware | table.insert(ingredients, kitchenware) | ||
end | end | ||
return ingredients | |||
return | |||
end | end | ||
| Line 308: | Line 318: | ||
return renderStandardIngredients(recipe) | return renderStandardIngredients(recipe) | ||
end | end | ||
| Line 400: | Line 398: | ||
function p._main(valids, craftType) | function p._main(valids, craftType) | ||
local _table = mw.html.create('table'):addClass('wikitable article-table sortable') | local _table = mw.html.create('table'):addClass('wikitable article-table sortable') | ||
-- Header row | -- Header row | ||
| Line 406: | Line 403: | ||
tr:tag('th'):wikitext('Item') | tr:tag('th'):wikitext('Item') | ||
tr:tag('th'):wikitext('Craft Type') | tr:tag('th'):wikitext('Craft Type') | ||
tr:tag('th'):wikitext(craftType == 'Furnishing Set' and 'Components' or 'Recipe') | tr:tag('th'):wikitext(craftType == 'Furnishing Set' and 'Components' or 'Recipe') | ||
| Line 451: | Line 443: | ||
:css{['text-align'] = 'center'} | :css{['text-align'] = 'center'} | ||
:wikitext('[[', recipe[Rlib.sTypeArg], ']]') | :wikitext('[[', recipe[Rlib.sTypeArg], ']]') | ||
local ingredients = renderRecipeIngredients(recipe) | local ingredients = renderRecipeIngredients(recipe) | ||