Anonymous

Module:Skills/Artisan: Difference between revisions

From Melvor Idle
no edit summary
No edit summary
No edit summary
Line 442: Line 442:
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', 'Ingredients', 'Currency'})
return p._getRecipeTable('Runecrafting', category, {'ItemImage', 'ItemName', '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', 'Ingredients', 'Currency'})
return p._getRecipeTable('Fletching', category, {'ItemImage', 'ItemName', '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', 'Ingredients', 'Currency'}
local columns = {'ItemImage', 'ItemName', '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 461: Line 461:
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', 'Ingredients', 'Currency'}
local columns = {'ItemImage', 'ItemName', '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 472: Line 472:
-- Note: This only supports a number of skills with consistent recipe data structures, being:
-- Note: This only supports a number of skills with consistent recipe data structures, being:
-- Fletching, Crafting, and Runecrafting
-- Fletching, Crafting, and Runecrafting
-- Valid column list options are: Item, SkillLevel, SkillXP, Currency, Ingredients, SkillXPSec, CurrencySec, CurrencyBar
-- Valid column list options are: Item, SkillLevel, SkillXP, Currency, Materials, SkillXPSec, CurrencySec, CurrencyBar
function p._getRecipeTable(skillName, categoryName, columnList)
function p._getRecipeTable(skillName, categoryName, columnList)
-- Validation: Parameters
-- Validation: Parameters
Line 520: Line 520:
["DLC"] = {["header"] = '[[DLC]]', ["altRepeat"] = true},
["DLC"] = {["header"] = '[[DLC]]', ["altRepeat"] = true},
["SkillXP"] = {["header"] = 'XP', ["altRepeat"] = false},
["SkillXP"] = {["header"] = 'XP', ["altRepeat"] = false},
["Ingredients"] = {["header"] = 'Ingredients', ["altRepeat"] = true},
["Materials"] = {["header"] = 'Materials', ["altRepeat"] = true},
["Currency"] = {["header"] = 'Value', ["altRepeat"] = true},
["Currency"] = {["header"] = 'Value', ["altRepeat"] = true},
--["SkillXPSec"] = {["header"] = 'XP/s', ["altRepeat"] = false},
--["SkillXPSec"] = {["header"] = 'XP/s', ["altRepeat"] = false},
Line 626: Line 626:
cell:wikitext(Items.getValueText(item) .. (qty > 1 and ' (x' .. qty .. ')' or ''))
cell:wikitext(Items.getValueText(item) .. (qty > 1 and ' (x' .. qty .. ')' or ''))
:attr('data-sort-value', tostring(val * qty))
:attr('data-sort-value', tostring(val * qty))
elseif colID == 'Ingredients' then
elseif colID == 'Materials' then
local currCost = { ["items"] = {}, ["currencies"] = recipe.currencyCosts }
local currCost = { ["items"] = {}, ["currencies"] = recipe.currencyCosts }
local currText = Common.getCostString(currCost, nil, nil, ' ')
local currText = Common.getCostString(currCost, nil, nil, ' ')
2,874

edits