Module:Skills/Artisan: Difference between revisions

Added description column for ring and necklace table for Crafting
(p._getRecipeTable -> skill.baseInterval is in milliseconds, not seconds (fixes GP/s and XP/s in tables))
(Added description column for ring and necklace table for Crafting)
Line 200: Line 200:
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
return p._getRecipeTable('Crafting', category, {'Item', 'SkillLevel', 'SkillXP', 'GP', 'Ingredients'})
local columns = {'Item', 'SkillLevel', 'SkillXP', 'GP', 'Ingredients'}
if category == 'Rings' or category == 'Necklaces' then
table.insert(columns, "Description")
end
return p._getRecipeTable('Crafting', category, columns)
end
end


Line 254: Line 258:
["Ingredients"] = {["header"] = 'Ingredients', ["altRepeat"] = true},
["Ingredients"] = {["header"] = 'Ingredients', ["altRepeat"] = true},
["SkillXPSec"] = {["header"] = 'XP/s', ["altRepeat"] = false},
["SkillXPSec"] = {["header"] = 'XP/s', ["altRepeat"] = false},
["GPSec"] = {["header"] = 'GP/s', ["altRepeat"] = true}
["GPSec"] = {["header"] = 'GP/s', ["altRepeat"] = true},
["Description"] = {["header"] = "Description", ["altRepeat"] = true}
}
}
-- Build the table header while we're here
-- Build the table header while we're here
Line 335: Line 340:
local val = math.floor(item.sellsFor) * qty / actionInterval
local val = math.floor(item.sellsFor) * qty / actionInterval
table.insert(resultPart, '\r\n|' .. spanStr .. 'data-sort-value="' .. val .. '"| ' .. Icons.GP(string.format('%.2f', val)))
table.insert(resultPart, '\r\n|' .. spanStr .. 'data-sort-value="' .. val .. '"| ' .. Icons.GP(string.format('%.2f', val)))
elseif colID == 'Description' then
table.insert(resultPart, '\r\n| '..spanStr..'|'..Items._getItemStat(item, 'description'))
else
else
table.insert(resultPart, '\r\n| ')
table.insert(resultPart, '\r\n| ')