Module:Skills/Artisan: Difference between revisions

no edit summary
(Add x to <sub> item count)
No edit summary
Line 474: Line 474:
function p.getRunecraftingTable(frame)
function p.getRunecraftingTable(frame)
local category = frame.args ~= nil and frame.args[1] or frame
local category = frame.args ~= nil and frame.args[1] or frame
return p._getRecipeTable('Runecrafting', category, {'ItemImage', 'ItemName', 'DLC', 'SkillLevel', 'SkillXP', 'Materials', 'Currency'})
return p._getRecipeTable('Runecrafting', category, {'Item', 'DLC', 'SkillLevel', 'SkillXP', 'Materials', 'Currency'})
end
end


function p.getFletchingTable(frame)
function p.getFletchingTable(frame)
local category = frame.args ~= nil and frame.args[1] or frame
local category = frame.args ~= nil and frame.args[1] or frame
return p._getRecipeTable('Fletching', category, {'ItemImage', 'ItemName', 'DLC', 'SkillLevel', 'SkillXP', 'Materials', 'Currency'})
return p._getRecipeTable('Fletching', category, {'Item', 'DLC', 'SkillLevel', 'SkillXP', 'Materials', 'Currency'})
end
end


function p.getCraftingTable(frame)
function p.getCraftingTable(frame)
local category = frame.args ~= nil and frame.args[1] or frame
local category = frame.args ~= nil and frame.args[1] or frame
local columns = {'ItemImage', 'ItemName', 'DLC', 'SkillLevel', 'SkillXP', 'Materials', 'Currency'}
local columns = {'Item', 'DLC', 'SkillLevel', 'SkillXP', 'Materials', 'Currency'}
if category == 'Rings' or category == 'Necklaces' then
if category == 'Rings' or category == 'Necklaces' then
table.insert(columns, "Description")
table.insert(columns, "Description")
Line 493: Line 493:
function p.getSmithingTable(frame)
function p.getSmithingTable(frame)
local category = frame.args ~= nil and frame.args[1] or frame
local category = frame.args ~= nil and frame.args[1] or frame
local columns = {'ItemImage', 'ItemName', 'DLC', 'SkillLevel', 'SkillXP', 'Materials', 'Currency'}
local columns = {'Item', 'DLC', 'SkillLevel', 'SkillXP', 'Materials', 'Currency'}
if category ~= 'Bars' and category ~= 'Abyssal Bars' then
if category ~= 'Bars' and category ~= 'Abyssal Bars' then
table.insert(columns, 'CurrencyBar')
table.insert(columns, 'CurrencyBar')
Line 547: Line 547:
-- Validation: Column list
-- Validation: Column list
local columnDef = {
local columnDef = {
["ItemImage"] = {["header"] = 'Item', ["altRepeat"] = false},
["Item"] = {["header"] = 'Item', ["altRepeat"] = false},
["ItemName"] = {["header"] = 'Name', ["altRepeat"] = true},
["SkillLevel"] = {["header"] = Icons._SkillRealmIcon(skillName, categoryRealm) .. '<br>Level', ["altRepeat"] = false},
["SkillLevel"] = {["header"] = Icons._SkillRealmIcon(skillName, categoryRealm) .. '<br>Level', ["altRepeat"] = false},
["DLC"] = {["header"] = '[[DLC]]', ["altRepeat"] = true},
["DLC"] = {["header"] = '[[DLC]]', ["altRepeat"] = true},
Line 571: Line 570:
return Shared.printError('Invalid column ' .. colID .. ' requested')
return Shared.printError('Invalid column ' .. colID .. ' requested')
else
else
header:tag('th'):wikitext(columnDef[colID].header)
if colID == 'Item' then
if colID == 'CurrencyBar' then
header:tag('th'):wikitext('Item')
-- For Smithing, a currency value per bar column is included. If this
:attr('colspan', 2)
-- is requested, then obtain a list of bar item IDs
else
barIDList = p.getBarItemIDs()
header:tag('th'):wikitext(columnDef[colID].header)
if colID == 'CurrencyBar' then
-- For Smithing, a currency value per bar column is included. If this
-- is requested, then obtain a list of bar item IDs
barIDList = p.getBarItemIDs()
end
end
end
end
end
Line 620: Line 624:
cell:attr('rowspan', tostring(rowspanAmt))
cell:attr('rowspan', tostring(rowspanAmt))
end
end
if colID == 'ItemImage' then
if colID == 'Item' then
cell:wikitext(Icons.Icon({item.name, type='item', size=25, notext=true}))
cell:wikitext(Icons.Icon({item.name, type='item', notext=true}))
:addClass('table-img')
:addClass('table-img')
elseif colID == "ItemName" then
cell:wikitext((qty > 1 and '<b>' .. qty .. 'x</b> ' or '') .. Icons.Icon({item.name, type='item', noicon=true}))
cell:wikitext((qty > 1 and '<b>' .. qty .. 'x</b> ' or '') .. Icons.Icon({item.name, type='item', noicon=true}))
if qty > 1 then
if qty > 1 then
2,647

edits